It's not possible not to have a scope in a Perl program. Remember that a file is a block as well.
Oh I know this well. Thanks for pointing out the potential for misunderstanding, I shouldnt have assumed that everybody (especially non native english speakers) would grasp the signifigance of "enclosing". Just so you can see the point I meant Ive included the definition of "enclosing" below. (Definitions 1-3 are relevent IMO)
| en·close ( P ) also in·close tr.v. en·closed, en·clos·ing, en·clos·es
[Middle English enclosen, from Old French enclos, past participle of enclore, from Latin includere, to enclose. See include.] Synonyms: enclose, cage, coop, fence, hem, 1pen, 2wall |
I'd considered using local, but then dismissed it as not necessary - the program is about to end anyway. Why have Perl save the old value of $" and restore it, if you're not going to use the old value?
Well, first off I agree (and I did say that I knew you knew this stuff :-) that in a quick and dirty that was for one-off or personal use that I might not use local. OTOH, I tend to wrap global var changes in as tight a block as I can just because once or twice Ive forgotten that I have not done so and then had to waste time finding the damn thing after the fact. This is what I mean by bad habits. Also as this answer is aimed at a newbie, I felt that pointing out the issue might avoid trouble. After all, you and I know that if we add anything after the global var assigment that we also probably will need to block in and localize the assignment. The OP probably wouldnt know such things so I felt it was prudent to add the comment to the thread.
use English "-no_match_vars"; is as old as at least 5.6.0, if not older.
Hmm, thanks, I was unaware of that option. Mostly becuase I dont use it due to its earlier reputation.
Furthermore, the program isn't using regular expressions, so the argument doesn't old anyway.
Well, I thought that the implication of saying "the module carries an unnacceptable performance penalty for programs that use regexes." was clear that it didnt apply directly here. Again, thanks for the follow up, I should take more care with my explanations.
There is however, IMO, a stronger argument to not use English.pm. The majority of the code, and the majority of the programmers out there don't use this module.
Bravo! This is indeed this is a very good argument for not using English.pm.
Cheers,
In reply to Re: Re: find and replace project with values coming from a table
by demerphq
in thread find and replace project with values coming from a table
by optiontrader
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |