Mailing List Archive

"Taint" necessariliy so; in-XOR-able bug?
I tried to post this twice. I think my newsfeed ate it both times.
Forgive me if I'm wrong.

% perl -v

This is perl, version 5.001

Unofficial patchlevel 1m.

--------------------
File a.pl:

<snip>
#!/usr/local/bin/perl -wT
use strict;
BEGIN { # Add '.' to the path
use File::Basename;
my ($base,$path,$type) = fileparse($0);
unshift(@INC, $path);
}
BEGIN { # Do it again
unshift(@INC, ".");
}
use b qw(fails);
print STDERR ord("D")^ord("1"),".\n"; # Works here
print STDERR &fails("D","1"),".\n"; # Fails here, but only if -T is set
<snip>

----------------------
File b.pm:

<snip>
#!/usr/local/bin/perl -w
package b;
use strict;
@b::ISA = qw(Exporter);
@b::EXPORT_OK = qw(fails);
sub fails {
my($s1,$s2) = @_;
my(@s1) = split '',$s1;
my(@s2) = split '',$s2;
return join "", pack "C*", map { ord($s1[$_]) ^ ord($s2[$_]) } 0..$#s1;
}
1; # Report success
<snip>

-----------------------
% a.pl

117.
Use of uninitialized value at b.pm line 11.
Argument "^B^A" isn't numeric for pack at b.pm line 11.