Help for this page

Select Code to Download


  1. or download this
    sub foo {
        my $calling_sub = (caller 1)[3];
    ...
    
    bar();  # prints: called from: main::bar
    foo();  # prints: called from: the main block
    
  2. or download this
    # using Sys::Syslog log levels
    sub open_db {
    ...
            log_this(LOG_ERR, 'OPEN_DB_NOK', $dbname, 'db connection faile
    +d');
        }
    }