implementing getopts when called by functions

Discussion in 'Perl Misc' started by Ironhide, Oct 28, 2008.

  1. Ironhide

    Ironhide Guest


    Is it possible to do this in perl?
    If yes, please let me know how.

    sub A {

    IOWorkload -v .. -a ..


    sub IOWorkload {

    Ironhide, Oct 28, 2008
    1. Advertisements

  2. No. The range operator is a binary operator, i.e. there is a missing
    value at the end of that line.
    Also, using two range operators like that most likely won't produce the
    results you may be expecting because one of the lists will be converted
    to a scalar as argument for the second range op.
    No. IOWorkload must be declared before being used if you want to omit
    the paranthesis in the call.

    Jürgen Exner, Oct 28, 2008
    1. Advertisements

  3. Ironhide

    smallpond Guest

    You could try something like:

    use Getopt::Tiny;

    sub IOWorkload($) {
    $_ = shift;
    my @ARGS = split;
    smallpond, Oct 28, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.