Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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


In reply to How best to return data from a package ??? by lcanty

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-25 05:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found