in reply to
IP to hex translator
perl -e "map {printf '%02x'} split '\.', '127.0.0.1'"
Comment on
Re: IP to hex translator
Download
Code
Replies are listed 'Best First'.
Re^2: IP to hex translator
by
Oleg_T
(Initiate)
on Sep 18, 2009 at 23:03 UTC
sorry,
perl -e "map {printf '%02x', $_} split '\.', '127.0.0.1'"
[reply]
[d/l]
Re^2: IP to hex translator
by
Oleg_T
(Initiate)
on Sep 18, 2009 at 23:18 UTC
perl -e "print unpack('H*', pack('C*', split ('\.', '127.0.0.1')))"
Or (whithout brackets)
perl -e "print unpack 'H*', pack 'C*', split '\.', '127.0.0.1'"
[reply]
[d/l]
[select]
In Section
Cool Uses for Perl