Presumably this is not in a subroutine, so the shift references the @ARGV array containing the arguments from the command line. If there weren't any command line arguments then shift will return 'nothing' using the value undef. The undef value is 'false' so the final value of the logical expression shift || 'foo.html' is the right-hand part, 'foo.html'. Thus if no arguments $file gets set to 'foo.html' as a default value.
In reply to Re: Shift function and file opening
by shenme
in thread Shift function and file opening
by Tricky
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |