PERL code to check if file exists

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.

Sorry about that, I have edit it in a UNIX text editor.

Can someone please help with this now?

Thank you all

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.