- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: Using lexicals in Perl 5
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2009 01:30 AM
03-12-2009 01:30 AM
Just a quickie question, is there any good way to "import" a lexical value (say f$getsyi("nodename")) to a variable in perl?
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?
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 :)
$node = `write sys$output f$getsyi("nodename")`;
Best regards
Fredrik Eriksson
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2009 03:37 AM
03-12-2009 03:37 AM
Solution$ perl -e "$node = qx(write sys\$output f\$getsyi(""nodename"")); print qq( -- $node --\n)"
-- TD183
--
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:
$ perl -e "print $ENV{q(SYS$LOGIN)}"
USER1:[HEIN]
Hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2009 04:00 AM
03-12-2009 04:00 AM
Re: Using lexicals in Perl 5
I need to store the nodename in a variable so I can distinguish which cluster machine I'm running the script on.
(Doing some monitoring stuff and need to check processes like SMTP_NODENAME_01).
Your solution worked perfectly.
$node = qx(write sys\$output f\$getsyi(""nodename""));
My mistake was that i tried to escape my quotation around nodename instead of doing ""nodename"".
Best regards
Fredrik Eriksson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2009 04:01 AM
03-12-2009 04:01 AM
Re: Using lexicals in Perl 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2009 06:55 AM
03-12-2009 06:55 AM
Re: Using lexicals in Perl 5
http://search.cpan.org/~dsugal/VMS_System-1_04/system/system.pm
Purely Personal Opinion