The code you've posted is perfectly legal (although you really need to check the return value of open: open(FILE, "filetoread") or die "Error opening file: $!\n";). I suspect your error is higher up in the code and perl just happens to error out at that line.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
:(){ :|:&};:
Note: All code is untested, unless otherwise stated
In reply to Re: 'strict refs' + 'strict sub' = suck.
by hardburn
in thread 'strict refs' + 'strict sub' = suck.
by toonski
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |