How and what are closures implemented in perl?



How and what are closures implemented in perl?..

Answer / Harshit Dwivedi

In Perl, closures (also known as anonymous subroutines) are created by defining a subroutine within another subroutine or a block. A closure retains access to its surrounding lexical scope and can capture the values of its free variables.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More CGI Perl Interview Questions

Enlist the advantages of using c over perl?

1 Answers  


How can you define “my” variables scope in Perl and how it is different from “local” variable scope?

1 Answers  


How does polymorphism work in perl?

1 Answers  


What does the command "use strict" do and why should you use it?

2 Answers   Symphony, TCS,


What is the use of now constructor in perl?

1 Answers  


Explain perl one-liner?

1 Answers  


What does undef function in perl?

1 Answers  


There are two types of eval statements i.e. Eval expr and eval block. Explain them.

1 Answers  


Which operator in perl is used for the concatenation of two strings?

1 Answers  


What are different data types that perl supports. Elaborate on them.

1 Answers  


Explain goto label?

1 Answers  


Explain subroutine?

1 Answers  


Categories