use strict; use warnings; print <<'JONAG'; Do you want to print the program's 1. default strings in reverse order 2. or enter your own to be reversed ? Choose option 1 or 2 or q to quit JONAG my $choice = ; chomp $choice; if ($choice eq 'q') { print "quitting\n"; exit; } # This is the default value. my @lines = qw( wrda vzc rregr zfgr bzfgzffg rergrge d fgsrg rwer ds vsgsrg ); if ($choice == 2) { print STDERR "enter your own strings\n"; chomp(@lines = ); } foreach my $line (reverse @lines) { print "\t$line\n"; }