in reply to Re^7: Creating 'new' subroutine.
in thread Creating 'new' subroutine.

thank you, got carried away a bit)

Replies are listed 'Best First'.
Re^9: Creating 'new' subroutine.
by Anonymous Monk on Oct 11, 2013 at 12:00 UTC

    sub new { my $class = shift; my $self = ref $_[0] ? $_[0] : { @_ }; return bless $self, $class; }

    Grab yourself a copy of the free book Modern Perl a loose description of how experienced and effective Perl 5 programmers work....You can learn this too. , it also explains this

      no, i knew about scalar context,
      i just did mistake
      thank you for kindly pointing it out
      thanks for the book as well, gonna read it. :)