1.

Write a Perl program to open a file.

Answer»

Here’s a code snippet to open a FILE using Perl program: 

open(DATA, "&LT;Filename.txt") or DIE "Unable to open the file Filename.txt, $! ";  while(<DATA&GT;) {     print "$_";  }  < or r: For read only Access  > or w: For creating, Writing, and Truncating files  >> or a: For writing, APPENDING, and creating files  +< or r+: For reading and writing files  +> or w+: For reading, writing, creating, and truncating files  +>> or a+: For reading, writing, appending, and creating files


Discussion

No Comment Found