Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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


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

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 lurking in the Monastery: (7)
As of 2014-12-21 09:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls