Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: How to get the key - value names from a hash

by Scotmonk (Sexton)
on Nov 29, 2019 at 22:56 UTC ( [id://11109462]=note: print w/replies, xml ) Need Help??


in reply to Re: How to get the key - value names from a hash
in thread How to get the key - value names from a hash

First, thankyou for your response, I really do appreciate it

Regarding the mess of the code, I am not a programmer at all, I am a scientist of the neuro kind.

I am spending my spare time trying to learn Perl, but I am finding it very difficult.
There is no group near me in Glasgow, and the websites that I use to try to understand often quickly go over my head

Often when I do copy code, it throws up errors on my machine, which is really frustrating

I have found you guys very helpfull, in fact you are great
Going forward I will take all advice given, including providing code that is tidy
coincidentally, those indents are there only so I can read it better
I have the Lama book, and as it says in there, Perl is difficult for beginners because so much goes on in the back ground
for such little snippets of written code; thats very true

I just want to understand what is going on in the background so I have been copying bits of code
from various places and trying to work out step by step what is going on
Those other variables were there because I was copying code in chunks and attmepting to work through
I have a lot of numbers to record and compare and evaluate, so most of
what I have to learn is arithmetic; i don't need to know much about whaty Perl does with letters

You guys are patient with me, and I do appreciate that
  • Comment on Re^2: How to get the key - value names from a hash

Replies are listed 'Best First'.
Re^3: How to get the key - value names from a hash
by davido (Cardinal) on Nov 30, 2019 at 01:20 UTC

    coincidentally, those indents are there only so I can read it better

    Coincidentally that's why we like indents too. Unlike Python, indents pretty much only serve to make code legible. (In Python they exist to aid legibility but also to indicate blocks of code, and scoping.)

    You might have a look at Perl::Tidy. It provides a utility that can clean up your formatting for you.


    Dave

      Thankyou
        Actually, there is some good stuff in the Camel book, but other parts are heavy going and not really needed for you.

        I can HEAVILY recommend the Perl Cookbook though :)
        http://shop.oreilly.com/product/9780596003135.do

        Cheers
        Chris
Re^3: How to get the key - value names from a hash
by haukex (Archbishop) on Nov 30, 2019 at 09:57 UTC
    I am spending my spare time trying to learn Perl, but I am finding it very difficult.

    Yes, I understand, Perl's learning curve isn't exactly small, but once things start to click, IMHO it's a great language :-) (my favorite!)

    the websites that I use to try to understand often quickly go over my head

    You said you have the Llama book, that's good, if you're interested in more I can suggest Modern Perl, and see also So what is your Perl book "Trilogy" anyway?. And once you've gotten into Perl a little more, IMHO the Camel is a must.

    Going forward I will take all advice given, including providing code that is tidy coincidentally, those indents are there only so I can read it better

    Yes, I should have made it more clear that aside from those suggestions being helpful for those trying to help (especially standardized indentation), cleaning up your code will help you narrow down and focus on the issue you're seeing. In general, remove a line of code, if the problem goes away or changes, put the line back in, but if the problem doesn't change, then that line of code most likely wasn't relevant to the issue.

    I just want to understand what is going on in the background so I have been copying bits of code from various places and trying to work out step by step what is going on

    In that case, Data::Dumper or Data::Dump are great tools, I use them for watching my data and debugging all the time.

      thankyou, I really do appreciate your help :)

Log In?
Username:
Password:

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

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

    No recent polls found