Jeff Pang wrote:
I also think this is the best way for your purpose.You can pass a
hash ref to subroutine,and store any arguments you want to be past
> to the subroutine in that hash.
> ...
Thanks for this. I'm going to do this, I think you're right it seems to
fit what I need.
Mug wrote:
> Maybe in OO Style ? I guess that would be clear enough.
> Just more sub-class to do more things.... likely no need
> to touch the old codes...
> ...
Thanks for this. I'm reading Intermediate Perl at the minute and hoping
to move over to OO soon. When I do, from what I've read so far, I would
be using something very similar to the hash ref solution above so it
seems a good next step to make. I'm not ready to start writing OO code
yet but I'll be there soon.
The code you suggest wouldn't do it for me with the situations I'm
coming across most as the extra variables usually need to be used by the
same bits of code as the current ones.
For example I may have some code to strip out certain characters from a
string and replace them with another character and so on. Later on I
decide I want to be able to control the character that is used as the
replacement character so I add a variable and make the original
character the default if no character is sent, so it still works the
same for the old calls.
Stuff like that.
Thanks for the help,
Nigel
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>