Solved

Getting a network name in Perl under OpenVMS 6.2

Posted on 1997-03-13
1
196 Views
Last Modified: 2010-05-18
In Perl under Unix I can have something like $name=`hostname` which will put the name of the local host into $name. Is there a more generic form of this that will also work under OpenVMS 6.2 or something that is specific to OpenVMS? I should add that I would prefer a full domain name to be returned rather than just the VMS node name.

Thanks for help in advance.
0
Comment
Question by:errol031297
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
Kallisti earned 50 total points
ID: 1203476
#!/usr/bin/perl

@addr = gethostent();

($a,$b,$c,$d) = unpack('C4',$_);

print "addr[0]:$a.$b.$c.$d\n";

Should dump out some info...  this means that, addr[0] should
be the name of the machine, and addr[4] should be the IP
address of it..  

BTW, you should have all the std C TCP stuff there...
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question