Anonymous user
File input/output: Difference between revisions
→[[Perl]]
Line 238:
==[[Perl]]==
'''Interpreter:''' [[Perl]] 5.8.8
#!/usr/bin/perl
open
open
# '>' overwrites file, '>>' appends to file, just like in the shell
while (
print
};
close $fh_in;
close $fh_out;
Perl has also a powerful mechanism in conjunction with opening files called IO disciplines. It allows you to automatically apply chainable transformations on the input and output. Mangling newlines, gzip (de)compression and character encoding are the most used examples.
==[[PHP]]==
|