Re: reading line by line

2006-08-09 Thread John W. Krahn
Octavian Rasnita wrote: > > Thank you very much for your suggestion. It works, but unfortunately very > very slow. > > If I put the data after __DATA__ and read , it works very fast, but if > I create a $text var that holds the same data then open(DATA, "<", \$text), > it works more than 100 time

Re: reading line by line

2006-08-09 Thread John W. Krahn
a big array that contains all these lines (exactly like > when reading line by line from a text file). > > It works fine if the program contains just a block of text, because in that > case I can put the data after __DATA__ and then use while(), but the > program contains 2 blocks of

Re: reading line by line

2006-08-09 Thread Mumia W.
On 08/09/2006 11:15 AM, Octavian Rasnita wrote: Hi, I have a program that contains a pretty big block of text: my $text = <), but the program contains 2 blocks of text. Is there a solution for this? There are two solutions I can think of. You can open an "in memory" variable (see perldoc -

Re: reading line by line

2006-08-09 Thread Octavian Rasnita
text line by line and analyse each line without > > needing to create a big array that contains all these lines (exactly like > > when reading line by line from a text file). > > > > It works fine if the program contains just a block of text, because in that > > c

Re: reading line by line

2006-08-09 Thread Jay Savage
On 8/9/06, Rob Dixon <[EMAIL PROTECTED]> wrote: In Perl 5.8 and onwards you can read directly from the string as if it were a file by just opening with a scalar reference instead of a filname. That seems to be exactly what you want. HTH, Rob use strict; use warnings; die "Too old a versio

Re: reading line by line

2006-08-09 Thread Rob Dixon
big array that contains all these lines (exactly like > when reading line by line from a text file). > > It works fine if the program contains just a block of text, because in that > case I can put the data after __DATA__ and then use while(), but the > program contains 2 blocks of te

reading line by line

2006-08-09 Thread Octavian Rasnita
Hi, I have a program that contains a pretty big block of text: my $text = <), but the program contains 2 blocks of text. Is there a solution for this? Thank you. Octavian -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]