Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Is an empty block not a block?

by eric256 (Parson)
on Nov 18, 2005 at 23:00 UTC ( [id://509988]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Is an empty block not a block?
in thread Is an empty block not a block?

Actualy {blah, "blah"} is considered a block. See below for proof. ;). Perl is trying to be smart and guessing on what exactly {} is based on context. {} makes lots of since as a hash ref but very little as a block. {blah, "blah"}is usefull as a block while my $x = {blah, "blah"}; is most probalby a hashref and treated that way.

C:\Perl\test>perl -e"{test,'blah'} print 'hello'"; hello C:\Perl\test>perl -e"{test,'blah', print '1'} print 'hello'"; 1hello

___________
Eric Hodges $_='y==QAe=e?y==QG@>@?iy==QVq?f?=a@iG?=QQ=Q?9'; s/(.)/ord($1)-50/eigs;tr/6123457/- \/|\\\_\n/;print;

Log In?
Username:
Password:

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

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

    No recent polls found