unable to use @ARG in Perl

R

ragavendran31

Hi all,

While i try 2 execute this prgm im getting output as Zero..... i didnt
get clear info abt @ARGV so can anyone help me reg this .... but in
notes its saying that in commandline v shd give sme inputs for sum ...

My Program is as Follows :

my $tot = 0;
$tot += $_ for @ARGV;
print"the total is $tot\n";

Thanks in advance.

By,
Ragavendran R
 
J

Jürgen Exner

While i try 2 execute this prgm im getting output as Zero..... i
didnt get clear info abt @ARGV so can anyone help me reg this ....
but in notes its saying that in commandline v shd give sme inputs for
sum ...

I realize that English is probably not your first language, but in
particular if you are not familiar with the language _PLEASE_ run your
posting through a spell checker before hitting the send button.
To me what you wrote above is mostly gibberish and at least I can not really
make any sense of it.

Thank you for your consideration.

jue
 
J

Jim Gibson

Hi all,

While i try 2 execute this prgm im getting output as Zero..... i didnt
get clear info abt @ARGV so can anyone help me reg this .... but in
notes its saying that in commandline v shd give sme inputs for sum ...

My Program is as Follows :

my $tot = 0;
$tot += $_ for @ARGV;
print"the total is $tot\n";

wrx 4 me:

jim 39% cat sum.pl
#!/usr/local/bin/perl
use strict;
use warnings;
my $tot = 0;
$tot += $_ for @ARGV;
print"the total is $tot\n";
jim 40% sum.pl 1 2 3 4
the total is 10
jim 41%

gd lk! c u l8r!
 
A

Arved Sandstrom

A. Sinan Unur said:
(e-mail address removed) wrote in


We could try to help you 'reg this' if we knew what it meant to 'reg'
something.


What is commandline v? What do you mean by "shd give sme"? Please write in
proper English. It is the language that is common to all of us on this
forum. Making it easy for others to understand what you mean, would help
you get help.

Somehow sounded better coming from you. :) If I got that request from
someone who I knew spoke English only, I'd fashion a blank stare and ask the
person to repeat themselves as many times as it took.

Damned text messaging.

As for "reg this", I assume (since no other helpful info was provided) that
the OP wants to use reg.exe on a Windows OS to place a Java object reference
that he has obtained as "this" in Java code into the registry, using Perl.

I forgive him the "give sme". That's a typo. I do the same when I type "the"
as "teh".

AHS
 
T

Tad McClellan

Arved Sandstrom said:
I forgive him the "give sme". That's a typo. I do the same when I type "the"
as "teh".


I make one particular typo so often that I have defined:

alias gerp=grep

:)
 

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

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top