The __DATA__ segment at the end of the file stores data in what Perl interpretes as some sort of pseudo-file. To read that out, you can use the filehandle DATA.
What TJPride does here is reading out all the lines as array and joining them into a single string. (Reading from < DATA > in array context since it is the array argument to join).
BREW /very/strong/coffee HTTP/1.1
Host: goodmorning.example.com
418 I'm a teapot
| [reply] [d/l] [select] |
my $cmdout = join '', <DATA>; is the same as if I just put all the stuff below the __DATA__ line into $cmdout directly. It's also the same as if I had that data in a file, opened a filehandle to it (let's say FH) and then read it using my $cmdout = join '', <FH>;. Basically, __DATA__ is just a good way to post code examples without having to exclude the file data it's running on. | [reply] [d/l] [select] |