I've got one question about scalar polymorphism:
How do I do to set up a scalar value eg '$foo' which has a numeric value in a numeric context and has a string value in a string context ?
For instance, I'd like to do something like that:
my $err = ???? ; my $num = $err + 0 ; print $num ; # Will print lets say the number '1' ; print $err ; # Will print the string 'ERROR 1' ;
I saw this type of behaviour in BerkeleyDB module and I wonder how it works.
Thanks for your precious help.
-- Nice photos of naked perl sources here !
In reply to scalar polymorphism by jeteve
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |