in reply to Advice on goto usage?
You want to avoid goto for this kind of thing - you are better off using a conditional looping construct:
update: removed the extraneous while#!/usr/bin/perl -w # + use strict; + my $value; + while ( not defined $value or $value eq 'R' ) { chomp($value = <STDIN>) + if ( $value eq 'E') { exit; } }
/J\
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Advice on goto usage?
by mrborisguy (Hermit) on May 05, 2005 at 14:11 UTC | |
by gellyfish (Monsignor) on May 05, 2005 at 14:17 UTC |