Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Generate Random IP Addresses

by fizbin (Chaplain)
on Sep 07, 2004 at 14:03 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://389049]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-03-28 17:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found