print "Delete files older than 3 days? [Y or N] \n"; chomp ($cleanup = ); if ($cleanup =~ /Y/i) { foreach my $file (@bigarray) { ... } }