<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Perl: Command Line Arguments in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-command-line-arguments/m-p/2887002#M102115</link>
    <description>This might be useful also:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://members.shaw.ca/andrew-johnson/perl/archit/Oct00" target="_blank"&gt;http://members.shaw.ca/andrew-johnson/perl/archit/Oct00&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
    <pubDate>Tue, 21 Jan 2003 18:24:41 GMT</pubDate>
    <dc:creator>harry d brown jr</dc:creator>
    <dc:date>2003-01-21T18:24:41Z</dc:date>
    <item>
      <title>Perl: Command Line Arguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-command-line-arguments/m-p/2887000#M102113</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Does anyone have an example of passing two or three command line arguments to a Perl script?  I've searched the ITRC and found plenty examples of passing arguments to a Perl subroutine, but not to the Perl script itself.  i.e. From a POSIX or Bourne shell script or directly from the crontab file.&lt;BR /&gt;&lt;BR /&gt;It's probably indicative of how little I know about PERL.  I've tried taking the "subroutine" examples and using them.  But I can't get them to work.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Tom</description>
      <pubDate>Tue, 21 Jan 2003 18:08:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-command-line-arguments/m-p/2887000#M102113</guid>
      <dc:creator>Tom Dawson</dc:creator>
      <dc:date>2003-01-21T18:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: Perl: Command Line Arguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-command-line-arguments/m-p/2887001#M102114</link>
      <description>#!/usr/contrib/bin/perl&lt;BR /&gt;#&lt;BR /&gt;#&lt;BR /&gt;$DataFileName = $ARGV[0];&lt;BR /&gt;$searchstr = $ARGV[1];&lt;BR /&gt;$valuestr = $ARGV[2];&lt;BR /&gt;print "filename is &amp;gt;&amp;gt;".$ARGV[0]."&amp;lt;&amp;lt; searchstr is &amp;gt;&amp;gt;".$ARGV[1]."&amp;lt;&amp;lt;\n";&lt;BR /&gt;print "====================\n";&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 21 Jan 2003 18:14:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-command-line-arguments/m-p/2887001#M102114</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2003-01-21T18:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Perl: Command Line Arguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-command-line-arguments/m-p/2887002#M102115</link>
      <description>This might be useful also:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://members.shaw.ca/andrew-johnson/perl/archit/Oct00" target="_blank"&gt;http://members.shaw.ca/andrew-johnson/perl/archit/Oct00&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 21 Jan 2003 18:24:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-command-line-arguments/m-p/2887002#M102115</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2003-01-21T18:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: Perl: Command Line Arguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-command-line-arguments/m-p/2887003#M102116</link>
      <description>As harry sais, all arguments passed to a perl script are available in the global array @ARGV.&lt;BR /&gt;A major difference with programming in C is that $ARGV[0] is the first argument, and not the program name. Perl has no $ARGC, but since $#ARGV is available as the last defined index in @ARGV, that should not prove to be a problem. Using @ARGV in scalar context&lt;BR /&gt;&lt;BR /&gt;$argc = @ARGV;&lt;BR /&gt;or&lt;BR /&gt;print "I have ", scalar @ARGV, " arguments\n";&lt;BR /&gt;&lt;BR /&gt;will return the number of arguments passed to the script. Look at $0 and/or $^X to see how the script was called.&lt;BR /&gt;&lt;BR /&gt;Some options can be set to variables implicitely without using @ARGV. See 'man perltun' for the details of using -s. Another thing to be aware of is the way perl scans the hashbang line&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl -ws&lt;BR /&gt;&lt;BR /&gt;passes the -w and -s options to the script without you having to type them.&lt;BR /&gt;&lt;BR /&gt;HTH. Enjoy, have FUN! H.Merijn</description>
      <pubDate>Tue, 21 Jan 2003 20:12:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-command-line-arguments/m-p/2887003#M102116</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-01-21T20:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: Perl: Command Line Arguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-command-line-arguments/m-p/2887004#M102117</link>
      <description>Harry, Merijn,&lt;BR /&gt;&lt;BR /&gt;Thanks!  I knew I should be using the ARGV array, but I just couldn't get the syntax right.&lt;BR /&gt;&lt;BR /&gt;Tom&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Jan 2003 12:23:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-command-line-arguments/m-p/2887004#M102117</guid>
      <dc:creator>Tom Dawson</dc:creator>
      <dc:date>2003-01-22T12:23:01Z</dc:date>
    </item>
  </channel>
</rss>

