Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: unpack(pack(join simplification

by Util (Priest)
on Jul 04, 2007 at 15:53 UTC ( [id://624904]=note: print w/replies, xml ) Need Help??


in reply to Re: unpack(pack(join simplification
in thread unpack(pack(join simplification

Good idea to use oct(), but $" is deprecated; use join() instead.

sub binary_array_to_uint { my $bin = join '', @_; return oct "0b$bin"; }
perl -wlane 'print oct( "0b" . join( "", @F ) );' <<END 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 END
Output: 2147483648 2147483647 2147483649 1 0

Replies are listed 'Best First'.
Re^3: unpack(pack(join simplification
by blazar (Canon) on Jul 04, 2007 at 21:40 UTC
    Good idea to use oct(), but $" is deprecated; use join() instead.

    Fully agreeing on the use of join (in this case) instead of $", but how is the latter deprecated?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://624904]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-25 22:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found