Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Comment on

( #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":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (9)
    As of 2014-12-27 18:50 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (177 votes), past polls