asthaonard has asked for the wisdom of the Perl Monks concerning the following question:
Hello
I'm very new to perl - just starting :) And so rather theoretical question
How could i force perl to treat variable as number or text?
Very short example:
my $a = '94'; my $b = '98'; my $c = $a ^ $b; print "$c\n"; my $x = 94; my $y = 98; my $z = $a ^ $b; print "$z\n"; my $i = 94 ^ 98; print "$i\n";
and output is:
♀ ♀ 60
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: variable treatment
by oxone (Friar) on Jun 08, 2011 at 05:59 UTC | |
by asthaonard (Acolyte) on Jun 08, 2011 at 07:21 UTC | |
Re: variable treatment
by choroba (Cardinal) on Jun 08, 2011 at 07:48 UTC |