J
Justin C
I can't see why this won't run, I've the Learning Perl book here and,
though I'm not using $i as per the example, I've followed it (AFAICT)
exactly. Here's the code:
#!/usr/bin/perl
use warnings ;
use strict ;
my @data = qw/ john paul george ringo / ;
thumbs(@data) ;
sub thumbs {
my $row_count = 5 ;
for ( my $pg_count = 15 ; $pg_count == 0 ; $pg_count-- ) {
print "$pg_count PC" ;
$row_count-- ;
$pg_count-- ;
}
}
This obviously isn't all my code but it's the shortest example that
demonstrates the problem.
I bet it's something really simple, but I can't see it... I'm tensed
and ready for the "stoopid noob" slap
What I've done to test this is litter the entire code with print
statements, the sub is called but the 'for' loop just appears to be
skipped.
Perl 5.8.4, Debian amd64 (Sarge, unofficial port).
I'm looking and looking at the loop:
The first part is an assignement, the second part is a test, the third
part is the increment (or whatever). Nope, I cannot see what it is.
Thank you for your time.
Justin.
though I'm not using $i as per the example, I've followed it (AFAICT)
exactly. Here's the code:
#!/usr/bin/perl
use warnings ;
use strict ;
my @data = qw/ john paul george ringo / ;
thumbs(@data) ;
sub thumbs {
my $row_count = 5 ;
for ( my $pg_count = 15 ; $pg_count == 0 ; $pg_count-- ) {
print "$pg_count PC" ;
$row_count-- ;
$pg_count-- ;
}
}
This obviously isn't all my code but it's the shortest example that
demonstrates the problem.
I bet it's something really simple, but I can't see it... I'm tensed
and ready for the "stoopid noob" slap
What I've done to test this is litter the entire code with print
statements, the sub is called but the 'for' loop just appears to be
skipped.
Perl 5.8.4, Debian amd64 (Sarge, unofficial port).
I'm looking and looking at the loop:
The first part is an assignement, the second part is a test, the third
part is the increment (or whatever). Nope, I cannot see what it is.
Thank you for your time.
Justin.