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

Re: Regular expression help

by roboticus (Canon)
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 studying the Monastery: (8)
As of 2014-07-14 12:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (258 votes), past polls