Sri wrote:
> Hi - I have just started with Perl and would need your help on this.
> I am trying to write a program which expects two strings(arguments)
> from the end user (no less, no more) and I would like to check if the
> end-user did pass only two arguments. I am using the code below for
> th
Sri wrote:
Hi - I have just started with Perl and would need your help on this.
Hello,
I am trying to write a program which expects two strings(arguments)
from the end user (no less, no more) and I would like to check if the
end-user did pass only two arguments.
@ARGV == 2 or die "usage: $0
Sri wrote:
> Hi - I have just started with Perl and would need your help on this.
> I am trying to write a program which expects two strings(arguments)
> from the end user (no less, no more) and I would like to check if the
> end-user did pass only two arguments. I am using the code below for
> th
Hi Sri,
a few comments on your code.
On Tuesday 02 November 2010 07:08:41 Sri wrote:
> Hi - I have just started with Perl and would need your help on this.
>
> I am trying to write a program which expects two strings(arguments)
> from the end user (no less, no more) and I would like to check if t
> "sw" == shawn wilson writes:
sw> couldn't you just do something like:
sw> die "I said two variables\n" unless #$ARGV = 2;
sw> ?
that would be a good idea but you are off by one. you should rarely use
$#foo as it gives the last index of an array. @foo in scalar context
gives the size
couldn't you just do something like:
die "I said two variables\n" unless #$ARGV = 2;
?
i'm not sure what you're asking? you already check this?
On Tue, Nov 2, 2010 at 1:08 AM, Sri wrote:
> Hi - I have just started with Perl and would need your help on this.
>
> I am trying to write a program whi