#!/usr/bin/perl -w ####################################################### # class2_08_list2 # # playing with assigment into lists of variables # (and the support for simple swapping that this gives!) # # modified by Sharon Tuttle from "Learning Perl", # by Schartz and Phoenix # # last modified: 4-10-03 ####################################################### print "give beginning of range: "; chomp($left_val = ); print "give ending of range: "; chomp($right_val = ); # swap range ends if user got 'em backwards! if ($left_val > $right_val) { ($right_val, $left_val) = ($left_val, $right_val); } @myArr = ($left_val..$right_val); $ct = 0; while ($ct <= $#myArr) { print "\$myArr[$ct]: $myArr[$ct]\n"; $ct++; } # end of class2_08_list2