For what you're defining as your "need ...ATM," is there some problem with the solution offered in
Re: search and using first letter of words on a line? It works:
#!/usr/bin/perl
use strict;
use warnings;
# 927275
use 5.012;
my @title = ("Part II: Nietzsche's Project, An Overall Review", "Learn
+ing Perl, 5th Ed.", "Mastering Regular Expressions");
for my $title(@title) {
my $acronym = join '', ($title =~ /(?:^|\s+)(\w)/g);
say $acronym;
}
=head OUTPUT
PINPAOR
LP5E
MRE
=cut
Of course, your spec leaves a little to be desired: how will you distinguish among Parts I, II and III of your first title?
If your problem is in applying that answer to <a href="file:///foobar baz">Bazing with foo</a>, then you need to consider something on the order of HTML::Parser or another of the HTML::... modules.
If you have some other stumbling block in your way, pray detail it, but without teaching Grandmother how to cook eggs with sed.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.