http://qs321.pair.com?node_id=1218060


in reply to Re^3: Find the shortest word in the English Language with: a b c d e f
in thread Find the shortest word in the English Language with: a b c d e f

I'm not accustomed to needing to specify the argument within the code. It's not like it's a command-line flag. I count yours at 78.

while(<>){$a=a;$a++while/$a/i;push@{$_[y///c]},$_ if$a gt f}@_=map$_?@ +$_:(),@_

If you're to actually print out the shortest, make it 89. Still quite a bit shorter than mine.

while(<>){$a=a;$a++while/$a/i;push@{$_[y///c]},$_ if$a gt f}@_=map$_?@ +$_:(),@_;print$_[0]

Of course, looking closely only one of your loops needs to be of the 'while' variety. 87 (or 76 unconcerned about output).

for(<>){$a=a;$a++while/$a/i;push@{$_[y///c]},$_ if$a gt f}@_=map$_?@$_ +:(),@_;print$_[0]
for(<>){$a=a;$a++while/$a/i;push@{$_[y///c]},$_ if$a gt f}@_=map$_?@$_ +:(),@_