Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Problem with regex ...

by LanX (Canon)
on Dec 26, 2012 at 22:26 UTC ( #1010424=note: print w/ replies, xml ) Need Help??


in reply to Problem with regex ...

If your problem is to distinguish between different blocks, then test for the delimiting "white line".

my $block=0; while (<DATA>){ if (!/^\s*$/) { print "$block: $_"; } else { $block++; } } __DATA__ Mod Ports Card Type Model Se +rial No. --- ----- -------------------------------------- ------------------ -- +--------- 1 24 CEF720 24 port 1000mb SFP WS-X6724-SFP SA +L1434RA09 3 20 7600 ES+T 76-ES+T-20G JA +E14530455 4 ... Mod Sub-Module Model Serial Hw + Status ---- --------------------------- ------------------ ----------- ------ +- ------- 1 Distributed Forwarding Card WS-F6700-DFC3CXL SAL1434RLPY 1.6 + Ok 3 7600 ES+ DFC XL 7600-ES+3CXL JAE14520N29 1.2 + Ok 5 ...

now you can delegate the rest to specific one-block solution(s).

Cheers Rolf


Comment on Re: Problem with regex ...
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1010424]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (18)
As of 2015-07-07 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (89 votes), past polls