# @_ is a list of variable name # if @_ contains "i" and "j" and $i == 42 $j eq "freeBSD", # the function should print : # i : 42 # j : freeBSD sub display_init { my @variables = @_; my $value; foreach (@variables) { eval("\$value=\$$_"); if (! defined($value) ) { $value = "undefined"; } print "$_ : $value\n"; } }
In reply to issues with eval (get a variable's value) by squale
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |