Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Undefined Subroutine & Global symbol requires explicit package name

by lune (Pilgrim)
on Jan 24, 2012 at 18:31 UTC ( #949741=note: print w/replies, xml ) Need Help??


in reply to Re^2: Undefined Subroutine & Global symbol requires explicit package name
in thread Undefined Subroutine & Global symbol requires explicit package name

You didn't really understand the first answer you got on the issue: "where did you find inet_aton documented?".

When you call a subroutine, it must be defined somewhere, unless it is a builtin Perl function, like "each" and "print" in your example. In your code, you want to use functions from the module "Socket.pm" - so you have to "use Socket" to make these functions available.

You can tell that inet_aton is not a Perl function simply by checking with man perlfunc or by trying

perldoc -f inet_aton

Of course, if you misspell a function you'll get the same error, but this is not the issue here.

further documentation

  • Comment on Re^3: Undefined Subroutine & Global symbol requires explicit package name
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2022-05-24 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (82 votes). Check out past polls.

    Notices?