Well, if you really want to get into some Win32 Perl hacking, you can use Win32::Registry to get at some nice tidbits in the registry concerning the ip number and all. I don't remember if the Browser service dumps a list of computernames to the registry, so I'll have to double-check that. I'll cook you up a script or module in a few hours (once I finish some module rebuilding for my own project). Unfortunately, I found out one of the small quirks of Win32::Registry (which is one of the reasons why people advocate Win32::TieRegistry instead). In the module,
GSar hardwires all of the registry objects into the main space (or main symbol table). So, if you do write a module you'll have to do:
my $HKLM = Win32::Registry::_new(&HKEY_LOCAL_MACHINE); # _new is a pri
+vate constructor defined in the module
You'll have to do this for every root registry object. Instead of pinging the machine, you can do a remote connection with Connect method and write the results to file. Also, if you really want to get into the registry without using Win32::Registry, you can use Win32API and load the win32.dll file, which contains all of the functions in the Win32::Registry module. The only bad thing is that you'll have to look up the registry calls in the MSDN library to know what structure to throw at win32.dll.
On another note, I should have made it clear that qx() and backticks are, in fact, the same thing. I just like to use qx(), with parens as the normal delimiters, because it's usually the easiest to read. Of course, you can do qx##, qx**, qx$$, or whatever (so long as the delimiters match... also, you might want to stay away from certain delimiters since you might confuse them with variables/typeglobs/etc.). They will do exactly the same thing. Thanks
Juerd for pointing out that little error.
Theodore Charles III
Network Administrator
Los Angeles Senior High
4650 W. Olympic Blvd.
Los Angeles, CA 90019
323-937-3210 ext. 224
email->secon_kun@hotmail.com
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.