#!/usr/bin/perl -w my $data; for (my $i=0; $i<1440; $i++) { opendir PROC, '/proc'; while (my $pid=readdir PROC) { next if $pid!~/^\d/; open STAT, ") { test($i); } close STAT; } } sub test { my $a=shift; return; if ($a==1) {} elsif ($a==2) {} elsif ($a==3) {} elsif ($a==4) {} elsif ($a==5) {} elsif ($a==6) {} elsif ($a==7) {} elsif ($a==8) {} elsif ($a==9) {} }