Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Getting a network name in Perl under OpenVMS 6.2

Posted on 1997-03-13
1
Medium Priority
?
210 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
1 Comment
 
LVL 1

Accepted Solution

by:
Kallisti earned 100 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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

886 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