For extra added fun, and laziness, add the Win32::Guitest Module into the mixture. That way you can use SendKeys() to send a copy and or paste, and only have to push your double bucky.
For this to work properly, you need to either add an extension for windowless perl scripts (i.e. using wperl) or change the batch file to call on wperl.
I have noticed a few things in Win32::Clipboard and Win32::GUITest that can bite you if you're not careful, first, it doesn't get the magic line-break translation that files and other IO operations do, so your linebreaks (mine were at least) will likely be \r\n instead of just \n. It may or may not matter according to where you are putting the output (my Email client doesn't much like just one or the other). Also apparenly, chomp only cut's off the \n, so you've gotta watch for that. And in ::GUITest, with the Sendkeys() you have to use lowercase for ctrl+c and ctrl+v, else you may end up not getting the effect you expected.
And now, a sample piece of code for making ordered lists, nice and easy, it's even set up so you can run it over pieces of text that have already been tagged, so you can make nested lists.
use Win32::GuiTest qw(SendKeys);
my $CLIP = Win32::Clipboard();
my $alter = $CLIP->Get();
my @alter = split /\r\n/, $alter;
$_ = "<li> $_ </li>" if !/<li>/;
$_ .= "\r\n";
$alter = join("",@alter);
$alter = "<ol>\r\n".$alter."</ol>";
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.