NamfFohyr has asked for the wisdom of the Perl Monks concerning the following question:
When I run with "use Strict" (as is my default these days, along with warnings) I get "unitialized variable messages" typically indicating I did something less-than-ideal. The print flags above show that $stem, set to $ARGV[0] is not getting defined (but the other arguments are). There is some cryptic and suspect output from Strict regarding "Subroutine bits redefined":my $stem = $ARGV[0]; my $start = $ARGV[1]; my $dir = $ARGV[2]; print "STEM: $stem\n"; print "START: $start\n"; print "DIR: $dir\n"; my $outstring; while(<*.pdb*>){ if(m,\.viols,){next} if(m,$stem,){ chomp; $outstring = $dir.$start.'.pdb'; print `cp $_ $outstring\n`; $start++}}
When I stop using Strict, the error messages go away and the debug prints now give the expected output. Everything's hunky dory. The ouput's as expected. Is this something regarding Strict that I don't understand (for example, does it sanity check/filter command line arguments)?Subroutine bits redefined at /System/Library/Perl/5.8.6/strict.pm line + 11. Subroutine import redefined at /System/Library/Perl/5.8.6/strict.pm li +ne 27. Subroutine unimport redefined at /System/Library/Perl/5.8.6/strict.pm +line 32. Use of uninitialized value in concatenation (.) or string at rename4li +b.pl line 16.
I don't want my subroutine bits defined, do I? I'm alone and frightened.
Thanks much,
ry
|
|---|