in reply to Re: how to enable, disable strict
in thread how to enable, disable strict
Sorry again for the mistakes i made concerning where should i add my question , im new here and new for PERL in general. cheers,#!/usr/bin/perl -w use warnings; use strict; my $secret = int(1 + rand 100); while(1) { print "please enter a guess from 1 to 100: "; chomp(my $guess = <STDIN>); if ($guess =~ /quit|exit|^s*$/i) { print " sorry you gave up.the number was $secret.\n"; last; } elsif ($guess < $secret) { no strict; print "you failed ,try higher\n"; } elsif ($guess > $secret) { print "you failed , try lower\n"; } elsif ($guess == $secret) { print "you got it\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: how to enable, disable strict
by GrandFather (Saint) on Apr 25, 2007 at 10:37 UTC | |
by elsiddik (Scribe) on Apr 25, 2007 at 10:58 UTC |