Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use strict;
- use warnings;
- my $filename = 'report.txt';
- open(my $fh, '>', $filename) or die "Could not open file '$filename' $!";
- my %hash;
- $hash{"a"}=["nabil", "zizan", "yus"];
- $hash{"b"}=["johan", "tokey", "acey"];
- $hash{"c"}=["abam", "zoey", "mark"];
- foreach my $val (values %hash)
- {
- foreach my $elem (@$val) {
- print $fh $elem;
- }
- }
- #print $fh "My first report generated by perl\n";
- close $fh;
- print "done\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement