in reply to endless loop while .=

See explanation by almut - while() is testing true/false of the statement, not status of <IN>. Here is small mod to your code that avoids the problem.
#!/usr/bin/perl use warnings; use strict; my $content; open(IN, "<", $ARGV[0]) or die $!; while ( <IN> ) { print $content.= $_; }; close(IN) or die $!;