giulienk has asked for the wisdom of the Perl Monks concerning the following question:
Now i have created a new Telephone::Number object (temporary namespace) cause i need it to do some dirty work parsing phone numbers... but this is not the point.sub new { my ($self, $tn, $key, $value); my $class = shift; if ($_[2] =~ /^\d+$/) { # this suppose no %hash key is all numeric $tn = Telephone::Number->new(shift, shift, shift); } else { $tn = Telephone::Number->new(shift); } my ($smstext, %hash) = @_; $self = bless { 'tn' => $tn, 'smstext' => $smstext, 'cookie_jar' => exists $hash{cookie_jar} ? delete $hash{cookie_jar} : "lwpcookies.txt", }, $class; @{$self}{keys %{$tn}} = @{$tn}{keys %{$tn}}; @{$self}{keys %hash} = @hash{keys %hash}; #dragonchild suggest +ion $self; }
Edit kudra, 2001-10-30 Changed title
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Once again looking for Wisdom
by davorg (Chancellor) on Oct 30, 2001 at 15:00 UTC | |
|
Re: Maintaining Contained Object Attributes
by Fletch (Bishop) on Oct 30, 2001 at 17:02 UTC | |
|
(tye)Re: Maintaining Contained Object Attributes
by tye (Sage) on Oct 30, 2001 at 20:22 UTC |