On 12-02-17 11:49 AM, lina wrote:
open my $fh, '<', $file or die "could not open $file: $!\n";
Here why use $!
?

$! is the OS error. If an OS error occurs, like an open error, it contains the related error message. See `perldoc perlvar` and search for /OS_ERROR/


--
Just my 0.00000002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

It's Mutual Aid, not fierce competition, that's the dominate
force of evolution.  Of course, anyone who has worked in
open source already knows this.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to