<html>
<body>
I had some agro trying to do it with getopt (tried to interpret h e l p
as args) <br><br>
so:<br><br>
<br>
<tt>getopts(&quot;hDd:f:t:&quot;, \%args) <br>
|| exec('perldoc', $0);&nbsp;&nbsp;&nbsp;&nbsp; # perldoc if bad
args&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<br><br>
(keys %args) || exec('perldoc', $0);&nbsp; #perldog if no args<br><br>
<br><br>
<br><br>
</tt>At 2003/06/05 03:30 PM, Sean Carte wrote:<br>
<blockquote type=cite class=cite cite>On Thu, 2003-06-05 at 15:25, Nick
Cleaton wrote:<br>
&gt; On Thu, Jun 05, 2003 at 02:40:52PM +0200, Sean Carte wrote:<br>
&gt; &gt; <br>
&gt; &gt; if ( $ARGV[0] and ( $ARGV[0] eq '--help' ) ) {<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^^^^^^^^^^^^<br>
&gt; &gt;&nbsp;&nbsp; exec('perldoc', $0);<br>
&gt; &gt; }<br>
&gt; <br>
&gt; To prevent a warning if there are no arguments, right ?<br><br>
Exactly.<br>
&nbsp;<br>
&gt; How about replacing those 3 lines with:<br>
&gt; <br>
&gt;&nbsp;&nbsp; exec 'perldoc', $0 if &quot;@ARGV&quot; eq
'--help';<br><br>
Nice. But I'll keep my warning prevention:<br><br>
exec 'perldoc', $0 if ( $ARGV[0] and ( $ARGV[0] eq '--help' ) 
);<br><br>
-- <br>
Regards<br>
Sean Carte<br><br>
University of Zululand<br>
Network Services Unit<br>
Phone: 035 902 6081<br>
Fax: 035 902 6028<br><br>
&quot;Always look on the bright side of life...&quot;<br><br>
_______________________________________________<br>
Za-pm mailing list<br>
Za-pm@mail.pm.org<br>
<a href="http://mail.pm.org/mailman/listinfo/za-pm" eudora="autourl">http://mail.pm.org/mailman/listinfo/za-pm</a>
</blockquote>
<x-sigsep><p></x-sigsep>
<tt><br>
<font face="Courier New, Courier" size=2>Spike Hodge<br><br>
UNIX Programmer<br>
</font></tt><font face="Courier New, Courier" size=2>M-Web Technology<br>
</font><tt>021 596 8496<br>
082 901 5265<br><br>
</tt>Click here and make M-Web your homepage<br>
<a href="http://homepage.mweb.co.za/" eudora="autourl">http://homepage.mweb.co.za</a></body>
</html>