[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Another use for silly bbedit/perl parser trick



The silly parser trick isn't just handy for labeling sections...


The function parser is a bit touchy, and will often choke on certain
files, rendering all of your functions past the choke point
inaccessible.

Some of the choking sequences can be fixed by putting extra "closing
quotes" in a comment at the end of a line, but others are more annoying.

You can't put comments in a <<HERE_DOC, and for some reason which I
haven't bothered to look at closely, RTF syntax in big HERE_DOC'ed
chunks seem very prone to choking the function parser. (and inlining
large chunks of RTF is very annoying w/o <<'HERE_DOC')

Rather than having all the functions from that point on be invisible to
the function menu , I move all affected functions to the very end of the
code so they don't affect the earlier functions.

Then do the trick from the last message...


# your function parser -friendly subs first
sub good_sub {}
sub another_good_sub {}
# silly parser trick:
=pod
sub _______________________chokers {}
sub choker_one {}
sub choker_two {}
sub choker_three {}
=cut
# then the *real* choking subs
sub choker_one {}
sub choker_two {}
sub choker_three {}


Now, to quickly access "choker_two", select it in the function menu, hit
command-e and then command-g, and there ya are. :)

A previously hard-to-reach sub is now at your fingertips :)

-matt

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch