Yes. I already provided that. use strict does not give an error with the code in my previous post.
use strict; use warnings; # ... Load config file ... my $hostname = 'hosta'; my @host = do { no strict 'refs'; @$hostname }; foreach my $cnf (@host) { ... }
By the way, why are you using qw(...) to initialize a scalar. Don't you want
$host = q(...);
or the equivalent but more readable
$host = '...';
In reply to Re^3: dynamically generated array variable
by ikegami
in thread dynamically generated array variable
by perlknight
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |