Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Purdy (2383)

Purdy
  jasonNO@SPAMpurdy.info
http://purdy.info/
AOL IM: EmeraldWarp (Add Buddy, Send Message)
Yahoo! ID: jpurdy2 (Add User, Send Message)

Bleh - not feeling creative right now. You can check me out on PerlMonks [perlmonks.org].

Journal of Purdy (2383)

Thursday February 14, 2002
11:50 AM

Scary Stuff...

[ #2866 ]
When I see this in an adopted script, I get very scared:

read(STDIN,$temp,$ENV{'CONTENT_LENGTH'});
@pairs=split(/&/,$temp);
foreach $item(@pairs)
{
($key,$content)=split(/=/,$item,2);
$content=~tr/+/ /;
$content =~ s///g;
$content=~s/%(..)/pack("c",hex($1))/ge;
$fields{$key}=$content;
}

$ENV{'QUERY_STRING'}=~s/%(..)/pack("c",hex($1))/ge;
@REFID=split(/-=-/,$ENV{'QUERY_STRING'});

Must ... convert ... to ... CGI.pm

Jason

PS: I saw that new <CITE> tag and got excited, thinking it was like a PRE tag, but no - it just italicizes everything. The CODE tag is merely a TT tag - I still gotta add those <BR>'s in there ... com'on ... let's get PRE in here! Please?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • pudge (and presumably others) don't want <pre> in here because it would allow people to fuxor the layout (by entering very long lines). When I get five minutes of contiguous tuits, I'll prolly put a small pre2slash script that'll throw in the <br/> (err, <br>, XHTML doesn't work here), the &nbsp;, and try to take into account limitations in numbers of contiguous chars. No big deal, I just need those five minutes :)

    --

    -- Robin Berjon [berjon.com]

    • I'd really like to come up with a better solution to the problem, but I've not yet envisioned one, or had one described to me. Maybe I'll dream on it some night. Of course, my luck, I'll forget it as soon as I wake up.
      • I haven't looked at the Everything engine code, but they have something that apparently can deal with proper formatting of code based on a given number of columns (it wraps beyond that width, and adds a small symbol at the end to indicate wrapping).

        I'm not sure that this would solve the problem completely, but it could help.

        --

        -- Robin Berjon [berjon.com]

        • I don't like how they do it. I don't like the wrapping thing, I think it's hard to read and clumsy. I'm not saying they're wrong, I'd just prefer something else.
          • C'mon Pudge, I know you're capable of saying it's wrong. :) I think the filters in both Slash and Everything originally came from Dave DeMaagd a long, long time ago.

            I'd like to revise the HTML parsing code anyway, but haven't finished writing tests.

          • There'd be a user setting for the width surely? Thus you could set that to either 'off' or some ridiculously large value and have it disabled.

            Others could have it as they like it.
            --
              ---ict / Spoon
            • No. I don't like it, I won't work to implement it.
              • What about if I submit a patch? (in the universe where I have spare time not spent arsing with journals =) )
                --
                  ---ict / Spoon
                • No ... you misunderstand. I don't like how it works. I don't want Slash to do it that way. There is another solution out there somewhere, and when I get some time, maybe I, or someone else, will think of it.
                  • Run code through a formatter set to a user-defined width? Not necessarily good.

                    Hmm.
                    --
                      ---ict / Spoon