Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

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.

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.

Comment on Re^3: Debugging help!
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2014-11-29 03:01 GMT
Find Nodes?
    Voting Booth?

    My preferred Perl binaries come from:

    Results (203 votes), past polls