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

Re: Generate Random IP Addresses

by pelagic (Priest)
on Sep 07, 2004 at 13:35 UTC ( #389034=note: print w/replies, xml ) Need Help??


in reply to Generate Random IP Addresses

#!/usr/bin/perl use strict; srand(time() ^ ($$ + ($$ << 15))); for (1..100){ print join ('.', (int(rand(255)) ,int(rand(255)) ,int(rand(255)) ,int(rand(255)))) , "\n"; } __OUTPUT__ 210.232.115.79 18.239.245.96 15.138.29.10 182.166.124.240 118.118.155.180 80.200.1.109 139.170.113.124 85.13.30.193 80.198.199.175 111.162.166.83 ... a.s.o.

pelagic

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://389034]
help
Chatterbox?
[Corion]: A good morning and weekstart to you too, Discipulus!

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2018-06-25 07:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (126 votes). Check out past polls.

    Notices?