Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

ananassa:

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; ...

...roboticus

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


Comment on Re: Regular expression help
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (15)
As of 2015-07-07 18:44 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 (93 votes), past polls