I'm having a problem running the code at the bottom. It tells me there is no such inputfile even though its sitting in the same directory as the pl script. The error is at the
system ("sort -k 1,1 -k 4n -T $workingDir $name
line. When I include the print statments
print "argument = /$workingDir/ \n";
print "argument = /$inputFileVolume/ \n";
print "argument = /$inputFileDir/ \n";
print "argument = /'pwd'/ \n";
#it gives me
argument = ///
argument = //
argument = //
argument = /'pwd'/
So I guess its not finding the proper directory for some reason. How would I fix this? Thanks
#!/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";