Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1004916]
help
Chatterbox?
[Discipulus]: Eternal City?
[Corion]: Hmm - my Italian isn't that great - I assume this is more an accident and less an art project, right?
[Discipulus]: yes we are falling down

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2017-02-28 10:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (399 votes). Check out past polls.