C:\test>type junk2.pl #! Perl ############################################################################################################### # # input_demo.pl - Requires Active Perl 5.8.9 Or Higher # # ############################################################################################################### #require 5.8.9; # Use Version 5.8.9 of Perl #use lib "D:/Perl_510/lib/core "; use English '-no_match_vars'; use File::Copy; use IO::Handle; use Win32; use Win32::File qw/GetAttributes SetAttributes/; my $runnum = 0; my $program = 1; if( $runnum < 1) { $cwd = Win32::GetCwd(); $prgmdir = $cwd; # $prgmpth = "$prgmdir\\"; print "\nProgram thinks it is located in the following directory:\n"; print "\t$cwd\n"; print "if incorrect (PATH has spaces)! Enter full path or return\n\n"; chomp ($prgmd = ); if( $prgmd =~ /^([a-zA-Z];\\).+$/ ) { $prgmdir = $prgmd; } else { $prgmdir = $cwd; } $prgmdir =~ /^(\w:).*/; $prgmdrv = $1 . ":"; print "\nProgram: $program, leaves you in directory: $prgmdir\t your input is: $prgmd \n"; } RECYCLE: print "\nTo quit enter 0\n"; chomp( $program = ); #Quit or rerun program if ( $program == 0 ) { exit 1;} goto RECYCLE; #exit 1; C:\test>type junk.dat fred 1 1 0 C:\test>junk2.pl < junk.dat Program thinks it is located in the following directory: C:\test if incorrect (PATH has spaces)! Enter full path or return Program: 1, leaves you in directory: C:\test your input is: fred To quit enter 0 To quit enter 0 To quit enter 0