Morning Monks,
Still kind of new to Perl and was hoping for some Perl wisdom from anyone out there... have just recently started trying to develop my own Package(have checked CPAN and couldnt find an existing one) that handles the Logical Volume Manager LVM for AIX.
My question is more on proper coding style more than anything but given a command...
lsvg -l rootvg
this returns the following data
LV NAME TYPE LPs PPs PVs LV STATE MOUNT
hd5 boot 1 2 2 closed/syncd N/A
hd6 paging 64 128 2 open/syncd N/A
pdumplv sysdump 64 64 1 open/syncd N/A
hd8 jfslog 1 2 2 open/syncd N/A
hd4 jfs 5 10 2 open/syncd /
hd2 jfs 122 244 2 open/syncd /usr
hd9var jfs 33 66 2 open/syncd /var
hd3 jfs 49 98 2 open/syncd /tmp
hd1 jfs 47 94 2 open/syncd /home
Given this data, what would be the best way to return the data from the package to a script that calls it?
Should the pacakage return a nested hash or six individual hashes which corresponds to each of the headings except for "LV NAME", which would be used as the index. Or perhaps use something like
Class::Struct ??? Though with
Class::Struct not being a standard package i was a little weary of using it
TIA
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.