In addition to the other answers to your questions, one thing I notice from 
your code is that you didn't 'use warnings'.  You should always turn on 
warnings, either by adding 'use warnings' or by adding a -w after perl on the 
shebang line.
 
 

        -----Original Message----- 
        From: Beast [mailto:[EMAIL PROTECTED] 
        Sent: Thu 10/20/2005 11:39 PM 
        To: Beginners Perl 
        Cc: 
        Subject: why not die?
        
        

        #!/usr/bin/perl
        use strict;
        
        my $log = '/non/existence/dir/test.log';
        my $msg = "test";
        &write_log($msg);
        
        sub write_log {
            my $msg = shift;
            open LOG, ">>$log" || die "Can't write to $log: $!\n";
               print LOG $msg;
            close LOG;
        }
        
        ---
        
        It doesn't die or print any error even $log did not exist.
        why?
        
        
        
        

Reply via email to