Re: Switching with case in perl ?
- From: "Petr Vileta" <stoupa@xxxxxxxxxxxxx>
- Date: Sun, 9 Sep 2007 04:20:19 +0200
lerameur wrote:
for my $minute (0..59) {
my $logtime = strftime("%y%m%d%H%M", 0, $minute, $hours, $day, $month
-1, $year + 100), "\n"; #line 20
print $logtime,"\n";
}
error: Useless use of constant in void context at line 20.
Maybe you have format or parameters in reverse order :-)
You can write this
my $logtime = strftime("%y%m%d%H%M\n", $year + 100, $month -1, $day, $hours, $minute);
or this
my $logtime = strftime("%y%m%d%H%M", $year + 100, $month -1, $day, $hours, $minute) . "\n";
# use dot for concate instead comma operator
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail from another non-spammer site please.)
.
- Follow-Ups:
- Re: Switching with case in perl ?
- From: Ben Morrow
- Re: Switching with case in perl ?
- References:
- Switching with case in perl ?
- From: lerameur
- Re: Switching with case in perl ?
- From: Joe Smith
- Re: Switching with case in perl ?
- From: lerameur
- Switching with case in perl ?
- Prev by Date: Re: Switching with case in perl ?
- Next by Date: A flexible multi-level UL/LI constructor
- Previous by thread: Re: Switching with case in perl ?
- Next by thread: Re: Switching with case in perl ?
- Index(es):
Relevant Pages
|