xossa has asked for the wisdom of the Perl Monks concerning the following question:
Hi, This is an extract of my file : Total Hard Errors: 0 Total Soft Errors: 0 Total Queue Length: 0 Name LUN 259 Minimum latency reads N/A How can I get the number '259' my script : open L_NAVICLI , "$NAVICLI $IP1 getall |" ; while (<L_NAVICLI>) { if (/Name.*LUN.*.(\d+)/){ $lunid = $3; print "\n!$lunid!\n"; print $_; exit; } } close L_NAVICLI; When i execute it, it returns : # perl capacx.pl !! Name LUN 259 Can you help me please to get the number '259' in my var $lunid ?? Thanks a lot Xossa
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parse a File and get a value
by toolic (Bishop) on Nov 09, 2011 at 18:38 UTC | |
by xossa (Initiate) on Nov 09, 2011 at 22:08 UTC | |
by choroba (Cardinal) on Nov 10, 2011 at 12:02 UTC |