liri has asked for the wisdom of the Perl Monks concerning the following question:
Item no.0: NameDepth [2] <0> Class: [1] NetElementObjectClass Instance +: (int) [2] <1> Class: [ 57 ] Vc3TtpSnkObjectClass Instan +ce: (int) [3] Item no.1: NameDepth [2] <0> Class: [1] NetElementObjectClass Instance +: (int) [2] <1> Class: [ 57 ] Vc3TtpSnkObjectClass Instan +ce: (int) [14]
open (FILE, "< logfile") or die "Couldn't open for read logfile: $!"; while ($file_content = <FILE>) { if ( $file_content =~ m/Vc3/ ) { my @numbers = $file_content =~ /\[(\d+)\]/g; } } close (FILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: extracting integers from bracketes when reading from file...
by Tanktalus (Canon) on Nov 12, 2005 at 22:08 UTC | |
|
Re: extracting integers from bracketes when reading from file...
by Aristotle (Chancellor) on Nov 12, 2005 at 22:11 UTC | |
|
Re: extracting integers from bracketes when reading from file...
by pg (Canon) on Nov 13, 2005 at 02:25 UTC |