Getting closer... Thank you! Sorry if I'm not clear enough, there's a lot of strings I'm matching against, but what I want remains the same. I want the group and role names in the hash. For instance, I used a string like this:
$string = "Role: Role Name▼▼Profile: Unnecessary_Extra_Stuff";
but it returned:
This is the Role Name:Role Name▼▼Profile Name: Unnecessary_Extra_Stuff
FYI, here's my code snippet:
while ( ${$ref}{$k}{'DIRTYDATA'} =~ /(Group|Role)\:\s+([\x00-\x7f]*)/g
+ ){
${$ref}{$k}{$1} = $2;
}
print "\n\nThis is the Group Name: " . ${$ref}{$k}{Group};
print "\nThis is the Role Name: " . ${$ref}{$k}{Role};
I only want it to return Group or Role names, not Profile names and no extended ascii characters.
I did mention an array before, but it's storing fine in my HoH which I'm getting out of a fetchall hashref from DBI, so storage really isn't the problem, the problem is only matching role group names in these dirty little strings.
Thanks.
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.