For Programmers: Free Programming Magazines  


Home > Archive > PERL Miscellaneous > February 2005 > Re: Why declare "my $something" on top if it's going to get a lexical









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Why declare "my $something" on top if it's going to get a lexical
GreenLeaf

2005-02-24, 3:57 am

strangeuser@strangesomputer.com wrote:

<code snipped>

> sub _transformToHex {
> my @data = @_


> But why do you have to do that, since we declare "my @data" inside a sub
> routine block?
> I don't understand this...


Error is due to the missing semicolon after @_. Perl clearly says there
is a syntax error there. I, as a newbie, have seen that it helps to
correct errors in the order they appear, especially when it comes to
syntax errors. :)

Hope this helps,
sat
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com