in reply to unsure how to use variable
The proper way is to use an array:
my @colors = qw/ green blue yellow/; for my $color (reverse @colors) { print "$color<br>"; } [download]
See perlintro and perldata for more information.