#!/usr/bin/perl use strict; use warnings; for (my $i = 1; $i < 10; $i++) { my $filename = time . rand; print "$filename\n"; open FILE, ">$filename"; print FILE "BOOGA BOOGA $i\n"; close FILE; } # If that's not unique enough, try this: for (my $i = 1; $i < 10; $i++) { my $filename = time() . rand() . rand(); print "$filename\n"; open FILE, ">$filename"; print FILE "BOOGA BOOGA 2 x $i\n"; close FILE; } __END__ #### #!/usr/bin/perl use strict; use warnings; opendir DIR, "."; # files starting with 10 should be okay for a while my @files = grep{/^10/} readdir(DIR); closedir DIR; for my $file(@files) { open FILE, "<$file" or die "can't open $file: $!"; local $/ = undef; my $data = ; close FILE; chomp $data; print "$data\n"; } __END__