Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How to get contents from an array inside a hash

by GrandFather (Saint)
on Dec 05, 2014 at 21:08 UTC ( [id://1109381]=note: print w/replies, xml ) Need Help??


in reply to How to get contents from an array inside a hash

Where is the sample layout file data?

Why one big blob of code instead of subs that can be tested individually?

Why oh why did you turn off warnings!

Perl is the programming world's equivalent of English
  • Comment on Re: How to get contents from an array inside a hash

Replies are listed 'Best First'.
Re^2: How to get contents from an array inside a hash
by gingera2z (Initiate) on Dec 05, 2014 at 21:18 UTC

    The sample layout file is at the top of the listing. I'll update and include some sample input data.

    I'm currently coding without subroutines because I'm still learning. I know the code could be more elegant, and definitely more efficient, but I can't start by banging my head against the keyboard and praying it works. :)

    Warnings is off because that's a shop standard for code that gets pushed to production. I simply hadn't included it when posting.

      "...banging my head against the keyboard and praying..."

      Stop praying and head banging; it doesn't help. Start to break it down into smaller pieces instead - at least four subs ;-)

      A sketch in a hurry:

      1. get_options() # use GetOpt::Long
      2. create_hash()
      3. update_chars()
      4. format_layout()

      ..or so.

      Update: I forgot to update, sorry.

      Consider also to put your stuff in a module.

      Please see perlmod, perlnewmod and Simple Module Tutorial how to accomplish this.

      And it is a good idea to study some sources on cpan.

      Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1109381]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-23 16:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found