Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^4: Things I Don't Use in Perl

by radiantmatrix (Parson)
on Aug 24, 2005 at 18:16 UTC ( [id://486320]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Things I Don't Use in Perl
in thread Things I Don't Use in Perl

Interesting points. To be fair, the original implementation only sets the name attribute equal to $_[0] as well, by virtue of $self->{name} = shift. I was less interested in the case of empty array as I was in the case of setting the attribute 'name' to be a scalar value, which seemed to make more sense. Should have been more clear. ;-)

As to die "No arguments in set_name()" unless @_;, note that I did leave a space in the setter to validate behavior, since we aren't going from a spec. Depending on the behavior required, that line may or may not be appropriate. The behavior you described as erratic is what I intended, but its interesting that we looked at the same OP and drew differing conclusions.

I guess this is an example to designers about how unclear specs can lead to unexpected behavior. ;-)

<-radiant.matrix->
Larry Wall is Yoda: there is no try{} (ok, except in Perl6; way to ruin a joke, Larry! ;P)
The Code that can be seen is not the true Code
"In any sufficiently large group of people, most are idiots" - Kaa's Law

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-25 14:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found