title: What is appropriate way of "parsing" string of certain format in Perl?
body: <p>I wrote very fancy and pretty customizable bash prompt (<code>PS1</code>), just in my <code>.bashrc</code>.
  So after I finished the &quot;code&quot; turned to be very messy and how prompt was customized wasn't very nice too (it worked though).</p>
  <p>I've come up with an idea to &quot;describe&quot; how I want my prompt to look like with a certain string i.e. <code>&quot;|&gt; user |&gt; hostname |&gt; pwd |&gt; git_status |&gt;&quot;</code> would generate a simple powerline-like prompt (&quot;|&gt;&quot; would be &quot;mapped&quot; to triangle symbol I thought).</p>
  <p>I've decided that using Perl might be good for this kind of task, however I know too little about Perl and am not too experienced with it. So I thought I just might ask experienced users about how would I &quot;parse&quot; a string like that in the example above via Perl.</p>
  <p>Allowed symbol strings may be different e.g: '|&gt;', '|)', '|/' or '|\', and would generate different symbols. Also prompt string may not contain any of those at all. The text would indicate command to be executed to get contents for part of the prompt.</p>