For options parsing, I use a block similar to the following that I just copy-n-paste to pretty much every bash
script I write:
readonly me=${0##*/} # slightly prettier than $0
partial=0
while getopts ':iph' opt
do
case $opt in
p) partial=1 # partial matches are the default for locate
;;
i) ignore_case='-i'
;;
h) echo "usage: $me -h | [-ip] dirname" >&2
echo " -i : ignore case when matching dirname" >&2
echo " -p : partial match on dirname" >&2
echo " -h : this help message" >&2
echo " colnum : column of numbers to add (non-numeric values in this col treated as 0)" >&2
exit
;;
:) echo "$me: $OPTARG requires an argument ($me -h for help)" >&2
exit 2
;;
\?) echo "$me: unknown argument $OPTARG ($me -h for help)" >&2
exit 2
;;
esac
done
shift $(( $OPTIND - 1 ))
Now, admittedly, this only deals with short (stackable) flags, but that's generally good enough for me. I'm an old-school *nixite who believes that ls
as an abbreviation for "list" was a good idea. :-D
Perhaps there's some interesting feature of Perl's SV structure that allows it to answer equality queries especially quickly compared to other operators.
]]>Thanks Buddy.
~Dinesh
]]>run some command | while read line do process each "$line" done]]>
What works is:
(load "~/.emacs.d/auto-highlight-symbol") (add-hook 'cperl-mode-hook 'auto-highlight-symbol-mode) (setq ahs-idle-interval 0.35)
The .el files are at https://github.com/emacsmirror/auto-highlight-symbol
]]>Also, highlight has a lot of more stuff than auto-highlight-symbol. So you might want to debug that, or at least file a bug report ?
]]>https://github.com/thoughtstream/Damian-Conway-s-Vim-Setup/blob/master/plugin/trackperlvars.vim
]]>