Not in the script, no. You use that syntax from the command-line to invoke the script, either in a *nix shell or from a DOS prompt, except under DOS you invoke Perl and give it your script name as the first argument. I normally use Solaris but I managed to turf the kids off the PC to try out what happens under Windows XP. I put this little script together; I called it fred
use strict;
use warnings;
print "The beginning\n";
my $flag = 1;
warn "Flag set\n" if $flag;
die "Farewell, cruel world\n";
and ran it firstly without any redirection of STDOUT or STDERR like this
C:> perl fred
The beginning
Flag set
Farewell, cruel world
C:>
I then tried redirecting STDOUT to a file
C:> perl fred > fred.out
Flag set
Farewell, cruel world
C:> type fred.out
The beginning
C:>
Finally, I tried redirecting STDERR as well
C:> perl fred > fred.out 2>&1
C:> type fred.out
The beginning
Flag set
Farewell, cruel world
C:>
Astonishingly, it seems to work just like Solaris. All they need to do now is get their slashes the right way round and we'll be laughing. Cheers, JohnGG |