input.pl to HTML.

index -|- end

Generated: Tue Feb 2 17:54:43 2010 from input.pl 2008/03/09 868.

#!/perl -w
# NAME: input.pl
# AIM: Test getting User keyborad input ...
# 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, followed by 'ENTER' key : "; 
get_input($msg);
close_log($outfile,0);
exit(0);
#######################
### subs only below ###
sub get_input {
   my ($m) = shift;
   my $in = '';
   prt($m);
   $in = <>;
   chomp $in;
   if (uc($in) eq 'Y') {
      prt( "Got [$in] ...YES ...\n" );
   } else {
      prt( "Got [$in] ...\n" );
   }
   return $in;
}
# eof - input.pl

index -|- top

checked by tidy  Valid HTML 4.01 Transitional