Tyler wrote:
> One more quick question.  How can I count the values
> in an array
> (@servernames)?
> I want to print my servernames seperately:
[snip]

Tyler,

To get a numeric count of the elements in
@servernames, do this:

$count = @servernames;  # count now equals the number
of elements in @servernames

To print out each of the elements, do this:

foreach $name (@servernames) {
     print "$name\n";
}

Another way to do the above is this:

for (@servernames) {
     print "$_\n";  # when no placeholder variable is
specified, by default the $_ variable is used
}

HTH,


=====
Dave Hoover
"Twice blessed is help unlooked for." --Tolkien
http://www.redsquirreldesign.com/dave

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Reply via email to