... open( FIND, '-|', 'find', $basedir, @opts ) or die "find: $!"; while () { if ( theres_something_about( $_ )) { print "What do you want with $_ ? "; chomp ( my $desired_outcome = <> ); #(fixed missing close-paren) do_something_to( $_, $desired_outcome ); } } close FIND;