From: ccc31807 on
On Jun 8, 3:06 pm, Ben Morrow <b...(a)morrow.me.uk> wrote:
> '%main_hash' is an appallingly bad name for a variable. Why is it there?
> What's it got in it? (In this case, probably, something like '%people'
> might be better.)


Sorry. I posted the code where I populated the two hashes, named %fac
and %sec.

> You want \Q\E here.

Trying that now.

> So you must be doing something else.

Not intentionally.

CC.
From: ccc31807 on
On Jun 8, 3:31 pm, "Uri Guttman" <u...(a)StemSystems.com> wrote:
>   c>         courses => @courses,
>
> same bug as i pointed out in another post. you need a ref or anon array
> there. that is very wrong. who knows what it is doing to your app?

@courses contains a list of numeric keys. If I:
print "Courses: [@courses]\n";
it will output something like this:
Courses: [23456 34567 45678]

This is NOT the problem here. What this does is make the hash element
$fac{$id}{courses} contain a scalar value like this:
'23456 34567 45678' This works perfectly and does exactly what I want
it to.

But thanks for pointing this out, CC.
From: Willem on
ccc31807 wrote:
) On Jun 8, 3:31?pm, "Uri Guttman" <u...(a)StemSystems.com> wrote:
)> ? c> ? ? ? ? courses => @courses,
)>
)> same bug as i pointed out in another post. you need a ref or anon array
)> there. that is very wrong. who knows what it is doing to your app?
)
) @courses contains a list of numeric keys. If I:
) print "Courses: [@courses]\n";
) it will output something like this:
) Courses: [23456 34567 45678]
)
) This is NOT the problem here. What this does is make the hash element
) $fac{$id}{courses} contain a scalar value like this:
) '23456 34567 45678' This works perfectly and does exactly what I want
) it to.

No, it doesn't.

It would if you spelled it like this:

courses => "@courses",

But now, it would make:

$fac{$id}{courses} contain '23456', and
$fac{$id}{34567} contain '45678'.

And count yourself lucky that there are an odd number of elements,
otherwise the following keys and values would be swapped around.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
From: J. Gleixner on
ccc31807 wrote:
> On Jun 8, 3:18 pm, "J. Gleixner" <glex_no-s...(a)qwest-spam-no.invalid>
> wrote:
>> Provide actual code that we can run that shows your issue and so we can
>> see what's happening.
>
> Here is the working code in my test script. Unfortunately, I can't
> post the data files. Note that this code does some other things and
> contains debugging statements.

How can we run this?

Create a short example we can run that shows the issue. Just
populate an array or two with example data and use that
in place of your files.

Narrow your example code down to the issue, get rid of all the other
stuff and you might find the problem on your own.
From: ccc31807 on
On Jun 8, 4:05 pm, Willem <wil...(a)turtle.stack.nl> wrote:
> ) This is NOT the problem here. What this does is make the hash element
> ) $fac{$id}{courses} contain a scalar value like this:
> ) '23456 34567 45678' This works perfectly and does exactly what I want
> ) it to.
>
> No, it doesn't.

I beg to differ, but it does. I've been running this particular piece
of code for about three years, and it has exactly the behavior I
described. This is a line from my debugging file with only the
personal information replaced with XXXXX.

1073251 => HASH(0x1e4ea6c)
xlist =>
middle => A
first => XXXXX
contract => XXXXX
csz => XXXXX
addy2 =>
courses => 235519 235524 237125
last => XXXXX
id2 => 1073251
addy1 => XXXXX Drive
mail => XXXXX(a)XXXXX
trs => Current Member
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5 6 7
Prev: How to read a given number of lines?
Next: something stupid