I have this program which does not work as expected. Help me.
I want to print a row heading.
If input is 4
, I want 1|2|3|4
to be output.
It does not work as all, if I hard-code $count
value it works partially but the last number is missing.
sub printC {
my $count = @_;
# count = 4 # works partially only prints 1|2|3
for(my $i=1;$i<$count;$i++) {
print "$i|";
}
print $i;
}
$count = 2;
&printC($count);
print "\n";