> Eugene van der Pijll <[EMAIL PROTECTED]> wrote: >> En op 05 mei 2002 sprak Tor Hildrum: >>> foreach (@names) { >>> print; >>> last if $_ =~/Dr /; >>> } >>> (untested as well) :) >> >> You do know that for and foreach are exact synonyms? > > And that $_ is the default variable for //, so the '$_ =~' can > be deleted? The straightforward golfish translation for your > program is something like > > print,/Dr /&&last for@names
27 strokes. for (@names){print;last if /Dr /;} 34 strokes. Not to bad :) Was over 50 strokes :) I foresee the future containing 'Perl Golf training sessions' such as this :) Tor