Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
use strict; use warnings; mysub(74.117.115.116); mysub(32.97.110.111); mysub(116.104.101.114); mysub(32.69.120.99); mysub(101.108.32.104); mysub(97.99.107.101); mysub(114.46.32.8); sub mysub { print $_[0]; }

I'm posting this as an obfu, but it might well be a SOPW. I ran into it the hard way. My test was passing an IP address - 8.8.8.8 - to a sub in the intended module. The test was failing. When I looked at the value of the param in the sub with Data::Dumper, I got 8.8.8.8, but when I printed the param, nothing appeared. I was wasting time looking at my sub when I should have been looking at the test. I had left out the quotes around the IP address.

I know what my code is doing. What I don't know is why. This construct certainly doesn't DWIM and I can't see why it should be what anyone else would mean. Is there a sensible explanation? And let me add my usual question - is this documented anywhere?

Regards,

John Davies


In reply to Parameter-driven confusion by davies

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-03-28 17:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found