main
December 2nd, 2024    

CIS 2.55
Main
Files
Syllabus
Overview
Links
Homeworks

UPLOAD HOMEWORKS

Notes
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
Bayes (src)

Tests
Sample Midterm
Sample Final

Misc
Arithmetics
Fourier Mult

Notes 0007

Input/Output

In Perl, the way input or output happens is largely determined by the way we open the input or output file handle. Thus, I refer you do the documentation for open function, and recommend that you read the perlopentut tutorial that is mentioned in the documentation.

You can read everything there is to know about open and sysopen here: http://perldoc.perl.org/perlopentut.html

Oh, a cooler way to load files:

sub loadFile {
   my ($name) = @_;
   open my $in,$name or die qq{$!: "$name"};
   local $/=undef;
   return <$in>;
}





































© 2006, Particle