Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Parse multipart/form-data with MIME::Parser

by jcb (Parson)
on Apr 23, 2021 at 23:03 UTC ( [id://11131674] : note . print w/replies, xml ) Need Help??


in reply to Re: Parse multipart/form-data with MIME::Parser
in thread Parse multipart/form-data with MIME::Parser

Is there some kind of memoization magic in there or will that only return the form once, since it reads <DATA> but does not save the array anywhere?

Replies are listed 'Best First'.
Re^3: Parse multipart/form-data with MIME::Parser
by choroba (Cardinal) on Apr 25, 2021 at 22:38 UTC
    You are right, it doesn't work when you try to reload a page. Sorry.

    Here's a fix:

    my @template = <DATA>; sub { my $req = 'Plack::Request'->new(shift); my %method = ( GET => sub { \@template }, ...

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]