Solved

Getting a network name in Perl under OpenVMS 6.2

Posted on 1997-03-13
1
178 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 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now