Help for this page

Select Code to Download


  1. or download this
    $ perl -Mstrict -w -e'while(1){ chomp( my $i = <STDIN>); $i eq "yes" &
    +& print "yes" && last; $i eq "no" && print "no" && last }'
    
  2. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
        if( $i eq 'yes' ) { print "Yes entered for system.\n"; last }
        if( $i eq 'no' ) { print "No entered for system.\n"; last }
    }
    
  3. or download this
    my $response = qr/^(yes|no)$/;
    while( chomp( $_ = <STDIN> ) )
    {
        /$response/ and print "$1 entered for system.$/" and last
    }