sharan has asked for the wisdom of the Perl Monks concerning the following question:
I also tried withwhile( defined(my $filename = glob("*.txt"))){ open(WORDLIST,$filename) || die "can't open wordlist: $!";} init_words();
but am not able to access all the files with .txt extension in the same folder.. Also i want to print the name of the file from which i print some text... e.g. file1.txt hasopen(WORDLIST, *.txt>);
file2.txt hasline1 line2
I want to get print as:line3 line4
Thanking you,file1.txt line1 file2.txt line4
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: read multiple files
by dHarry (Abbot) on Jan 28, 2009 at 11:39 UTC | |
|
Re: read multiple files
by cdarke (Prior) on Jan 28, 2009 at 12:41 UTC | |
by Bloodnok (Vicar) on Jan 28, 2009 at 14:14 UTC | |
|
Re: read multiple files
by Illuminatus (Curate) on Jan 28, 2009 at 12:49 UTC | |
|
Re: read multiple files
by Marshall (Canon) on Jan 28, 2009 at 15:39 UTC |