ellem has asked for the wisdom of the Perl Monks concerning the following question:
#! /usr/local/bin/perl use warnings ; use strict ; #LP3 ex3-1 #Reverse a string my $q = 0 ; until ($q) { print "Enter some stuff. Hit 'q' to quit: " ; my @input = <STDIN> ; if (@input eq 'q') { $q = 1 ; } else { my @rev = reverse @input ; print @rev ; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A quit key when no chomp
by Juerd (Abbot) on Mar 03, 2002 at 01:57 UTC | |
by ellem (Hermit) on Mar 03, 2002 at 07:45 UTC | |
by Juerd (Abbot) on Mar 03, 2002 at 10:21 UTC | |
|
Re: A quit key when no chomp
by erikharrison (Deacon) on Mar 03, 2002 at 06:38 UTC | |
by ellem (Hermit) on Mar 03, 2002 at 07:41 UTC | |
by erikharrison (Deacon) on Mar 03, 2002 at 07:46 UTC | |
by ellem (Hermit) on Mar 03, 2002 at 08:03 UTC |