So, I'm having a bit of trouble with a simple program I've (poorly) written to find version information, etc. about various executables. An xml file is supplied containing the executable name, the command line option to find the version, and (usually) the line number of the output from the previous command on which the actual version appears. My problem is this - it works fine on my test cases of ruby and perl, but when it gets to python the output of the "python -V" command is printed to the screen instead of being taken in by the PULLINFO filehandle, and it thus does not get passes along to the rest of the program. Does anyone know why this is? I'm assuming that it has something to do with the way that python's "-V" command operates internally, but I don't really have a whole lot of understanding on the matter myself. I also assume that their are many ways to better do what I'm trying to, and I'd certainly be open to hearing about them as well (however, due to constraints at work I am unable to install modules without a good deal of difficulty). Here is a code snippet of the relevant portion:
#%executables is a hash of hashes, keyed by the executable name, and w +ithin that hash by names corresponding to the xml file - flag, versio +n, etc. #$exName is the name of the executable being dealt with in the curren +t loop iteration. open (PULLINFO, "$exName $executables{$exName}{'flag'} |") or die("bla +sted cutthroats... can't they refrain from \"$! \"-ing?"); my @versInfo = <PULLINFO>; close PULLINFO; unless($versInfo[$executables{$exName}{"opLine"}]=~ /((?:\d+)(?:\. +\d+)+)/ and $executables{$exName}{"version"}= $1) { FINDFO:foreach (@versInfo) { if(/((?:\d+)(?:\.\d+)+)/){$executables{$exName}{"version"} + = $1;last FINDFO;} } }
Any help would be much appreciated :ロ]
~~~~~~~~~~~~~~~~~~~~~~
Timshel - bloody heck yes.

In reply to version retrieval difficulties by Snigwel

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.