in reply to Shift function and file opening
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Shift function and file opening
by wirrwarr (Monk) on Sep 04, 2003 at 12:16 UTC | |
by edan (Curate) on Sep 04, 2003 at 13:33 UTC |