in reply to Re^2: runtime problem; elusive error
in thread runtime problem; elusive error
I'd like to be able to put a "numeric" or "string" in front a var to let it know what I want
You can. They are spelled "0+" and "''." respectively.
my $x = '8'; my $y = '16'; print((0+$x) | (0+$y), "\n"); # 24 print((''.$x) | (''.$y), "\n"); # 96
Update: Oops, that doesn't quite answer your question. If the variable wasn't read-only, you could do the following:
$x .= ''; # Stringify $x += 0; # Numerify
|
|---|