in reply to Re^2: Perl: Directoriesand files
in thread Perl: Directoriesand files
If that is really what you want to do then you can change the 'while' loop to a simple 'if', because that's what it effectively is. The while loop will never be executed more than once, because if $content is anything but $x the while loop will exit immediately
if ($content == $x){ print ($content, $content1, $content2, $content3, $content4); $x++; }
You don't need the close as the files are automatically closed on program exit or reopening
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl: Directoriesand files
by craziestfire73 (Initiate) on Mar 30, 2011 at 11:11 UTC | |
by jethro (Monsignor) on Mar 30, 2011 at 11:22 UTC | |
by Anonymous Monk on Mar 30, 2011 at 11:35 UTC |