My current directory is the same directory that my perl script lives in. I am running as administrator and as far as I can tell the directory allows Full Control to admins.
How can I confirm your suspicion?
| [reply] |
What is the full path? WinDoze got picky about writing to "\Program Files\whatever...." some time ago. Running as Admin doesn't always override that.
Writing to C:\Public, on the other hand, is unlikely to give you problems, but whatever the issue may be, you'll be well served to create a new directory, on another (local) drive if that's available in which to put your new work. Commingling your Perl install with homework, experiments, learning-challenges and other scripts will be a hassle a few weeks or months from now.
Just BTW, as this has already been partially addressed by way of correction, but I don't know how the open shown in your OP could work, period, given the missing close-quote, comma operator, space, open-quote sequence. Of course, sometimes I miss the memo... and I did not test your version because I expected a syntax error.
Update: Please don't read the preceding paragraph. Pretty Please? See Rev. Canon AnomalousMonk's reply below. Watch ww flush with embarrasment! Mea Culpa.
| [reply] [d/l] |
open FILE,"> hello.txt" or die $!;
... I don't know how the open shown in your OP could work, period, given the missing close-quote, comma operator, space, open-quote sequence.
That's the old, disparaged, denigrated, frowned-upon, but not deprecated two-argument form of open. The file-access specifier is fused with the file name in a single string. IIRC, the space between the '>' write-access specifier and the file name is just the sort of gateway (among others) to a potential pitfall that the three-argument open was designed to avoid. Yes, it works.
Give a man a fish: <%-{-{-{-<
| [reply] [d/l] [select] |
Thanks for the advice. I am indeed going to just move my stuff to a different directory that seems to work.
As for the code in the OP, it actually does work. One of the good (and bad) things about Perl is that it is so forgiving of lazy coding. Consider me properly admonished!
| [reply] |
| [reply] [d/l] |
| [reply] |