#!/usr/bin/perl for (;;) { my $fh; eval {open($fh, "foo.pl")}; last if $!; push @foo, $fh; } print "all out $!\n"; sleep(1000);