jarwulf has asked for the wisdom of the Perl Monks concerning the following question:
So I guess its not finding the proper directory for some reason. How would I fix this? Thanksprint "argument = /$workingDir/ \n"; print "argument = /$inputFileVolume/ \n"; print "argument = /$inputFileDir/ \n"; print "argument = /'pwd'/ \n"; #it gives me argument = /// argument = // argument = // argument = /'pwd'/
#!/usr/bin/perl use strict; use warnings; use File::Spec; my $inputFile = $ARGV[0]; my $backgroudFile = $ARGV[1]; #get name of the tester file and set it as the current working directo +ry my ($inputFileVolume,$inputFileDir,$name) = File::Spec->splitpath($inp +utFile); my @workingDirArr = ($inputFileVolume,$inputFileDir); my $workingDir = File::Spec->catdir(@workingDirArr); chdir $workingDir or die "$0 failed to chdir to working dir $workingDi +r"; system ("sort -k 1,1 -k 4n -T $workingDir $name >tempLoc_$name")==0 or + die "$0 failed to sort $name"; open (NAM, "tempLoc_$name") or die "$0 failed to open file tempLoc_$na +me";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: problems with perl input
by Athanasius (Archbishop) on Mar 20, 2013 at 02:26 UTC |