I know, I told you what was wrong and what had to be fixed to get your code to overwrite itself with "hello!", which is what you seem to want to do for some reason.
open (FILEHANDLE, ">not.txt") or die (Cannot open not.txt"); print FILEHANDLE "hello!"; close (FILEHANDLE);
Should be:
open (FILEHANDLE, ">not.txt") or die ("Cannot open not.txt"); print FILEHANDLE "hello!"; close (FILEHANDLE);
Had you read any of the links I provided you'd be using something like:
use strict; use warnings; use diagnostics; open (FILEHANDLE, ">not.txt") or die ("Cannot open not.txt"); print FILEHANDLE "hello!"; close (FILEHANDLE);
In reply to Re^5: how to create a perl program using filehandle and streams ?
by marto
in thread how to create a perl program using filehandle and streams ?
by Monk_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |