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.
In reply to Re: Get file version information in Perl
by GrandFather
in thread Get file version information in Perl
by salem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |