package Logndebug; use strict; use warnings; use Exporter; our @ISA = qw[ Exporter ]; our @EXPORT = qw[ LOG DEBUG logging ]; sub LOG { return unless fileno( *STDLOG ); print STDLOG @_; } sub DEBUG { return unless fileno( *STDDBG ); print STDDBG @_; } sub logging { my( $logging, $debugging ) = @_; *STDLOG = *{ $logging } if defined $logging and fileno( $logging ); *STDDBG = *{ $debugging } if defined $debugging and fileno( $debugging ); } 1;