Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: REGexp match query

by toolic (Bishop)
on Oct 09, 2015 at 13:33 UTC ( [id://1144302]=note: print w/replies, xml ) Need Help??


in reply to REGexp match query

$outputlist[$_] = /^0/
One problem is that you need to use the binding operator =~

It might be easier to use split:

use warnings; use strict; while (<DATA>) { chomp; if (s/^\s+//) { my @cols = split; } } __DATA__ Queue counters: Queued packets Trans packets Dropped pak 0 258520344 520344 0 1 11006822 1006822 0 2 832114 0832114 0 3 8294677 8294677 0 4 5416057 5416057 0

Replies are listed 'Best First'.
Re^2: REGexp match query
by karlgoethebier (Abbot) on Oct 09, 2015 at 14:42 UTC
    "... easier to use split..."

    Yes. Perhaps even more simplified?

    <DATA>; while (<DATA>) { chomp; my @cols = split; }

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 21:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found