use strict; use warnings; my $outfile = 'ppid_file.txt'; my $dir = 'c:/users/lastgen/docs/saved_ppid'; my $input; my $ok = ''; while ($ok !~ /[Yy]/){ print "SCAN PPID: "; $input = ; chomp $input; print "Make sure you confirm the PPID before you proceed...\n\n"; print "PPID: $input \n\n"; print "ok? [y/n]: "; $ok = ; } open my $wfh, '>', "$dir/$outfile" or die "can't open the damned output file! $!"; print $wfh $input;