in reply to Puzzling warning "Use of unitialized value" in very simple code

I'd look at $login and $quotedLogin. When perl encounters that warning at some point later in an elsif ladder, it'll report it as happening on the line where the if starts it all, even if it's much later.

Updated with an example:

my $def1 = 'true'; my $def2 = 'foo'; my $def3 = 'blue'; my $undef1; if ( $def1 =~ /X/ ) { # <-- problem reported here print 'not here'; } elsif ( $def2 =~ /Y/ ) { print 'not here either'; } elsif ( $undef1 =~ /$def3/ ) { # <-- problem exists here print 'oh noes'; } else { print "happiness ensues\n"; }

Replies are listed 'Best First'.
Re^2: Puzzling warning "Use of unitialized value" in very simple code
by massa (Hermit) on Aug 04, 2008 at 17:41 UTC
    <AOL>Me too!</AOL>
    I think kyle nailed it. Put:
    use Data::Dumper; print Dumper([$login,$quotedLogin,$password]);
    on line 22 and see the results...
    []s, HTH, Massa (κς,πμ,πλ)
Re^2: Puzzling warning "Use of unitialized value" in very simple code
by jlhsgcib (Novice) on Aug 05, 2008 at 09:06 UTC

    Dear kyle, moritz,

    The line number displayed for the warning was indeed misleading me. It actually occurs because of the undefined $email argument.

    By the way, Fletch remark was pertinent: the warning was related to the "eq" operator, not to the "m//" one.

    Thank you for your help.
    Best regards,
    -- Jeremie