Assuming that the cause of your error in present within your code snippet, the warning is being thrown by your print statement. Specifically, variable interpolation within double quotes is implicitly done with the concatenation operator, thus when you attempt to print without first initializing $csa_file, warnings notes you are concatenating with an undefined value. See String interpolation. I suspect this error is the result from your misplaced curly bracket. Perhaps you mean something like this:
#_ Command line options & setup filenames for ($i=0; $i<=$#ARGV; $i++) { if($ARGV[$i] eq "-a") { $alignment_file = $ARGV[$i+1]; } if($ARGV[$i] eq "-s") { $scorecons_file = $ARGV[$i+1]; } if($ARGV[$i] eq "-i") { $image_file = $ARGV[$i+1]; } if($ARGV[$i] eq "-m") { $numbered_model = $ARGV[$i+1]; } if($ARGV[$i] eq "-c") { $csa_file = $ARGV[$i+1]; } } print "test $csa_file\n"; #_ Check for minimum number of command line argument variables if($#ARGV < 6) { Usage(); print "NOT ENOUGH COMMAND LINE ARGUMENTS\n"; exit 0; } $fh_csa = new FileHandle($csa_file, "r") || die "Cannot open CSA file: + $csa_file ($!)";
Some side notes on style:
foreach my $i (0 .. $#ARGV)
Update: Your update supports the conclusion that you have a brackets probelm. You are only evaluating the first term of your argument list opening your file and continuing.
In reply to Re: Use of uninitialized value in concatenation (.) or string error after adding new arguement on command line
by kennethk
in thread Use of uninitialized value in concatenation (.) or string error after adding new arguement on command line
by Angharad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |