Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: ⭐ (strings)
I want to be able to play with a string as if it were a I/O stream. You can see this sort of functionality in C++ with sstream, and in Java with StringBuffer*Stream. A simple e.g., I'd love to be able to do something like:
...but on a larger scale. Cheers, - jsproatmy $stringfile = FileHandle::newFromString( "One fish\nTwo fish\nThree + fish\nFour fish" ); while( <$stringfile> ) { dosomething( $_ ); }
Originally posted as a Categorized Question.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How do I treat a string like a filehandle?⭐
by davido (Cardinal) on Oct 02, 2003 at 03:55 UTC | |
Re: How do I treat a string like a filehandle?⭐
by runrig (Abbot) on Sep 16, 2000 at 00:27 UTC | |
by runrig (Abbot) on Sep 16, 2000 at 00:30 UTC | |
by sproaticus (Initiate) on Sep 16, 2000 at 01:15 UTC | |
Re: How do I treat a string like a filehandle?
by indigo (Scribe) on Sep 16, 2000 at 03:59 UTC | |
by merlyn (Sage) on Sep 16, 2000 at 04:25 UTC | |
Re: How do I treat a string like a filehandle?
by hsinclai (Deacon) on Mar 09, 2004 at 04:14 UTC | |
by zentara (Archbishop) on Mar 09, 2004 at 15:59 UTC | |
Re: How do I treat a string like a filehandle?
by sproaticus (Initiate) on Sep 16, 2000 at 00:29 UTC |
Back to
Seekers of Perl Wisdom