Hi all,

Can somebody please explain what is the difference between:

sub subroutine {
        my $var = @_;
        ...
        return 1;
}

and:

sub subroutine {
        my ($var) = @_;
        ...
        return 1;
}

I think it's something related to the context but I'm not completely sure. What I know is that to have the behaviour I want I have to declare the variable like in the second example (with parentheses). This confuses me a bit because it's not the way I usually declare variables in my main program (that is, without parentheses).

Please assume I'm 5 years old.

Thanks,

--
rent0n

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to