I only added the eval bit as I got tired of having to manually convert $username = $params{'username'}; each time I wanted to display the username variable (again my own code which replaces tagged fields with variables and I was unable to get it to handle hash or list values but it was happy with scalars).Huh? That's odd. This is Perl, not PHP, and you can use hash items in a string just like any other scalar. Just use the correct type of quotes, or no quotes for a bareword (= just like the name of a plain variable), or escape them with a backslash. Like this:
All three work equally well.$params{'name'} = "Slim Shady"; print "My name is $params{'name'}\n"; print "My name is $params{name}\n"; print "My name is $params{\"name\"}\n";
In reply to Re: Re: Re: Re: Re: Re: the search string and me
by bart
in thread the search string and me
by deveyus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |