http://qs321.pair.com?node_id=496270


in reply to Text manipulation with perl

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