in reply to Disable Interpolation while assigning a value to a variable

I believe the OP is asking about the split(), which needs to be coded my ( $u, $d ) = split /\@/, $email;

Replies are listed 'Best First'.
Re^2: Disable Interpolation while assigning a value to a variable
by pryrt (Abbot) on Jun 26, 2024 at 13:20 UTC
    That backslash is not required.

    #!perl use strict; use warnings; my $email = 'peter@gmail.com'; my ($u,$d) = split (/@/,$email); print "$email => $u,$d\n";

    outputs:

    peter@gmail.com => peter,gmail.com

    In other words, if $email properly contains the email address, the split command that the original poster showed works as they wanted it to -- without your unneeded backslash (though your backslash doesn't change the results, in this case). Hence, the earlier monks were properly digging into the actual contents of $email to try to debug the problem.