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>"; }

See perlintro and perldata for more information.