sub import_file
{
my $self = shift;
my $query = $self->query();
my upload = CGI::Uload->new($self);
my %file = ( name => $upload->file_name("upload"),
type => $upload->file_type("upload"),
handle => $upload->file_handle("upload"),
mime => $upload->mime_type("upload"),
);
####
Error executing run mode 'import_file': $VAR1 = {
'handle' => bless( \*IO::File::_GEN_0, 'IO::File' ),
'name' => 'test_file.txt',
'type' => 'txt',
'mime' => 'text/plain'
};
##
##
my @foo = ();
while($_ = $file{handle}->getline) { push @foo, $_; }
##
##
my @foo = ();
while($_ = \*{$file{handle}}->getline) { push @foo, $_; }
##
##
Error executing run mode 'import_file': Can't call method "getline" without a package or object reference
##
##
die "Weeee!!!!!" if($file{handle}->opened);
##
##
Error executing run mode 'import_file': Weeee!!!!!
##
##
my $buffer;
my @results;
my $fh = $upload->file_handle('upload');
while (read($fh, $buffer, 45)) {
push (@results, pack("u", $buffer));
}
$fh->close;