in reply to Saving my output to a folder
The following will loop until the user first types in a PPID, then until they type 'y' to confirm it.
It then writes the PPID to $outfile in the $dir directory.
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 = <STDIN>; chomp $input; print "Make sure you confirm the PPID before you proceed...\n\n"; print "PPID: $input \n\n"; print "ok? [y/n]: "; $ok = <STDIN>; } open my $wfh, '>', "$dir/$outfile" or die "can't open the damned output file! $!"; print $wfh $input;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Saving my output to a folder
by LastGen Monk (Novice) on Apr 19, 2016 at 20:06 UTC | |
by NetWallah (Canon) on Apr 19, 2016 at 21:40 UTC | |
by LastGen Monk (Novice) on Apr 20, 2016 at 11:31 UTC | |
by NetWallah (Canon) on Apr 20, 2016 at 18:49 UTC | |
by LastGen Monk (Novice) on Apr 22, 2016 at 18:50 UTC | |
|
Re^2: Saving my output to a folder
by LastGen Monk (Novice) on Apr 20, 2016 at 11:46 UTC |