Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Who are you, and what did you do to Net::Wake?

by girarde (Hermit)
on Apr 30, 2014 at 02:45 UTC ( [id://1084425] : perlquestion . print w/replies, xml ) Need Help??

girarde has asked for the wisdom of the Perl Monks concerning the following question:

Recently decided to recreate my "wake up that computer over there" script. Looks like this:

#!/usr/bin/perl use warnings; use strict; use Net::Wake qw(by_udp); my $reveille; $reveille = Net::Wake::by_udp('255.255.255.255','ma:ca:dd:re:ss'); print $reveille; sleep 120; exit;

and it dies thusly:

Undefined subroutine &Net::Wake::by_udp called at /home/username/bin/wakehost line 11.

Ideas?

Replies are listed 'Best First'.
Re: Who are you, and what did you do to Net::Wake?
by davido (Cardinal) on Apr 30, 2014 at 05:18 UTC

    For what it's worth, I cannot reproduce your error message. Are we seeing the exact code that produces it?

    I checked, and see that the module hasn't been updated since 2003, so that eliminates the module author or a maintainer acting in his behalf from your list of "who" might have introduced the problem. ;)


    Dave

      This "module" is rather thin, just a little routine, minimal POD and no exporter.

      Even a beginner should be able to c&p and debug it. :)

      Cheers Rolf

      ( addicted to the Perl Programming Language)

      I posted the exact code other than spoofing the hostname, username and mac address.

        I think what LanX meant is to copy and paste the sub by_udp (and the use IO::Socket;) from the module's source code and try using that in your script directly. If it doesn't work, then that can be debugged, and if it does, then something strange is going on with the import of the module.

Re^2: Who are you, and what did you do to Net::Wake?
by godsham (Novice) on Apr 30, 2014 at 03:13 UTC

    I copied your code and ran it on my machine. It worked without error. Maybe you need to reinstall Net::Wake? Perl 5.16.3, net-wake .02

Re: Who are you, and what did you do to Net::Wake?
by LanX (Saint) on Apr 30, 2014 at 03:09 UTC
    what happens if you don't try to import qw(by_udp);?

    BTW I'm LanX and your threads title doesn't help much.

    Cheers Rolf

    ( addicted to the Perl Programming Language)

      It fails the exact same way.