in reply to _ doing something new to me?
It is basically the same thing as the last "thing" tested with the previous test operator but without having to re-test it (which is apparently expensive). I remember reading that in a book.
Update: I think it is called 'chaining' tests.
To save the overhead of a low-level stat() system call, Perl caches the previously-examined inode in a special variable called simply '_'; so we can do tests like this:if ( -e $file && -r _ && -x _) { # $file exists and is both readable and executable ... }
And you didn't even know bears could type.
|
|---|