Generated: Tue Feb 2 17:54:31 2010 from editgroup.pl 2008/03/09 1 KB.
#!/perl -w # NAME: editgroup.pl # AIM: Read a GROUP fo files in a FOLDER, and edit each one by one ... # 09/03/2008 - geoff mclane - http://geoffair.net/mperl/samples use strict; use warnings; require 'logfile.pl' or die "Unable to load logfile.pl ...\n"; # log file stuff my ($LF); my $pgmname = $0; if ($pgmname =~ /\w{1}:\\.*/) { my @tmpsp = split(/\\/,$pgmname); $pgmname = $tmpsp[-1]; } my $outfile = "temp.$pgmname.txt"; open_log($outfile); prt( "$0 ... Hello, World ...\n" ); my $msg = "Enter input, 'C'=continue, else 'A'=abort, followed by 'ENTER' key : "; my $continue = 1; while ($continue) { my $input = get_input($msg); if ($input eq 'C') { prt( "Continue ...\n" ); } elsif ($input eq 'A') { prt( "Abort ...\n" ); $continue = 0; } else { prt( "Not C nor A ...\n" ); } } close_log($outfile,0); exit(0); ####################### ### subs only below ### sub get_input { my ($m) = shift; my $in = ''; prt($m); $in = <>; chomp $in; $in = uc($in); return $in; } # eof - editgroup.pl