Posted on 2009-11-02 08:11:36-08 by oliver in response to 11690
Re: How to pass an open session to a subroutine
Hi Amir.

Yes this is a Perl language question really. Arguments to subroutines are passed by-copy in Perl, so you can just pass $s directly like enterCommands($s, @array) and it will work. Also, when calling methods on $s you should not use the round brackets: $s->cmd() will work fine.

I think you might want to look at buying a copy of the Learning Perl O'Reilly book which is a good introduction to Perl.

Best of luck,
regards, oliver.
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.