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

Re^8: File::Random module (McA)

by tobyink (Canon)
on Apr 02, 2013 at 16:17 UTC ( [id://1026731]=note: print w/replies, xml ) Need Help??


in reply to Re^7: File::Random module (McA)
in thread File::Random module

The following crawls a directory and prints out random file names. Each file has a 1 in 10 chance of being selected.

use PIR; my $iter = PIR->new->file->iter($somedir); while (defined(my $file = $iter->())) { next if int rand 10; print $file, "\n"; }
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-03-29 07:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found