sierrathedog04 has asked for the wisdom of the Perl Monks concerning the following question:
I would like to be able to use this same syntax when the text to be processed is in the form of a string rather than a file. Can I associate a string with a virtual filehandle? Ideally the syntax would be something like:open (MYFILE, 'mypath'); while (<MYFILE>){ #my code here }
#magically turn $myString into a filehandle. while (<MYSTRING>){ #my code here }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Can Perl Turn A String Into A Virtual File?
by Masem (Monsignor) on May 25, 2001 at 00:35 UTC | |
by shotgunefx (Parson) on May 25, 2001 at 05:16 UTC | |
|
(boo) Re: Can Perl Turn A String Into A Virtual File?
by boo_radley (Parson) on May 25, 2001 at 00:27 UTC | |
|
Re: Can Perl Turn A String Into A Virtual File?
by Big Willy (Scribe) on May 25, 2001 at 00:59 UTC | |
|
Re: Can Perl Turn A String Into A Virtual File?
by bikeNomad (Priest) on May 25, 2001 at 10:21 UTC | |
|
Re: Can Perl Turn A String Into A Virtual File?
by DBX (Pilgrim) on May 25, 2001 at 00:40 UTC | |
|
Re: Can Perl Turn A String Into A Virtual File?
by Anonymous Monk on May 25, 2001 at 04:01 UTC |