Ech, shelling-out is so 20th century!  :^)  Yeah, if you're going to be shelling-out a lot an an array wouldn't buy you much efficiency.  If you need random access to the data you can do it most easily with a hash of (anonymous) hashes like this:
<br><br><div style="margin-left: 40px; font-family: courier new,monospace; font-weight: bold;">%object_type1 = (<br></div>
<div style="margin-left: 80px; font-family: courier new,monospace; font-weight: bold;">
<div style="margin-left: 40px;">id1 =&gt; { fs =&gt; $filespec, cl =&gt; $changelist, bg =&gt; $bug_no },<br>id2 =&gt; { fs =&gt; $filespec, cl =&gt; $changelist, bg =&gt; $bug_no },<br>id3 =&gt; { fs =&gt; $filespec, cl =&gt; $changelist, bg =&gt; $bug_no },
<br>id4 =&gt; { fs =&gt; $filespec, cl =&gt; $changelist, bg =&gt; $bug_no },<br>id5 =&gt; { fs =&gt; $filespec, cl =&gt; $changelist, bg =&gt; $bug_no },<br>id6 =&gt; { fs =&gt; $filespec, cl =&gt; $changelist, bg =&gt; $bug_no },
<br>
</div>
<div style="margin-left: 40px;">... <br>
</div>);</div><br>The &#39;id&#39; can be any unique value you&#39;d like of course... then you can access (get or set) it like this:<br><br><div style="margin-left: 40px;"><span style="font-family: courier new,monospace; font-weight: bold;">
<span style="font-weight: bold;"><span style="font-weight: bold;"># retrieve a value</span><br></span>my $changelist = $</span>object_type<span style="font-family: courier new,monospace; font-weight: bold;">1{id2}-&gt;{cl};
<br><br># set a value<br style="font-family: courier new,monospace; font-weight: bold;"></span><span style="font-family: courier new,monospace; font-weight: bold;">$</span>object_type<span style="font-family: courier new,monospace; font-weight: bold;">
1{id5}-&gt;{bg} = $new_bug;<br><br># create a new record<br></span><span style="font-family: courier new,monospace; font-weight: bold;">$</span>object_type<span style="font-family: courier new,monospace; font-weight: bold;">
1{id213} = { </span>fs =&gt; $filespec, cl =&gt; $changelist, bg =&gt; $bug_no };</div><br>...which is pretty efficient, and, I think, straightforward to use. Alternatively you could opt to use anonymous arrays and access them by index.
<br><br><span style="text-decoration: underline;">BUT</span> if you want (or need) to optimize this process (i.e. avoid shelling-out) you might either try the <span style="font-weight: bold;">Inline </span>distribution from CPAN (which would allow you to tie your code into the native language of the objects your dealing with via an XSub wrapper),&nbsp; or if this only interacts with 
<span style="font-style: italic;">Perforce</span> you could avoid reinventing the wheel and just use something in the <span style="font-weight: bold;">P4</span> namespace from CPAN. Like this guy: <a href="http://search.cpan.org/%7Esmee/P4-3.5313/P4.pm">
http://search.cpan.org/~smee/P4-3.5313/P4.pm</a>.<br><br><br>Hope that helps,<br>Montgomery<br><br><br><div><span class="gmail_quote">On 9/14/07, <b class="gmail_sendername"><a href="mailto:tmcd@panix.com">tmcd@panix.com</a>
</b> &lt;<a href="mailto:tmcd@panix.com">tmcd@panix.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Thu, 13 Sep 2007, Montgomery Conner &lt;
<a href="mailto:montgomery.conner@gmail.com">montgomery.conner@gmail.com</a>&gt; wrote:<br>&gt; If you don&#39;t require encapsulation the easiest (and most efficient)<br>&gt; solution would be to forgo building an object to hold this data:
<br>&gt; there would be no point and there is a semi-trivial amount of<br>&gt; overhead in doing so.<br><br>Micro-optimization leads to micro-results.&nbsp;&nbsp;What&#39;s going to dominate<br>the runtime of this program is the many many `...` and
<br>open(IN, &quot;...|&quot;) calls to external programs.<br><br>&gt; You could use an array instead.<br><br>The three types of objects:<br>- Filespecs like //depot/dev/foo/bar.java#3<br>&nbsp;&nbsp;That&#39;s a dead giveaway that it&#39;s Perforce.
<br>- Changelist numbers like 67890<br>- Bug numbers like 12345<br><br>A filespec is associated with a changelist.&nbsp;&nbsp;A changelist may be<br>associated with a bug.&nbsp;&nbsp;I have to do system(&quot;p4 ...&quot;) to find out what<br>
objects exist and their associations.&nbsp;&nbsp;I need to be able to query<br>whether I&#39;ve dealt with an object before, so lookup must be efficient.<br>There&#39;s different data that I want to store with each object type.<br>
<br>Filespecs obviously wouldn&#39;t work as array indices, and searching<br>array values would be ugly to work with.&nbsp;&nbsp;The changelist numbers and<br>bug numbers could work as arrays, but I was thinking of hashes anyway.<br>
<br>--<br>Tim McDaniel; Reply-To: <a href="mailto:tmcd@panix.com">tmcd@panix.com</a><br>_______________________________________________<br>Austin mailing list<br><a href="mailto:Austin@pm.org">Austin@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/austin">
http://mail.pm.org/mailman/listinfo/austin</a><br></blockquote></div><br>