Bitwise Or and Exclusive Or

Bitwise Or and Exclusive Or Binary "|" returns its operands ORed together bit by bit. Binary "^" returns its operands XORed together bit by bit. Although no warning is currently raised, the results are not well defined when these operations are performed on operands that aren't either numbers (see Integer Arithmetic) nor bitstrings (see Bitwise String Operators). Note that "|" and "^" have lower priority than relational operators, so for example the parentheses are essential in a test like pri

Bitwise And

Bitwise And Binary "&" returns its operands ANDed together bit by bit. Although no warning is currently raised, the result is not well defined when this operation is performed on operands that aren't either numbers (see Integer Arithmetic) nor bitstrings (see Bitwise String Operators). Note that "&" has lower priority than relational operators, so for example the parentheses are essential in a test like print "Even\n" if ($x & 1) == 0; If the experimental "bitwise" feature is enab

Binding Operators

Binding Operators Binary "=~" binds a scalar expression to a pattern match. Certain operations search or modify the string $_ by default. This operator makes that kind of operation work on some other string. The right argument is a search pattern, substitution, or transliteration. The left argument is what is supposed to be searched, substituted, or transliterated instead of the default $_ . When used in scalar context, the return value generally indicates the success of the operation. The exc

bind

bind SOCKET,NAME Binds a network address to a socket, just as bind(2) does. Returns true if it succeeded, false otherwise. NAME should be a packed address of the appropriate type for the socket. See the examples in Sockets: Client/Server Communication in perlipc.

binmode

binmode FILEHANDLE, LAYER binmode FILEHANDLE Arranges for FILEHANDLE to be read or written in "binary" or "text" mode on systems where the run-time libraries distinguish between binary and text files. If FILEHANDLE is an expression, the value is taken as the name of the filehandle. Returns true on success, otherwise it returns undef and sets $! (errno). On some systems (in general, DOS- and Windows-based systems) binmode() is necessary when you're not working with a text file. For the sake of p

bigrat - Transparent BigNumber/BigRational support for Perl

NAME SYNOPSIS DESCRIPTIONModules Used Math Library Sign Methods MATH LIBRARY Caveat Options CAVEATS EXAMPLES LICENSE SEE ALSO AUTHORS NAME bigrat - Transparent BigNumber/BigRational support for Perl SYNOPSIS use bigrat; print 2 + 4.5,"\n"; # BigFloat 6.5 print 1/3 + 1/4,"\n"; # produces 7/12 { no bigrat; print 1/3,"\n"; # 0.33333... } # Import into current package: use bigrat qw/hex oct/; print hex("0x1234567890123490"),"\n"; print oct("01234567890123490"),"\n"; DESCRIPTION Al

bignum - Transparent BigNumber support for Perl

NAME SYNOPSIS DESCRIPTIONOptions Methods Caveats Math Library INTERNAL FORMAT SIGN CAVEATS MODULES USED EXAMPLES LICENSE SEE ALSO AUTHORS NAME bignum - Transparent BigNumber support for Perl SYNOPSIS use bignum; $x = 2 + 4.5,"\n"; # BigFloat 6.5 print 2 ** 512 * 0.1,"\n"; # really is what you think it is print inf * inf,"\n"; # prints inf print NaN * 3,"\n"; # prints NaN { no bignum; print 2 ** 256,"\n"; # a normal Perl scalar now } # for older Perls, import into current pack

bigint - Transparent BigInteger support for Perl

NAME SYNOPSIS DESCRIPTIONuse integer vs. use bigint Options Math Library Internal Format Sign Method calls Methods CAVEATS MODULES USED EXAMPLES LICENSE SEE ALSO AUTHORS NAME bigint - Transparent BigInteger support for Perl SYNOPSIS use bigint; $x = 2 + 4.5,"\n"; # BigInt 6 print 2 ** 512,"\n"; # really is what you think it is print inf + 42,"\n"; # inf print NaN * 7,"\n"; # NaN print hex("0x1234567890123490"),"\n"; # Perl v5.10.0 or later { no bigint; print 2 ** 256,"\n"; #

Bigger Numbers

Bigger Numbers The standard Math::BigInt, Math::BigRat, and Math::BigFloat modules, along with the bignum , bigint , and bigrat pragmas, provide variable-precision arithmetic and overloaded operators, although they're currently pretty slow. At the cost of some space and considerable speed, they avoid the normal pitfalls associated with limited-precision representations. use 5.010; use bigint; # easy interface to Math::BigInt $x = 123456789123456789; say $x * $x; +15241578780673678515622620

Benchmark - benchmark running times of Perl code

NAME SYNOPSIS DESCRIPTIONMethods Standard Exports Optional Exports :hireswallclock Benchmark Object NOTES EXAMPLES INHERITANCE CAVEATS SEE ALSO AUTHORS MODIFICATION HISTORY NAME Benchmark - benchmark running times of Perl code SYNOPSIS use Benchmark qw(:all) ; timethis ($count, "code"); # Use Perl code in strings... timethese($count, { 'Name1' => '...code1...', 'Name2' => '...code2...', }); # ... or use subroutine references. timethese($count, { 'Name1' => s