INHF
February 6, 2012, 1:53pm
1
Hi Guy�s,
I have this simple PERL code which checks whether the file exists . At the moment I am getting the following error
This is the code I am using
#!/usr/bin/perl
Open (F, "home/work/PerlWork/dataFile") or die "Could not open the file:$!\";
Also how can I read the content of the file line by line?
Please help
Thank you all
You have edited this code in Microsoft Word, which has capitalized random things and filled it with smart quotes, ruining it. Try editing it in a UNIX text editor.
INHF
February 7, 2012, 2:05pm
3
Sorry about that, I have edit it in a UNIX text editor.
Can someone please help with this now?
Thank you all
SFNYC
February 7, 2012, 2:43pm
4
Well, make sure Open is not capitalized like Corona688 mentioned.
Then take away the '\'.
open (F, "home/work/PerlWork/dataFile") or die "Could not open the file:$!";
That should get rid of any syntax errors. Then run it and see what errors you receive and let us know.