fritsimeel has asked for the wisdom of the Perl Monks concerning the following question:
The result is: JT; qwerty@dh.nl,abcde@dh.nl I just need: qwerty@dh.nl,abcde@dh.nl The (part of) file is:#finding @dh.nl #!/usr/bin/perl -w my $file="logs1"; chomp $file; open (FILE, $file) || die "Can't open logs file: $!\n"; my @line =(<FILE>); chomp (@line); foreach (@line){ if (/(\D+)(@)(dh.nl)/) { $a=$1; $b=$2; $c=$3; } } print "$a"."$b"."$c"."\n"; close FILE;
What am I doing wrong? Please advice me. Thanks in advance. fritsimeel.193.10.168.23 - - [07/Jan/2013:00:07:48 +0000] "GET /UserFiles/File/Ra +dio%203rd%20Newsletter%20for%20web.pdf HTTP/1.0" 304 - "-" "gsa-crawl +er (Enterprise; M2-N7RQ5RABCA2JT; qwerty@dh.nl,abcde@dh.nl)"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using regular expressions showing just the hits.
by choroba (Cardinal) on Apr 05, 2013 at 14:52 UTC | |
by fritsimeel (Initiate) on Apr 05, 2013 at 15:13 UTC | |
by choroba (Cardinal) on Apr 05, 2013 at 15:18 UTC | |
by fritsimeel (Initiate) on Apr 05, 2013 at 15:33 UTC |