##
# use strict; # TODO
+use POSIX qw(strftime);
use vars qw($msgType $uh $lastWho $ident);
use vars qw(%lang %lastWho);
$reply = "$lhs $mhs $result";
}
- if ($reply =~ s/^\Q$who\E is/you are/i) {
- # fix the person.
- } else {
- if ($reply =~ /^you are / or $reply =~ / you are /) {
- return if ($addressed);
- }
- }
+ $reply =~ s/^\Q$who\E is/you are/i) {
}
}
sub substVars {
my($reply,$flag) = @_;
- # $date, $time.
+ # $date, $time, $day.
# TODO: support localtime.
- my $date = scalar(gmtime());
- $date =~ s/\:\d+(\s+\w+)\s+\d+$/$1/;
+ my $date = strftime("%Y.%m.%d", gmtime());
$reply =~ s/\$date/$date/gi;
- $date =~ s/\w+\s+\w+\s+\d+\s+//;
- $reply =~ s/\$time/$date/gi;
+ my $time = strftime("%k:%M:%S", gmtime());
+ $reply =~ s/\$time/$time/gi;
+ my $day = strftime("%A", gmtime());
+ $reply =~ s/\$day/$day/gi;
# support $ident when I have multiple nicks
- my $mynick = $conn->nick();
+ my $mynick = $conn->nick() if $conn;
# dollar variables.
if ($flag) {