unable to use @ARG in Perl

Discussion in 'Perl Misc' started by ragavendran31@gmail.com, Dec 1, 2006.

  1. Guest

    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
     
    , Dec 1, 2006
    #1
    1. Advertising

  2. wrote:
    > 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ürgen Exner, Dec 1, 2006
    #2
    1. Advertising

  3. Jim Gibson Guest

    In article <>,
    <> wrote:

    > 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!
     
    Jim Gibson, Dec 1, 2006
    #3
  4. "A. Sinan Unur" <> wrote in message
    news:Xns988C46631481Dasu1cornelledu@127.0.0.1...
    > wrote in
    > news::
    >
    >> 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

    >
    > We could try to help you 'reg this' if we knew what it meant to 'reg'
    > something.
    >
    >> .... but in
    >> notes its saying that in commandline v shd give sme inputs for sum ...

    >
    > 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
     
    Arved Sandstrom, Dec 2, 2006
    #4
  5. Arved Sandstrom <> wrote:

    > 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

    :)


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Dec 2, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. n00m
    Replies:
    5
    Views:
    396
  2. Bartek Lakomiec
    Replies:
    4
    Views:
    243
    Eric Schwartz
    Apr 5, 2007
  3. pc

    unable to use perl on windows

    pc, Aug 15, 2007, in forum: Perl Misc
    Replies:
    8
    Views:
    96
    Ayaz Ahmed Khan
    Aug 16, 2007
  4. Replies:
    7
    Views:
    182
  5. Replies:
    21
    Views:
    328
    Barry Schwarz
    Mar 5, 2014
Loading...

Share This Page