[Petal] Petal::Hash - get vs. fetch

Jean-Michel Hiver jhiver at mkdoc.com
Tue Oct 14 14:40:50 BST 2003


> Could someone who is familiar with Petal::Hash enlighten me as to the
> difference between get and fetch? I am working on a modifier that will
> take a key of an arrayref in the hash and return a random subset of
> items from the list. I'm finding that both get and fetch are returning
> the same list for me. Should I use one over the other?

It has all to do with entity encoding. Using get will encode &, <, >, "
and ' to &amp;, &lt;, &gt;, &quot; and &apos; respectively.

Within your plugins, I recommend that you use fetch to avoid double
encoding issues.

Cheers,
-- 
Building a better web - http://www.mkdoc.com/
---------------------------------------------
Jean-Michel Hiver
jhiver at mkdoc.com  - +44 (0)114 255 8097
Homepage: http://www.webmatrix.net/


More information about the Petal mailing list