Perl really has 4 default filehandles available. They are STDIN, STDOUT, STDERR and ARGV. ARGV is a filehandle that points all of the files on the command line. I lie about it because I have never actually seen anyone use this.
chomp doesn't really remove carriage returns. It removes the input record separator. This is normally the carriage return, but it could be something else. So, it really removes whatever $/ is set to. I lie because $/ is normally \n.
It doesn't really print to the screen. It prints to to STDOUT which the user could have re-directed. I lied because it is simplier to say than making people take my Introduction to Unix Class.
It actually prints to the currently selected filehandle. Since the default default filehandle is STDOUT I lie. But, you can change this via the select(FILEHANDLE) call.
Ok, it doesn't really tell you the number of elements in the array. It gives you the subscript of the last element in the array. So, if you have an array that is assigned like such:
$bob[0] = 1; $bob[3] = 3;@#bob will equal 3, and not 2. I lied because it was easier than explaining sparse arrays.
http://www.bofh.com/perl-class/white-lies.html
© Copyright 1996 by Jot Powers