Re: I don't know where to start with this one.



Kenton Brede wrote:

This is getting very close to what I'm trying to do, see below. There
is just one point I'm stuck on, how to grab the username portion of
the email address into a variable. I'm able to get the username of
the official email address @mail.nowhere.com, but I can't seem to
figure out how to grab each username of the aliases @nowhere.com.
What I've written below seems to grab a "slice" or something and isn't
a true array value. What I would like is to grab j_johnson and
jim_johnson from j_johnson@xxxxxxxxxxx and jim_johnson@xxxxxxxxxxxx
So I could use each username as a variable for a different portion of
the email.

[ snip ]

for my $email ( keys %emails ) {
@names = @{$emails{$email}};

print "These are your mismatched email names: ";

for my $line ( @names ) {
my @n = ($line =~ /(.*)@/);
my @netid = split(/@/, $email);
print "$n[0], $netid[0]";
}

local $" = ', ';
my $message = <<TEXT;

These are your email aliases: @{$emails{$email}}
This is your official email address: $email

TEXT

print $message;
}

for my $email ( keys %emails ) {
local $" = ', ';
my @names = map /(.+)\@.*nowhere\.com\z/, $email, @{ $emails{ $email } };
print <<TEXT;
These are your mismatched email names: @names
These are your email aliases: @{$emails{$email}}
This is your official email address: $email

TEXT
}




John
--
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order. -- Larry Wall
.



Relevant Pages

  • Re: Normalize table
    ... john wrote: ... (Username, ApplicationName) ... DBEngine.Execute strSQL, dbFailOnError ... and you can grab the Application Name by getting the ...
    (comp.databases.ms-access)
  • Re: I dont know where to start with this one.
    ... > I've got a mail alias file, space delimited and sorted on the second ... The second thing I need to do is grab all ... is just one point I'm stuck on, how to grab the username portion of ... I'm able to get the username of ...
    (perl.beginners)
  • Re: HttpContext.Current.User.Identity.Name & ServerVariable("LOGON_USE
    ... Dominick Baier - DevelopMentor ... > System.Web.HttpContext.Current.User.Identity.Name to grab the ... > SCENARIO: ... > USERNAME than what was logged into the machine with. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: VBSCRIPT to get USERNAME / LOGIN
    ... I am new to VBSCRIPT and can't find a way to get the username of the ... This may help you out since you say this is on your Intranet. ... Set WSHShell = CreateObject ... 'Grab the computer name for use in add-on code later ...
    (microsoft.public.scripting.vbscript)
  • Re: problem when calling a stored procedure from ms sql 2000 with java
    ... public boolean login_procedure(String Username, String Password) { ... When I try to grab the value from the UserName column ...
    (comp.lang.java.databases)