
KevinR
Veteran

Dec 8, 2003, 9:20 PM
Views: 3436
|
|
Re: [john8320] pattern matching
|
|
|
if you prefer just using a regexp:
#!/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)
|