This is a terribly dirty thing to do, combining symbolic references and global variables, but I'm lowdown enough to show you how:
{ my $name = 'a'; sub separate_data { @{$name++} = split / /, $_[0]; } }
You'll need to do that under no strict qw(vars refs); . Can you think of a better design for what you're doing? Hint: hash.
After Compline,
Zaxo
In reply to Re: incrementing array name
by Zaxo
in thread incrementing array name
by Lhamo_rin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |