Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Syntax allowed in interpolated hash/array indexes

by Somni (Friar)
on Dec 10, 2007 at 23:12 UTC ( [id://656267]=note: print w/replies, xml ) Need Help??


in reply to Syntax allowed in interpolated hash/array indexes

The reason your second qq is a syntax error is because you are using your end delimiter in your string.

Try: qq[ $h->{  fn("{") =~ /c/ } ]

The syntax allowed there is an expression, any expression will do. You are still somewhat limited, even in the expression, by the delimiters you use for the qq, however.

There's even a module (Interpolation) that takes advantage of this by tying a hash that would simply return the result of the expression.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://656267]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-04-25 21:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found