O'Reilly logo

Beginning Perl for Bioinformatics by James Tisdall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Built-in Functions

Perl has a great many built-in functions. Table B-6 is a partial list with short descriptions.

Table B-6. Perl built-in functions

Function

Summary

abs VALUE

Return the absolute value of its numeric argument

atan2 Y, X

Return the principal value of the arc tangent of Y/X from -π to π

chdir EXPR

Change the working directory to EXPR (or home directory by default)

chmod MODE LIST

Change the file permissions of the LIST of files to MODE

chomp (VARIABLE or LIST)

Remove ending newline from string(s), if present

chop (VARIABLE or LIST)

Remove ending character from string(s)

chown UID, GID, LIST

Change owner and group of LIST of files to numeric UID and GID

close FILEHANDLE

Close the file, socket, or pipe associated with FILEHANDLE

closedir DIRHANDLE

Close the directory associated with DIRHANDLE

cos EXPR

Return the cosine of the radian number EXPR

dbmclose HASH

Break the binding between a DBM file and a hash

dbmopen HASH, DBNAME, MODE

Bind a DBM file to a HASH with permissions given in MODE

defined EXPR

Return true or false if EXPR has a defined value or not

delete EXPR

Delete an element (or slice) from a hash or an array.

die LIST

Exit the program with an error message that includes LIST

each HASH

Step through a hash with one key, or key-value pair, at a time

exec PATHNAME LIST

Terminate the program and execute the program PATHNAME with arguments LIST

exists EXPR

Return true if hash key or array index exists

exit EXPR

Exit the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required