First let's get this out of the way: ? = "1" | "2" | "4" | "8", < = "4" | "8", Meaning: if you see ? then it used strings and not the numbers. First observation: perl -wle 'my $x=4 ;my $y=8 ;print $x | $y;' # prints 12 perl -wle 'my $x="4";my $y="8";print $x | $y;' # prints < perl -wle 'my $x="4";my $y="8";print 0 | $x | $y;' # prints 12 (which is ok/expected) Second observation: #!/usr/bin/perl -l use Readonly; Readonly my $RETACT_DO_MARK_FRAUD => 4; Readonly my $RETACT_DO_EMAIL_CONFIRM => 8; print $RETACT_DO_MARK_FRAUD|$RETACT_DO_EMAIL_CONFIRM; print $RETACT_DO_MARK_FRAUD|$RETACT_DO_EMAIL_CONFIRM; __END__ Output: < 12 This shows that it first used the string "4" and the string "8" and after that the number 4 and the number 8. But I find this somewhat confusing... perl -wle 'my $x="4";my $y="8";print $x | $y;print $x | $y' # prints < < and not < 12. Looking deeper: perl -wle 'use Tie::Scalar;use base qw/Tie::StdScalar/;tie my $x, "main", 4;tie my $y, "main", 8;for (1 .. 2) { print $x | $y }' Also prints < and 12. Taking Tie::Scalar out of the picture: perl -wle 'sub TIESCALAR { my $foo = $_[1]; bless \$foo, "main"; };sub FETCH { ${ $_[0]} } ;tie my $x, "main", 4;tie my $y, "main", 8;for (1 .. 2) { print $x | $y }' Also prints < and 12. So could this be a problem with how tie works? Kind regards, BramThread Previous | Thread Next