If you mean version information for a Windows Portable Executable format file (.exe, .dll, ...) then you may be interested in Win32::PEFile.

use strict; use warnings; use Win32::PEFile; my $filename = 'c:/windows/notepad.exe'; my $pe = Win32::PEFile->new (-file => $filename); my $strings = $pe->getVersionStrings (); printf "%-20s %s\n", $_, $strings->{$_} for sort keys %$strings; my $values = $pe->getFixedVersionValues(); printf "%-20s 0x%08x\n", $_, $values->{$_} for sort keys %$values;

Prints:

CompanyName Microsoft Corporation FileDescription Notepad FileVersion 5.1.2600.5512 (xpsp.080413-2105) InternalName Notepad LegalCopyright © Microsoft Corporation. All rights reserved. OriginalFilename NOTEPAD.EXE ProductName Microsoft® Windows® Operating System ProductVersion 5.1.2600.5512 dwFileDateLS 0x00000000 dwFileDateMS 0x00000000 dwFileFlags 0x00000000 dwFileFlagsMask 0x0000003f dwFileOS 0x00040004 dwFileSubtype 0x00000000 dwFileType 0x00000001 dwFileVersionLS 0x0a281588 dwFileVersionMS 0x00050001 dwProductVersionLS 0x0a281588 dwProductVersionMS 0x00050001 dwSignature 0xfeef04bd dwStrucVersion 0x00010000

This module release is very much a case of "Publish early, publish often" (although the "often" bit has been neglected). In particular, obvious error handling (like for a bad file name or path!) is absent at present.

True laziness is hard work

In reply to Re: Get file version information in Perl by GrandFather
in thread Get file version information in Perl by salem

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.