Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

2 Answers 2

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
1  
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
1  
man perl primarily lists all of the other perl man pages, including perlrun Perl execution and options –  cas Jul 31 '12 at 22:49
1  
perlrun's online copy has hyperlinks and nicer formatting. Just to know that option too. –  manatwork Aug 3 '12 at 17:52

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
    
The information is valid, I apologize if the formatting was incorrect but obviously I am new to Stack. No reason to down reputation due to that although I guess you increased your rep. congrats on that, great job. –  Fritzah Nov 29 at 6:57

Your Answer

 
discard

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.