Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: pcre callouts



On Tue, Oct 31, 2023 at 6:31 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> On 10/31/23, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> >
> > It occurs to me that if you create a scope, you could also create $_
> > in that scope with PM_HIDE set, and then use $_ directly with no
> > namespace needed.
>
> Wouldn't any code inside need to immediately store the value of $_ in
> another parameter to avoid overwriting it after the first command?

PM_HIDE is "local -h" ... if that's set the global value of $_ will
change after every command but the local scope won't be able to see
it.  Seems to work in a quick function example I tried.




Messages sorted by: Reverse Date, Date, Thread, Author