Perl monking (was Menu{Master,Maestro,etc} question(s)

Bill Campbell bill at celestial.com
Mon May 14 13:22:04 PDT 2007


On Mon, May 14, 2007, Jay R. Ashworth wrote:
>On Mon, May 14, 2007 at 01:09:38PM -0700, Bill Campbell wrote:
>> One of the things I really like in perl, that's not in python, is
>> the concept of alternative methods of quoting which can make
>> things like this much cleaner.
>> 
>> Single quotes, 'stuf' can be replaced with q(stuf).
>> 
>> Double auotes, "stuf$variable" by qq(stuf$variable).
>> 
>> Backticks `somecommand` by qx(somecomand).
>> 
>> Regular expressions /expression/ by qr(expression).
>> 
>> This is particularly useful when the stuff you want quoted
>> contains the character you need to use for the quotes.
>
>I'd forgotten about these.  Happens they weren't actually the problem,
>of course, but...
>
>> Furthermore, the quoted text can be enclosed in parenthesis,
>> braces, etc., so that vi(m)'s ``%'' key can be used to find the
>> matching delimiter (this is very high on my list of priorities).
>
>Indeed.  Newer Vim's seem to auto-highlight the matches as your cursor
>across them, as well; I think this was whatever ships on SuSE 10.2.

The vim option to have the cursor momentarily jump to the matching
delimiter is ``showmatch'', and can be turned off in your $HOME/.vimrc
file.  Personally I like it on.

You can turn off that obnoxious coloration with ``:syntax off'' or
something similar in the $HOME/.vimrc file.  Fairlite has a color setting
that he likes as well.

Personally I only turn the syntax highlighting on when I'm chasing a syntax
error that's probably caused by failing to close a quote somewhere because
I find the highlighting colors unreadable.

Bill
--
INTERNET:   bill at Celestial.COM  Bill Campbell; Celestial Software, LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
FAX:            (206) 232-9186  Mercer Island, WA 98040-0820; (206) 236-1676

``Many citizens because of their respect for what only appears to be a law
are cunningly coerced into waiving their rights due to ignorance.''
    -- U.S. v. Minker


More information about the Filepro-list mailing list