On 12/04/2011 08:40 AM, Chris Stinemetz wrote:
I have a program that I am working on improveing. The fist step I have
taken is converting it in using the strict pragma.
Now when this subroutine call is made I get the following compilation error:
Global symbol "$cell" requires explicit package name at ./evdo.pl line 279.
Global symbol "$cell" requires explicit package name at ./evdo.pl line 279.
I understand lexical scope, but am having a hard time figuring out how to
fix this.
Any help is greatly apprciated.
Chris
sub getMarket
{
my $_cell = shift;
why are you putting a _ before the name? that is not a typical perl way
to spell a scalar. _ before a sub name is a convention that the
sub/method is private. that isn't needed with lexically scoped vars.
if( $cell>= $start&& $cell<= $end)
look at the spelling there.
also that line (and others) can use more whitespace. it helps others to
read the code.
uri
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/