use 5.010; @var = qw (a b c); $var2 = undef; $one = '$var'; $two = '$var2'; if (defined ${"${\substr $one, 1}"}) { say '$var exists'; } else { say '$var does not exist'; } __END__ $var does not exist
In reply to Re^5: Using a sting with a variable name
by JavaFan
in thread Using a sting with a variable name
by bingohighway
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |