sub printlog { print LOG @_ unless $nolog; } printlog "======== done =========\n"; #### print LOG "======== done =========\n" unless $nolog; #### BEGIN { my $nolog = 0; sub setlog { $nolog = shift; } sub printlog { print LOG @_ unless $nolog; } } setlog 1; printlog "======== done =========\n";
## print LOG "======== done =========\n" unless $nolog; ##
## BEGIN { my $nolog = 0; sub setlog { $nolog = shift; } sub printlog { print LOG @_ unless $nolog; } } setlog 1; printlog "======== done =========\n";