in reply to question of pack.
Just replace hex( ) with oct( ) for oct. For binary there is no bin( ), I was struggling with the same problem recently -use warnings; use strict; print "Please input a hex no. to convert to dec. :"; chomp (my $value = <STDIN>); print hex("$value"), "\n";
http://perlmonks.org/index.pl?node_id=591504
should find some answers there. PS - can someone please tell me the tags to make urls clickable in a post? Ta
Edit, sorry - just spotted that I got the conversion backwards in the code
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: question of pack.
by liverpole (Monsignor) on Dec 26, 2006 at 14:53 UTC | |
by thevoid (Scribe) on Dec 26, 2006 at 15:42 UTC | |
by thevoid (Scribe) on Dec 27, 2006 at 09:40 UTC |