\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Nikolay Mishin (mishin)} \pdfinfo{ /Title (perlcheat.pdf) /Creator (Cheatography) /Author (Nikolay Mishin (mishin)) /Subject (perlcheat Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{3874FF} \definecolor{LightBackground}{HTML}{F2F6FF} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{perlcheat Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Nikolay Mishin (mishin)} via \textcolor{DarkBackground}{\uline{cheatography.com/1008/cs/396/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Nikolay Mishin (mishin) \\ \uline{cheatography.com/mishin} \\ \uline{\seqsplit{mishin}.narod.ru} \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 1st June, 2012.\\ Updated 12th May, 2016.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{x{2.14011 cm} x{2.83689 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{About Perlcheat}} \tn % Row 0 \SetRowColor{LightBackground} AUTHOR & Juerd Waalboer, with the help of many Perl Monks. \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} the original PM post & \seqsplit{http://perlmonks.org/?node\_id=216602} \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} Damian Conway's Perl 6 version & \seqsplit{http://perlmonks.org/?node\_id=238031} \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} home of the Perl Cheat Sheet & \seqsplit{http://juerd.nl/site.plp/perlcheat} \tn % Row Count 9 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{CONTEXTS}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{void} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{scalar} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{list} \tn % Row Count 3 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{SIGILS}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\$scalar} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{@array} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\%hash} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\&sub} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{*glob} \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.05271 cm} x{1.55618 cm} x{1.96811 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{ARRAYS,HASHES}} \tn % Row 0 \SetRowColor{LightBackground} & ARRAYS & HASHES \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} whole: & @array & \%hash \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} slice: & @array{[}0, 2{]} & @hash\{'a', 'b'\} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} element: & \$array{[}0{]} & \$hash\{'a'\} \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{SCALAR VALUES}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{number, string, reference, glob, undef% Row Count 1 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{SYNTAX}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{for (LIST) \{ \}, for (a;b;c) \{ \}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{while ( ) \{ \}, until ( ) \{ \}} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{if ( ) \{ \} elsif ( ) \{ \} else \{ \}} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{unless ( ) \{ \} elsif ( ) \{ \} else \{ \}} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{for equals foreach (ALWAYS)} \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{LINKS}} \tn % Row 0 \SetRowColor{LightBackground} Search the CPAN - metacpan.org & \seqsplit{https://metacpan.org} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{Perl Weekly}} & \seqsplit{http://perlweekly.com/latest.html} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{PerlMonks - The Monastery Gates}} & \seqsplit{http://www.perlmonks.org/} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} What's happening in the world of Perl programming, including Perl 5, Perl 6, the CPAN and Parrot? & \seqsplit{http://perlbuzz.com/} \tn % Row Count 11 (+ 5) % Row 4 \SetRowColor{LightBackground} The Comprehensive Perl Archive Network - www.cpan.org & http://cpan.org \tn % Row Count 14 (+ 3) % Row 5 \SetRowColor{white} News and views of the Perl programming language & \seqsplit{http://www.perl.com/} \tn % Row Count 17 (+ 3) % Row 6 \SetRowColor{LightBackground} Perl programming documentation - perldoc.perl.org & \seqsplit{http://perldoc.perl.org/} \tn % Row Count 20 (+ 3) % Row 7 \SetRowColor{white} Perl Conferences, YAPCs, Workshops, and Hackathons & \seqsplit{http://www.yapc.org/} \tn % Row Count 23 (+ 3) % Row 8 \SetRowColor{LightBackground} {\bf{Perl 6}} & http://perl6.org/ \tn % Row Count 24 (+ 1) % Row 9 \SetRowColor{white} {\bf{Perl 6 Tablet 2 - Basic Syntax}} & \seqsplit{http://tablets.perl6.org/tablet-2-basic-syntax.html} \tn % Row Count 27 (+ 3) % Row 10 \SetRowColor{LightBackground} Learn Perl - learn.perl.org & \seqsplit{http://learn.perl.org/} \tn % Row Count 29 (+ 2) % Row 11 \SetRowColor{white} Perl - Download & \seqsplit{http://www.perl.org/get.html} \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{LINKS (cont)}} \tn % Row 12 \SetRowColor{LightBackground} The Perl.org Online Library & \seqsplit{http://www.perl.org/books/library.html} \tn % Row Count 2 (+ 2) % Row 13 \SetRowColor{white} {\bf{Books and More (Videos)}} & \seqsplit{http://www.perl.org/media.html} \tn % Row Count 4 (+ 2) % Row 14 \SetRowColor{LightBackground} Padre, the Perl IDE & \seqsplit{http://padre.perlide.org/} \tn % Row Count 6 (+ 2) % Row 15 \SetRowColor{white} perlcheat & \seqsplit{http://perldoc.perl.org/perlcheat.html} \tn % Row Count 8 (+ 2) % Row 16 \SetRowColor{LightBackground} {\bf{Gabor Szabo Perl Trainer and developer}} & http://szabgab.com/ \tn % Row Count 11 (+ 3) % Row 17 \SetRowColor{white} Perl,Perl Mongers,Mongers,User Group,Meeting & http://pm.org \tn % Row Count 14 (+ 3) % Row 18 \SetRowColor{LightBackground} {\bf{Facebook vs Google+ for Perl projects}} & \seqsplit{http://szabgab.com/facebook-vs-google-plus-for-perl-projects.html} \tn % Row Count 18 (+ 4) % Row 19 \SetRowColor{white} Lections about Per from Gabor Szabo & \seqsplit{http://www.youtube.com/results?search\_query=gabor+perl} \tn % Row Count 21 (+ 3) % Row 20 \SetRowColor{LightBackground} mod\_perl world & \seqsplit{http://perl.apache.org} \tn % Row Count 23 (+ 2) % Row 21 \SetRowColor{white} Interpreted Languages: PHP, Perl, Python, Ruby (Sheet One) & \seqsplit{http://hyperpolyglot}.org/scripting \tn % Row Count 26 (+ 3) % Row 22 \SetRowColor{LightBackground} Moose - A postmodern object system for Perl & \seqsplit{http://moose.iinteractive.com/} \tn % Row Count 29 (+ 3) % Row 23 \SetRowColor{white} {\bf{Perl Training Australia - Perl Tips}} & \seqsplit{http://perltraining.com.au/tips/} \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{LINKS (cont)}} \tn % Row 24 \SetRowColor{LightBackground} {\bf{ Basic Perl (Ynon Perek | An Amazing Learning Experience) , super}} & \seqsplit{http://ynonperek.com/courses/basic-perl.html} \tn % Row Count 4 (+ 4) % Row 25 \SetRowColor{white} {\bf{Perl Questions - Stack Overflow}} & \seqsplit{http://stackoverflow}.com/questions/tagged/perl?sort=faq\&pagesize=15 \tn % Row Count 8 (+ 4) % Row 26 \SetRowColor{LightBackground} Perl - Cheat sheets Collection & \seqsplit{http://perl4everything}.blogspot.com/2010/12/perl-cheat-sheets-collection.html \tn % Row Count 12 (+ 4) % Row 27 \SetRowColor{white} {\bf{complete, working examples of good Perl code}} & \seqsplit{http://perlmeme.org/start\_here/index.html} \tn % Row Count 15 (+ 3) % Row 28 \SetRowColor{LightBackground} Perl Programming Tutorials & \seqsplit{http://www.devshed.com/c/b/Perl/} \tn % Row Count 17 (+ 2) % Row 29 \SetRowColor{white} Video from UniverTV & \seqsplit{http://univertv.ru/search/?txt=perl\&x=0\&y=0} \tn % Row Count 20 (+ 3) % Row 30 \SetRowColor{LightBackground} FAQ по perl и \seqsplit{программированию} для web & \seqsplit{http://www.cyberguru.ru/web/web-programming/perl-web-programming-faq-page2.html} \tn % Row Count 24 (+ 4) % Row 31 \SetRowColor{white} {\bf{FAQ PERL Agava}} & \seqsplit{http://hosting.agava.ru/faq/tech/docs/perl.shtml} \tn % Row Count 27 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Modern::Perl}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Modern::Perl} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}enable all of the features of Modern Perl with one import} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Toolkit} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}use Toolkit; and put all your favorite modules in a file: \textgreater{} cat \seqsplit{\$PERL5LIB/Toolkit/Macros/ALWAYS/Modules} use strict; use warnings; use Carp; use Smart::Comments;} \tn % Row Count 8 (+ 5) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{use common::sense;} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}supposed to be the same, with much lower memory usage, as: \# \# use strict qw(vars subs); \# use feature qw(say state switch); \# no warnings; \# use warnings qw(FATAL closed threads internal debugging pack substr malloc \# unopened portable prototype inplace io pipe unpack regexp \# deprecated exiting glob digit printf utf8 layer \# reserved parenthesis taint closure semicolon); \# no warnings qw(exec newline);} \tn % Row Count 19 (+ 11) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{latest} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}There is latest, which is no longer the latest. Demonstrates part of the naming problem.} \tn % Row Count 22 (+ 3) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{uni::perl} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Also, uni::perl which adds enabling unicode part of the mix.} \tn % Row Count 25 (+ 3) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{ToolSet} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}ToolSet offers a subset of Toolkit's abilities, but without source filters.} \tn % Row Count 28 (+ 3) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Moose} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}I'll include Moose here, since it automatically adds strict and warnings to the calling package.} \tn % Row Count 32 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Modern::Perl (cont)}} \tn % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Acme::Very::Modern::Perl} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}Using this module, you'll get Modern::Perl, Toolkit, latest, uni::perl, perl5i, and common::sense with just one simple line.} \tn % Row Count 4 (+ 4) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{Source} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}\seqsplit{http://stackoverflow.com/questions/1625839/should-i-use-commonsense-or-just-stick-with-use-strict-and-use-warnings}} \tn % Row Count 8 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.9954 cm} x{3.9816 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{REGEX METACHARS}} \tn % Row 0 \SetRowColor{LightBackground} \textasciicircum{} & string begin \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \$ & str. end (before \textbackslash{}n) \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} + & one or more \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} * & zero or more \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} ? & zero or one \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \{3,7\} & repeat in range \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} () & capture \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} (?:) & no capture \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} {[}{]} & character class \tn % Row Count 9 (+ 1) % Row 9 \SetRowColor{white} | & alternation \tn % Row Count 10 (+ 1) % Row 10 \SetRowColor{LightBackground} \textbackslash{}b & word boundary \tn % Row Count 11 (+ 1) % Row 11 \SetRowColor{white} \textbackslash{}z & string end \tn % Row Count 12 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{\seqsplit{http://perldoc.perl.org/perlre.html}} \tn % Row Count 13 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Perl image}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{p{5.377cm}}{\vspace{1px}\centerline{\includegraphics[width=5.1cm]{/web/www.cheatography.com/public/uploads/mishin_1338568208_index.jpg}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.38896 cm} x{2.58804 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{REGEX CHARCLASSES}} \tn % Row 0 \SetRowColor{LightBackground} . & {[}\textasciicircum{}\textbackslash{}n{]} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \textbackslash{}s & {[}\textbackslash{}x20\textbackslash{}f\textbackslash{}t\textbackslash{}r\textbackslash{}n{]} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \textbackslash{}w & {[}A-Za-z0-9\_{]} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \textbackslash{}d & {[}0-9{]} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \textbackslash{}S, \textbackslash{}W and \textbackslash{}D & negate \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} x{4.4793 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{REGEX MODIFIERS}} \tn % Row 0 \SetRowColor{LightBackground} /i & case insens. \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} /m & line based \textasciicircum{}\$ \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} /s & . includes \textbackslash{}n \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} /x & ign. wh.space \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} /g & global \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \textbackslash{}Q & quote (disable) pattern metacharacters till \textbackslash{}E \tn % Row Count 7 (+ 2) % Row 6 \SetRowColor{LightBackground} \textbackslash{}E & end either case modification or quoted section, think vi \tn % Row Count 9 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.59501 cm} x{3.06659 cm} x{0.9154 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{FUNCTION RETURN LISTS}} \tn % Row 0 \SetRowColor{LightBackground} stat & localtime & caller \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} 0 dev & 0 second & 0 package \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} 1 ino & 1 minute & 1 \seqsplit{filename} \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} 2 mode & 2 hour & 2 line \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} 3 nlink & 3 day & 3 \seqsplit{subroutine} \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} 4 uid & 4 month-1 & 4 hasargs \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} 5 gid & 5 year-1900 & 5 \seqsplit{wantarray} \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} 6 rdev & 6 weekday & 6 \seqsplit{evaltext} \tn % Row Count 15 (+ 2) % Row 8 \SetRowColor{LightBackground} 7 size & 7 yearday & 7 \seqsplit{is\_require} \tn % Row Count 17 (+ 2) % Row 9 \SetRowColor{white} 8 atime & 8 is\_dst & 8 hints \tn % Row Count 19 (+ 2) % Row 10 \SetRowColor{LightBackground} 9 mtime & & 9 bitmask \tn % Row Count 21 (+ 2) % Row 11 \SetRowColor{white} 10 ctime & just use & \tn % Row Count 23 (+ 2) % Row 12 \SetRowColor{LightBackground} 11 blksz & POSIX:: & 3..9 only \tn % Row Count 25 (+ 2) % Row 13 \SetRowColor{white} 12 blcks & strftime! \seqsplit{http://docstore.mik.ua/orelly/perl/prog3/ch32\_36.htm} & with EXPR \tn % Row Count 28 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{opendir \& grep:}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{opendir(DIR,"\$SCANDATA"); \newline % Row Count 1 (+ 1) @files = sort(grep(/{[}0-9{]}{\emph{\textbackslash{}.{[}0-9{]}}}\textbackslash{}-/,readdir(DIR))); \newline % Row Count 3 (+ 2) closedir(DIR);% Row Count 4 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{hash iteration:}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{while ((\$key,\$val) = each (\%hash)) \{ \}% Row Count 1 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{getopt}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{use Getopt::Std; \newline % Row Count 1 (+ 1) \%options=(); \newline % Row Count 2 (+ 1) getopts("he:f:s:SD:u:F:",\textbackslash{}\%options); \newline % Row Count 3 (+ 1) if (\$options\{h\}) \{ \&usage(); \} \newline % Row Count 4 (+ 1) \seqsplit{http://www.perlhowto.com/parsing\_command\_line\_parameters\_with\_getopt\_long} \newline % Row Count 6 (+ 2) \seqsplit{http://www.perlmonks.org/?node\_id=455158} \newline % Row Count 7 (+ 1) \seqsplit{http://aplawrence.com/Unix/perlgetopts.html} \newline % Row Count 8 (+ 1) http://www.cs.mcgill.ca/\textasciitilde{}abatko/computers/programming/perl/howto/getopts/ \newline % Row Count 10 (+ 2) \seqsplit{http://perl.find-info.ru/perl/015/interface/1.htm}% Row Count 11 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.74195 cm} x{3.23505 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Perl IDE}} \tn % Row 0 \SetRowColor{LightBackground} source & http://www.perlide.org/ \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{Padre}} & \seqsplit{http://padre.perlide.org/} The Perl Application Development and Refactoring Environment (written in Perl 5) \tn % Row Count 6 (+ 5) % Row 2 \SetRowColor{LightBackground} {\bf{Eclipse}} & with the EPIC plugin http://www.epic-ide.org/ or with Perlipse \seqsplit{http://code.google.com/p/perlipse/} using dltk \tn % Row Count 11 (+ 5) % Row 3 \SetRowColor{white} {\bf{ActiveState}} & proprietary Komodo IDE \seqsplit{http://www.activestate.com/Products/komodo\_ide/} or free Komodo Edit \seqsplit{http://www.activestate.com/Products/komodo\_ide/komodo\_edit.mhtml} \tn % Row Count 18 (+ 7) % Row 4 \SetRowColor{LightBackground} {\bf{Kephra}} & \seqsplit{http://kephra.sourceforge.net} Programmers Editor along perl-like Paradigms, written in Perl \tn % Row Count 22 (+ 4) % Row 5 \SetRowColor{white} {\bf{Gvim}} & www.vim.org with Perl support \seqsplit{http://www.vim.org/scripts/script.php?script\_id=556} \tn % Row Count 26 (+ 4) % Row 6 \SetRowColor{LightBackground} {\bf{Emacs}} & \seqsplit{www.gnu.org/software/emacs/} with CPerl Mode \seqsplit{http://www.emacswiki.org/cgi-bin/wiki/CPerlMode} \tn % Row Count 30 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{1.74195 cm} x{3.23505 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Perl IDE (cont)}} \tn % Row 7 \SetRowColor{LightBackground} Perl Development Tools & \seqsplit{http://www.perlmonks.org/?node=Perl\%20Development\%20Tools} \tn % Row Count 3 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{0.9954 cm} x{3.9816 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Escape sequences}} \tn % Row 0 \SetRowColor{LightBackground} \textbackslash{}t & tab (HT, TAB) \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \textbackslash{}n & newline (LF, NL) \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \textbackslash{}r & return (CR) \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \textbackslash{}f & form feed (FF) \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \textbackslash{}a & alarm (bell) (BEL) \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \textbackslash{}e & escape (think troff) (ESC) \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \textbackslash{}cK & control char (example: VT) \tn % Row Count 8 (+ 2) % Row 7 \SetRowColor{white} \textbackslash{}x\{\}, \textbackslash{}x00 & character whose ordinal is the given hexadecimal number \tn % Row Count 10 (+ 2) % Row 8 \SetRowColor{LightBackground} \textbackslash{}N\{name\} & amed Unicode character or character sequence \tn % Row Count 12 (+ 2) % Row 9 \SetRowColor{white} \textbackslash{}N\{U+263D\} & Unicode character (example: FIRST QUARTER MOON) \tn % Row Count 14 (+ 2) % Row 10 \SetRowColor{LightBackground} \textbackslash{}o\{\}, \textbackslash{}000 & character whose ordinal is the given octal number \tn % Row Count 16 (+ 2) % Row 11 \SetRowColor{white} \textbackslash{}l & lowercase next char (think vi) \tn % Row Count 17 (+ 1) % Row 12 \SetRowColor{LightBackground} \textbackslash{}u & uppercase next char (think vi) \tn % Row Count 18 (+ 1) % Row 13 \SetRowColor{white} \textbackslash{}L & lowercase till \textbackslash{}E (think vi) \tn % Row Count 19 (+ 1) % Row 14 \SetRowColor{LightBackground} \textbackslash{}U & uppercase till \textbackslash{}E (think vi) \tn % Row Count 20 (+ 1) % Row 15 \SetRowColor{white} \textbackslash{}Q & quote (disable) pattern metacharacters till \textbackslash{}E \tn % Row Count 22 (+ 2) % Row 16 \SetRowColor{LightBackground} \textbackslash{}E & end either case modification or quoted section, think vi \tn % Row Count 24 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.23965 cm} x{2.73735 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{REFERENCES}} \tn % Row 0 \SetRowColor{LightBackground} \textbackslash{} & \$\$foo{[}1{]} == \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} references & \$foo-\textgreater{}{[}1{]} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \$@\%\&* & \$\$foo\{bar\}== \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} dereference & \$foo-\textgreater{}\{bar\} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \{\} & \$\{\$\$foo{[}1{]}\}{[}2{]}== \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} anon. hashref & \$foo-\textgreater{}{[}1{]}-\textgreater{}{[}2{]} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \textbackslash{}() & \$\{\$\$foo{[}1{]}\}{[}2{]}== \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} list of refs & \$foo-\textgreater{}{[}1{]}{[}2{]} \tn % Row Count 8 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{1.14471 cm} x{3.83229 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{SPECIAL VARIABLES}} \tn % Row 0 \SetRowColor{LightBackground} \$\_ & default variable \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \$0 & program name \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \$/ & input separator \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \$\textbackslash{} & output separator \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \$| & autoflush \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \$! & sys/libcall error \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \$@ & eval error \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} \$\$ & process ID \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} \$. & line number \tn % Row Count 9 (+ 1) % Row 9 \SetRowColor{white} @ARGV & command line args \tn % Row Count 10 (+ 1) % Row 10 \SetRowColor{LightBackground} @INC & include paths \tn % Row Count 11 (+ 1) % Row 11 \SetRowColor{white} @\_ & subroutine args \tn % Row Count 12 (+ 1) % Row 12 \SetRowColor{LightBackground} \%ENV & environment \tn % Row Count 13 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.23965 cm} x{2.73735 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{NUMBERS vs STRINGS}} \tn % Row 0 \SetRowColor{LightBackground} NUMBERS & STRINGS \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} = & = \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} . & . \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} == != & eq ne \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \textless{} \textgreater{} \textless{}= \textgreater{}= & lt gt le ge \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \textless{}=\textgreater{} & cmp \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{DO}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{use Modern::Perl;} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{use strict;} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{use warnings;} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{my \$var;} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{open() or die \$!;} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{use Modules;} \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{DON'T}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{"\$foo"} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\$\$variable\_name} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{`\$userinput`} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{/\$userinput/} \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{capitalizing:}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{word: \$foo = ucfirst lc \$foo; \newline % Row Count 1 (+ 1) each word: \$foo =\textasciitilde{} s/(\textbackslash{}w+)/\textbackslash{}u\textbackslash{}L\$1/g;% Row Count 2 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{referencing a subroutine:}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\$SUBNAME = "junk"; \newline % Row Count 1 (+ 1) \&\$SUBNAME(@PARAMETERS);% Row Count 2 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{foreach:}} \tn \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{foreach \$FILE (@FILES) \{ \}% Row Count 1 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{OPERATOR PRECEDENCE}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{-\textgreater{}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{++ -{}-} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{**} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{! \textasciitilde{} \textbackslash{} u+ u-} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{=\textasciitilde{} !\textasciitilde{}} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{* / \% x} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{+ - .} \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\textless{}\textless{} \textgreater{}\textgreater{}} \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{named uops} \tn % Row Count 9 (+ 1) % Row 9 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\textless{} \textgreater{} \textless{}= \textgreater{}= lt gt le ge} \tn % Row Count 10 (+ 1) % Row 10 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{== != \textless{}=\textgreater{} eq ne cmp} \tn % Row Count 11 (+ 1) % Row 11 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\&} \tn % Row Count 12 (+ 1) % Row 12 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{| \textasciicircum{}} \tn % Row Count 13 (+ 1) % Row 13 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{\&\&} \tn % Row Count 14 (+ 1) % Row 14 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{||} \tn % Row Count 15 (+ 1) % Row 15 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{.. ...} \tn % Row Count 16 (+ 1) % Row 16 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{?:} \tn % Row Count 17 (+ 1) % Row 17 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{= += -= *= etc.} \tn % Row Count 18 (+ 1) % Row 18 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{, =\textgreater{}} \tn % Row Count 19 (+ 1) % Row 19 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{list ops} \tn % Row Count 20 (+ 1) % Row 20 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{not} \tn % Row Count 21 (+ 1) % Row 21 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{and} \tn % Row Count 22 (+ 1) % Row 22 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{or xor} \tn % Row Count 23 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Link to perl cheat}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{perlcheat} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}\seqsplit{http://www.cheatography.com/mishin/cheat-sheets/perlcheat/}} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{perl-reference-card} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}\seqsplit{http://www.cheatography.com/mishin/cheat-sheets/perl-reference-card/}} \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{\seqsplit{20-killer-perl-programming-tips}} \tn \mymulticolumn{1}{x{5.377cm}}{\hspace*{6 px}\rule{2px}{6px}\hspace*{6 px}\seqsplit{http://www.cheatography.com/mishin/cheat-sheets/20-killer-perl-programming-tips-for-beginners/}} \tn % Row Count 9 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}