Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Use of uninitialized value in pattern match (m//)

by sauoq (Abbot)
on May 23, 2012 at 22:39 UTC ( #972122=note: print w/ replies, xml ) Need Help??


in reply to Use of uninitialized value in pattern match (m//)

If this is the exact code you had on your windows box, you likely had a bug there too, even if you never noticed it.

The problem looks like you are matching against $_ in your eslif condition when you want to be matching against $str. Change that line to:

}elsif ($str =~/^\s*$/) {

-sauoq
"My two cents aren't worth a dime.";


Comment on Re: Use of uninitialized value in pattern match (m//)
Select or Download Code
Replies are listed 'Best First'.
Re^2: Use of uninitialized value in pattern match (m//)
by Sushma (Initiate) on Nov 09, 2012 at 09:47 UTC
    hi, I am also getting same error for below code if ($response->{'Name'} =~ /Approval/) Could you pleas help me. Thanks, sushma

      If you get that error, looking at perldiag usually tells you where the error comes from. In your case, $response->{'Name'} is not what you think it is.

      I recommend looking at $response, maybe by using Data::Dumper.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2015-07-28 03:07 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 (251 votes), past polls