in reply to problem with print content of file
Hope this is of help.#!/usr/bin/perl $dir = "/temp"; opendir (DIR,$dir) or die "Can't open folder $dir: $!\n"; @files = readdir DIR or die "Couldn't read from $dir: $!\n"; foreach $file (@files) { if (($file ne ".") and ($file ne "..")) { $/=undef; open MYFILE, "$file" or die "Cannot open :$!\n"; print MYFILE "$file \n"; close FILE; $/="\n"; } } closedir DIR;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: problem with print content of file
by tilly (Archbishop) on Aug 07, 2000 at 11:09 UTC | |
|
RE: Re: problem with print content of file
by chromatic (Archbishop) on Aug 09, 2000 at 07:55 UTC |