In old version of perl (before 5.6) we could not use scalar variabsles as file
handles so we used uppercase letters such as XYZ or INPUT, QQRQ or FILEHANDLE.
Also the function had only 2 parameters.
Example 6-10. examples/files/open_file_old.pl
#!/usr/bin/perl use strict; use warnings; my $filename = "data.txt"; open(FH, $filename); my $line = <FH>; close FH; open(FH, ">$filename"); print FH "data"; close FH;
Security problems.
Being global, difficult to pass as parameter to functions.
| Prev | Home (Copyright Gabor Szabo) Perl Training Israel | Next |
| Analyze the Apache log file | Up | Exercise: Add more statistics |