Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding a variable definition in perl 1

Status
Not open for further replies.

tbarthen

Technical User
Jul 26, 2003
33
US
I know that you can use [blue]Ctrl-%[/blue] to match the brackets or parenthesis in a perl script from with the vi editor.

I was wondering if there is also some trick to locate the definition or "origination" of a selected variable in a script.

Does anyone know if this is possible?

[hammer]
 
I don't know if vi tracks that much semantic information. Considering you don't have to declare a variable at all, and when you do, there's a multitude of ways to do it, I would seriously doubt it's capable. Besides, this isn't really a Perl question. Is there a *nix userland forum about? Maybe one of the *nix desktop/server forums?

________________________________________
Andrew

I work for a gift card company!
 
Yeah, I wasn't sure if this was very suitable for a Perl forum, but I couldn't really think of a better place to ask. Maybe a Unix forum would be better.

Anyways, you're probably right. I doubt there is a way to do this.

Thanks for the reply.
 
I agree with icrf, this is sort of a question for a *nix forum.

However, since you can use regexs in vi, you can probably search for something like 'my $varName' (assuming you define the variable with my) and come up with something. If you reuse variable names, though, this won't work very well.
 
yeah, I occaisionally use vi(m) but I'm nowhere near as versed in it as those server monkeys are. Best of luck, and if you di get anything positive back, be sure to share with us lowly perl folk. ;-)

________________________________________
Andrew

I work for a gift card company!
 
Try the standard Perl module B::Xref, instructions in the documentation.

Mike

To err is human,
but to really foul things up -
you require a man Mike.

Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top