syswrite

syswrite FILEHANDLE,SCALAR,LENGTH,OFFSET syswrite FILEHANDLE,SCALAR,LENGTH syswrite FILEHANDLE,SCALAR Attempts to write LENGTH bytes of data from variable SCALAR to the specified FILEHANDLE, using write(2). If LENGTH is not specified, writes whole SCALAR. It bypasses buffered IO, so mixing this with reads (other than sysread()), print, write, seek, tell, or eof may cause confusion because the perlio and stdio layers usually buffer data. Returns the number of bytes actually written, or undef if

ioctl

ioctl FILEHANDLE,FUNCTION,SCALAR Implements the ioctl(2) function. You'll probably first have to say require "sys/ioctl.ph"; # probably in # $Config{archlib}/sys/ioctl.ph to get the correct function definitions. If sys/ioctl.ph doesn't exist or doesn't have the correct definitions you'll have to roll your own, based on your C header files such as <sys/ioctl.h>. (There is a Perl script called h2ph that comes with the Perl kit that may help you in this, but it's n

Assignment Operators

Assignment Operators "=" is the ordinary assignment operator. Assignment operators work as in C. That is, $x += 2; is equivalent to $x = $x + 2; although without duplicating any side effects that dereferencing the lvalue might trigger, such as from tie(). Other assignment operators work similarly. The following are recognized: **= += *= &= &.= <<= &&= -= /= |= |.= >>= ||= .= %= ^= ^.= //=

exists

exists EXPR Given an expression that specifies an element of a hash, returns true if the specified element in the hash has ever been initialized, even if the corresponding value is undefined. print "Exists\n" if exists $hash{$key}; print "Defined\n" if defined $hash{$key}; print "True\n" if $hash{$key}; exists may also be called on array elements, but its behavior is much less obvious and is strongly tied to the use of delete on arrays. WARNING: Calling exists on array values is stro

readlink

readlink EXPR readlink Returns the value of a symbolic link, if symbolic links are implemented. If not, raises an exception. If there is a system error, returns the undefined value and sets $! (errno). If EXPR is omitted, uses $_ . Portability issues: readlink in perlport.

utime

utime LIST Changes the access and modification times on each file of a list of files. The first two elements of the list must be the NUMERIC access and modification times, in that order. Returns the number of files successfully changed. The inode change time of each file is set to the current time. For example, this code has the same effect as the Unix touch(1) command when the files already exist and belong to the user running the program: #!/usr/bin/perl $atime = $mtime = time; utime $atime,

unlink

unlink LIST unlink Deletes a list of files. On success, it returns the number of files it successfully deleted. On failure, it returns false and sets $! (errno): my $unlinked = unlink 'a', 'b', 'c'; unlink @goners; unlink glob "*.bak"; On error, unlink will not tell you which files it could not remove. If you want to know which files you could not remove, try them one at a time: foreach my $file ( @goners ) { unlink $file or warn "Could not unlink $file: $!"; } Note: unlink will not attem

dump

dump LABEL dump EXPR dump This function causes an immediate core dump. See also the -u command-line switch in perlrun, which does the same thing. Primarily this is so that you can use the undump program (not supplied) to turn your core dump into an executable binary after having initialized all your variables at the beginning of the program. When the new binary is executed it will begin by executing a goto LABEL (with all the restrictions that goto suffers). Think of it as a goto with an interv

opendir

opendir DIRHANDLE,EXPR Opens a directory named EXPR for processing by readdir, telldir, seekdir, rewinddir, and closedir. Returns true if successful. DIRHANDLE may be an expression whose value can be used as an indirect dirhandle, usually the real dirhandle name. If DIRHANDLE is an undefined scalar variable (or array or hash element), the variable is assigned a reference to a new anonymous dirhandle; that is, it's autovivified. DIRHANDLEs have their own namespace separate from FILEHANDLEs. See

$INPUT_LINE_NUMBER

$INPUT_LINE_NUMBER