That's what I try doing, once I clean up my syntax
errors, I get this as my output, except $server would
be = 5.  Strange. The only thing I did not add was qw.

my $a = 0;
foreach my $server (@Servers) {
    $a++;
    print "server=$server\n";
}
print "a=$a\n";


--- $Bill Luebkert <[EMAIL PROTECTED]> wrote:
> Jim Hansen wrote:
> 
> > Can this be made dynamic or is it strictly static
> as
> > far as number of rows and contents:
> > 
> > For example, this doesn't work, but can it in some
> > way?
> > 
> > my $status <<EOD
> > 
> > $a=0;
> > 
> > foreach $server (@Servers){
> > 
> >    $a++;
> > 
> >    server $server[$a]\n
> > 
> > }
> > 
> > EOD
> 
> Not sure what you're trying to do, but you could do
> something like this :
> 
> use strict;
> use warnings;
> 
> my @Servers = qw(1 2 3 4 5);
> 
> my $status = <<'EOD';
> 
> my $a = 0;
> foreach my $server (@Servers) {
>    $a++;
>    print "server=$server\n";
> }
> print "a=$a\n";
> 
> EOD
> 
> print "status=$status\n";
> eval $status;
> 
> __END__
> 
> 
> -- 
>   ,-/-  __      _  _         $Bill Luebkert   
> Mailto:[EMAIL PROTECTED]
>  (_/   /  )    // //       DBE Collectibles   
> Mailto:[EMAIL PROTECTED]
>   / ) /--<  o // //      Castle of Medieval Myth &
> Magic http://www.todbe.com/
> -/-' /___/_<_</_</_    http://dbecoll.tripod.com/
> (My Perl/Lakers stuff)
> 


                
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to