[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Getting Need Explicit Package



At 9:12 PM -0500 12/17/97, WagsWorld wrote:

} Reading the book: Advanced Perl Programming - Sriram Srinivasan. On page 62
} there is an example of Closures.  When I run it, I get the following error
} message:
}
} # Global symbol "odd_iter" requires explicit package name.

It's because "use strict" is *strict*, and doesn't like this line:

($even_iter,$odd_iter) = even_odd_print_gen(10);

As it says, it doesn't like the fact that these two global variables aren't
explicitly put in package main.  If you write it

my ($even_iter,$odd_iter) = even_odd_print_gen(10);

then you uncover the other problem that's left as an exercise (Hint: it's a
missing #).  Fix them, and the script works as advertised.



[snip]
}
}  Not certain what is happening and unsure where to look to find out what is
} really wrong.
}
} Any assistance would be greatly appreciated.
}
} Wags
}

---
Paul J. Schinder
NASA Goddard Space Flight Center
Code 693, Greenbelt, MD 20771
schinder@pjstoaster.pg.md.us



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch