Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Debugging help!

by NetWallah (Abbot)
on Aug 31, 2012 at 14:35 UTC ( #991016=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Debugging help!
in thread Debugging help!

{ s/\.\d+//g; $1=>$2 if/(.+)\s+\|\s+(.+)/; }
This will supply 2 elements to properly populate the hash if the match succeeds.

However, on match failure, the return value is undef() (I think), but the important thing is that a single (ODD NUMBER) value is returned, so the hash is not happy.

Update:
I would correct it as :

{ s/\.\d+//g; /(.+)\s+\|\s+(.+)/ ? ($1=>$2) : () }

             I hope life isn't a big joke, because I don't get it.
                   -SNL

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2016-08-29 07:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (399 votes). Check out past polls.