Help with counting lines?

D

Davidd Sargent

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
 
G

Gunnar Hjalmarsson

Davidd said:
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.
 
D

Davidd Sargent

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
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top