>>>>> "Kimberly" == Kimberly Long <siberia@usis.com> writes:
Kimberly> I've finally figured out what caused domo to crash while I was
Kimberly> gone. It seems my admin upgraded to Perl 5 without me knowing.
Kimberly> Now, how to fix it is the problem. The faq says:
Kimberly> Majordomo is written in Perl (at least 4.035, preferably
Kimberly> 4.036). It is also known to work under Perl 5, if you edit
Kimberly> majordomo and resend and look for instances of the "@" character
Kimberly> inside text strings "@" Change the "@" to "\@". This only
Kimberly> happened with recent versions of Perl 5. The same fix is also
Kimberly> required if you want to run Majordomo under OSF/1 on the DEC AXP
Kimberly> systems with Perl 4 or 5. [from Jim Reisert]
Kimberly> I'm not really clear on this explanation. Do I change every
Kimberly> single "@" to "\@"?
Only those that appear within quotations. "@" introduces an array
reference in perl. Pre-5.0 versions of perl ignored the special meaning of
"@" when the "@" character appeared *within* a text string, such as this:
print STDERR, "Can't send to $user@$host.\n";
Perl 5 will interpret that "@" sign as an array interpolation. For
example, run the following script through perl 4:
$user = "bmc";
$host = "telebase.com";
print STDERR, "Can't send to $user@$host.\n";
You should see the message "Can't send to bmc@telebase.com." Run it
through perl 5, however, and the message becomes: "Can't send to bmc.".
Perl 5 has interpreted the "@" differently. It looks at the "@$host" part
and says, "Okay, first substitute '$host'. That gets us '@telebase.com'
Now, interpolate the values of perl array '@telebase.com'. Oops! That
array doesn't exist, so we'll have to substitute the empty string."
You can verify this behavior by doing the following:
$var1 = "variable 1";
$var2 = "array";
@array = ("element-1", "element-2");
print "$var1 @$var2\n";
If you run that script through perl 4, you should see the output:
variable 1 @array
Again, that's because the "@" inside the quotes is treated as a literal in
perl 4. If you run that same script through perl 5, you should see the
output:
variable 1 element-1 element-2
To get a literal "@" to appear in perl 4, escape its meaning with a
preceding backslash. That solution should fix things for perl 5 without
screwing up the script for perl 4.
Sorry for the long explanation, and for boring the perl experts ...
----
Brian M. Clapper, bmc@telebase.com
The end move in politics is always to pick up a gun.
-- Buckminster Fuller
References:
|
|