my $page = "perl";
If i go back around 14 years, i can still remember the time i used to sit behind a commodore 64 for at least 6 hours to write a simple script on Quickbasic, i dont know if some of you still remember the INPUT, REM, and all the stars heh, back then i was really happy once i came home with Qbasic level/1/2 diploma in my hands.
Anyway - Perl made programming life easier , this corner's going to be about this amazing programming language, you will find plenty useful links and some <codes> i wrote myself.
This <code> here is one of my first <codes> with Perl -- is a teasing games keep asking you for a number until you get it right - its an easy <code> to write now , but back then took me 4 hours? well yea something like that.
<code>
#!/usr/bin/perl
use warnings;
use strict;
my $secret;
while (1) {
$secret = int(1 + rand 100) if ! defined $secret;
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;
}
if ($guess < $secret) {
print "You failed, try higher.\n";
} elsif ($guess > $secret) {
print "You failed, try lower.\n";
} elsif ($guess == $secret) {
print "You got it!\n";
$secret = undef;
}
}
< /code>