En op 08 juni 2002 sprak Dave Hoover:
> Eugene wrote:
> > That is one option. Alternatively, you could perhaps use <INPUT
> > TYPE="file"> to upload files.
> 
> This has been suggested before and I remember resisting it.  I realize now,
> though, that my resistance was based on a false assumption that it would
> require PGAS to store all of these solutions as files.  I think this could
> work...does anyone see any downside to this approach?

Downside is that it's more work for the golfers if they don't use
special chars. So you should probably include both the TEXTAREA and the
upload as options on the submit page.

> > $script =~ s#(\cM\cJ)#'<BR>'#ge;
> > $script =~ s#([\0-\x1f])#'<FONT COLOR="red">^'.($1^"\x40").'</FONT>'#ge;
> 
> Could you describe what is going on here?  I feel stupid and contagious...

$script =~ s#\cM\cJ#<BR>#g; # Replace newlines by <BR> tags.
                            # Not really needed inside a <PRE>, but
                            # simplifies next expression
$script =~ s#([\0-\x1f])#'<FONT COLOR="red">^'.($1^"\x40").'</FONT>'#ge;
                            # Replace all other special chars with ^X.
                            # Display tese in red.

Note that you would also need to handle the characters above 127:

$script =~ s#([\x7f-\xff])#'<FONT COLOR="red">\x'.(sprintf '%x',ord$1).
                           '</FONT>'#ge;

(-ugene

-- 
It is when I struggle to be brief that I become obscure. -- |-|orace

Reply via email to