in reply to Function Confusion

Actually, I ran into a few other syntax errors. If anyone can help.
sub fireball{ my $uint32_t = \buffer; my $word_count; my $bias; ( uint23_t checksum = $bias while($word_count); { checksum += \buffer word_count-- buffer++ } return checksum )
Im getting an syntax errors near $bias and buffer++. do i need semicolons after these, because when i put them in, it still does not work. Thanks.

Replies are listed 'Best First'.
Re^2: Function Confusion
by moritz (Cardinal) on Jul 09, 2009 at 21:34 UTC
    uint23_t checksum = $bias is not Perl syntax. and \ is not a sigil. And checksum and word_count and buffer still don't have sigils.
Re^2: Function Confusion
by stevemayes (Scribe) on Jul 10, 2009 at 05:53 UTC

    your syntax on the while loop is still incorrect.

    You have:

    while ($string_tested); { statement statement statement }

    It should read like this:

    while (test) { statement0; statement1; statement2; }

    I echo the approach suggested by mzedeler and also that you have a look at the tutorials section. Oh and always  use strict; use warnings;.