http://qs1969.pair.com?node_id=134389

oaklander has asked for the wisdom of the Perl Monks concerning the following question:

I have a script that gives me the files and directory listing but I need it to print page by page because some of the outputs are very large. I could do the more command in unix but what would I use for a pc??
use File::Find qw(finddepth); die "GIVE DIRECTORY NAME AS AN ARGUMENT\n" unless @ARGV; *name = *File::Find::name; finddepth \&lis, @ARGV; if ( !-d ) { print "DIRECTORY NOT FOUND!\n"; exit(0); } else { sub lis { if (!-l && -d _) { $i++; print "$name is a DIRECTORY\n"; } else { $j++; print "$name\n"; } } $x=$i+$j; print "\nDIRECTORY COUNT = $i\n"; print "FILE COUNT = $j\n"; print "TOTAL RECORD COUNT = $x\n"; }
I tried putting a for loop for STDIN in this but it didnt work:
foreach($y=0) { print "$name is a DIRECTORY\n"; unless( $y++ % 80 ) { <STDIN>;
Please advise.