bory has asked for the wisdom of the Perl Monks concerning the following question:
And I'm interested in extracting the values between "Testnok = <" and ">;", exactly the following values:------------------------------------------------------- RDN[ 01 ] : checking my test = 1 RDN[ 1 ] : allowing data = 11030101 RDN[ 2 ] : retrieving data = 1 FOR CLASS main WITH NAME TYPE help = < 1 > Testnok = < [0] [1] [0] [[0]] [[1]] [[0]] > ; --------------------------------------------------------------
I have done this in this way, but it's wrong:[0] [1] [0] [[0]] [[1]] [[0]]
Thank you for your timeopen(IN, "< myfile.txt"); my @list = <IN>; close IN; while ( $_ = shift ( @list ) ) { s/Testnok\s*=\s*<\s*//; s/\s*>//; s/\s*//; } #and it's not printing only my interested values
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: reading from a textfile
by davidj (Priest) on Jun 14, 2004 at 14:06 UTC | |
by bory (Beadle) on Jun 15, 2004 at 06:32 UTC | |
by davidj (Priest) on Jun 15, 2004 at 11:33 UTC | |
|
Re: reading from a textfile
by Happy-the-monk (Canon) on Jun 14, 2004 at 14:04 UTC | |
|
Re: reading from a textfile
by Wonko the sane (Curate) on Jun 14, 2004 at 14:46 UTC |