in reply to Appending in a switch case statement

<Update> I meant to include my reason for not just using CDPATH. I play around in directory trees like: $HOME/<projectname>/(source|target)/<modulename>/CPAN_structured_tree where I am usually in the bottom of one project's source tree, and occasionally want to jump to the sister-directory in the target or into the source of a different project. I use shell history and a few exported variable names for directories.
</Update>

For background, I ran across this cute alias which I never use:

realias='$EDITOR ~/.aliases; source ~/.aliases'
In the case you give, I use exported variables and cd. I've never felt the need to have my environment evolve so rapidly that I couldn't use an editor in a spare screen to edit my .bashrc. So I would just:
$ export tmp=/tmp $ cd $tmp
To make this more suited to your style, I'd blend this together into something like:
function reexport { echo export "$*" >> $HOME/.exports; source $HOME/.exports; }
Given that you perl, perhaps you can stand some dollar signs.

Be well,
rir