Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On StackExchange I came across a command that looked like this:

perl -pe ...

Curious what the -pe options meant, I did man perl. This is the synopsis of that man page:

perl [ -sTtuUWX ]      [ -hv ] [ -V[:configvar] ]      [ -cw ] [ -d[t][:debugger] ] [ -D[number/list] ]      [ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal/hexadecimal] ]
        [ -Idir ] [ -m[-]module ] [ -M[-]'module...' ] [ -f ]      [ -C [number/list] ]      [ -S ]      [ -x[dir] ]      [ -i[extension] ]
        [ [-e|-E] 'command' ] [ -- ] [ programfile ] [ argument ]...

However, the man page does not explain what any of the options sTtuUWXhvcwpnafS do. Instead it refers you to perldoc. However, I can't seem to find any reference to the actual command line arguments in perldoc. Where are they actually documented? Is there some secret linux documentation information retrieval method I am unaware of here?

On a side note/rant, is the fact that I can't find this information an indication of a failing in the perl documentation? I am happy to read the documentation rather than just ask questions online, but I swear finding my answer in the documentation can be near impossible at times! Graarh! /rant

share|improve this question
up vote 3 down vote accepted

perlrun is the manpage you're looking for:

man perlrun
share|improve this answer
Egh. How was I supposed to know that?! – Cory Klein Jul 31 '12 at 20:52
man perl has references to specific versions of perl at the end (the 'see also' section, usually overlooked). Following them (e.g. man perl5.12) gives you all the manual pages you can think of. – Wojtek Rzepala Jul 31 '12 at 21:51
man perl primarily lists all of the other perl man pages, including perlrun Perl execution and options – cas Jul 31 '12 at 22:49
perlrun's online copy has hyperlinks and nicer formatting. Just to know that option too. – manatwork Aug 3 '12 at 17:52
Also note that not all distros install the complete perl manpages by default, so you might have to do, for example on Ubuntu, sudo apt install perl-doc. – David Röthlisberger Mar 17 '15 at 10:44

perl -h is useful

  • -e program: one line of program (several -e's allowed, omit programfile)
  • -p: assume loop like -n but print line also, like sed
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.