in reply to peeling the top 10 lines from a file

while( (<>) && counter <10){
Setting aside all the other matters already addressed by other posters, AFAIK while's magic with angular parentheses holds only for the
while(<>) { # ...
construct (or the equivalent one including an explicit filehandle).

Update: (to better explain myself) hence your script, even if corrected from the obvious error, would give you a "Use of uninitialized value in print" warning.

Also, unless you chomp it shouldn't be necessary to include "\n" in your output string. Unless you really want double spacing. In any case I'd probably locally set $\ suitably instead.

Hence all in all I'd simply do:

while (<>) { print; last if $. == 10; }