[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] Perl : escape-koder til chars



Peter Maersk-Moller <sslug@sslug> writes:

> Jeg køre et CGI-script i perl, der oversætter escape-koder
> fra en browser (http) til chars. Scriptet er vist forneden,
> men kan det ikke gøres mere elegant ? Og findes der et perl-modul,
> der kan gøre det ?

> sub correct_input {
>    local ($mystr) = @_;
>    $mystr =~ s/%0A//g;
...
>    $mystr =~ s/%40/@/g;
>    $mystr =~ s/%3A/:/g;
>    return $mystr;
> }

Noget i retning af:
$mystr =~ s/%([0-9A-F]{2})/chr(hex($1))/eg

.Henrik

-- 
>> Jo ja nej æh bøh!
>Helt enig.
Me too ... 
		-- vi lader personerne bag være anonyme


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-09-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *