Question re. Email.pm code change in RT 3.4.6

Between RT 3.4.5 and 3.4.6, the way Email.pm looks through the
MailPlugins list changed from using $_ to using a local variable:

From:
$_ = “RT::Interface::email::”.$_ unless $_ =~
/^RT::Interface::email::/;
eval “require $_;”;

To:
my $Class = $_;
$Class = “RT::Interface::email::” . $Class
unless $Class =~ /^RT::Interface::email::/;
$Class->require or
do { $RT::Logger->error(“Couldn’t load $Class: $@”); next };

Does anyone remember exactly why? I ask because we’re using the older
code and we’re seeing an intermittent problem in which $_ appears to
be set to “RT::Interface::email::” at the eval, causing the require
to fail, and users’ email to be returned with the 'Could not load
valid user" message. Was this the same reason the code change was
made? I checked the 3.4.6 Changelog but couldn’t see an entry that
told me the answer.

Thanks,
Steve

Stephen Turner
Senior Programmer/Analyst - SAIS
MIT Information Services and Technology (IS&T)

Between RT 3.4.5 and 3.4.6, the way Email.pm looks through the
MailPlugins list changed from using $_ to using a local variable:

From:
$_ = “RT::Interface::email::”.$_ unless $_ =~
/^RT::Interface::email::/;
eval “require $_;”;

To:
my $Class = $_;
$Class = “RT::Interface::email::” . $Class
unless $Class =~ /^RT::Interface::email::/;
$Class->require or
do { $RT::Logger->error(“Couldn’t load $Class: $@”);
next };

Does anyone remember exactly why?

  • Killing string eval
  • Dealing with weird issues where $_ isn’t set properly
  • Cleaning up the code.

at least, as i recall

At 7/14/2008 04:32 PM, Jesse Vincent wrote:

  • Dealing with weird issues where $_ isn’t set properly

Thanks - I’m sure this is the part that was biting us.

Steve