UPDATED (twice)
I'd go with using a string compare of one type or another. ==
is a numeric compare and forces both sides of the comparison to numeric. Almost any string other than a pure number winds up being equal to 0.
while (my $line = <STDIN>) {
chomp $line;
# use the string comparison operator...
last if $line eq "0";
# or use a match operator...
# last if $line =~ m/^0$/;
# or match on some special number
# last if $line == 3.1415926;
push @stdin, $line;
}
I tested this in windows:
perl -e "while(my $line = <STDIN>){chomp $line;last if $line =~ m'^[.]$'}END{print @l}"
and unix:
perl -e 'while(my $line = <STDIN>){chomp $line;last if $line=~m/^[.]$/;push@l,$line}END{print@l,$/}'
OLD ANSWER
Ctrl + Z in Windows? The flag that is already built-in. On Unix you'd use Ctrl + D.