CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [john8320] pattern matching: Edit Log



KevinR
Veteran


Dec 8, 2003, 9:20 PM


Views: 4595
Re: [john8320] pattern matching

if you prefer just using a regexp:

Code
#!/perl/bin/perl.exe -w 
use strict;
my @final_array;
print qq~Content-type: text/html\n\n~;

while ( <DATA> ) {#assumes file is already open
chomp;
1 while $_ =~ s/,?([A-Z])[a-z]+/$1\./g;
push @final_array, $_;
}
print "$_<br>\n" for @final_array;

__DATA__
John
John,Jodie
John,Jodie,Susan
John,Jodie,Susan,Frank
John,Jodie,Susan,Frank,Mary

-------------------------------------------------


(This post was edited by KevinR on Dec 8, 2003, 9:23 PM)


Edit Log:
Post edited by KevinR (Veteran) on Dec 8, 2003, 9:23 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives