Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
1. why is a comma not semicolon after the first "shift" in while loop#1: sub new { #2: my $class = shift; #3: my $self = { }; #4: while (scalar(@_)) { #5: $self->{$_[0]} = $_[1]; shift, shift; #6: } #7: bless $self, ref($class)||$class; #8: }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: confusing constructor code
by Corion (Patriarch) on Jul 01, 2008 at 07:25 UTC | |
by Burak (Chaplain) on Jul 01, 2008 at 07:47 UTC | |
by Corion (Patriarch) on Jul 01, 2008 at 07:52 UTC | |
by Burak (Chaplain) on Jul 01, 2008 at 08:07 UTC | |
by dragonchild (Archbishop) on Jul 01, 2008 at 12:55 UTC |