in my autohandler I have this filter block to convert English to  
Spanish:

<%filter>
if ($session{langauge} eq "espagnol" ){

# Convert from characters to bytes if necessary.
$_ = encode_utf8( $_ ) if is_utf8( $_ );
$r->set_content_length( length $_ );
if (1) {
        my $uri = $r->uri;
        foreach my $key (keys %{$en2es{$uri}}) {
                
s{(<(?:div|span|td|a|li|p|h1|h2|h3|h4|br|b|th|caption)[^>>]*[>>] 
[^<<]*)$key([^<]*[<</]{1,2}(?:div|span|td|a|li|p|h1|h2|h3|h4|br|b|th| 
caption))} {$1$en2es{$uri}->{$key}$2}gis;
                }
        foreach my $key (keys %{$en2es{all}}) {
                
s{(<(?:div|span|td|a|li|p|h1|h2|h3|h4|br|b|th|caption)[^>>]*[>>] 
[^<<]*)$key([^<]*[<</]{1,2}(?:div|span|td|a|li|p|h1|h2|h3|h4|br|b|th| 
caption))} {$1$en2es{all}->{$key}$2}gis;

                }       
        }
  }

</%filter>

if $session{langauge} eq "espagnol" it doesn't filter.  If I switch  
it to if (1) it works.  %session is globally defined in httpd.conf.   
What's the problem?  Can I not access $session{langauge} from a  
filter block?

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to