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

SOAP::Lite and hashrefs

by cLive ;-) (Prior)
on Mar 22, 2004 at 23:42 UTC ( #338839=perlquestion: print w/replies, xml ) Need Help??

cLive ;-) has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to send a hashref as an argument to a SOAP server. I'm dumping the args to a log on the server and they look fine, but I get a warning when running the client:
Cannot encode 'hashref' element as 'hash'. Will be encoded as 'map' in +stead
And, here's the weird bit. I was just running an adapted sample from the docs that begins with:
#!perl -w
When I change this to:
#!/usr/bin/perl use strict; use warnings;
the warning disappears.

Is there a difference between the -w switch and the "use warnings" pragma?

confused...

cLive ;-)

ps - I'm running these as "perl script.pl" rather than "./script.pl"

Replies are listed 'Best First'.
Re: SOAP::Lite and hashrefs
by tinita (Parson) on Mar 22, 2004 at 23:49 UTC
    Is there a difference between the -w switch and the "use warnings" pragma?
    yes, and this has been asked before, e.g. here

      OK, so I now get the difference, but that brings up another question...

      Trawling through SOAP::Lite, I see they use a local $^W to supress warnings, and use $^W to decide whether to warn or not.

      Since $^W stays at 0 when "use warnings" pragma is used, is it fair to say that the weirdness is bad programming practice from the SOAP::Lite developer(s), or should I be using -w and "use warnings" and just let it go?

      cLive ;-)

        is it fair to say that the weirdness is bad programming practice from the SOAP::Lite developer(s),

        use warnings; is relatively new to Perl. Any modules that were created before it might not be completely rewritten to include it, and any modules written when it was new may not have used it in order to be backwards compatible with earlier versions of perl. So, it may be more of a kludge to make it work then bad programming


        Want to support the EFF and FSF by buying cool stuff? Click here.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2022-06-25 01:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My most frequent journeys are powered by:









    Results (81 votes). Check out past polls.

    Notices?