in reply to Can I do single-file, Object oriented perl?

$ echo 'package Tom;' > foo.pl $ chmod u+x foo.pl $ ./foo.pl package: not found
This is where splain comes in handy.

$ ./foo.pl 2>&1 | splain package: not found (#1) (A) You've accidentally run your script through the Bourne shell instead of Perl. Check the #! line, or manually feed your script into Perl yourself.

Your mistake in posting was to say "my code looks something like this, it gives some errors" and then go into a long tangent about what you THINK might be causing the errors. Much better is to say "here's the exact code, here is what I expected it to do, and here is the exact error I got." Smart Questions HOWTO.

(The mystery of how somebody who doesn't understand that #! is parsed by the shell got a job adminning 800 Linux boxes is left as an exercise to the reader.)

Replies are listed 'Best First'.
Re^2: Can I do single-file, Object oriented perl?
by Anonymous Monk on Jul 06, 2005 at 17:53 UTC
    The mystery of how somebody who doesn't understand that #! is parsed by the shell got a job adminning 800 Linux boxes is left as an exercise to the reader.

    What mystery? That's the norm, in my experience.