in reply to Concatenating Identical Key's Values

If your code was cut n' pasted, your problem probably lies in your use of $day in the else as you use day (string, not a scalar) beforehand.

Also, you can simplify things by doing away with if/else entirely ...

while( my $ref = $sth->fetchrow_hashref ) { $events{ $ref->{'day'} } .= $ref->{'title'}; }

    --k.


Replies are listed 'Best First'.
Re: Re: Concatenating Identical Key's Values
by jerrygarciuh (Curate) on Apr 04, 2002 at 04:42 UTC
    Kanji++. Sometimes I feel like I must be code blind! Thanks very much!
    jg
    _____________________________________________________
    Think a race on a horse on a ball with a fish! TG
      If you had used "use strict;" Perl would have caught that for you. See perldoc strict.
        I most certainly am using strict but what I may not have done is run a commandline compile check. When I do a web-app like this I usually make my small changes and upload and if it doesn't bork I don't check -c.
        BTW I am also running under -w and eventually under -T (once user-guided input gets added).
        jg
        _____________________________________________________
        Think a race on a horse on a ball with a fish! TG
      Syntax hiliting also sometimes helps to spot such things, but use strict should be used nevertheless.