Unable to write files.
Everything seems to go well, but nothing is created. Am I using the right syntax?
open(LAL, ">lalal.txt");
print LAL "$lalal\n";
close(LAL);
Everything seems to go well, but nothing is created. Am I using the right syntax?
open(LAL, ">lalal.txt");
print LAL "$lalal\n";
close(LAL);
anti posted this at 08:19 — 18th May 2000.
They have: 453 posts
Joined: Jan 1999
Always check if your open worked:
Vorm posted this at 17:17 — 18th May 2000.
They have: 62 posts
Joined: May 2000
Errr, I copied your code anti and got a 500.
Rob Pengelly posted this at 19:06 — 18th May 2000.
They have: 850 posts
Joined: Jul 1999
Is the file CHMOD correctly? You will need to chmod it to 755 or 777, so that the script has access to write to a file.
------------------
click here to help save lives
http://www.wiredstart.com : The Technology Start Page
http://www.thehungersite.com - http://www.therainforestsite.com
http://www.ratemymullet.com - Beauty is only mullet deep.
Orpheus posted this at 20:42 — 18th May 2000.
They have: 568 posts
Joined: Nov 1999
"Everything seems to go well, but nothing is created. Am I using the right syntax?"
So your trying to create a file?
try
open(file,"> file.txt");
print file "lala\n";
close(file);
If you want it to create the file then you need to chmod the directory 777, if you want the program to update the file you need to chmod the file its self 777.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.