in reply to Re: Arrays of files from an array of file names
in thread Arrays of files from an array of file names
This fails with:#!/usr/bin/perl -w use strict; my $file1 = "trixee"; #just some nicknames! my $file2 = "limo"; my $file3 = "nata"; my @files = qw(file1 file2 file3); my @contents; foreach (@files) { open FILE, $_ or do { warn "Can't open $_: $!\n"; next } push @contents, [<FILE>]; } foreach my $tmp(@contents) { print "$tmp\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: What am I doing wrong?
by japhy (Canon) on Feb 19, 2001 at 07:11 UTC |