Friday, January 9, 2015

Perl Resources

From One of the best way to start learning Perl for Developement jobs, is to read the below books in order and practice on your own. Don't be baffled on the below list of books. If you want to work as a Perl Developer and be a competent Perler you need to work hard. Or otherwise, if enough Perl is required to get the Job Done for your organisation, then "Beginning Perl by James Lee - Apress" is your reference, although it will not work for production level code.

1) Sams Teach yourself Perl in 24 Hours
This gives a definite understanding of all Perl Variables and References for a Beginner. At least first 2 Parts is must reading

2) Learning Perl - Oreilly
This one is definite for Perl Basics and Idioms and with hands on Practice on the exercises to start as a real perl developer

3) Intermediate Perl - Oreilly
This one is for References, Modules and Object Oriented Programming. This book will surely take time to understand if you are new to Perl References and OOPs. But once you are through you can call yourself as a Perl Developer, but be sure to practice the exercises and don't skip it.

4) Mastering Perl - Oreilly
This one is for Typeglobs and other Advanced Perl features, but would recommend to read this book if you have worked atleast on 2 Perl Projects.

5) Effective Perl
This one is only Refresher if there is some gap for your next Perl Project, and that's why I gave 4 stars, but it's a good read ( if you have time ) and it helps to improve your code and you will learn some new perl tricks.

6) Perl Cookbook 2e, Aug. 2003

7) Programming Perl: Unmatched power for text processing and scripting, 4e, Mar. 2012

Labels: , , ,

Tuesday, January 6, 2015

convert linux man page to pdf

man -t find | ps2pdf - find.pdf

export MANWIDTH=120
#unset MANWIDTH

How to print man pages:

       MANWIDTH
              If $MANWIDTH is set, its value is used as the line length for which manual pages should
              be formatted.  If it is not set, manual pages will be  formatted  with  a  line  length
              appropriate to the current terminal (using an ioctl(2) if available, the value of $COL‐
              UMNS, or falling back to 80 characters if neither is available).  Cat pages  will  only
              be saved when the default formatting can be used, that is when the terminal line length
              is between 66 and 80 characters.

Labels: ,

Monday, January 5, 2015

help vs info vs man


help commands
  1. help cd
  2. cd --help
  3. man ls
  4. apropos floppy
  5. whatis ls
  6. info coreutils
Source help is a built-in command in the bash shell (and that shell only) that documents some of the builtin commands and keywords of that shell. That's an internal documentation system of that shell. Other shells have their own documentation system (ksh93 has --help and --man options for its builtins, zsh has a run-help helper that extracts information from manuals in other formats). Other commands like vim have their own embedded documentation system.
man is a system-wide documentation system that provides short reference manuals (pages) for individual commands, API functions, concepts, configuration file syntax, file formats organised in sections (1 for user commands, 2 for system calls...). That's the traditional Unix documentation system.
info is another documentation system originating in the GNU project. It's hypertext with links (predates the web). An info manual is like a digital book with a concept of table of contents and (searchable) index which helps locating the information.
There's overlap between the 3. For instance, bash being part of the GNU project has both a man page and an info manual. The size of the manual makes the man system not as appropriate for bash though. However, the structure of the info manual and index is not very good in bash which makes it not as easy to look information in as in other info manuals like zsh's. zsh manual being even bigger is split into several man pages and also has a good info manual with a very good index.
It should be noted that the info manual is generated from a texinfo format which is also used to generate HTML and printable (PDF/PS) versions. In the case of zsh though, the texinfo is generated from another format (yodl).

Labels: ,