14 lines
259 B
Perl
14 lines
259 B
Perl
#!/usr/bin/perl -w
|
|
|
|
use strict;
|
|
|
|
log_warning("A", "B");
|
|
log_warning("C");
|
|
log_warning();
|
|
|
|
sub log_warning {
|
|
my $message = shift || "Something's wrong";
|
|
my $time = shift || localtime; # Default to now.
|
|
print "[$time] $message\n";
|
|
}
|