I am a beginner in Perl. My Question is,
#!/usr/local/bin/perl eval{ my $a=5; get_accounts(); }; sub get_accounts { print $a; }
When I execute the program, perl prints Nothing. Does declaring $a inside eval block will affect the scope ? As far as I studied, I believe that eval block will not hide any value, and also I understand that $a is a global variable. Please help me in understanding this concept. Regards, Rajan.
In reply to Doubt in Eval by rajan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |