No subject


Wed Mar 18 03:15:45 PDT 2009


-s

enables rudimentary switch parsing for switches on the command line after
the program name but before any filename arguments (or before an argument of
--). This means you can have switches with two leading dashes (--help). Any
switch found there is removed from @ARGV and sets the corresponding variable
in the Perl program. The following program prints ``1'' if the program is
invoked with a -xyz switch, and ``abc'' if it is invoked with -xyz=abc. 
    #!/usr/bin/perl -s
    if ($xyz) { print "$xyz\n" }
Do note that --help creates the variable ${-help}, which is not compliant
with strict refs.


Lary
-----Original Message-----
From: lsprilus at bioinfo2.weizmann.ac.il
[mailto:lsprilus at bioinfo2.weizmann.ac.il] 
Sent: Monday, January 27, 2003 6:05 PM
To: perl at perl.org.il
Subject: Re: [Perl] Commandline Parameters


According to Shlomo Yona:
> Which built-in system do you use for reading and processing
> commandline parameters?

Getopt::Simple

Jaim
-- 
 Dr Jaime Prilusky                | Jaime.Prilusky at weizmann.ac.il
 Weizmann Institute of Science    | fax: 972-8-9344113
 76100 Rehovot - Israel           | tel: 972-8-9344959

 info URL http://bioinformatics.weizmann.ac.il/jaime_prilusky.html
 OCA is at http://bioinformatics.weizmann.ac.il:8500
 Perl Users in Rehovot http://rehovot.pm.org/
_______________________________________________
Perl mailing list
Perl at perl.org.il
http://www.perl.org.il/mailman/listinfo/perl

YAPC::Israel::2003
http://www.perl.org.il/YAPC/2003/


This e-mail message has been sent by Elop Electro-Optics Industries Ltd. and
is for the use of the intended recipients only. The message may contain
information that is privileged or confidential.If you are not the intended
recipient you are hereby notified that any use, distribution or copying of
this communication is strictly prohibited, and you are requested to delete
the e-mail and any attachments and notify the sender immediately.

------_=_NextPart_001_01C2C768.FE9AA8B0
Content-Type: text/html;
	charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DISO-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: [Perl] Commandline Parameters</TITLE>
</HEAD>
<BODY>
<BR>

<P><FONT SIZE=3D2>From&nbsp; perlrun documentation:</FONT>
</P>

<P><FONT SIZE=3D2>-s</FONT>
</P>

<P><FONT SIZE=3D2>enables rudimentary switch parsing for switches on =
the command line after the program name but before any filename =
arguments (or before an argument of --). This means you can have =
switches with two leading dashes (--help). Any switch found there is =
removed from @ARGV and sets the corresponding variable in the Perl =
program. The following program prints ``1'' if the program is invoked =
with a -xyz switch, and ``abc'' if it is invoked with -xyz=3Dabc. =
</FONT></P>

<P><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; #!/usr/bin/perl -s</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; if ($xyz) { print =
&quot;$xyz\n&quot; }</FONT>
<BR><FONT SIZE=3D2>Do note that --help creates the variable ${-help}, =
which is not compliant with strict refs.</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Lary</FONT>
<BR><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: lsprilus at bioinfo2.weizmann.ac.il [<A =
HREF=3D"mailto:lsprilus at bioinfo2.weizmann.ac.il">mailto:lsprilus at bioinfo=
2.weizmann.ac.il</A>] </FONT>
<BR><FONT SIZE=3D2>Sent: Monday, January 27, 2003 6:05 PM</FONT>
<BR><FONT SIZE=3D2>To: perl at perl.org.il</FONT>
<BR><FONT SIZE=3D2>Subject: Re: [Perl] Commandline Parameters</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>According to Shlomo Yona:</FONT>
<BR><FONT SIZE=3D2>&gt; Which built-in system do you use for reading =
and processing</FONT>
<BR><FONT SIZE=3D2>&gt; commandline parameters?</FONT>
</P>

<P><FONT SIZE=3D2>Getopt::Simple</FONT>
</P>

<P><FONT SIZE=3D2>Jaim</FONT>
<BR><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>&nbsp;Dr Jaime =
Prilusky&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp; | Jaime.Prilusky at weizmann.ac.il</FONT>
<BR><FONT SIZE=3D2>&nbsp;Weizmann Institute of =
Science&nbsp;&nbsp;&nbsp; | fax: 972-8-9344113</FONT>
<BR><FONT SIZE=3D2>&nbsp;76100 Rehovot - =
Israel&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | =
tel: 972-8-9344959</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;info URL <A =
HREF=3D"http://bioinformatics.weizmann.ac.il/jaime_prilusky.html" =
TARGET=3D"_blank">http://bioinformatics.weizmann.ac.il/jaime_prilusky.ht=
ml</A></FONT>
<BR><FONT SIZE=3D2>&nbsp;OCA is at <A =
HREF=3D"http://bioinformatics.weizmann.ac.il:8500" =
TARGET=3D"_blank">http://bioinformatics.weizmann.ac.il:8500</A></FONT>
<BR><FONT SIZE=3D2>&nbsp;Perl Users in Rehovot <A =
HREF=3D"http://rehovot.pm.org/" =
TARGET=3D"_blank">http://rehovot.pm.org/</A> =
_______________________________________________</FONT>
<BR><FONT SIZE=3D2>Perl mailing list</FONT>
<BR><FONT SIZE=3D2>Perl at perl.org.il</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://www.perl.org.il/mailman/listinfo/perl" =
TARGET=3D"_blank">http://www.perl.org.il/mailman/listinfo/perl</A></FONT=
>
</P>

<P><FONT SIZE=3D2>YAPC::Israel::2003</FONT>
<BR><FONT SIZE=3D2><A HREF=3D"http://www.perl.org.il/YAPC/2003/" =
TARGET=3D"_blank">http://www.perl.org.il/YAPC/2003/</A></FONT>
</P>
<BR>

<P><B><FONT SIZE=3D2>This e-mail message has been sent by Elop =
Electro-Optics Industries Ltd. and is for the use of the intended =
recipients only. The message may contain information that is privileged =
or confidential.If you are not the intended recipient you are hereby =
notified that any use, distribution or copying of this communication is =
strictly prohibited, and you are requested to delete the e-mail and any =
attachments and notify the sender immediately.</FONT></B></P>

</BODY>
</HTML>
------_=_NextPart_001_01C2C768.FE9AA8B0--



More information about the Perl mailing list