implementing getopts when called by functions

I

Ironhide

Hi,

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

sub A {

IOWorkload -v .. -a ..

}

sub IOWorkload {
...
...
}

_G
 
J

Jürgen Exner

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

sub A {
Yes.

IOWorkload -v .. -a ..

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.
}

sub IOWorkload {

No. IOWorkload must be declared before being used if you want to omit
the paranthesis in the call.

jue
 
S

smallpond

Hi,

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

sub A {

IOWorkload -v .. -a ..

}

sub IOWorkload {
..
..

}

_G


You could try something like:

use Getopt::Tiny;

sub IOWorkload($) {
$_ = shift;
my @ARGS = split;
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top