Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: If Not Replace

by Inexistence (Acolyte)
on Sep 10, 2011 at 14:51 UTC ( [id://925254]=note: print w/replies, xml ) Need Help??


in reply to Re: If Not Replace
in thread If Not Replace

You should not write %myarray because that is a hash, and $myarray0 is refering to @myarray, whereas $myarray{0} is refering to %myarray

I was following examples from 'http://oreilly.com/catalog/advperl/excerpt/ch01.html' but I no doubt got them wrong.

Thank-you muchly for guiding me re the above variable information. Associative arrays are what I believe i'm use to using in LUA, the hash naming just confuses me atm *bow*

Replies are listed 'Best First'.
Re^3: If Not Replace
by davido (Cardinal) on Sep 10, 2011 at 16:43 UTC

    That's a good book, but having read it (and having re-read the excerpt you pointed to in the link above), I am not seeing quite how you came up with what you did. But that's not important. The important thing is that you've asked a few good questions, and have had thick enough skin to stick around for the answers. I ++ed both of your nodes in this thread for that reason, particularly after seeing the updates. So many times we see someone "fly by" with a question that seems like it's coming from left field, and then after we answer or request further clarification, never see the individual again. Kudos for sticking with it.

    I recommend putting the Advanced Perl Programming book off for now. It's a great book but it doesn't deal with advanced Perl syntax so much as advanced topics addressed by Perl. It does get into symbol table tricks to some degree, but for the most part it's about implementing solutions with Perl. Mastering Perl is in a similar category; another great book that sort of takes on random topics related to implementing real-world solutions with Perl.

    But Learning Perl and Intermediate Perl are books dedicated to Perl itself; Perl syntax, Perl data types, Perl objects, Perl modules, Perl operators, etc.


    Dave

      Thanks for the comment :)

      I read a bunch of different examples before I posted. Its hard for me to ask the right questions when I don't know the terminology. Understanding the variables is my biggest issue atm, which i'm slowly grasping through trial and error. I've read lots, but at this point in time, I can't grasp how to do the stuff I do in LUA.

      My apologies if a question seems out in left field, but if you look at the mashing of code that I produce, you'd laugh your head off(seriously) So I try to clean it up so it just represents the question I have :)

      This last question, yes my code was completely redundant, but thats how i've always built my arrays. I couldn't have found that out without asking, no tutorial on the internet would have said so. Nor would I have found out that I should be using the @ instead of % as the tutorial was telling me(logically, I like @ more and my instinct told me to use it, but the tutorial said otherwise) I'm amazed that Monk saw my code as I posted and deleted it quickly because it was a mess...

      Learning Perl and Intermediate Perl, I'll see what I can learn from them. Its frusterating that i'm not a 'beginner' at coding, but I am in Perl syntax. The easy books are too easy and anything heavier is too complex *gasp*

      Thank-you again, much appreciated as always :)

        The easy books are too easy and anything heavier is too complex.

        I wrote Modern Perl for people in your situation. Can you let me know if it helps?

        Improve your skills with Modern Perl: the free book.

        Believe me, I know what you're talking about, as does probably everyone here who has learned more than one language. You may actually find a lot of good information in perlintro, perl, perlsyn, perlsub, and perlref. But I still wouldn't hesitate to suggest Learning Perl and Intermediate Perl. Maybe you'll get through them fairly quickly, but they will provide that foundation.


        Dave

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-26 00:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found