Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Greetings Monks
I copied the sub "dec2bin" from section 2.4 "Converting Between Binary and Decimal" in the Perl Cookbook (page 48 in my copy).
sub dec_to_bin { my $flag = shift ; my $str = unpack("B32", pack("N", $flag)) ; $str =~ s/^0+(?=\d)// ; return $str ; }
When I run it, I get this strange warning ...
Ambiguous call resolved as CORE::unpack(), qualify as such or use & at ./utils.pl line 190.
Ambiguous call resolved as CORE::pack(), qualify as such or use & at ./utils.pl line 190.
The result seems OK to me -- so what is the problem? Anyone here know?
The OS is FreeBSD.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "Ambiguous call" in decimal to binary conversion
by bart (Canon) on Apr 29, 2004 at 10:21 UTC | |
|
Re: "Ambiguous call" in decimal to binary conversion
by theorbtwo (Prior) on Apr 29, 2004 at 10:22 UTC | |
by Anonymous Monk on Apr 29, 2004 at 12:57 UTC | |
by Anonymous Monk on Apr 30, 2004 at 02:53 UTC |