convb2d($decimal); sub convb2d { my $decimal = unpack ( "N", pack("B32", substr("0" x 32 . $_[0], -32 ))); print ("Decimal: $decimal\n"); exit; }
You no longer need the extra variable and can now use this function in many more ways.$decimal = convb2d($decimal); sub convb2d { return unpack ( "N", pack("B32", substr("0" x 32 . $_[0], -32 ))); }
In reply to Re: perl do's and don'ts
by Sifmole
in thread perl do's and don'ts
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |