in reply to Basic mod-perl question : why my variable is undefined ?

G'day pcouderc,

I was unable to replicate your results:

#!/usr/bin/env perl use strict; use warnings; my $lig; #... $lig=4; print STDERR "ligA <<$lig>>\n"; sub xxxx { #... print STDERR "ligX <<$lig>>\n"; } print STDERR "ligB <<$lig>>\n"; xxxx();

Outputs:

ligA <<4>> ligB <<4>> ligX <<4>>

[I'm running 5.18.1 on darwin-thread-multi-2level]

-- Ken

Replies are listed 'Best First'.
Re^2: Basic mod-perl question : why my variable is undefined ?
by pcouderc (Monk) on Jul 23, 2014 at 11:47 UTC
    Thank you. Did you try under mod-perl ?
    Anyway, my script is much more complex. And sometimes the result is ok. Other times it is not.