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??
I tried putting a for loop for STDIN in this but it didnt work: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"; }
Please advise.foreach($y=0) { print "$name is a DIRECTORY\n"; unless( $y++ % 80 ) { <STDIN>;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Output question
by hotshot (Prior) on Dec 26, 2001 at 18:01 UTC | |
by arhuman (Vicar) on Dec 26, 2001 at 18:14 UTC | |
by tilly (Archbishop) on Jan 04, 2002 at 09:32 UTC | |
by oaklander (Acolyte) on Dec 26, 2001 at 19:10 UTC | |
by arhuman (Vicar) on Dec 26, 2001 at 19:42 UTC | |
IO::Page
by chip (Curate) on Dec 27, 2001 at 02:16 UTC |
Back to
Seekers of Perl Wisdom