Skip Menu |

This queue is for tickets about the Getopt-Euclid CPAN distribution.

Report information
The Basics
Id: 29301
Status: resolved
Priority: 0/
Queue: Getopt-Euclid

People
Owner: Nobody in particular
Requestors: dillman [...] ria.buffalo.edu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Getopt::Euclid incompatable with ActiveState's perlapp.
Date: Tue, 11 Sep 2007 09:27:26 -0400
To: bug-getopt-euclid [...] rt.cpan.org
From: dillman [...] ria.buffalo.edu
Download smime.p7s
application/x-pkcs7-signature 5.4k

Message body not shown because it is not plain text.

Perl programs compiled into windows executables by ActiveState's perlapp don't have access to their own source code. This seems to be a problem for Getopt::Euclid. I've been able to recapture a (small) subset of Getopt::Euclid's functionality by using Pod::Usage and placing my POD in the __DATA__ section. Can Getopt::Euclid be modified to be able to read from <DATA> or the like? Thomas J. Dillman Research Institute on Addictions 1021 Main Street, Buffalo, NY 14203
Hi Thomas, Thanks for the bug report. Try to use the latest version of Getopt::Declare since significant changes have occured since you filed this issue. Please report here about your findings. If the bug is reproducible with the latest Getopt::Euclid version, maybe you could try to put the POD in a separate .pm file that you import from your main script. If you still have issues after trying the advices above, could you please give a step-by-step method to reproduce the bug? Best, Florent
Subject: Re: [rt.cpan.org #29301] Getopt::Euclid incompatable with ActiveState's perlapp.
Date: Tue, 5 Jul 2011 14:56:35 -0400
To: bug-Getopt-Euclid [...] rt.cpan.org
From: dillman [...] ria.buffalo.edu
Hello. Thank you for the response. I've not yet looked into Getopt::Declare as you suggest, but I've gone back and tested Getopt::Euclid as you've suggested. I've copied the code out of the SYNOPSIS section of the Getopt::Euclid man page and saved the results to a file named EuclidTest.pl. It's output when run directly from perl is not surprising. ------- C:\Users\dillman.RIA\Documents\Perl>perl EuclidTest.pl --help Usage: EuclidTest.pl -o <file> -s=<h>x<w> [options] EuclidTest.pl --help EuclidTest.pl --version Required arguments: -s[ize]=<h>x<w> Specify size of simulation -o[ut][file] <file> Specify output file Options: -i Specify interactive simulation -l[[en][gth]] <l> Length of simulation [default: 99] --version --usage --help --man Print the usual program information ------- When I compile this file using Activestate's perlapp to EuclidTest.exe: ------- C:\Users\dillman.RIA\Documents\Perl>EuclidTest.exe --help Usage: EuclidTest.exe EuclidTest.exe --help EuclidTest.exe --version C:\Users\dillman.RIA\Documents\Perl>EuclidTest.exe --man C:\Users\dillman.RIA\Documents\Perl>EuclidTest.exe --usage Usage: EuclidTest.exe EuclidTest.exe --help EuclidTest.exe --version C:\Users\dillman.RIA\Documents\Perl>EuclidTest.exe --version This is EuclidTest.exe version Tue Jul 5 13:43:06 2011 ---- I found the --version output surprising, but interesting. Putting the POD into a .pm would not really change the situation as all .pm files are compiled into the .exe . Pod::Usage seems to get around this problem by allowing you to specify file variable from which to read the POD. This allows use of the source code's __DATA__ section to hold the POD. Take the attached file for example: In this case, sending the "-input => \*main::DATA" parameters to Pod::Usage works around the problem of inaccessible source code. Thomas J. Dillman Research Institute on Addictions 1021 Main Street, Buffalo, NY 14203

Message body is not shown because sender requested not to inline it.

Hi Thomas, POD sections can be found in .pm and .pl files. In these files, the POD sections can be either interspersed in the code, or at the end of a file, typically after __END__. POD can also be found in .pod files. PerlApp is proprietary software from ActiveState, and I don't know exactly how it changes Perl programs and modules. I assume that when it transforms Perl code into an executable, the POD gets mangled. It seems like the bug you reported is really a bug with PerlApp and that you should try to report it to ActiveState. In the specific case you are mentioning, you are the author of the code, so, there might be workarounds to try: 1/ Getopt::Euclid imposes no restriction about where in a Perl file the POD is located. You can equally well have it interspersed in your code, in an __END__ section, or why not, in an __DATA__ section. Try to put your code in __DATA__ and see if it works better after it's been through PerlApp. 2/ POD can be placed in .pod files. I have not seen this before, but I assume that one could write a Module.pm file and associated Module.pod file. Getopt::Euclid does not currently support this, but if there was interest in this sort of behavior, then I could look into implementing it. Please let me know if any of this helps, Florent
Subject: Re: [rt.cpan.org #29301] Getopt::Euclid incompatable with ActiveState's perlapp.
Date: Fri, 8 Jul 2011 09:34:22 -0400
To: bug-Getopt-Euclid [...] rt.cpan.org
From: dillman [...] ria.buffalo.edu
I'm not trying to lay blame about who owns a bug. I'm just trying to point out that 2 pieces of software that are useful are also incompatible. PerlApp encapsulates source files in a way that is incompatible with source filters and Getopt::Euclid. Getopt::Euclid wants to get it's POD only from the program's own source. Interestingly, the only part of a program's own source that a program compiled with PerlApp can access is it's __DATA__ section via the \*main::DATA filehandle. Your Suggestion #1 (Use the __DATA__ section) is part of how I can make Pod::Usage (or Getopt::Long's stub functions to it) work in PerlApp compiled programs. It's workable, but I'm greedy & would like the lovely magic of Getopt::Euclid. Your Suggestion #2 (Have the parser look somewhere other than the program source) is the other half of how Pod::Usage works with PerlApp. Via the -input parameter of Pod::Usage::pod2usage(), I can hand the \*main::DATA filehandle (or as you suggest a .pod filename) to Pod::Usage and get a humble subset of the glory that is Getopt::Euclid. If Getopt::Euclid could mirror the functionality of Pod::Usage's -input parameter, we could deliver it's functionality to Windows boxes that are not blessed with a perl install. So in the end perhaps this is not a bug report but a feature request. I would like Getopt::Euclid to be able to read POD from a specified filename/filehandle. Thomas J. Dillman Research Institute on Addictions 1021 Main Street, Buffalo, NY 14203
Hi Thomas, To fix the problem properly involves you contacting ActiveState to let them know that their PerlApp does not handle POD gracefully. That is, if ActiveState listens to bug reports. For the next release of Getopt::Euclid, I will try to add support for .pod files. But rather than specifying them, they will likely be automatically detected, in the same way that you don't have to specify where in the Perl files the POD code is located, as it is automatically extracted from the entire Perl file. In the meantime, I was suggesting that you put your POD code in the __DATA__ section, compile it with PerlApp and use Getopt::Euclid to parse it, as Getopt::Euclid will look for POD code anywhere in a Perl file, not just after __END__. I know that most (all?) examples in the Getopt::Euclid documentation have the POD after __END__ but POD can be placed anywhere in Perl file. Florent
I've implemented code that makes Getopt::Euclid search for .pod files in version 0.2.5. I'm closing this bug. Please, have a look at it and re-open it if something is wrong. Florent