Perl: the Markov chain saw | |
PerlMonks |
Re: Program Not Printing Helpby Athanasius (Archbishop) |
on May 16, 2014 at 16:47 UTC ( [id://1086358]=note: print w/replies, xml ) | Need Help?? |
Hello Hrand, and welcome to the Monastery! First: always begin your script with:
as this will help you identify typos and other syntax errors. Second, you cannot pass subroutine arguments in Perl as you do in C/C++. You need something like:
Third, there is a logic error in the second for loop: the first occurrence of the line:
should be deleted. There are various other observations that could be made as to style, such as preferring for my $i (0 .. $testCases - 1) to the C-style loop used, but the points above are the main ones to start with. Hope that helps,
In Section
Seekers of Perl Wisdom
|
|