[26003] in Perl-Users-Digest
Perl-Users Digest, Issue: 8222 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 2 18:05:28 2005
Date: Sat, 2 Jul 2005 15:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 2 Jul 2005 Volume: 10 Number: 8222
Today's topics:
Re: "Variable ... is not imported..." using an import <Peter@PSDT.com>
<%@ language=PerlScript%> 500 err <by @request.only>
Re: <%@ language=PerlScript%> 500 err <no@email.com>
Re: [ANNOUNCE] wxPerl 0.23 greymaus@gmaildo.ttocom
ActiveState license: I can't distribute perl with my Wi <nomail@sorry.com>
Re: ActiveState license: I can't distribute perl with m <no@email.com>
Re: ActiveState license: I can't distribute perl with m <me@privacy.net>
Re: ActiveState license: I can't distribute perl with m <nomail@sorry.com>
Re: ActiveState license: I can't distribute perl with m <r.kobes@uwinnipeg.ca>
Re: How do I implement open(FOO, "foo |") with fork()? (Anno Siegel)
Re: How do I implement open(FOO, "foo |") with fork()? <thepoet_nospam@arcor.de>
Re: How do I implement open(FOO, "foo |") with fork()? (Anno Siegel)
Re: remove sequence <tadmc@augustmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 02 Jul 2005 14:37:41 GMT
From: Peter Scott <Peter@PSDT.com>
Subject: Re: "Variable ... is not imported..." using an imported variable from a module
Message-Id: <pan.2005.07.02.14.37.36.714640@PSDT.com>
On Fri, 01 Jul 2005 07:04:28 -0700, Volker Nicolai wrote:
> #!/usr/local/bin/perl
>
> #use strict; # _1_
> use import_pack;
> # use vars qw($p_hash); # _2_
> # *p_hash = \%main::p_hash; # _3_
>
> # print "P_HASH: $::p_hash{x} , $::p_hash{y}\n"; # _4_
> print "P_HASH: $p_hash{x} , $p_hash{y}\n"; # _5_
>
> -------------------------------------------
> and the module import_pack.pm:
> -------------------------------------------
> #!/usr/local/bin/perl
>
> use Exporter;
>
> @ISA = qw(Exporter);
> @EXPORT = qw(%p_hash);
>
> %p_hash = (
> x => 123,
> y => 888,
> );
>
> 1;
> -------------------------------------------
>
> If I run it without use stricts it is fine.
> But if I use strict (_1_) then I need line _4_* instead of _5_,
> otherwise I get:
> Variable "%p_hash" is not imported at import_test.pl line 9
This is one of the most confusing messages this side of "... will not stay
shared..."
It is worth noting that you could get the same message with just this
script and no modules:
#!/path/to/perl
use strict;
%main::p_hash = ();
print $p_hash{x};
When perl gets to the last line, it sees a variable with no package
qualifier. Since strict vars is in effect, it looks to see if it's
a lexical, or permitted by use vars, or if it's $a/$b, etc - no dice on
any of those - or if it's imported into the current package.
You did no import, though. Because "use import_pack" is a compile time
"require import_pack" followed by "import_pack->import", and you had no
package called "import_pack", there was no call to Exporter->import.
At this point, perl is going to complain about the unqualified variable,
but it tries to be helpful and looks to see if there's a package variable
with the same name that isn't imported (this isn't quite what the flow of
control is intended to do but the effect is the same). Since you set
%p_hash in main:: (in a separate scope where strict wasn't enabled, thus
letting you get away with it), perl finds that and helpfully suggests that
you're referring to the wrong imported variable.
If all this is too confusing, just remember to set strict in all files and
for the target of a use statement to begin with a package declaration of
the same name (especially if it's using the Exporter).
--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/
------------------------------
Date: Sat, 2 Jul 2005 16:35:49 -0500
From: "Wayne B" <by @request.only>
Subject: <%@ language=PerlScript%> 500 err
Message-Id: <1ODxe.90511$yV4.52115@okepread03>
ActiveState Perl on XP IIS and iis asp.dll using localhost with .asp doc
<%@ language=PerlScript%> produces 500 err <script
language=PerlScript></script> works fine. All other syntax works fine.
Checked FAQ, Docs and searches. All I could find was Permissions set. I
don't think that is the issue. Also apache server shows html but no server
side results.What's up?
Thanks for any help!
------------------------------
Date: Sat, 02 Jul 2005 22:58:51 +0100
From: Brian Wakem <no@email.com>
Subject: Re: <%@ language=PerlScript%> 500 err
Message-Id: <3ioh0rFmdnbnU1@individual.net>
Wayne B wrote:
> ActiveState Perl on XP IIS and iis asp.dll using localhost with .asp doc
> <%@ language=PerlScript%> produces 500 err <script
> language=PerlScript></script> works fine. All other syntax works fine.
> Checked FAQ, Docs and searches. All I could find was Permissions set. I
> don't think that is the issue. Also apache server shows html but no server
> side results.What's up?
>
> Thanks for any help!
Check Apache's error log.
--
Brian Wakem
------------------------------
Date: 2 Jul 2005 13:22:01 GMT
From: greymaus@gmaildo.ttocom
Subject: Re: [ANNOUNCE] wxPerl 0.23
Message-Id: <slrndcd55h.1de.greymaus@maus.org>
On Thu, 30 Jun 2005 20:09:19 GMT, Mattia Barbon wrote:
> A new version of wxPerl, the Perl bindings to wxWidgets, is out!
>
> wxWidgets is a free and cross platform (Windows/Motif/GTK/Mac) C++ GUI
> toolkit with native look and feel. (visit http://www.wxwidgets.org/
> for details).
>
> You can download wxPerl sources from
> $CPAN/authors/id/M/MB/MBARBON/Wx-0.23.tar.gz;
>
> Screenshots: http://wxperl.sourceforge.net/sshot01.html
> Binary packages for ActivePerl/Win32 8xx builds, Red Hat
> Linux and Mac OS X are available along with documentation
> in HTML and MS HTML Help format from
> http://wxperl.sourceforge.net/download.html
>
> The project home page is http://wxperl.sourceforge.net/. There is also
> a mailing list dedicated to wxPerl users:
> wxperl-users@lists.sourceforge.net
>
> Changes since the last release:
> - Added wxArtProvider and Wx::PlArtProvider
> (thanks to Matthew "Cheetah" Gabeler-Lee).
> - Compatibility with wxWidgets 2.5.4, 2.6.0 and 2.6.1.
> - Added Wx::PlPreviewFrame, Wx::PlPreviewControlBar,
> Wx::PrintFactory.
> - Added Wx::PopupWindow and Wx::PopupTransientWindow.
> - Added Wx::DatePickerCtrl. (2.5/2.6)
> - Added Wx::MimeTypesManager.
>
> Regards
> Mattia
My System Slackware 10.0
Can't exec "wx-config": No such file or directory at
/usr/local/src/Wx-0.23/build/Wx/build/Config/Any_wx_config.pm line 10.
Use of uninitialized value in pattern match (m//) at
/usr/local/src/Wx-0.23/build/Wx/build/Config/Any_wx_config.pm line 11.
Use of uninitialized value in division (/) at
/usr/local/src/Wx-0.23/build/Wx/build/Config/Any_wx_config.pm line 12.
Use of uninitialized value in addition (+) at
/usr/local/src/Wx-0.23/build/Wx/build/Config/Any_wx_config.pm line 12.
Can't exec "wx-config": No such file or directory at
/usr/local/src/Wx-0.23/build/Wx/build/Config/Any_wx_config.pm line 53.
Use of uninitialized value in scalar chomp at
/usr/local/src/Wx-0.23/build/Wx/build/Config/Any_wx_config.pm line 54.
Use of uninitialized value in pattern match (m//) at
/usr/local/src/Wx-0.23/build/Wx/build/Config/Any_wx_config.pm line 88.
Unable to determine toolkit! at
/usr/local/src/Wx-0.23/build/Wx/build/Config/Any_wx_config.pm line 90.
--
greymaus
97.025% of statistics are wrong
------------------------------
Date: Sat, 02 Jul 2005 13:19:03 -0700
From: Arvin Portlock <nomail@sorry.com>
Subject: ActiveState license: I can't distribute perl with my Windows application?
Message-Id: <da6srp$1nng$1@agate.berkeley.edu>
I produce a number of perl programs for people in my
community but outside of my organization to use freely.
As my audience uses Windows and they have widely varying
technical skills, I really like to package everything
up into a single setup script so all they have to do is
install it and run it. I include a very minimal version
of ActiveState's perl, stripped down to just the few
modules and files needed to run the particular application.
I don't like to force my users to install anything else,
including perl. I don't want to force them to use ppm to
grab any additional modules they may need. I don't want
to teach them about PATHs and opening the command prompt
and navigating directories, executing perl or anything like
that. I like to set things up so all they need to do is
install my program, click an icon or drag a file and be
done with it.
So I had another look at the ActiveState license, and sure
enough, it looks like I'm in violation:
"You may make and give away verbatim copies of this
Package for personal use, or for use within your
organization, provided that you duplicate all of the
original copyright notices and associated disclaimers.
You may not distribute copies of this Package, or copies
of packages derived from this Package, to others outside
your organization without specific prior written per-
mission from ActiveState (although you are encouraged to
direct them to sources from which they may obtain it for
themselves)."
Does anybody know whether ActiveState looks favorably on
written requests for my type of distribution? Is my only other
alternative to use perl2exe?
Arvin
------------------------------
Date: Sat, 02 Jul 2005 22:07:27 +0100
From: Brian Wakem <no@email.com>
Subject: Re: ActiveState license: I can't distribute perl with my Windows application?
Message-Id: <3ioe0fFmdirdU1@individual.net>
Arvin Portlock wrote:
> I produce a number of perl programs for people in my
> community but outside of my organization to use freely.
> As my audience uses Windows and they have widely varying
> technical skills, I really like to package everything
> up into a single setup script so all they have to do is
> install it and run it. I include a very minimal version
> of ActiveState's perl, stripped down to just the few
> modules and files needed to run the particular application.
>
> I don't like to force my users to install anything else,
> including perl. I don't want to force them to use ppm to
> grab any additional modules they may need. I don't want
> to teach them about PATHs and opening the command prompt
> and navigating directories, executing perl or anything like
> that. I like to set things up so all they need to do is
> install my program, click an icon or drag a file and be
> done with it.
>
> So I had another look at the ActiveState license, and sure
> enough, it looks like I'm in violation:
>
> "You may make and give away verbatim copies of this
> Package for personal use, or for use within your
> organization, provided that you duplicate all of the
> original copyright notices and associated disclaimers.
> You may not distribute copies of this Package, or copies
> of packages derived from this Package, to others outside
> your organization without specific prior written per-
> mission from ActiveState (although you are encouraged to
> direct them to sources from which they may obtain it for
> themselves)."
Why don't you ask ActiveState for permission?
--
Brian Wakem
------------------------------
Date: Sat, 02 Jul 2005 21:23:19 GMT
From: Justin <me@privacy.net>
Subject: Re: ActiveState license: I can't distribute perl with my Windows application?
Message-Id: <slrndce1hk.p9k.me@sealab.socal.rr.com>
On 2005-07-02, Arvin Portlock <nomail@sorry.com> wrote:
>
>
> I produce a number of perl programs for people in my
> community but outside of my organization to use freely.
> As my audience uses Windows and they have widely varying
> technical skills, I really like to package everything
> up into a single setup script so all they have to do is
> install it and run it. I include a very minimal version
> of ActiveState's perl, stripped down to just the few
> modules and files needed to run the particular application.
>
> I don't like to force my users to install anything else,
> including perl. I don't want to force them to use ppm to
> grab any additional modules they may need. I don't want
> to teach them about PATHs and opening the command prompt
> and navigating directories, executing perl or anything like
> that. I like to set things up so all they need to do is
> install my program, click an icon or drag a file and be
> done with it.
>
> So I had another look at the ActiveState license, and sure
> enough, it looks like I'm in violation:
>
> "You may make and give away verbatim copies of this
> Package for personal use, or for use within your
> organization, provided that you duplicate all of the
> original copyright notices and associated disclaimers.
> You may not distribute copies of this Package, or copies
> of packages derived from this Package, to others outside
> your organization without specific prior written per-
> mission from ActiveState (although you are encouraged to
> direct them to sources from which they may obtain it for
> themselves)."
>
> Does anybody know whether ActiveState looks favorably on
> written requests for my type of distribution? Is my only other
> alternative to use perl2exe?
>
> Arvin
Attempting to obtain written permission is worth a shot.
However...
Why not write an installation program that fetches the software
from ActiveState's website? The AS package (not MSI) seems to
be installed on the system via a command-line installation
script (Installer.bat) -- with a little study of that script,
you should be able to write your own counterpart that would run
non-interactively.
Just a thought. If you can pull it off, you'd be complying with
the letter of the license (as I read it, anyway).
------------------------------
Date: Sat, 02 Jul 2005 14:17:34 -0700
From: Arvin Portlock <nomail@sorry.com>
Subject: Re: ActiveState license: I can't distribute perl with my Windows application?
Message-Id: <da709g$1png$1@agate.berkeley.edu>
Brian Wakem wrote:
> >So I had another look at the ActiveState license, and sure
> >enough, it looks like I'm in violation:
> >
> > "You may make and give away verbatim copies of this
> > Package for personal use, or for use within your
> > organization, provided that you duplicate all of the
> > original copyright notices and associated disclaimers.
> > You may not distribute copies of this Package, or copies
> > of packages derived from this Package, to others outside
> > your organization without specific prior written per-
> > mission from ActiveState (although you are encouraged to
> > direct them to sources from which they may obtain it for
> > themselves)."
>
> Why don't you ask ActiveState for permission?
Actually, It turns out I don't have to. When taking another look
at perl2exe (which wouldn't really work for me anyway, turns out),
I noticed IndigoPerl. Must have slipped by me the last time I was
at their website. IndigoPerl *can* be distributed without written
agreement, as long as the licenses, etc., are intact.
I may just shoot a request off to ActiveState so I don't have to
go back and repackage everything. I certainly have no complaints
with their requirements and restrictions on distribution, it's
quite understandable. But it's nice to have Indigoperl to fall back
on now. But I'm still wondering how ActiveState has responded to
requests like this in the past. Surely I can't be the only one?
Arvin
------------------------------
Date: Sat, 02 Jul 2005 16:50:31 -0500
From: Randy Kobes <r.kobes@uwinnipeg.ca>
Subject: Re: ActiveState license: I can't distribute perl with my Windows application?
Message-Id: <da727c$6oe$1@titan.uwinnipeg.ca>
Arvin Portlock wrote:
> Brian Wakem wrote:
>
>> >So I had another look at the ActiveState license, and sure
>> >enough, it looks like I'm in violation:
>> >
>> > "You may make and give away verbatim copies of this
>> > Package for personal use, or for use within your
>> > organization, provided that you duplicate all of the
>> > original copyright notices and associated disclaimers.
>> > You may not distribute copies of this Package, or copies
>> > of packages derived from this Package, to others outside
>> > your organization without specific prior written per-
>> > mission from ActiveState (although you are encouraged to
>> > direct them to sources from which they may obtain it for
>> > themselves)."
>>
>> Why don't you ask ActiveState for permission?
>
>
> Actually, It turns out I don't have to. When taking another look
> at perl2exe (which wouldn't really work for me anyway, turns out),
> I noticed IndigoPerl. Must have slipped by me the last time I was
> at their website. IndigoPerl *can* be distributed without written
> agreement, as long as the licenses, etc., are intact.
The current license for IndigoPerl:
http://www.indigostar.com/indigoperl.htm#License
might not, in some circumstances, be as simple as that:
3. You may make and give away verbatim copies of IndigoPerl
for personal use, or for use within your organization and
to others outside your organization, provided that you
duplicate all of the original copyright notices and
associated disclaimers.
4. You may not distribute copies of IndigoPerl or components
derived from IndigoPerl to others outside your organization
where IndigoPerl is bundled with a commercial product without
specific prior written permission from IndigoSTAR Software
except as noted below.
5. You may distribute copies of IndigoPerl or components
derived from IndigoPerl to others outside your organization
where IndigoPerl is bundled with a commercial product as
long as total sales of the bundled product do not exceed
$1000 US per year.
--
best regards,
randy kobes
------------------------------
Date: 2 Jul 2005 10:50:42 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How do I implement open(FOO, "foo |") with fork()?
Message-Id: <da5ri2$qbr$1@mamenchi.zrz.TU-Berlin.DE>
fishfry <fishfry@your-mailbox.com> wrote in comp.lang.perl.misc:
> What I mean is, when I call fork(), what is the sequence of fd
> manipulations to get the output of the child process redirected so that
> the parent can read it?
Open a pipe with READHANDLE and WRITEHANDLE before you fork. Then
fork and -- very important -- close READHANDLE in the child and
WRITEHANDLE in the parent. Now the parent can read from READHANDLE
everything the child writes to WRITEHANDLE. If you want to capture
the child's STDOUT, open STDOUT as a duplicate to WRITEHANDLE.
pipe R, W;
defined( my $pid = fork) or die "fork: $!";
if ( $pid ) {
close W;
print while <R>;
} else {
close R;
open STDOUT, '>&', fileno W;
print "$_\n" for qw( gaga gigi gugu);
}
Anno
------------------------------
Date: Sat, 02 Jul 2005 15:49:54 +0200
From: Christian Winter <thepoet_nospam@arcor.de>
Subject: Re: How do I implement open(FOO, "foo |") with fork()?
Message-Id: <42c69b75$0$10805$9b4e6d93@newsread4.arcor-online.net>
Anno Siegel wrote:
> pipe R, W;
> defined( my $pid = fork) or die "fork: $!";
> if ( $pid ) {
> close W;
> print while <R>;
> } else {
> close R;
You accidentially left out the vital
close STDOUT;
here.
> open STDOUT, '>&', fileno W;
> print "$_\n" for qw( gaga gigi gugu);
> }
-Chris
------------------------------
Date: 2 Jul 2005 14:56:02 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How do I implement open(FOO, "foo |") with fork()?
Message-Id: <da69u2$4ep$2@mamenchi.zrz.TU-Berlin.DE>
Christian Winter <thepoet_nospam@arcor.de> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:
> > pipe R, W;
> > defined( my $pid = fork) or die "fork: $!";
> > if ( $pid ) {
> > close W;
> > print while <R>;
> > } else {
> > close R;
>
> You accidentially left out the vital
> close STDOUT;
> here.
Opening a file handle implies closing of the current one if it is open.
When would explicit close of STDOUT make a difference?
>
> > open STDOUT, '>&', fileno W;
> > print "$_\n" for qw( gaga gigi gugu);
> > }
Anno
------------------------------
Date: Sat, 2 Jul 2005 07:48:35 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: remove sequence
Message-Id: <slrndcd393.7k2.tadmc@magna.augustmail.com>
Ross <a@cuhk.edu.hk> wrote:
> i can just simply use
>
> if (line =~ ^>.*)
> if (line =~ (.*)X(.*) )
> newline = $1;
You can?
How did you get it to compile?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 8222
***************************************