|go ahead... be a heretic|
Why do I need a local variable in map functionby Anonymous Monk
|on May 23, 2019 at 07:31 UTC||Need Help??|
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have a function with should select files by a given list of extension. I wrote a program, which did not work. After playing a little around I found a working solution (using a local variable: my $x). But I do not understand, why my first version is not working.
Can you help me explaining the difference between this two versions:
In the first version the expression(@ext) is replaces by '1';
In the second version the expression(@ext) is correct. ('f.*\\.txt$', 'f.*\\.txt.*$')
Thanks for your help !!!