CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [OpenSys] Upload with CURL FAIL: Edit Log



KevinR
Veteran


Apr 5, 2009, 10:18 AM


Views: 1606
Re: [OpenSys] Upload with CURL FAIL

I have never used the module or CURL either, but this sub needs to be changedL


Code
sub builduploadfile {  
my ($file)=@_;

my $fh = new FileHandle;
if ($fh->open("< $file")) {
undef $fh;
}

return $fh;

}


It looks like you need to return the contents of the file, so try this:


Code
sub builduploadfile {  
my ($file)=@_;
my $content;
my $fh = new FileHandle;
if ($fh->open("< $file")) {
$content = do {local $/; <$fh>};
undef $fh;
}
return $content;
}

-------------------------------------------------


(This post was edited by KevinR on Apr 5, 2009, 10:18 AM)


Edit Log:
Post edited by KevinR (Veteran) on Apr 5, 2009, 10:18 AM
Post edited by KevinR (Veteran) on Apr 5, 2009, 10:18 AM
Post edited by KevinR (Veteran) on Apr 5, 2009, 10:18 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives