in reply to Re: Getopt::Long subroutine question
in thread Getopt::Long subroutine question

Hi 2teez,

From my reading of that documentation the my original answer still is correct. Your code calls sub1 3 times (once for each parameter passed on the command line). Yet the OP asked how to have the sub called just once with all parameters in tow.

Replies are listed 'Best First'.
Re^3: Getopt::Long subroutine question
by 2teez (Vicar) on Jul 23, 2013 at 05:00 UTC

    Yes, you are right, however, what I intend to answer, is the OP words ..as if the sub was called 3 times..
    That was why I quoted the documentation, that though the sub is called each time an option is encountered, however it could be shown as though those options were gotten once!! Accessing only the the value to be stored, in this case a,b and c NOT like the OP has it test a, test b and test c.

    If you tell me, I'll forget.
    If you show me, I'll remember.
    if you involve me, I'll understand.
    --- Author unknown to me