Just another Perl shrine | |
PerlMonks |
Re: perl handle and common variableby Rahul6990 (Beadle) |
on Apr 08, 2013 at 06:10 UTC ( [id://1027435]=note: print w/replies, xml ) | Need Help?? |
File handle is required to perform read and write operation on the underlying file. For accessing the file content you have to go through the file handle.
Example:
$file = '/etc/passwd'; # Name the file
open(INFO, $file); # Open the file
@lines = <INFO>; # Read it into an array
close(INFO); # Close the file
print @lines; # Print the array
In Section
Seekers of Perl Wisdom
|
|