Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^9: Creating 'new' subroutine.

by Anonymous Monk
on Oct 11, 2013 at 12:00 UTC ( #1057873=note: print w/ replies, xml ) Need Help??


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

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


Comment on Re^9: Creating 'new' subroutine.
Download Code
Re^10: Creating 'new' subroutine.
by Lennotoecom (Monk) on Oct 11, 2013 at 12:04 UTC
    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. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1057873]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (10)
As of 2014-07-23 23:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (154 votes), past polls