tutorials:perl_quick_reference
This is an old revision of the document!
Perl Quick Reference
- ($): variable is a name for a container that holds one or more values; use $ to get the value.
- (!): negation operator
- (tr/): transliterating one group of characters into another. * (s/): substitution
- (%): modulus operator:
- /s : match any character with
- ! : negation operator and see P35
- \s : shortcut for whitespace
- \s+ : match for one or more whitespace characters
- \S+ : match any character that their counterpart would not match
- /g : global replacements
- -p option : tells perl to write a program for you/file is a named pipe
- -e option : executable code follow / file or directory name exist
- /d : modifier delete found but unreplaced characters
- (=~): right against string on the left
- == : equal
- = : assignment operator
- . : string values can be concatenated with the . operator
- ( * ): match the preceding item 0 or more times
- m : pattern match operator * ^ : carets * mkdir : make a directory * GetOptions: the option name is followed by an = (means this option requires a value and s. * grep operator: picking some items from a list can be done with grep * grep command: which print out text lines matching a given pattern. * (whitespace): characters like space, tabs, and newlines. * (\d, \w, \s): nondigital characters, nonword character,,or a nonwhitespace characters. * (\D, \W, \S): match any character that their counterpart would not match
tutorials/perl_quick_reference.1281514342.txt.gz · Last modified: by susanbruce