(sub {
print 1;
})();
sub {
print 1;
}();
I tried various ways, all are wrong…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
(sub { ... })will give you the pointer to the function so you must call by reference.(sub { print "Hello world\n" })->();The other easy method, as pointed out by Blagovest Buyukliev would be to dereference the function pointer and call that using the
{ }operators&{ sub { print "Hello World" }}();