use strict; use warnings; print "The beginning\n"; my $flag = 1; warn "Flag set\n" if $flag; die "Farewell, cruel world\n"; #### C:> perl fred The beginning Flag set Farewell, cruel world C:> #### C:> perl fred > fred.out Flag set Farewell, cruel world C:> type fred.out The beginning C:> #### C:> perl fred > fred.out 2>&1 C:> type fred.out The beginning Flag set Farewell, cruel world C:>