Gowtham schreef:
> Martin Barth:
>>> for my ($index = 0; $index <= 10; $index++) {
>>>print ("$hour:$min:$sec\n");
>>> }
>>
>> for my $index (0..10){
>> print ("$hour:$min:$sec\n");
>> }
>
> Don't wrap the entire loop initializer, condition and
> counter update in my(). [...]
Gowtham,
On Jul 10, 9:13 pm, [EMAIL PROTECTED] (Martin Barth) wrote:
> > for my ($index = 0; $index <= 10; $index++) {
>
> > print ("$hour:$min:$sec\n");
>
> > }
>
> for my $index (0..10){
> print ("$hour:$min:$sec\n");
>
> }
>
> hth
Don't wrap the entire loop initializer, condition and counter upd
CM Analyst wrote:
for my ($index = 0; $index <= 10; $index++) {
for (my $index = 0; $index <= 10; $index ++ ) {
--- Shawn
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
> for my ($index = 0; $index <= 10; $index++) {
>
> print ("$hour:$min:$sec\n");
>
> }
for my $index (0..10){
print ("$hour:$min:$sec\n");
}
hth
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
Hello.
I have this code that works fine without the for loop
but fails with it with this error message:
"Missing $ on loop variable at time.pl line 7."
Here's the code itself:
###
use strict;
use warnings;
use Time::Local;
my ($sec, $min, $hour, $mday, $mon, $year, $wday,
$yday, $isdst