Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Connecting to WiFi

by zer (Deacon)
on Jul 23, 2007 at 20:42 UTC ( [id://628327]=perlquestion: print w/replies, xml ) Need Help??

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

Is there a module that will allow you to control the internet connectivity on all platforms? Especially for selecting which source to connect to via wifi?

Replies are listed 'Best First'.
Re: Connecting to WiFi
by Trizor (Pilgrim) on Jul 23, 2007 at 22:54 UTC

    Have you searched CPAN through search.cpan.org for maybe the keyword wifi or wireless? If you had you would have found Wifi while its in early alpha stages and appears to have not been updated in a while you could help out and speed it along. You have to remember that CPAN authors are under no obligation to fit your schedule, and shouldn't be demanding when you can't find what you're looking for.

Re: Connecting to WiFi
by mpapet (Novice) on Jul 23, 2007 at 23:30 UTC
    I would use back ticks. Ex. `\usr\bin\wpa_supplicant -I ath0 -c /etc/wpaconfig.conf` or die $!\n;

    I'm sure someone can come up with high-minded reasons not to do this. But it works.

      Backticks are for collecting the textual output of a program. The system() function is for executing something and getting a numeric success/fail/status result. Your example (syntax error aside) would decide that "no output" is an error, which may or may not be what you intended, but is not likely useful in the general case.

      --
      [ e d @ h a l l e y . c c ]

Re: Connecting to WiFi
by halley (Prior) on Jul 24, 2007 at 15:56 UTC

    The way that programs at the user's level can control the lower-level services available on a platform will vary GREATLY between different platforms.

    On some platforms, every card is different, they have different command-line tools or names you must provide, and just enumerating the available network services is not trivial.

    Deciding what interfaces are implemented with wifi and what is wired and what is going through a bluetooth or firewire bridge might even trip you up.

    Due to the real nature of TCP/IP, there's no way to detect if a network interface is aimed at "the Internet" or not, until you're connected and you decide that contacting a known machine is sufficient proof for yourself.

    --
    [ e d @ h a l l e y . c c ]

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-23 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found