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
Octavian Rasnita wrote: > Hi, Hello, > I have a program that contains a pretty big block of text: > > my $text = < line1 > line2 > ... > line 12 > EOF > > I want to read this block of text line by line and analyse each line without > needing to create a big array that contains all these lin

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
From: "Rob Dixon" <[EMAIL PROTECTED]> > > I have a program that contains a pretty big block of text: > > > > my $text = < > line1 > > line2 > > ... > > line 12 > > EOF > > > > I want to read this block of text line by line and analyse each line without > > needing to create a big ar

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
Octavian Rasnita wrote: > Hi, > > I have a program that contains a pretty big block of text: > > my $text = < line1 > line2 > ... > line 12 > EOF > > I want to read this block of text line by line and analyse each line without > needing to create a big array that contains all these lines (exac