Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Broadcast address: a binary anding question

by quidity (Pilgrim)
on Nov 24, 2000 at 16:53 UTC ( #43209=note: print w/ replies, xml ) Need Help??


in reply to Broadcast address: a binary anding question

CPAN is, as ever, your friend. I would use the Net::IPv4Addr module. From the synopsis:

use Net::IPv4Addr qw( :all ); my ($broadcast) = ipv4_broadcast($ip_str, $msk_str);

Where $ip_str and $msk_str in this case (assuming you have (0..255) in your arrays) would be:

$ip_str = join('.', @ip); $msk_str = join('.', @netmask);

If you want to know how your problem is solved in the module, then download it and use the source luke.


Comment on Re: Broadcast address: a binary anding question
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (18)
As of 2015-07-29 15:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls