Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Regular expression help

by roboticus (Chancellor)
on Nov 21, 2012 at 13:21 UTC ( #1004916=note: print w/ replies, xml ) Need Help??

in reply to Regular expression help


Your code is assuming that you're getting seven columns from your split on line 22. Then you're using several of those to do a regex match. However the last line of your file, for example, is likely empty (because many files end in a '\n'), causing you to have fewer than 2 columns fields array.

You might try something like:

... my @fields = split /\t/, $item; next if @fields < 7; ...


When your only tool is a hammer, all problems look like your thumb.

Comment on Re: Regular expression help
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2015-11-29 19:45 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (753 votes), past polls