in reply to Re: Working through it...
in thread Working through it...
I guess its because no-one knows what i'm tring to do because my code is so rudimentary. Previously I was using hashes, then was told to instead use arrays, so I did that with limited success. Almost had it working in fact, then it collapsed. I'll go back to hashes because I DO NEED the named indexes. I'll fully read that next recommended section a couple times re hashes
Do you mean instead $currVar = \@myarray;?Using the @ was causing errors for me
What do you expect this to do? for ($i = 1; $i <= $depth; $i++) { $currVar=\@currVar[$arrayKey[$i]]; }
This is supposed to make the reference to the variable according to depth, so I can then enter a value. @arrayKey contains all of the variable names, so the loop just inserts them in order, creating the reference
if($line =~ /^\s{0,4}\<\/(.*)\>/) {The data this code will receive has 0-4 spaces depending on the depth of the value. I'm sure there's a better way to do it, but for now it works
I know you think that's going to be more work, but it's not. It's really notIf I only use mods, i'd most certainly succeed. But i'm trying to learn HOW to do this at the same time. I've bashed my head into walls numerous times, but the picture is becoming clearer, more and more reading, more attempts, days of failed code attempts. More recommendations on things to read, subtle improvements each time(Note: my server admin is a cow and only allows some mods. My other server only allows other mods, I need a new server)
As always, thank-you for your input *bow*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Working through it...
by chromatic (Archbishop) on Sep 11, 2011 at 01:29 UTC | |
by Inexistence (Acolyte) on Sep 11, 2011 at 21:14 UTC | |
by Inexistence (Acolyte) on Sep 11, 2011 at 22:35 UTC | |
by chromatic (Archbishop) on Sep 12, 2011 at 04:56 UTC | |
by Inexistence (Acolyte) on Sep 12, 2011 at 05:23 UTC |