Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^7: Creating 'new' subroutine.

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


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

You posted code where you test an array with ref, it doesn't do what you think it does (it does nothing)

its the equivalent of  if( not ref "shamalama" eq "dingdong" ){ ... }

its equivalent to  if(1){ ... }

clear now?

Replies are listed 'Best First'.
Re^8: Creating 'new' subroutine.
by Lennotoecom (Pilgrim) on Oct 11, 2013 at 11:48 UTC
    thank you, got carried away a bit)

      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. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1057868]
help
Chatterbox?
[marto]: there's just so much FUD
[choroba]: we had the training yesterday
[hippo]: GDPR applies to everyone but there is an exception for individuals keeping records of their own personal activities.
[hippo]: The full monty
[hippo]: It is, of course, an utter mess.
[Corion]: marto: GDPR is focused on businesses and business-like entities (like my Perl club), but you mostly have to have a set of (technically enforced) rules when to delete data, and also an overview of what kinds of data you collect and why.
[choroba]: The basic message was "The regulations remain the same, what changed is the fines"
[Discipulus]: here we are blatantly uncompliant..
[marto]: hippo yes, but the list of exceptions (Section 17 IIRC) is open to interpretation
[Corion]: For small businesses, there isn't much to do IMO, as long as you don't outsource anything and don't employ third parties (like Google Analytics, or mailing list services/ advertising services etc.)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2018-05-22 07:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?