<commit_before># Copyright (C) 2006, The Perl Foundation.
# $Id$

.namespace ['CGI'; 'QueryHash']

=head1 NAME

['CGI' ; 'QueryHash'] - A helper for classic CGI 

=head1 SYNOPSIS

    load_bytecode 'CGI/QueryHash.pbc'

    parse_get_sub = get_global [ 'CGI'; 'QueryHash' ], 'parse_get'
    .local pmc    params_from_get
    params_from_get = parse_get_sub()

    parse_post_sub = get_global [ 'CGI'; 'QueryHash' ], 'parse_post'
    .local pmc    params_from_post
    params_from_post = parse_post_sub()

=head1 Functions

=over

=item parse_get

Get parameters for GET method.

=cut


.sub 'parse_get' 

    .local pmc my_env, query_hash
    .local string query

    my_env          = new .Env
    query           = my_env['QUERY_STRING']
    query_hash      = parse( query )

    .return (query_hash)
.end

=item parse_post

Get parameters for POST method.

=cut


.sub 'parse_post' 

    .local pmc my_env, in, query_hash
    .local string content_length, query
    .local int len

    my_env          = new .Env
    content_length  = my_env['CONTENT_LENGTH']
    len             = content_length
    in              = getstdin
    query           = read in, len
    query_hash = parse( query )
    close in

    .return (query_hash)
.end
<commit_msg>[CGI;QueryHash] Check for existence on $ENV{QUERY_STRING} and $ENV{CONTENT_LENGTH}<commit_after># Copyright (C) 2006, The Perl Foundation.
# $Id$

.namespace ['CGI'; 'QueryHash']

=head1 NAME

['CGI' ; 'QueryHash'] - A helper for classic CGI 

=head1 SYNOPSIS

    load_bytecode 'CGI/QueryHash.pbc'

    parse_get_sub = get_global [ 'CGI'; 'QueryHash' ], 'parse_get'
    .local pmc    params_from_get
    params_from_get = parse_get_sub()

    parse_post_sub = get_global [ 'CGI'; 'QueryHash' ], 'parse_post'
    .local pmc    params_from_post
    params_from_post = parse_post_sub()

=head1 Functions

=over

=item parse_get

Get parameters for GET method.

=cut


.sub 'parse_get' 

    .local pmc my_env, query_hash
    .local int does_exist

    query_hash      = new .Hash
    my_env          = new .Env
    does_exist = exists my_env['QUERY_STRING']
    unless does_exist goto end_parse_get
        .local string query
        query           = my_env['QUERY_STRING']
        query_hash      = parse( query )

end_parse_get:
    .return (query_hash)
.end

=item parse_post

Get parameters for POST method.

=cut


.sub 'parse_post' 

    .local pmc my_env, query_hash
    .local int does_exist

    query_hash   = new .Hash
    my_env       = new .Env
    does_exist   = exists my_env['CONTENT_LENGTH']
    unless does_exist goto end_parse_post
        .local pmc in
        .local string content_length, query
        .local int len
        content_length  = my_env['CONTENT_LENGTH']
        len             = content_length
        in              = getstdin
        query           = read in, len
        close in
        query_hash = parse( query )

end_parse_post:
    .return (query_hash)
.end

{'fraction_non_alphanumeric': 0.08888137884420412, 'fraction_numerical': 0.004731328151402501, 'mean_word_length': 2.4458672875436553, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '513660', 'n_tokens_mistral': 1044, 'n_tokens_neox': 999, 'n_words': 273}