<?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 how to access elemt in array from perl in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-access-elemt-in-array-from-perl/m-p/4470053#M361053</link>
    <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have one array say:&lt;BR /&gt;&lt;BR /&gt;a=('jan','feb','mar','apr','may','june','jul') ,[(2,4)];&lt;BR /&gt;&lt;BR /&gt;i am not able to compile thsi statment. It gives me the error like:&lt;BR /&gt;&lt;BR /&gt;Can't modify constant item in scalar assignment at af.pl line 2, near "),"&lt;BR /&gt;Execution of af.pl aborted due to compilation errors.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And also what is the difference betwenn [] and [()] operatores in accessing the elements.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
    <pubDate>Thu, 30 Jul 2009 10:03:49 GMT</pubDate>
    <dc:creator>diwakar_4</dc:creator>
    <dc:date>2009-07-30T10:03:49Z</dc:date>
    <item>
      <title>how to access elemt in array from perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-access-elemt-in-array-from-perl/m-p/4470053#M361053</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I have one array say:&lt;BR /&gt;&lt;BR /&gt;a=('jan','feb','mar','apr','may','june','jul') ,[(2,4)];&lt;BR /&gt;&lt;BR /&gt;i am not able to compile thsi statment. It gives me the error like:&lt;BR /&gt;&lt;BR /&gt;Can't modify constant item in scalar assignment at af.pl line 2, near "),"&lt;BR /&gt;Execution of af.pl aborted due to compilation errors.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;And also what is the difference betwenn [] and [()] operatores in accessing the elements.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Jul 2009 10:03:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-access-elemt-in-array-from-perl/m-p/4470053#M361053</guid>
      <dc:creator>diwakar_4</dc:creator>
      <dc:date>2009-07-30T10:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to access elemt in array from perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-access-elemt-in-array-from-perl/m-p/4470054#M361054</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;A tutorial:&lt;BR /&gt;&lt;A href="http://www.comp.leeds.ac.uk/Perl/associative.html" target="_blank"&gt;http://www.comp.leeds.ac.uk/Perl/associative.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 30 Jul 2009 10:09:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-access-elemt-in-array-from-perl/m-p/4470054#M361054</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-07-30T10:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to access elemt in array from perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-access-elemt-in-array-from-perl/m-p/4470055#M361055</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;It's not clear exactly what you are trying to do.  You need to specify and array with the '@' sigil.  Then it appears that you want an array slice of elements 2 and 4.  Something like this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;my @a=('jan','feb','mar','apr','may','june','jul');&lt;BR /&gt;print join ' ', @a[(2,4)], "\n";&lt;BR /&gt;my @b=qw( jan feb mar apr may june jul);&lt;BR /&gt;print join ' ', @b[2,4], "\n";&lt;BR /&gt;&lt;BR /&gt;...You should use the 'strict' and 'warnings' pragmas as they will expose many errors.&lt;BR /&gt;&lt;BR /&gt;You can drop the inner parentheses from the slice as I show in the second example.&lt;BR /&gt;&lt;BR /&gt;@ SEP: You say you know Perl.  You should know then that this was a simple array and not a hash.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 30 Jul 2009 11:01:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-access-elemt-in-array-from-perl/m-p/4470055#M361055</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-07-30T11:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to access elemt in array from perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-access-elemt-in-array-from-perl/m-p/4470056#M361056</link>
      <description>Hi JRF,&lt;BR /&gt;&lt;BR /&gt;Many thanks&lt;BR /&gt;&lt;BR /&gt;Both the outputs are same. It means&lt;BR /&gt;@b[2,4]=@b[(2,4)]&lt;BR /&gt;&lt;BR /&gt;If both are same then why () is used, is any specify significance of this?&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 30 Jul 2009 11:31:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-access-elemt-in-array-from-perl/m-p/4470056#M361056</guid>
      <dc:creator>diwakar_4</dc:creator>
      <dc:date>2009-07-30T11:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to access elemt in array from perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-access-elemt-in-array-from-perl/m-p/4470057#M361057</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;I don't know of any reason why the parenthesis would have been used.  There's nothing to evalulate before the slice is taken.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 30 Jul 2009 11:49:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-access-elemt-in-array-from-perl/m-p/4470057#M361057</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-07-30T11:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to access elemt in array from perl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-access-elemt-in-array-from-perl/m-p/4470058#M361058</link>
      <description>Hi James,&lt;BR /&gt;&lt;BR /&gt;Thanks a lot. That is fine for me.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Diwakar</description>
      <pubDate>Fri, 31 Jul 2009 03:59:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-access-elemt-in-array-from-perl/m-p/4470058#M361058</guid>
      <dc:creator>diwakar_4</dc:creator>
      <dc:date>2009-07-31T03:59:42Z</dc:date>
    </item>
  </channel>
</rss>

