Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Generate Random IP Addresses

by fizbin (Chaplain)
on Sep 07, 2004 at 14:03 UTC ( #389049=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # for 192.168.*.*
    my @netmask_a = qw ( 255 255 0 0 );
    ...
    $addr ^= $sample;
    # Dotted quad form:
    my $dottedaddr = join(".", unpack("C*", pack("N", $addr)));
    
  2. or download this
    sub rand_addr ($$) {
      my ($netmask, $code) = @_;
    ...
    my @newaddrlist =
      map { join(".", unpack("C*", pack("N",$_))) }
      map { rand_addr($netmask,$sample); } ( 1 .. 5678 );
    
  3. or download this
    --
    @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/;
    map{y/X_/\n /;print}map{pop@$_}@/for@/
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2014-07-26 14:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (177 votes), past polls