patgas has asked for the wisdom of the Perl Monks concerning the following question:
-- More than perfect! Let us engage the Concord!#!/usr/bin/perl -w use strict; my %names; while ( <> ) { s/\s+/ /ig; /<a href="(.*)">(.*)<\/a><br>/; # /<a href="(mailto:)??(.*)">(.*)<\/a><br>/; $names{"$2($1)"} = $1; } open OUT, ">sortboater.txt" or die "Cannot open file: $!"; for ( sort keys %names ) { /^(.*)\(.*\)$/; print OUT qq(<a href="mailto:$names{$_}">$1</a><br />\n); } close OUT or die "Cannot close file: $!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problems with regex grouping
by abstracts (Hermit) on Aug 17, 2001 at 21:45 UTC | |
by damian1301 (Curate) on Aug 17, 2001 at 21:59 UTC | |
|
(dkubb) Re: (1) Problems with regex grouping
by dkubb (Deacon) on Aug 17, 2001 at 23:29 UTC |