in reply to Re^2: session as function argument in net:telnet:cisco
in thread session as function argument in net:telnet:cisco

Too many arguments for main::doOne ...
sub doOne(){ ... }

You define the  doOne() subroutine as taking no arguments (using the  () prototype; see Prototypes in perlsub), and then you try to pass it an argument when you invoke it. That won't work. In general, don't use prototypes unless you know what they are, what they do, and why you're using one in a particular instance. See Far More than Everything You've Ever Wanted to Know about Prototypes in Perl -- by Tom Christiansen.

Update: mvcorrea: I see that the code in the OP has been 'fixed' again to remove the prototype from the  doOne() function definition (it was altered once before in response to Corion's reply), and again there is no notation that a critical alteration has been made. Please don't do this: it makes comments based on the original post seem incoherent. By all means, make changes to your posts, but please make a note of the changes within the changed post! (If you post as a registered user, you can always go back and edit your post.)