<?xml version="1.0" encoding="windows-1252"?>
<node id="997181" title="Module ( method ) alias ?" created="2012-10-04 01:14:40" updated="2012-10-04 01:14:40">
<type id="115">
perlquestion</type>
<author id="930100">
exilepanda</author>
<data>
<field name="doctext">
Hi Monks,

I have a module set to manage Video files for our Knowledge Management system. The interface is something like this
&lt;p&gt;
&lt;code&gt;
use ManVideo;
my $mv = new ManVideo( DB =&gt; $dbhRef );
$mv -&gt; newVideoRecord ( Trainer =&gt; "someone", Year =&gt; 2011, VideoType =&gt; "training" );
$mv -&gt; save();
&lt;/code&gt;
&lt;p&gt;
And now, my next task is almost the same, and yet identical , but this time is for audio. So I may use the same framework, by giving different DB handle. However, although I can completely use ManVideo::* to do the job, however this is odd to use the same interface to write my source code for Audio like this : &lt;code&gt;$audio = newVideoRecord ( ... ) &lt;/code&gt;
&lt;p&gt;
So, is there any simple (and safe) hack, so that I can create another module set, namely &lt;code&gt;ManAudio&lt;/code&gt;, 
looks like :&lt;code&gt;
my $aud = new ManAudio;
$aud -&gt; newAudioRecord( ..., AudioType =&gt; "meeting" ) ;# implement by ManVideo::newVideoRecord;
&lt;/code&gt;

&lt;br&gt;
One thing that might be a little complex is that I might need to do some pre-process on the arguments. As shown in above code is &lt;code&gt;AudioType=&gt;"meeting"&lt;/code&gt;. I have to change &lt;code&gt;AudioType&lt;/code&gt; to &lt;code&gt;VideoType&lt;/code&gt; before passing to &lt;code&gt;newVideoRecord().&lt;/code&gt; ( This return me a list of authorize staffs to view/listen )

&lt;p&gt;
Thank you very much in advance for any clues.



</field>
</data>
</node>
