Jester:
Are you new to coding in general or just perl?
When I first took on perl, I was overwhelmed, but it does get easier.
A note in input, as given in the example by sleetdrop.
If you are familiar with linux or any other coding, you will no doubt be familiar with stdin and stdout, as these are common streams. These streams work as though they were a file handle, which means that you can read from them and write to them just like you would a file.
The example uses <STDIN>. The <> can be considered 'slurp' operators. Whatever file handle you put between them is going to be slurped up and returned. For example, to load an entire file into an array, you could say:
Code:
#!/usr/bin/perl
my($file) = '/etc/mail/sendmail.cf';
open IN, $file or die "Cannot open file: $!\n";
# Now, we slurp the file into an array variable
my(@content) = <IN>;
close IN;
If any of this doesn't make sense, don't worry about it just yet, just look at the <> line.
And since STDIN is basically the same as a file handle, you slurp into it the same way, just like in sleetdrop's example.
I hope that this helps and makes sense to you! If you have any questions, please ask. I will do my best to answer.