perlunifaq - Perl Unicode FAQ

NAME Q and Aperlunitut isn't really a Unicode tutorial, is it? What character encodings does Perl support? Which version of perl should I use? What about binary data, like images? When should I decode or encode? What if I don't decode? What if I don't encode? Is there a way to automatically decode or encode? What if I don't know which encoding was used? Can I use Unicode in my Perl sources? Data::Dumper doesn't restore the UTF8 flag; is it broken? Why do regex character classes sometimes match

Net::servent - by-name interface to Perl's built-in getserv*() functions

NAME SYNOPSIS DESCRIPTION EXAMPLES NOTE AUTHOR NAME Net::servent - by-name interface to Perl's built-in getserv*() functions SYNOPSIS use Net::servent; $s = getservbyname(shift || 'ftp') || die "no service"; printf "port for %s is %s, aliases are %s\n", $s->name, $s->port, "@{$s->aliases}"; use Net::servent qw(:FIELDS); getservbyname(shift || 'ftp') || die "no service"; print "port for $s_name is $s_port, aliases are @s_aliases\n"; DESCRIPTION This module's default exports overr

$a

$a

lock

lock THING This function places an advisory lock on a shared variable or referenced object contained in THING until the lock goes out of scope. The value returned is the scalar itself, if the argument is a scalar, or a reference, if the argument is a hash, array or subroutine. lock() is a "weak keyword" : this means that if you've defined a function by this name (before any calls to it), that function will be called instead. If you are not under use threads::shared this does nothing. See thread

pipe

pipe READHANDLE,WRITEHANDLE Opens a pair of connected pipes like the corresponding system call. Note that if you set up a loop of piped processes, deadlock can occur unless you are very careful. In addition, note that Perl's pipes use IO buffering, so you may need to set $| to flush your WRITEHANDLE after each command, depending on the application. Returns true on success. See IPC::Open2, IPC::Open3, and Bidirectional Communication with Another Process in perlipc for examples of such things. On

Named Unary Operators

Named Unary Operators The various named unary operators are treated as functions with one argument, with optional parentheses. If any list operator (print(), etc.) or any unary operator (chdir(), etc.) is followed by a left parenthesis as the next token, the operator and arguments within parentheses are taken to be of highest precedence, just like a normal function call. For example, because named unary operators are higher precedence than ||: chdir $foo || die; # (chdir $foo) || die chdir(

I/O Operators

I/O Operators There are several I/O operators you should know about. A string enclosed by backticks (grave accents) first undergoes double-quote interpolation. It is then interpreted as an external command, and the output of that command is the value of the backtick string, like in a shell. In scalar context, a single string consisting of all output is returned. In list context, a list of values is returned, one per line of output. (You can set $/ to use a different line terminator.) The comma

English - use nice English (or awk) names for ugly punctuation variables

NAME SYNOPSIS DESCRIPTION PERFORMANCE NAME English - use nice English (or awk) names for ugly punctuation variables SYNOPSIS use English; use English qw( -no_match_vars ) ; # Avoids regex performance # penalty in perl 5.16 and # earlier ... if ($ERRNO =~ /denied/) { ... } DESCRIPTION This module provides aliases for the built-in variables whose names no one seems to like to read. Variables with side-effects which get tr

No-ops

No-ops Perl doesn't officially have a no-op operator, but the bare constants 0 and 1 are special-cased not to produce a warning in void context, so you can for example safely do 1 while foo();

rand

rand EXPR rand Returns a random fractional number greater than or equal to 0 and less than the value of EXPR. (EXPR should be positive.) If EXPR is omitted, the value 1 is used. Currently EXPR with the value 0 is also special-cased as 1 (this was undocumented before Perl 5.8.0 and is subject to change in future versions of Perl). Automatically calls srand unless srand has already been called. See also srand. Apply int() to the value returned by rand() if you want random integers instead of rand