Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 taking refuge in the Monastery: (6)
As of 2015-07-04 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls