<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("hDd:f:t:", \%args) <br>
|| exec('perldoc', $0); # perldoc if bad
args
<br><br>
(keys %args) || exec('perldoc', $0); #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>
> On Thu, Jun 05, 2003 at 02:40:52PM +0200, Sean Carte wrote:<br>
> > <br>
> > if ( $ARGV[0] and ( $ARGV[0] eq '--help' ) ) {<br>
> ^^^^^^^^^^^^<br>
> > exec('perldoc', $0);<br>
> > }<br>
> <br>
> To prevent a warning if there are no arguments, right ?<br><br>
Exactly.<br>
<br>
> How about replacing those 3 lines with:<br>
> <br>
> exec 'perldoc', $0 if "@ARGV" 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>
"Always look on the bright side of life..."<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>