ElectroRed has asked for the wisdom of the Perl Monks concerning the following question:
$dir = "/temp/"; opendir(DIR, $dir) or die "cannot open"; while (defined($file = readdir(DIR))){ open (F, $file) or die "cannot open file"; while (<F>){ print $_; } close F; } closedir(DIR);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File handling basics
by GrandFather (Saint) on Jul 17, 2015 at 10:31 UTC | |
|
Re: File handling basics
by vinoth.ree (Monsignor) on Jul 17, 2015 at 10:07 UTC | |
|
Re: File handling basics
by i5513 (Pilgrim) on Jul 17, 2015 at 10:02 UTC | |
by ElectroRed (Initiate) on Jul 17, 2015 at 10:22 UTC | |
by vinoth.ree (Monsignor) on Jul 17, 2015 at 10:33 UTC | |
by ElectroRed (Initiate) on Jul 17, 2015 at 10:36 UTC | |
by Laurent_R (Canon) on Jul 17, 2015 at 11:29 UTC | |
by vinoth.ree (Monsignor) on Jul 17, 2015 at 10:39 UTC | |
by ww (Archbishop) on Jul 17, 2015 at 16:17 UTC | |
|
Re: File handling basics
by Laurent_R (Canon) on Jul 17, 2015 at 11:08 UTC | |
by Monk::Thomas (Friar) on Jul 17, 2015 at 15:15 UTC | |
by Laurent_R (Canon) on Jul 17, 2015 at 17:58 UTC | |
by marinersk (Priest) on Jul 17, 2015 at 20:59 UTC | |
|
Re: File handling basics
by choroba (Cardinal) on Jul 17, 2015 at 10:03 UTC | |
|
Re: File handling basics
by i5513 (Pilgrim) on Jul 17, 2015 at 10:02 UTC |