http://www.perlmonks.org?node_id=162552


in reply to Editing features for advanced users

gmax++. Excellent article! I've been delving into so many features of vim I don't think I'll ever be able to use another editor. Exporting to syntax-highlighted, numbered HTML is cool. I've also never seen the 'showmatch' option, but always wanted it!

I just have one question for you, which may be more of a ctags question--I don't know. Say you have some perl...
#!/usr/bin/perl -w use strict; use Business::CreditCard qw(); Business::CreditCard::validate('4111111111111111') or die "The credit card number appears to be invalid\n";
When I run pltags.pl on this, it just returns "No tags found.". Isn't the function call a tag? I would expect it to make a tags file with a hyperlink to Business::CreditCard that points straight to the line where validate() is defined. Is this possible? I would so love to know the answer to this riddle. If I could do this it would be incredibly easy to navigate my perl code.

---
"A Jedi uses the Force for knowledge and defense, never for attack."

Replies are listed 'Best First'.
Re: Re: Editing features for advanced users
by gmax (Abbot) on Apr 29, 2002 at 05:19 UTC
    The purpose of the tags program is to bookmark where a variable or sub was declared, so that you can go back to that point when needed.
    Say you have this script:
    use DBI; use strict; my $DNS = shift; my $dbh = DBI->connect($DNS);
    Save it as test_DBI.pl and then run
    $ /your_path_to_it/pltags.pl test_DBI.pl `perldoc -l DBI`
    (perldoc -l returns the path of an installed module).
    Then, editing test_DBI.pl, if you have your cursor over the "connect" word, Ctrl-] will take you to the DBI.pm module, at the line where the "connect" sub was defined.
    In your case, replace the script and module names and you'll have some more tags available.
    HTH
     _  _ _  _  
    (_|| | |(_|><
     _|