Help for this page

Select Code to Download


  1. or download this
    sub getfile {
       my ($qfn) = @_;
    ...
    my @files = ('file.txt', 'file2.txt' );
    
    my @file_contents = map { [ getfile($_) ] } @files;
    
  2. or download this
    sub getfile {
       my ($qfn) = @_;
    ...
    my @files = ('file.txt', 'file2.txt' );
    
    my %file_contents = map { $_ => [ getfile($_) ] } @files;
    
  3. or download this
    for my $file (keys %file_contents) {
       print("File $file:\n");
    ...
    
       print("\n");
    }