Hi,
The problem concerns opening and reading a text file line by line (about 500 lines). I need to do the same thing across several scripts and created a package. The problem is that it doesn't print all the lines - it stops about three quarters way through. If I put the routine into the script it reads and prints the whole file no problem (indicating that the problem is not the data!)
Can anyone explain what is wrong and how to put it right? Thanks
package wslib; use strict; our @EXPORT = qw( workspace ); #place all the variables you want to ex +port by default in here (c.f. @EXPORT_OK) use Exporter; our @ISA = qw(Exporter); my $data_reg ='/root_to_file'; sub workspace { open PAGE, "$data_reg" or die "Cant open $data_reg: $!"; while (my $line = <PAGE>) { print "$line<br>"; } close PAGE; } 1;
In reply to data leak using package by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |