in reply to Sending variables to a log file

Sounds to me like you are describing the wrong symptom. Perhaps the first time you tested your problem, $msg was never defined. Then you tried your work around and this time $msg was set. Otherwise $_ would also be undefined. Think about it, given this expression:
$_ = $msg;
how can $_ not be undefined (or contain the empty string) if $msg is undefined (or contains the empty string)? Change it to the latter snippet, i'll bet that you get the same results as the former (given that you really are setting $msg before hand).

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: (jeffa) Re: Sending variables to a log file
by sulfericacid (Deacon) on Jun 23, 2003 at 01:36 UTC
    That's what I was thinking but $msg was defined.
    $_ = $msg; print LOG "$msg :: $ENV{REMOTE_ADDR}\n"; print "\$msg is $msg"; close (LOG);
    The test print of $msg did print out whatever I expected to be in there, it just never showed up in logs. That's why I posted this, it's too confusing because what should have worked didn't and now it does work and there's no reason for it to be any different. ahhh, time for some Mountain Dew I think :)

    "Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

    sulfericacid