<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl

# YAGUARSER, a form parser, by Javier Viveros (javier@yagua.com)
# Yagua's Parser. I work as programmer in www.yagua.com :)
#
# USAGE:
#
# In your program call the routine like this:
# my %FORM = Yaguarser();
#
# You can include this one directly into your code or use a require 'yaguarser.pl'


sub Yaguarser {
        my (%RECIBIDO,@parejas,$clave,$valor,$buffer); 
     
        if ($ENV{'REQUEST_METHOD'} eq 'POST') {
                read(STDIN,$buffer,$ENV{'CONTENT_LENGTH'});
        } else {
                $buffer=$ENV{'QUERY_STRING'}
        }
        $buffer =~ s/\+/\%20/g;
        $buffer =~ s/%(..)/pack("C",hex($1))/ge;
 
        @parejas=split(/&amp;/,$buffer);

        for (@parejas) {
                ($clave,$valor)=split(/=/,$_);
                $RECIBIDO{$clave}=$valor;
        }
        return %RECIBIDO;
}
</pre></body></html>