File IO (Input and Output)
File IO is used a lot and it is very easy to do thanks to same simple Perl commands.
Writing
When you open a file for writing you use w as the second argument for the FileHandle constructor.
#!/usr/bin/perl use FileHandle; $MyFile = new FileHandle "temp.txt","w"; for($A = 0; $A < 10; $A++) { print $MyFile "Line $A\n"; } $MyFile->close;
page revision: 1, last edited: 29 Apr 2009 18:39