in reply to "uhshifting" the diamond?

You could move the meat of the while loop to another place, like so:

sub some_function { # do stuff with $_ } my ($word1, $word2) = split /\s+/,<>; &some_function; # $_ is the first line &some_function while (<>); # $_ cycles through rest of file

...and if you dislike egregiously abusing $_, you can throw in explicit variables in some_function.