Neutron Jack has asked for the wisdom of the Perl Monks concerning the following question:
The C++ way would be to overload verify, but I can't do that in Perl:verify $a; verify "hello", $b;
Any ideas? I could put the optional string after the reference, but I don't want to. I'm not happy about having to put in an explicit backslash when calling verify, either.sub verify(\$) { ... } sub verify($\$) { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Optional parameter before reference
by BrowserUk (Patriarch) on Jul 23, 2004 at 17:44 UTC | |
|
Re: Optional parameter before reference
by Eimi Metamorphoumai (Deacon) on Jul 23, 2004 at 17:30 UTC | |
|
Re: Optional parameter before reference (!proto)
by tye (Sage) on Jul 23, 2004 at 18:02 UTC | |
by Neutron Jack (Pilgrim) on Jul 23, 2004 at 19:26 UTC | |
by tye (Sage) on Jul 23, 2004 at 22:21 UTC | |
|
Re: Optional parameter before reference
by LassiLantar (Monk) on Jul 23, 2004 at 17:37 UTC | |
|
Re: Optional parameter before reference
by heroin_bob (Sexton) on Jul 23, 2004 at 18:36 UTC |