Solved

Getting a network name in Perl under OpenVMS 6.2

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Existing perl code to be changed for ftp to sftp handling 14 263
Any syntax error for this clone.plscript 6 149
Awk Question 2 136
octal error in perl program 3 42
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…
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…
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…

734 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