Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^6: Building data structures from CGI params

by fullermd (Priest)
on Aug 08, 2012 at 17:36 UTC ( #986330=note: print w/replies, xml ) Need Help??


in reply to Re^5: Building data structures from CGI params
in thread Building data structures from CGI params

That line is generated by the workaround

[...]

This is the bug, it forgot to split on \0, because Vars joins on \0

Oh, I see what you mean. Hm. I hate that NUL stuff...

I guess the best thing would be to add a config'able (probably on by default) splitting on them to the processing. I like that better than expecting a ->param, since that breaks it away from the contract of purely hash->hash.

I'll see if I can't get that into a new release in the next few weeks. Annoyingly busy... :|

Replies are listed 'Best First'.
Re^7: Building data structures from CGI params
by Anonymous Monk on Aug 09, 2012 at 08:30 UTC

    I like that better than expecting a ->param, since that breaks it away from the contract of purely hash->hash.

    Adding a branch breaks no contracts

    sub build_cgi_struct { my ($iv, $errs, $conf) = @_; use Scalar::Util qw(blessed); my $blessed = blessed $iv; my $splitnull = 1; if( $blessed and UNIVERSAL::can( $iv, 'param') ){ $splitnull = 0; if( $iv->isa('CGI') ){ $iv = $iv->{"param"} ; # cheat :) } else { $iv = { map { $_ => [ $iv->param($_) ] } $iv->param }; } } ... ... if $splitnull;
Re^7: Building data structures from CGI params
by fullermd (Priest) on Oct 01, 2012 at 16:27 UTC

    I'll see if I can't get that into a new release in the next few weeks.

    Well, OK, it's still just a few weeks. FSVO "few" :)

    I've uploaded a new version that does nullsplits by default (as well as one or two other minor tweaks).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://986330]
help
Chatterbox?
[Lady_Aleena]: erix, right, it searches files for a pattern. pcregrep is supposed to do the same thing with the addition of being able to search multiline.
[erix]: ah, pcregrep is a stanalone program?
[Lady_Aleena]: erix, yes.
[Lady_Aleena]: pcre stands for 'Perl Compatible Regular Expressions'.
[erix]: ok, ok, I thought you meant the engine
[perldigious]: Tanktalus: Ha, understandable, that does make it harder when you don't want to move. I assume you are looking at remote work from home jobs too?
[Tanktalus]: yeah, I'm looking at a lot of remote work - I've been working from home since 2002, so I know how to do the work from remote, I just need a new employer ;)
[Lady_Aleena]: Discipulus, I wouldn't know how to get a script to do what the greps do in one line.
[perldigious]: Even working for a large software engineering contractor that's willing to do remote could be an option. The fortune 500 company at $job-- I worked for had quite a lot of that work to hire out to large contractors.
[perldigious]: The pay and benifits leave a lot to be desired though, or so I've heard...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (14)
As of 2017-05-23 19:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?