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
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
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 -
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
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
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