Skip Menu |

This queue is for tickets about the HTML-Mason CPAN distribution.

Report information
The Basics
Id: 120766
Status: resolved
Priority: 0/
Queue: HTML-Mason

People
Owner: Nobody in particular
Requestors: gdo [...] leader.it
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: <%args> @Array </%args> wrong using recente perl release
Date: Mon, 27 Mar 2017 08:53:45 +0200 (CEST)
To: bug-HTML-Mason [...] rt.cpan.org
From: Guido Brugnara <gdo [...] leader.it>
Using Perl 5.22 on Ubuntu 16.04+Apache2.4+mod_perl when I call this test page: http://myserver/test_bug_array_params.html?Arr=uno&Arr=due&Arr=tre it respond: @Array = [ 'ARRAY(0x7fadc00093e0)' ] %ARGS = { 'Arr' => 'ARRAY(0x7fadc00093e0)' } Using Perl 5.14 on Ubuntu 12.04+Apache2.2+mod_perl the correct result is this: @Array = [ 'uno', 'due', 'tre' ] %ARGS = { 'Arr' => [ 'uno', 'due', 'tre' ] } test_bug_array_params.html test file: --------------------------------------- <%flags> inherit => undef </%flags> <%args> @Arr </%args> <%once> use Data::Dumper; </%once> @Array = <% Dumper(\@Arr) %><br> %ARGS = <% Dumper(\%ARGS) %> --------------------------------------- bye gdo
Subject: Re: [rt.cpan.org #120766] AutoReply: <%args> @Array </%args> wrong using recente perl release
Date: Sun, 2 Apr 2017 11:32:27 +0200 (CEST)
To: bug-HTML-Mason <bug-HTML-Mason [...] rt.cpan.org>
From: Guido Brugnara <gdo [...] leader.it>
I have solved the problem! It is due to the use of a wrong plugin that I found many years ago at http://www.cybaea.net/Blogs/TechNotes/Mason-utf-8-clean.html (the link was deleted): # file .../lib/MasonX/Plugin/UTF8.pm package MasonX::Plugin::UTF8; use base qw(HTML::Mason::Plugin); use warnings; use strict; sub start_request_hook { my ( $self, $context ) = @_; my $args_ref = $context->args(); foreach my $arg ( @{$args_ref} ) { utf8::is_utf8($arg) || utf8::decode($arg); } return; } 1; The call "utf8::decode($arg)" replaces $arg Array rererence with "ARRAY(0x...)" string. Using old perl compiler this doesn't occur, but I think the strings in $arg arrays and hashes were not decoded! The wrong (incomplete using array and hash parameters) example is referenced at: https://sourceforge.net/p/mason/mailman/message/27614905/ but a better example that manages Arrays (but without Hashes) is reported here: http://www.mail-archive.com/mason-users@lists.sourceforge.net/msg03152.html In new Apache 2.4 environment the plugin is not necessary, I think; I have removed it and the old application now works correctly. bye gdo