[Fwd: SPUG: 'my' question :)]

Alyssa Harding axhard2 at uswest.com
Thu May 18 15:21:33 CDT 2000


Sorry, that was a typo on my part, I did mean to split( /&/, $pair )

A.


Damian Conway wrote:
> 
>    >   foreach $pair (@pairs){
>    >     ($name, $value) = split(/&/, $buffer);
>    >      $hash{$name} = $value;
>    >   }
> 
> Unless you're doing something very tricky, no matter how any pairs are
> in @pair, this is always going to split $buffer and assign the same
> thing to $hash{$name} each time.
> 
> Are you sure the loop only executes once and not multiple times with one
> effect?
> 
> Or did you mean:
> 
>       foreach $pair (@pairs){
>         ($name, $value) = split(/&/, $pair);
>          $hash{$name} = $value;
>       }
> 
> I'd like to help, but I need to understand first. :-)
> 
> BTW, I get no difference between the my'd and unmy'd versions under
> 5.00503 under Unix.
> 
> Damian

-- 
Alyssa W. Harding 
Web Programmer
U S WEST Creative Services
phon: (206) 345-4073
cell: (206) 769-8735
-------------------------------------------------------------------
Racism was not a problem on the Discworld, because -- what with
trolls and
dwarfs and so on -- speciesism was more interesting. Black and white
lived
in perfect harmony and ganged up on green.
        -- (Terry Pratchett, Witches Abroad)

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 For Subscriptions, Email to majordomo at pm.org:  ACTION  spug-list  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email address





More information about the spug-list mailing list