It's theoretically possible, but "it's stupid to use a variable as a variable name".
Usually, a hash serves well in these situations:
use warnings; use strict; my $counter = 0; my %hash; while (<>) { $counter++; $hash{"bin_$counter"} = $_; # or whatever } use Data::Dumper; print Dumper(\%hash);
In reply to Re: Use an incrementing counter as a variable
by haukex
in thread Use an incrementing counter as a variable
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |