Solved

Getting a network name in Perl under OpenVMS 6.2

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
compress files in RAR using perl 13 80
Removing file extension within a file. 4 92
ppm conversion to curl on a module install 8 82
Writing a parser for java language 4 78
I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
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 video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 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