<?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 Using lexicals in Perl 5 in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/using-lexicals-in-perl-5/m-p/5162878#M41863</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Just a quickie question, is there any good way to "import" a lexical value (say f$getsyi("nodename")) to a variable in perl?&lt;BR /&gt;&lt;BR /&gt;I was thinking it would work as easy as just doing a write, but what device is supposed to write to perl from inside the script?&lt;BR /&gt;&lt;BR /&gt;Just as an demonstrative example something like this is what I'm trying to do. I know that sys$output is way off, but since I have no clue I'll use that as the example :)&lt;BR /&gt;&lt;BR /&gt;$node = `write sys$output f$getsyi("nodename")`;&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Fredrik Eriksson</description>
    <pubDate>Thu, 12 Mar 2009 08:30:34 GMT</pubDate>
    <dc:creator>Fredrik.eriksson</dc:creator>
    <dc:date>2009-03-12T08:30:34Z</dc:date>
    <item>
      <title>Using lexicals in Perl 5</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexicals-in-perl-5/m-p/5162878#M41863</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Just a quickie question, is there any good way to "import" a lexical value (say f$getsyi("nodename")) to a variable in perl?&lt;BR /&gt;&lt;BR /&gt;I was thinking it would work as easy as just doing a write, but what device is supposed to write to perl from inside the script?&lt;BR /&gt;&lt;BR /&gt;Just as an demonstrative example something like this is what I'm trying to do. I know that sys$output is way off, but since I have no clue I'll use that as the example :)&lt;BR /&gt;&lt;BR /&gt;$node = `write sys$output f$getsyi("nodename")`;&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Fredrik Eriksson</description>
      <pubDate>Thu, 12 Mar 2009 08:30:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexicals-in-perl-5/m-p/5162878#M41863</guid>
      <dc:creator>Fredrik.eriksson</dc:creator>
      <dc:date>2009-03-12T08:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using lexicals in Perl 5</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexicals-in-perl-5/m-p/5162879#M41864</link>
      <description>That'll work, but the executed string is subject to variable interpolation, and you will need to put 'ESCAPES', but for PERL and for DCL when using a one-liner:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$ perl -e "$node = qx(write sys\$output f\$getsyi(""nodename"")); print qq( -- $node --\n)"&lt;BR /&gt; -- TD183&lt;BR /&gt; --&lt;BR /&gt;&lt;BR /&gt;Please tell us EXACTLY what you want, because perl may have a build-in. For example for a logical you want to use the 'fake' %ENV array:&lt;BR /&gt;&lt;BR /&gt;$ perl -e "print $ENV{q(SYS$LOGIN)}"&lt;BR /&gt;USER1:[HEIN]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hth,&lt;BR /&gt;Hein.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Mar 2009 10:37:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexicals-in-perl-5/m-p/5162879#M41864</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2009-03-12T10:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using lexicals in Perl 5</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexicals-in-perl-5/m-p/5162880#M41865</link>
      <description>Well it's actually right there what I wanted to do.&lt;BR /&gt;&lt;BR /&gt;I need to store the nodename in a variable so I can distinguish which cluster machine I'm running the script on.&lt;BR /&gt;(Doing some monitoring stuff and need to check processes like SMTP_NODENAME_01).&lt;BR /&gt;&lt;BR /&gt;Your solution worked perfectly.&lt;BR /&gt;$node = qx(write sys\$output f\$getsyi(""nodename""));&lt;BR /&gt;&lt;BR /&gt;My mistake was that i tried to escape my quotation around nodename instead of doing ""nodename"".&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;Fredrik Eriksson</description>
      <pubDate>Thu, 12 Mar 2009 11:00:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexicals-in-perl-5/m-p/5162880#M41865</guid>
      <dc:creator>Fredrik.eriksson</dc:creator>
      <dc:date>2009-03-12T11:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using lexicals in Perl 5</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexicals-in-perl-5/m-p/5162881#M41866</link>
      <description>solution above</description>
      <pubDate>Thu, 12 Mar 2009 11:01:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexicals-in-perl-5/m-p/5162881#M41866</guid>
      <dc:creator>Fredrik.eriksson</dc:creator>
      <dc:date>2009-03-12T11:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using lexicals in Perl 5</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/using-lexicals-in-perl-5/m-p/5162882#M41867</link>
      <description>The VMS::system module may be helpful&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://search.cpan.org/~dsugal/VMS_System-1_04/system/system.pm" target="_blank"&gt;http://search.cpan.org/~dsugal/VMS_System-1_04/system/system.pm&lt;/A&gt;</description>
      <pubDate>Thu, 12 Mar 2009 13:55:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/using-lexicals-in-perl-5/m-p/5162882#M41867</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2009-03-12T13:55:02Z</dc:date>
    </item>
  </channel>
</rss>

