Help with counting lines?

Discussion in 'Perl' started by Davidd Sargent, Aug 13, 2004.

  1. Hi Everybody,
    I'm new to this group.
    I am trying to make a script but have a slight problem so I turned to you
    guys.

    I have a textarea which the user types there subdomain in to and then click
    submit.
    What I want is on the results page for it to count the number of subdomains
    (each domain will be separated by \n (a newline)).

    Thanks in Advance

    Kind Regards


    Dave
     
    Davidd Sargent, Aug 13, 2004
    #1
    1. Advertising

  2. Davidd Sargent wrote:
    > I have a textarea which the user types there subdomain in to and
    > then click submit.
    > What I want is on the results page for it to count the number of
    > subdomains (each domain will be separated by \n (a newline)).


    Show us the code you have so far.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Aug 13, 2004
    #2
    1. Advertising

  3. My Code
    Sorry I'm a beginner.

    $tempvar = $in{'packageID'};
    $line = "\n";
    @newtextareaarray = split($tempvar,$line);
    $count ="0";
    foreach $line (@newtextareaarray) {
    $count++;

    }


    print qq|Here : $count|;


    Thanks

    Dave

    "Davidd Sargent" <> a écrit dans le message de
    news:cfhtng$fs$...
    > Hi Everybody,
    > I'm new to this group.
    > I am trying to make a script but have a slight problem so I turned to you
    > guys.
    >
    > I have a textarea which the user types there subdomain in to and then

    click
    > submit.
    > What I want is on the results page for it to count the number of

    subdomains
    > (each domain will be separated by \n (a newline)).
    >
    > Thanks in Advance
    >
    > Kind Regards
    >
    >
    > Dave
    >
    >
     
    Davidd Sargent, Aug 13, 2004
    #3
  4. Gunnar Hjalmarsson, Aug 13, 2004
    #4
    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. mikester
    Replies:
    7
    Views:
    605
    mikester
    Dec 25, 2003
  2. j
    Replies:
    1
    Views:
    745
    Kevin Spencer
    Jul 22, 2003
  3. Brent

    Counting lines of text.

    Brent, Feb 16, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    400
    =?Utf-8?B?TmlrYW5kZXIgJiBNYXJncmlldCBCcnVnZ2VtYW4=
    Feb 18, 2005
  4. Anders K. Jacobsen [DK]

    Counting code lines i asp.net project

    Anders K. Jacobsen [DK], Jul 5, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    911
    Carlos J. Quintero [.NET MVP]
    Jul 6, 2005
  5. edwardfredriks

    counting up instead of counting down

    edwardfredriks, Sep 6, 2005, in forum: Javascript
    Replies:
    6
    Views:
    213
    Dr John Stockton
    Sep 7, 2005
Loading...

Share This Page