Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

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

Thanks for your help. This looks really good. Unfortunately I only have perl 5.12 so this fails with these errors

Type of arg 1 to keys must be hash or array (not private variable) at +./test.pl line 25, near "$value ]" Type of arg 1 to keys must be hash or array (not private variable) at +./test.pl line 32, near "$found) " Type of arg 1 to values must be hash or array (not private variable) a +t ./test.pl line 34, near "$found)"

Also as regards %filer_device and %filer_volume sometimes in this data structure these are not hashes, sometimes both are, and sometimes one is and the other isn't I am really not too sure how to go about dealing with that :-( Also regarding the %defaults section I am not allowed to hardcode that. In the small sample of this data structure I have shown this is tied in to the tag "@dev". So any mountpoint defined under here gets those permissions. In the rest of the data structure I have other tags like @build and @software and under each one of these they have their own set of multiple mount point definitions and their own set of default permissions that need to be set. I ultimately need to print the strings out in the following format without hardcoding any key names in the subroutine I use to parse the data struture. All I can pass to the subroutine is the data structure and the @keylist:

@dev:/links:nydevnfs_links:/vol/links:0755:root:root:nfsvers=3,timeo=6 +00,re +trans=2 @dev:/links:rnap7750-s:/vol/links_c:0755:root:root:nfsvers=3,timeo=600 +,retr +ans=2 @dev:/home7:nydevnfs_home7:/vol/home7:0755:root:root:nfsvers=3,timeo=6 +00,re +trans=2 @dev:/home7:rnap7751-s:/vol/home7_c:0755:root:root:nfsvers=3,timeo=600 +,retr +ans=2 @dev:/home8:nydevnfs_home2:/vol/home2:0755:root:root:nfsvers=3,timeo=6 +00,re +trans=2 @dev:/home8:rnap2114-s:/vol/home2_c:0755:root:root:nfsvers=3,timeo=600 +,retr +ans=2

In reply to Re^2: Traversing a complex data structure searching for certain keys and printing their values by newperluser2013
in thread Traversing a complex data structure searching for certain keys and printing their values by newperluser2013

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 avoiding work at the Monastery: (3)
As of 2024-04-23 22:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found