Loading ...
Sorry, an error occurred while loading the content.
 

RE: [PBML] Build date and time using PerlApp.

Expand Messages
  • Arthur Donchey
    Sorry, that did not work. C: Projects TestConstants.pl release TestConstants.exe Version = 1.1 Time = Thu Aug 25 15:37:24 2005
    Message 1 of 3 , Aug 25, 2005
      Sorry, that did not work.



      C:\Projects\TestConstants.pl>release\TestConstants.exe

      Version = 1.1

      Time = Thu Aug 25 15:37:24 2005

      C:\Projects\TestConstants.pl>release\TestConstants.exe

      Version = 1.1

      Time = Thu Aug 25 15:37:25 2005

      C:\Projects\TestConstants.pl>release\TestConstants.exe

      Version = 1.1

      Time = Thu Aug 25 15:37:26 2005

      C:\Projects\TestConstants.pl>release\TestConstants.exe

      Version = 1.1

      Time = Thu Aug 25 15:37:27 2005

      C:\Projects\TestConstants.pl>release\TestConstants.exe

      Version = 1.1

      Time = Thu Aug 25 15:37:29 2005

      C:\Projects\TestConstants.pl>release\TestConstants.exe

      Version = 1.1

      Time = Thu Aug 25 15:37:31 2005



      Here may test code:

      #!/usr/bin/perl



      use strict;

      use constant;



      use constant BUILD_TIME => scalar localtime();

      use constant VERSION => "1.1";



      sub main{

      print "\tVersion = ".VERSION."\n\tTime = ".BUILD_TIME;

      }



      main;





      Looks to me that even when compiled the PerlApp, it still parses (sp?) the
      Perl code each time. All I think the perlapp does when it parses is gets a
      list of modules to include and just make a big package with perl.exe, the
      modules and the perl script. (Just my theory)



      Here is another solution that I came up with, but it is not very good and
      has some problems. I use the files date stamp, which could (and will)
      change.



      <snip>

      my($exename);

      if ($PerlApp::BUILD){

      $exename = PerlApp::exe();

      }else{

      $exename = "GetIPConfig.pl";

      }



      my(@path) = split(/\\/,$exename);



      my($exe) = $path[$#path];

      my($compiledate) = scalar localtime((stat($exename))[9]);

      my($version) = "$exe Version 0.01 (build: $compiledate)\n";

      <snip>





      I am getting closer, thanks for the help so far.



      ----------------------------------------------------------

      "You don't know fear until you are on the International Space Station and
      the power goes out." -Dr. David A. Wolf
      <http://www.jsc.nasa.gov/Bios/htmlbios/wolf.html>
      http://www.jsc.nasa.gov/Bios/htmlbios/wolf.html




      Arthur Donchey

      rratt@...

      _____

      From: perl-beginner@yahoogroups.com [mailto:perl-beginner@yahoogroups.com]
      On Behalf Of Donato Azevedo
      Sent: Thursday, August 25, 2005 1:02 PM
      To: perl-beginner@yahoogroups.com
      Subject: RE: [PBML] Build date and time using PerlApp.



      Perl has a good way to deal with constants wich is: you define them as
      variables and during parse time they are optimized as constants. Therefore
      you may use something like:
      $TIME = localtime();
      $VERSION = 1.1 #or whatever

      Since you parse it only once (during perlapp's parse phase) the values will
      remain through the following runs (if there's such a word..hehe)

      Donato Azevedo


      -----Original Message-----
      From: "Arthur Donchey"<adonchey-l@...>
      Sent: 8/25/05 12:01:37 PM
      To: "perl-beginner@yahoogroups.com"<perl-beginner@yahoogroups.com>
      Subject: [PBML] Build date and time using PerlApp.



      I am an old programmer, but somewhat new to Perl (and Perlapp). In
      VC++, I
      like using the constants __DATE__ and __TIME__ to keep track of the
      build
      date and time. The are defined be the compiler at build time.



      Example:



      #define VERSION 0.01

      printf("\nMyProgram version %5.2f (build %s
      %s)\n",VERSION,__DATE__,__TIME__);



      I am trying to do the same thing when building an executable using
      PerlApp.
      I can't seem to find any command line parameters or in code constants
      that
      will do this. I was trying to create a temp file during the build
      process
      and include it, but that didn't work to well. Creating the temp file
      was
      not the problem, but including it seemed a little flaky. PerlApp has a
      couple variable (like $PerlApp::BUILD and $PerlApp::VERSION), but they
      are
      the build and version number for PerlApp. I am using the "--info name =
      val
      ; ..." parameter to put information into the exe header. Is there a way
      to
      extract that information? It would also help if it would not give me
      any
      error if I just run the .pl file.



      If someone could just point me in the right direction, I would
      appreciate
      it. Thanks.





      ----------------------------------------------------------

      "You don't know fear until you are on the International Space Station
      and
      the power goes out." -Dr. David A. Wolf
      <http://www.jsc.nasa.gov/Bios/htmlbios/wolf.html>
      http://www.jsc.nasa.gov/Bios/htmlbios/wolf.html




      Arthur Donchey

      rratt@...





      [Non-text portions of this message have been removed]




      Unsubscribing info is here:
      http://help.yahoo.com/help/us/groups/groups-32.html
      Yahoo! Groups Links









      Unsubscribing info is here:
      http://help.yahoo.com/help/us/groups/groups-32.html




      _____

      YAHOO! GROUPS LINKS



      * Visit your group "perl-beginner
      <http://groups.yahoo.com/group/perl-beginner> " on the web.

      * To unsubscribe from this group, send an email to:
      perl-beginner-unsubscribe@yahoogroups.com
      <mailto:perl-beginner-unsubscribe@yahoogroups.com?subject=Unsubscribe>

      * Your use of Yahoo! Groups is subject to the Yahoo!
      <http://docs.yahoo.com/info/terms/> Terms of Service.



      _____



      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.