[Israel.pm] OT: how can you limit your search to a block in vi or emacs?

Gaal Yahas gaal at forum2.org
Mon Sep 8 03:07:35 PDT 2008


What does it mean to "use typeglobs" in this context and why does it help Gabor?

Note that lexical variables (declared with "my") are not in a package
symbol table.

On Mon, Sep 8, 2008 at 12:46 PM, sawyer x <xsawyerx at gmail.com> wrote:
> given you want to differ between @x and $x, $x and $x{$name},
> $x[$num], i think regular editor (vim / emacs without a macro) does
> not seem to cover it.
> considering you're probably looking to add variable name replacements
> to Pedro, while making sure you're allowing for similar names of
> different typed variables (scalar, array, hash could have similar name
> and not be mistaken), i think the best answer was to use typeglobs (as
> suggested by Dov) or look into packages more specifically.
> maybe the search could prompt for a package name (assuming by default
> "main" or whatever is in the first "package" paragraph till it finds
> another) and then parse the code using perl (i think adam kennedy has
> something for that) and change all the variable names.
>
> On Sun, Sep 7, 2008 at 8:34 PM, Gabor Szabo <szabgab at gmail.com> wrote:
>>
>> I often need to find (and maybe rename) all the ocurances of a variable.
>>
>> The problem is
>> 1) if the same name is used in multiple places then my search keeps
>>     going to the other places as well an does not stay within the scope.
>>
>> 2) how can I easily locate both @x and $x[2]  but not $x nor $x{name}?
>>
>> Gabor
>> _______________________________________________
>> Perl mailing list
>> Perl at perl.org.il
>> http://perl.org.il/mailman/listinfo/perl
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
>



-- 
Gaal Yahas <gaal at forum2.org>
http://gaal.livejournal.com/



More information about the Perl mailing list