> Perhaps you learnt to program with something like
> Apple Basic like I did <nostalgia mode>when I was
> 10 years old on the Apple IIe</nostalgia mode>
> which requires line numbers.

Or the BBC Micro, or the commodore 64, or the
Spectrum or the <Insert ancient computer here>.

> Perl doesn't need them.

But you can have them if you want them:

#!/usr/bin/perl -w
while (<DATA>) {
    if (/^(\d+) (.*)$/) {
        $code{$1} = $2 . ';';
    } else {
        next if /^\s*$/;
        warn "Error, invalid line:\n";
        die  "$_\n";
    }
}
$code .= $code{$_} foreach (sort keys %code);
eval $code;

__DATA__
10 print "Enter a word, then press return: "
20 $value = <>
30 print "You entered:" . $value

__END__

Jonthan Paton

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to