> > Ummm... I'm not sure if this is the "correct way". It may be the
> normal
> > way for
> > some languages/frameworks (PHP?), but it's not standard. Java, C and
> Perl
> > (just
> > a few off the top of my head) don't do it that the square-bracket
way.
> 
> Well, you may be right, but I do remember reading it somewhere about
the
> time XHTML came out.  At the time, I don't believe Perl supported it,
> but I think it does now.  I haven't really tested it out lately,
though,
> as I usually just leave the [] off because I always thought it was
> rather ugly and it worked fine without it in Perl, which is my
language
> of choice at the moment.
> 
> Now you got me curious... I'm gonna go google it.
> 

Ok, I stand corrected.  This is something that PHP invented and is
non-standard.  I'm guessing Ruby (or maybe just Rails) also uses this
convention, which is why it's the default implementation in
scriptaculous.  If you do the variable that way in Perl, you have to
reference it with the brackets in your code as well:

$in{'item[]'} instead of $in{item} (assuming %in is your input hash).

Although there may be some frameworks that have modified it to work the
same as PHP, I don't really know.

Greg
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to