Mrdini has asked for the wisdom of the Perl Monks concerning the following question:
So I made the code below, but it doesn't seem to create any new files, & I can't figure out why.------- filename.txt blahblah ------------- filename2.txt blahwahwah ------ etc..
Thanks in advance!while(<>){ print if m/^-/; if (m/$\.txt/){ open (FILE, ">m/$\.txt/"); print FILE "Success"; close FILE; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File opening, based on a regex...
by Zaxo (Archbishop) on Feb 03, 2004 at 22:26 UTC | |
by Mrdini (Initiate) on Feb 03, 2004 at 22:28 UTC | |
|
Re: File opening, based on a regex...
by Plankton (Vicar) on Feb 03, 2004 at 22:20 UTC |