Re: Switching with case in perl ?



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.)




.



Relevant Pages