"; when you need to capture all three standard file handles of the process.
I would write an example, but it works mostly the same way IPC:: Open2 does, but with a slightly different order to the arguments and a third file handle.
Perl one-liners are small and awesome Perl programs that fit in a single line of code and they do one thing really well.
These things include changing line spacing, numbering lines, doing calculations, converting and substituting text, deleting and printing certain lines, parsing logs, editing files in-place, doing statistics, carrying out system administration tasks, updating a bunch of files at once, and many more. Anything that took you minutes to solve, will now take you seconds! Imagine you are on a remote server and have this file and you need to do the replacement.
The back tick runs 'command' and then returns a string representing its standard out (whatever it would have printed to the screen) You can also use popen to run shell commands and I think that there is a shell module - 'use shell' that gives you transparent access to typical shell commands.
Wouter insists that Ruby Gems are enough of an argument to keep Rails at a distance.
The gets edited in-place, meaning Perl opens the file, executes the substitution for each line, prints the output to a temporary file, and then replaces the original file.
The difference between 'exec' and 'system' is that exec replaces your current program with 'command' and NEVER returns to your program.
system, on the other hand, forks and runs 'command' and returns you the exit status of 'command' when it is done running.
How about getting a list of the names of all users on the system? If you wish to learn more and become really fast in the shell, I suggest you get a copy of my "Perl One-Liners Explained" e-book.
The e-book contains 130 unique one-liners and many of them are presented in several different ways, so the total number of one-liners in this book is over 200.