I am very new to perl and I need to do the following:
from a module name.pm file, find a text file, open it, find the string 0xF110000C00 and then on the next line after that I have to parse the string:
0x0402000000000100020003000400060007000800100000000000000000000000000000000000000
0000000000000
This would be version 04.02.00 and then continue to 0001 says slot 1, 0002 says slot 2, and so forth.
Create a subroutine and in the perl module fru.pm that will
Find the record in discovered information
a.
Parse the string into bytes
b.
Decode it into a HASH structure
c.
{version}
{current} {major}
{current} {minor}
{current} {maintenance}
{current}{patch}
{current}{aux1}
{current}{aux2}
{backup} {major}
{backup} {minor}
{backup} {maintenance}
{backup}{patch}
{backup}{aux1}
{backup}{aux2}
{fruid}
Return the hash
d.
If optional param is true, print a nice table of this output
e.
Usage: $sys->{'1_2'}{slot}
7->getFUMIStatusRecord()
This is not for a class. This is for my knowledge only.
Any help would be appreciated. I am using linux.
Thanks,
Craig
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.