When arguments are sent to Perl, they're in the @ARGV array. When you read from <>, Perl treats the elements in @ARGV as though they were actually filenames.
Perhaps you want to force a read from STDIN, or else remove the elements from @ARGV (locally, perhaps).
while (<STDIN>) { ... }
# or
{
local @ARGV;
while (<>) { ... }
}