in reply to weird files
#!/usr/bin/perl -w -00 use strict; open TABFILE, "tabfile" or die "Error message here: $!"; my @array = <TABFILE>; print scalar @array; # prints 6 for the above file
You can get the same effect from within a program by setting $/ = "":
#!/usr/bin/perl -w use strict; open TABFILE, "tabfile" or die "Error message here: $!"; { local $/ = ""; my @array = <TABFILE>; } print scalar @array;
See $/ in perlvar for an explanation of this.
--
John.
|
|---|