Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: How can we interpolate an expression??

by Anonymous Monk
on Sep 20, 2012 at 18:10 UTC ( #994716=note: print w/replies, xml ) Need Help??


in reply to Re^2: How can we interpolate an expression??
in thread How can we interpolate an expression??

my $arrayref = [ 4200 / 100 ]; print "The answer is $arrayref \n";
The answer is ARRAY(0x3f8a94)

my $arrayref = [ 4200 / 100 ]; print "The answer is @$arrayref \n";
The answer is 42

my $arrayref = ; print "The answer is @[ 4200 / 100 ] \n";
syntax error at - line 1, near "= ;" Execution of - aborted due to compilation errors.

print "The answer is @{[ 4200 / 100 ]}\n";
The answer is 42

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994716]
help
Chatterbox?
[Corion]: Hmmm - and now that I look at it, the gallery I'm using doesn't produce non-Javascript compatible links in the sense that hotlinking to an image will only work for Javascript enabled...
[Corion]: On the other hand, maybe supporting non-Javascript isn't that much a priority, and I'm not exactly sure how I could make it work for both kinds of browsers without server-side magic
[Corion]: Should I ever come across far too much money, this would become my evil maniac lair ;)

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2017-02-27 08:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (377 votes). Check out past polls.