Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

checking for config file param

by PerlSufi (Friar)
on Jun 11, 2013 at 17:40 UTC ( #1038295=perlquestion: print w/ replies, xml ) Need Help??
PerlSufi has asked for the wisdom of the Perl Monks concerning the following question:

hello monks, I wanted to check if a config file param is not "" and if it isn't, crawl with the information contained in the param. Here is what I have:
use WWW::Mechanize; use Config::Simple; if($cfg->param("$ARGV[0]".".notification2") != "") { my $notif2 = $cfg->param("$ARGV[0]".".notification2"); $mech->get('http://path/to/site.php'); $mech->submit_form( form_name => 'notification_form', fields => {"email" => $notif2, } ); }

That param is not empty, so why is it not posting?
Thanks in advance

Comment on checking for config file param
Download Code
Re: checking for config file param
by hippo (Vicar) on Jun 11, 2013 at 17:49 UTC

    != compares numbers whereas ne compares strings. warnings usually picks this up. HTH.

      Thanks!
      That did it..
      peace!

Log In?
Username:
Password:

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

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