O'Reilly logo

Penetration Testing with Perl by Swizec Teller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Input/output streams

So far, our application has only printed the returned results to our screen, which is standard output, or STDOUT. Next, we will take a look at how we can log the output easily from our Perl program into a file using the shell redirect operators > and >>. These operators behave in a similar fashion to how they are used in the Perl open() function for opening a file for writing. We will also learn how to redirect STDOUT into STDIN, or the standard input of another application as arguments.

Tip

Guess what? Our screen is also a file! In the directory /dev/ in most Linux distributions, there is a file called stdout, which we can echo strings into or even redirect a command into, and the output is returned from the file descriptor ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required