in reply to variable treatment

Good question! See Bitwise String Operators, which says "You may explicitly show which type of operation you intend by using "" or 0+". So this:
use strict; use warnings; my $a = '94'; my $b = '98'; my $c = 0+$a ^ 0+$b; print "$c\n"; my $x = 94; my $y = 98; my $z = 0+$a ^ 0+$b; print "$z\n"; my $i = 94 ^ 98; print "$i\n";
Gives:
60 60 60

Replies are listed 'Best First'.
Re^2: variable treatment
by asthaonard (Acolyte) on Jun 08, 2011 at 07:21 UTC
    Thank you. I hadn't thought it's so easy.