ramigi has asked for the wisdom of the Perl Monks concerning the following question:
For example, store some text in a variable, rework it with regular expressions and print it in the same HTML page.
#!/usr/local/bin/perl my $ligne; my $corpus = "file.txt"; #some text in a variable open (CORPUS,"<$corpus") or die "erreur de texte d'origine"; while($ligne=<CORPUS>){ $ligne=~s/^\s*//; #if line begins with one or sev. spaces, repla +ce by nothing if($ligne=~m/$\./){ #if line ends with a dot, print "$1\<br\>"; #add <br> } print "$ligne"; }
Thank you,
RG
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl inside HTML
by Corion (Patriarch) on Dec 16, 2005 at 09:46 UTC | |
|
Re: perl inside HTML
by reneeb (Chaplain) on Dec 16, 2005 at 10:37 UTC | |
by turo (Friar) on Dec 16, 2005 at 12:45 UTC | |
by samizdat (Vicar) on Dec 16, 2005 at 13:34 UTC | |
|
Re: perl inside HTML
by eweaver (Sexton) on Dec 16, 2005 at 19:37 UTC | |
by ramigi (Novice) on Dec 17, 2005 at 10:12 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |