Problem related to File handling in Perl [message #233660] |
Fri, 27 April 2007 02:09 |
lokeshg82
Messages: 23 Registered: February 2007 Location: chennai
|
Junior Member |
|
|
Dear Experts,
i wanted to run sipmle file handing program in perl.
hope this is very basic doubt which i have,
pls see the example code below,
vi tax12.pl
open(FILEHANDLE, ">file.txt") or die "cannot open file for reading: $!";
print FILEHANDLE "I love goldfishes, they're so delicious!";
close(FILEHANDLE) or die "an error occured while trying to close the file: $!";
when i run the script,it was throwing below error
tax12: syntax error at line 1 : `(' unexpected
i verified the syntax through net,it was fine only..
pls do the needful,
thanks in advance..
|
|
|
|
|
|