# ...
}
+If VARIABLE is a hash, it chomps the hash's values, but not its keys.
+
You can actually chomp anything that's an lvalue, including an assignment:
chomp($cwd = `pwd`);
#...
}
+If VARIABLE is a hash, it chops the hash's values, but not its keys.
+
You can actually chop anything that's an lvalue, including an assignment:
chop($cwd = `pwd`);
it, or else see L</select> above. The Time::HiRes module from CPAN
may also help.
-See also the POSIX module's C<sigpause> function.
+See also the POSIX module's C<pause> function.
=item socket SOCKET,DOMAIN,TYPE,PROTOCOL
h interpret integer as C type "short" or "unsigned short"
If no flags, interpret integer as C type "int" or "unsigned"
+Perl supports parameter ordering, in other words, fetching the
+parameters in some explicitly specified "random" ordering as opposed
+to the default implicit sequential ordering. The syntax is, instead
+of the C<%> and C<*>, to use C<%>I<digits>C<$> and C<*>I<digits>C<$>,
+where the I<digits> is the wanted index, from one upwards. For example:
+
+ printf "%2\$d %1\$d\n", 12, 34; # will print "34 12\n"
+ printf "%*2\$d\n", 12, 3; # will print " 12\n"
+
+Note that using the reordering syntax does not interfere with the usual
+implicit sequential fetching of the parameters:
+
+ printf "%2\$d %d\n", 12, 34; # will print "34 12\n"
+ printf "%2\$d %d %d\n", 12, 34; # will print "34 12 34\n"
+ printf "%3\$d %d %d\n", 12, 34, 56; # will print "56 12 34\n"
+ printf "%2\$*3\$d %d\n", 12, 34, 3; # will print " 34 12\n"
+ printf "%*3\$2\$d %d\n", 12, 34, 3; # will print " 34 12\n"
+
There are also two Perl-specific flags:
- V interpret integer as Perl's standard integer type
- v interpret string as a vector of integers, output as
- numbers separated either by dots, or by an arbitrary
- string received from the argument list when the flag
- is preceded by C<*>
+ V interpret integer as Perl's standard integer type
+ v interpret string as a vector of integers, output as
+ numbers separated either by dots, or by an arbitrary
+ string received from the argument list when the flag
+ is preceded by C<*>
Where a number would appear in the flags, an asterisk (C<*>) may be
used instead, in which case Perl uses the next item in the parameter
FIRSTKEY this
NEXTKEY this, lastkey
DESTROY this
+ UNTIE this
A class implementing an ordinary array should have the following methods:
SPLICE this, offset, length, LIST
EXTEND this, count
DESTROY this
+ UNTIE this
A class implementing a file handle should have the following methods:
WRITE this, scalar, length, offset
PRINT this, LIST
PRINTF this, format, LIST
+ BINMODE this
+ EOF this
+ FILENO this
+ SEEK this, position, whence
+ TELL this
+ OPEN this, mode, LIST
CLOSE this
DESTROY this
+ UNTIE this
A class implementing a scalar should have the following methods:
FETCH this,
STORE this, value
DESTROY this
+ UNTIE this
Not all methods indicated above need be implemented. See L<perltie>,
L<Tie::Hash>, L<Tie::Array>, L<Tie::Scalar>, and L<Tie::Handle>.
If BITS is 16 or more, bytes of the input string are grouped into chunks
of size BITS/8, and each group is converted to a number as with
-pack()/unpack() with big-endian formats C<n>/C<N> (and analoguously
+pack()/unpack() with big-endian formats C<n>/C<N> (and analogously
for BITS==64). See L<"pack"> for details.
If bits is 4 or less, the string is broken into bytes, then the bits
extend the string with sufficiently many zero bytes. It is an error
to try to write off the beginning of the string (i.e. negative OFFSET).
+The string should not contain any character with the value > 255 (which
+can only happen if you're using UTF8 encoding). If it does, it will be
+treated as something which is not UTF8 encoded. When the C<vec> was
+assigned to, other parts of your program will also no longer consider the
+string to be UTF8 encoded. In other words, if you do have such characters
+in your string, vec() will operate on the actual byte string, and not the
+conceptual character string.
+
Strings created with C<vec> can also be manipulated with the logical
operators C<|>, C<&>, C<^>, and C<~>. These operators will assume a bit
vector operation is desired when both operands are strings.