mrxg4 has asked for the wisdom of the Perl Monks concerning the following question:
Hello Perl Monks,
I have been briefly been working with Perl and have mainly been using it to automate my daily tasks. Now, I'm writting a script that reads from a file, and analyses the first character of every line to format it.
For instance, if there is a line that reads "R Whatever", it becomes <li>Whatever</li>. That's all easy and has been written already.
The problem actually lies with another type of format. Example:
K Perl
K Monks
K Is
K Cool
Here, I need it to be outputted as:
<p>%Perl,%Monks,%Is,%Cool</p>
Since I'm reading every line individually I'm having a hard time formatting it this way, and especially knowing when to put the ending </p> tag.
Any help is greatly appreciated. Thanks for taking your time to read this :)
Marcos
I have been briefly been working with Perl and have mainly been using it to automate my daily tasks. Now, I'm writting a script that reads from a file, and analyses the first character of every line to format it.
For instance, if there is a line that reads "R Whatever", it becomes <li>Whatever</li>. That's all easy and has been written already.
The problem actually lies with another type of format. Example:
K Perl
K Monks
K Is
K Cool
Here, I need it to be outputted as:
<p>%Perl,%Monks,%Is,%Cool</p>
Since I'm reading every line individually I'm having a hard time formatting it this way, and especially knowing when to put the ending </p> tag.
Any help is greatly appreciated. Thanks for taking your time to read this :)
Marcos
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Formatting
by atcroft (Abbot) on Jul 10, 2004 at 03:28 UTC | |
Re: Formatting
by wfsp (Abbot) on Jul 10, 2004 at 11:45 UTC | |
by mrxg4 (Initiate) on Jul 10, 2004 at 13:13 UTC | |
by wfsp (Abbot) on Jul 10, 2004 at 14:15 UTC | |
by mrxg4 (Initiate) on Jul 11, 2004 at 21:56 UTC | |
by wfsp (Abbot) on Jul 12, 2004 at 07:38 UTC | |
| |
Re: Formatting
by murugu (Curate) on Jul 10, 2004 at 04:35 UTC |
Back to
Seekers of Perl Wisdom