Ugly, but probably 'rock-solid', no esoteric modules and should work with any perl.my $str = "123e4"; print asNum( $str ); sub asNum { my $str = shift; my $foo; eval "\$foo = $str"; # backslash for string not reference if( $@ ) { warn( "oops : $@" ); } return $str; }
In reply to Re: Extract numbers in multiple bases
by jbert
in thread Extract numbers in multiple bases
by jcwren
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |