I have no idea what that means, but it is a clue for more experienced eval monk.use warnings; use strict; my $NB_ORA_CINC; my $NB_ORA_CLIENT; my @NB_VAR_LIST=("NB_ORA_CINC", "NB_ORA_CLIENT"); my $NB_VAR; $ENV{NB_ORA_CLIENT} = 'client01'; $ENV{NB_ORA_CINC} = 1; foreach $NB_VAR ( @NB_VAR_LIST ) { if ( defined $ENV{$NB_VAR} ) { print "Variable $NB_VAR is $ENV{${NB_VAR}}\n"; eval("\$${NB_VAR} = $ENV{${NB_VAR}}"); warn $@ if $@; } } if ( defined $NB_ORA_CINC ) { print "\$NB_ORA_CINC is $NB_ORA_CINC +\n"; } if ( defined $NB_ORA_CLIENT ) { print "\$NB_ORA_CLIENT is $NB_ORA_CLIE +NT\n"; } __END__ Variable NB_ORA_CINC is 1 Variable NB_ORA_CLIENT is client01 Bareword "client01" not allowed while "strict subs" in use at (eval 2) + line 1. $NB_ORA_CINC is 1
In reply to Re: Why is my loop dropping alphabetic strings?
by toolic
in thread Why is my loop dropping alphabetic strings?
by DiabeticJim
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |