I have the following script:
open FILE, $filename || die $!;
while (<FILE>) {
#search for --from
if (/--from/) {
$from = $_;
$from =~ s/^--from\t//g;
$from =~ s/\t\\//g;
$from =~ s/@//g;
print $from; }
The original value of $from is "--from me@mydomain.com \"
The problem that I am having is the part where I read in $from =~ s/@//g;
I want to remove everything that comes after the @ in the string.
i.e.. I have me@mydomain.com and I just want $from to equal me and remove the @mydomain.com
Since this is my first time using Regular Expressions, I'm a little puzzled by what I need to do to get this to work, so, any help is greatly appreciated!