FreeKB - Perl articles
Perl articles

ArraysGetting Started with ArraysAppend value to the beginning of an array (unshift)Append value to the end of an array (push)Count values in an arrayCreate array over SSHRemove all values from array (undef)Remove empty lines from arrayRemove first line from array (splice)Remove values beginning of array (shift)Remove values end of array (pop) Remove values from array (splice)Replace values in array (map)Sort ArrayStore files directories in array (glob)Built in Perl commandsEscape special characters using quotemeta (\Q \E)Lower case (lc)Random number generator (rand)Update the first character in a string to be upper case (ucfirst)Upper case (uc)Wrap text (Text::Wrap)Command Line Options and FlagsGetting Started with command line options and flagsCountCount characters in a string (length)Count lines in a file ($.)Data::DumperGetting Started with Data::DumperDate TimeDate and time using strftimeDate and time using Time::PieceDirectoriesList directoriesFile::BasenameFile::Basename moduleFilesPrevious, current, and next line in a file (seek, tell)Transfer a fileFiles - JSONGetting Started with JSON::ParseJSON Modification of a read-only valueFiles - TXT / DOC / CSVDetermine if file contains a string of dataRead a file (<)Read and write to the same fileReplace values in a fileWrite to a file (> and >>)Files - XLSAppend or replace data in an Excel spreadsheet (Spreadsheet::ParseExcel)Read an Excel 95-2003 spreadsheet (xls) Write to an Excel 95-2003 spreadsheet (xls) HashesArray of HashesCount keys and values in a hashHash (append values)Hash (create empty hash)Hash (determine if hash is defined)Hash (determine if hash key is defined)Hash (grep keys)Hash (lock_keys lock_values)Hash (multidimensional hash)Hash (remove values)Hash (sort keys)Hash Array (append key value pairs) Hash Array (append keys)Hash Array (append values)Hash Array (create empty array)Hash Array (determine if hash array defined)Hash Array (remove values)loop through hash keysloop through hash valuesprint hash valuesif elsif else statementsGetting Started with if elsif else statementsDetermine if a directory is emptyInstallInstall a module (cpan)Install Perl on LinuxLoggerGetting Started with Log::Log4perl LoggerLoopsforeach loopsLoop through a file until line matchloop through a range of items in an arrayMoving onto next value in a loop (next)while loopMathAddition (+)Convert hexadecimal to decimalDivision (/)Multiplication (*)Subtraction (-)Sum of integers in a fileModulesCreate your own moduleDetermine if a module is installedOtherNative operating system command (`backticks`)Prompt a user for inputScientific notation with Microsoft ExcelPrinting outputBold text (Term::ANSIColor)Display text on the console (print and say)Regular Expressions (regex)( and ) charactersAppend leading zeros to numberscarriage returns (\r ^M)Do something end of lineDo something every nth line in a fileDo something range of linesFlatten lists (merge similar lines)Match last occurrence of a line in a fileRegular expression delimiterReplace text in a file (-pi -e =~)Trailing forward slashUsing grepwhitespace (\s)SFTPGetting Started with Net::SFTPSpliting stringCut a string into pieces (substr)Split fields at delimiterSQL databaseConnect to a SQL databaseSSHGetting Started with Net::OpenSSHGetting Started with Net::SSH:PerlLocal and remote variables over SSHSSH run command on a remote hostSubroutinesGetting Started with SubroutinesIdentical subroutine names (package, namespace)Pass values to a subroutine (@_ and $_ and shift)return in a subroutineVariables / ScalarsGetting Started with scalars and variablesAppend values to a variable (.=)Determine if a variable is definedDetermine if a variable is empty or nullGlobal and lexical variables (my)Replace values in a variable (=~)XML::SimpleGetting Started with XML::SimpleData::Dumper and XML::SimpleXML::Simple ArraysXML::Simple ForceArrayXML::Simple Ignore Attributes XML::Simple looping through hash keysXML::Simple looping through keysXML::Simple looping through keys that contain attributesXML::Simple Printing AttributesXML::Simple printing keys (XMLin)XML::Simple printing values (XMLin)