#!/usr/bin/perl use strict; use Term::ReadLine; my @list = <>; # get pipeline input print scalar @list, " file names found\n"; my $term = new Term::ReadLine; my $prmt = "would you like to see the next file name? [y] "; while ( defined( $_ = $term->readline($prmt))) { last if ( /^n/i ); print shift @list; }