<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


In reply to Re: Appending in a switch case statement by rir
in thread Appending in a switch case statement by diffredential

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.