in reply to unquoted string error??!!
It tells you that you can capitalize it; ERASE will avoid the warning messages. Underscores work too. Quoting could also work, but you'd have to use curly braces in your print:Unquoted string "erase" may clash with future reserved word at (#1) (W reserved) You used a bareword that might someday be claimed as +a reserved word. It's best to put such a word in quotes, or capital +ize it somehow, or insert an underbar into it. You might also declare it + as a subroutine.
print {"erase"} "LOL";
However, a more modern coding style uses lexical filehandles, the 3-arg form of open and autodie to check success:
use warnings; use strict; use autodie; open my $fh, '>', 'lol.txt'; print $fh 'LOL'; close $fh;
|
|---|