-
-
Save pradhuman7d1/85da91fe527906b610e44a132f72ef4a to your computer and use it in GitHub Desktop.
perl-File i/o
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q. What is the use of die keyword? | |
A. When the program fail to read or write a file then it will kill itself and print the error provided with die keyword. | |
Q. Perl is used mainly to deal with what files? | |
A. Perl stands for practical extraction and report language and as the name suggests it is most efficient in handling txt files. | |
Q. What operations are supported by the file handler of perl? | |
A. Open and read, open and append, open and write are the common operations supported by perl. | |
Q. What does <$fh> do? | |
A. It creates an array like structure and stores each line of text file at seperate indexes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q. What is the correct code that helps us to seek to the starting of a txt file? | |
a. seek @fh, 0, 0; | |
b. seek $fh, 0, 0; | |
c. seek @fh, 1, 1; | |
d. seek $fh, 1, 1; | |
A. b. seek $fh, 0, 0; | |
Q. What is the notation used for file read only? | |
a. < | |
b. > | |
c. >> | |
d. << | |
A. a. < | |
Q. What is append in file handling? | |
a. Used to edit a file | |
b. Used to remove text from a file | |
c. Used to add text to a file | |
d. Used to replace all text in a file | |
A. c. Used to add text to a file | |
Q. What does +< signifies? | |
a. Open a file to read | |
b. Open a file to edit | |
c. Append to a file | |
d. Delete a file's data | |
A. b. Open a file to edit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment