Perl Programming Question: Download Questions PDF
When would local $_ in a function ruin your day?
![Perl Programming Interview Answer Perl Programming Interview Question](https://globalguideline.com/public/images/interview/27.png)
Answer:
When your caller was in the middle for a while(m//g) loop
The /g state on a global variable is not protected by running local on it. That'll teach you to stop using locals. Too bad $_ can't be the target of a my() -- yet.
The /g state on a global variable is not protected by running local on it. That'll teach you to stop using locals. Too bad $_ can't be the target of a my() -- yet.
Download Perl Programming Interview Questions And Answers
PDF
Previous Question | Next Question |
How do I read command-line arguments with Perl? | What happens to objects lost in "unreachable" memory..... ? |