in reply to $class name not pass in the new()

These are function calls. The only arguments the functions receive are those you pass manually:

Cow::speak; Horse::speak; Sheep::speak;

These are method calls. They receive their invocants as arguments, along with any arguments you pass manually:

Cow->speak; Horse->speak; Sheep->speak;

You can call methods as functions, but you will break things if you do.


Improve your skills with Modern Perl: the free book.

Replies are listed 'Best First'.
Re^2: $class name not pass in the new()
by perldood (Initiate) on May 11, 2012 at 19:32 UTC
    Thanks guys !! Awesome explanation...