#\usr\bin\perl use strict; use warnings; opendir (DIR, '\mail') || die "Can't open \mail.\n"; for my $file (readdir DIR) { if (!open (WRITE, "\mail\$file")) { print "Can't open \mail\$file\n"; next; } my $text = <WRITE>; print $text; }
In reply to Re: Read first line from each file in a directory
by TJPride
in thread Read first line from each file in a directory
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |