Well, since you said you are new to perl, the following
gives you the benefit of the doubt, that you are at least
willing to make a good faith effort to teach yourself, and
not have the entire solution done for you by someone else.
This should give you a good head start. If you can dissect
this and add the missing pieces yourself, it shows you're
putting in some effort. If not, it smells like someone asking
for free homework.
### begin_: init perl
use strict;
use warnings;
use YAML;
### begin_: init vars
my $sYAML;
my $oData;
my $iM;
### begin_: main
$sYAML = join"",(<DATA>);
$oData = YAML::Load($sYAML."\n\n");
$iM = ((scalar(@{$oData}))-1<29)?scalar(@{$oData})-1:29;
print join "/\n",map{sprintf"'%s'",uc($_);}@{$oData}[0..$iM]
+;
### begin_: end perl
1;
__DATA__
- Some words here
- some other words on this line
- you get the idea
...
=oQDlNWYsBHI5JXZ2VGIulGIlJXYgQkUPxEIlhGdgY2bgMXZ5VGIlhGV
-
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>
<u> <ul>
-
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
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|