On Thu, 2009-01-01 at 17:28 -0500, Chas. Owens wrote: > If the file is long and you want to do paging, well, that really isn't > Perl's job. Use whatever pager your OS provides (more, pg, less, > etc.).
In *nix, traditionally the user's favourite pager is stored in the environment variable $PAGER. #!/usr/bin/perl use strict; use warnings; use File::Copy; my $file = shift @ARGV; if( -t STDOUT ){ my $pager = $ENV{PAGER} || 'more'; open my $out_fh, '|-', $pager or die "could not open pipe to pager: $!\n"; copy( $file, $out_fh ); close $out_fh; }else{ copy( $file, \*STDOUT ); } -- Just my 0.00000002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/