[29268] in Perl-Users-Digest
Perl-Users Digest, Issue: 512 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 14 03:10:06 2007
Date: Thu, 14 Jun 2007 00:09:05 -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 Thu, 14 Jun 2007 Volume: 11 Number: 512
Today's topics:
How to check the perl's syntax error before runing the <sonet.all@msa.hinet.net>
Re: How to check the perl's syntax error before runing <jurgenex@hotmail.com>
Massive Memory Structures ruu@cwcom.net
new CPAN modules on Thu Jun 14 2007 (Randal Schwartz)
PAR on OS X <kw@codebykevin.com>
Re: PAR on OS X <spamtrap@dot-app.org>
Re: perl and php noident@my-deja.com
Perl Bug??? <Mike.Thorland@sas.com>
Re: Perl Bug??? <mritty@gmail.com>
Re: Perl Bug??? <bart.lateur@pandora.be>
Re: Perl Bug??? usenet@DavidFilmer.com
Re: Perl Bug??? <Mike.Thorland@sas.com>
Re: Perl Bug??? <mritty@gmail.com>
Re: Perl Bug??? <mritty@gmail.com>
Re: perl vs C for CGI <stoupa@practisoft.cz>
Re: perl vs C for CGI saran.jegan@gmail.com
Re: variable scope <joe@inwap.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 14 Jun 2007 12:15:01 +0800
From: "sonet" <sonet.all@msa.hinet.net>
Subject: How to check the perl's syntax error before runing the code?
Message-Id: <f4qhd7$184$1@netnews.hinet.net>
How to check the perl's syntax error but does not execute it?
The eclipse (PERL EPIC Project) can check the perl's syntax
error when the code does not in runtime.
And it support source format the perl's code.Have any rules
can do that?
------------------------------
Date: Thu, 14 Jun 2007 05:04:15 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: How to check the perl's syntax error before runing the code?
Message-Id: <j%3ci.4524$4t5.479@trndny07>
sonet wrote:
> How to check the perl's syntax error but does not execute it?
Trivial. Did you check the documentation of perl?
From "perldoc perlrun":
-c causes Perl to check the syntax of the program and then exit
without executing it. [...]
jue
------------------------------
Date: Wed, 13 Jun 2007 13:44:09 -0700
From: ruu@cwcom.net
Subject: Massive Memory Structures
Message-Id: <1181767449.369682.26370@j4g2000prf.googlegroups.com>
OK - I was under the impression that perl running on a 64 bit OS,
compiled for said 64 bit OS would be able to handle data structures in
memory greater than 4G in size. I've tried this with a couple of OS's
(Solaris on sparc, Solaris on x86_64) with both packaged and compiled
versions of perl with identical results - as soon as I hit 4G with my
script, I get an out of memory error and the script dies.
I'm pretty sure I don't have a ulimit issue, since more or less
everything is unlimited, and other programs run by the same user can
access over 4G of ram quite happily.
Two questions:
1) Is it possible to access a structure over 4G with perl running on
Solaris?
2) If so, what options do I need to compile in to make this happen.
Dave
------------------------------
Date: Thu, 14 Jun 2007 04:42:10 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Thu Jun 14 2007
Message-Id: <JJLzqA.GMz@zorch.sf-bay.org>
The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN). You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.
App-Build-0.67
http://search.cpan.org/~mbarbon/App-Build-0.67/
extends Module::Build to build/install/configure entire applications (i.e. web applications), not just modules and programs
----
Bundle-OpenXPKI-0.03
http://search.cpan.org/~alech/Bundle-OpenXPKI-0.03/
A bundle to install modules required for OpenXPKI
----
Business-KontoCheck-2.1
http://search.cpan.org/~michel/Business-KontoCheck-2.1/
Perl extension for checking German and Austrian Bank Account Numbers
----
Business-OnlinePayment-3.00_08
http://search.cpan.org/~ivan/Business-OnlinePayment-3.00_08/
Perl extension for online payment processing
----
Catalyst-Component-ACCEPT_CONTEXT-0.03
http://search.cpan.org/~jrockway/Catalyst-Component-ACCEPT_CONTEXT-0.03/
Make the current Catalyst request context available in Models and Views.
----
Class-C3-XS-0.08
http://search.cpan.org/~blblack/Class-C3-XS-0.08/
XS speedups for Class::C3
----
Config-Apt-Sources-0.01
http://search.cpan.org/~iank/Config-Apt-Sources-0.01/
Parse and manipulate apt sources
----
Config-Basic-1.85
http://search.cpan.org/~fdulau/Config-Basic-1.85/
----
DBI-1.56_91
http://search.cpan.org/~timb/DBI-1.56_91/
Database independent interface for Perl
----
DBIx-Class-0.07999_06
http://search.cpan.org/~blblack/DBIx-Class-0.07999_06/
Extensible and flexible object <-> relational mapper.
----
EasyCGI-2.0.4
http://search.cpan.org/~foolfish/EasyCGI-2.0.4/
Perl CGI Interface
----
Fatal-Exception-0.0101
http://search.cpan.org/~dexter/Fatal-Exception-0.0101/
succeed or throw exception
----
File-LinkTree-Builder-0.001
http://search.cpan.org/~rjbs/File-LinkTree-Builder-0.001/
builds a tree of symlinks based on file metadata
----
Lemonldap-NG-Manager-0.7
http://search.cpan.org/~guimard/Lemonldap-NG-Manager-0.7/
Perl extension for managing Lemonldap::NG Web-SSO system.
----
Lemonldap-NG-Portal-0.74
http://search.cpan.org/~guimard/Lemonldap-NG-Portal-0.74/
The authentication portal part of Lemonldap::NG Web-SSO system.
----
Linux-Taskstats-Read-4.00
http://search.cpan.org/~scottw/Linux-Taskstats-Read-4.00/
Read Linux taskstats structures
----
Net-Amazon-Thumbnail-0.01
http://search.cpan.org/~ityndall/Net-Amazon-Thumbnail-0.01/
Use the Amazon Alexa Site Thumbnail web service
----
Net-Amazon-Thumbnail-0.02
http://search.cpan.org/~ityndall/Net-Amazon-Thumbnail-0.02/
Use the Amazon Alexa Site Thumbnail web service
----
Net-Amazon-Thumbnail-0.03
http://search.cpan.org/~ityndall/Net-Amazon-Thumbnail-0.03/
Use the Amazon Alexa Site Thumbnail web service
----
Net-Amazon-Thumbnail-0.04
http://search.cpan.org/~ityndall/Net-Amazon-Thumbnail-0.04/
Use the Amazon Alexa Site Thumbnail web service
----
Net-Amazon-Thumbnail-0.05
http://search.cpan.org/~ityndall/Net-Amazon-Thumbnail-0.05/
Use the Amazon Alexa Site Thumbnail web service
----
Nmap-Parser-1.1
http://search.cpan.org/~apersaud/Nmap-Parser-1.1/
parse nmap scan data with perl
----
Nmap-Parser-1.11
http://search.cpan.org/~apersaud/Nmap-Parser-1.11/
parse nmap scan data with perl
----
WebService-Hatena-Graph-0.05
http://search.cpan.org/~kentaro/WebService-Hatena-Graph-0.05/
A Perl interface to Hatena::Graph API
----
WebService-Hatena-Graph-0.06
http://search.cpan.org/~kentaro/WebService-Hatena-Graph-0.06/
A Perl interface to Hatena::Graph API
----
Weed-0.0034
http://search.cpan.org/~hooo/Weed-0.0034/
----
XML-Bare-0.01
http://search.cpan.org/~codechild/XML-Bare-0.01/
Minimal XML parser implemented via a C++ state engine
----
XML-Bare-0.02
http://search.cpan.org/~codechild/XML-Bare-0.02/
Minimal XML parser implemented via a C++ state engine
If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.
This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
http://www.stonehenge.com/merlyn/LinuxMag/col82.html
print "Just another Perl hacker," # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 13 Jun 2007 21:40:20 -0400
From: Kevin Walzer <kw@codebykevin.com>
Subject: PAR on OS X
Message-Id: <30491$46709c84$4275d90a$15963@FUSE.NET>
Anyone using PAR on OS X to deploy standalone Perl applications? Does
this work with universal binaries?
--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
------------------------------
Date: Thu, 14 Jun 2007 00:03:11 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: PAR on OS X
Message-Id: <m23b0vnpxc.fsf@local.wv-www.com>
Kevin Walzer <kw@codebykevin.com> writes:
> Anyone using PAR on OS X to deploy standalone Perl applications?
I am. CamelBones includes several prebuilt .par "kits". One for DBI and
DBIx related modules, one for XML modules, one for Catalyst, and so on.
Just add the .par file to your CamelBones app in your Xcode project. Xcode
doesn't know what to do with .par files, but it turns out that the default
of copying it into Resources/ is what we wanted anyway.
Then edit your main.pl, so that instead of this:
use strict;
use warnings;
use CamelBones qw(:All);
You have this:
use strict;
use warnings;
BEGIN {
use CamelBones qw(:All);
my $resDir = NSBundle->mainBundle()->resourcePath();
eval "use PAR '$resDir/*.par'";
}
This will put all of the PAR-bundled modules in @INC
Have a look at the "Snapshots" section here:
<http://camelbones.sourceforge.net/download/cvs-install.html>
This is a stand-alone app that includes PARs for DBI, DBD::Mysql, and
DBD::Pg, built for both 5.8.1 (10.3 "Panther") and 5.8.6 (10.4 "Tiger"),
with the Tiger version a Universal Binary.
Don't expect miracles of productivity from this "app", btw - it's only
intended to demonstrate how to use PARs in standalone Cocoa apps.
> Does this work with universal binaries?
Yes, but XS modules are a pain to build. You need version-specific subdirs
for the different versions of Perl that Apple has shipped and you intend to
support.
The approach I've taken when packaging PARs is to use a script that drives
the CPAN.pm module's programmatic interface. With two or three different OS
versions - with their accompanying Perl versions - to support, automation is
the key.
I do this by copying older versions of Perl from old OS media. As one would
reasonably expect, these old versions will run fine on the current OS version.
Basically, I get /usr/bin/perl5.x.y and /System/Library/Perl/*.
Make sure that your Tiger Perl 5.8.6 is a Universal Binary - if you bought
10.4.0 for your PPC, and you've been upgrading since, it might not be. If
it's not, you'll need access to the install media for a UB installation of
10.4.x; copy the UB Perl binary and /System/Library/Perl/* files from it.
Pacifist is a nice way to extract specific files from the OS install disks.
Now, with multiple platform SDKs and Perls to match them, I can build modules
that are compatible with every Apple-supplied Perl. I take care that the 10.4
"Tiger" binaries are Universal.
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
------------------------------
Date: Wed, 13 Jun 2007 17:06:07 -0700
From: noident@my-deja.com
Subject: Re: perl and php
Message-Id: <1181779567.685795.271680@g37g2000prf.googlegroups.com>
On Jun 12, 9:19 pm, peter <p...@juno.com> wrote:
> I have been away from UNIX software for quite awhile and want to get
> back into it. I liked "C" but Java seems like the way to go for
> compiled langs, now days so I will learn that.
There is also C++, which seems to be in use, but yes, Java is the
flavour of the day these days.
> At one time, I did a bit of perl but now I see php alot. I was
> wondering what you guys thinks of the pros/cons of perl and php.
If you intend for it to be the tool of the trade (to earn a living),
then PHP pays awfully low (at least in my country). Perl pays better,
but not as high as Java and C++, which are in greater demand.
If you want to just develop apps for websites, especially if you want
to collaborate with other developers on this, then PHP is the language
of the web these days (like it or not).
However, stuff written in Perl will run for a hundred years, PHP
doesn't seem to bother a lot with backward compatibility between major
releases, e.g. stuff written in php4 may not run in php5, really.
Also, Perl is a useful tool for a system administrator, if you swing
that way, and PHP isn't.
------------------------------
Date: Wed, 13 Jun 2007 14:34:12 -0400
From: "Mike Thorland" <Mike.Thorland@sas.com>
Subject: Perl Bug???
Message-Id: <f4pdb4$6e4$1@foggy.unx.sas.com>
This was tested with Perl 5.8.5 and 5.6.1
Test Program:
sub Foo() {
print "array_test: @array_test\n";
$shellcmd = "/bin/echo hi'";
open SHELLCMD, "$shellcmd |" or
die "Could not open shellcmd $!\n";
while (<SHELLCMD>) { } # do nothing - works with backticks not with shell
loop
close SHELLCMD;
print "array_test: @array_test\n";
}
@array_test = ("one");
for (@array_test) {
Foo();
}
Output:
array_test: one
array_test:
Why does array_test become unitialized? Yet if I add a loop variable for
@array_test ...
for $bar (@array_test) {
Foo();
}
It works:
Output:
array_test: one
array_test: one
------------------------------
Date: Wed, 13 Jun 2007 12:11:43 -0700
From: Paul Lalli <mritty@gmail.com>
Subject: Re: Perl Bug???
Message-Id: <1181761903.532008.212050@i38g2000prf.googlegroups.com>
On Jun 13, 2:34 pm, "Mike Thorland" <Mike.Thorl...@sas.com> wrote:
> Subject: Perl Bug???
Whenever you find yourself wanting to type something like that, you
should really count to 10 and ask yourself what's more likely - that
there's a new and undiscovered bug in the language that's been used
worldwide for 20 years that you just happened to find, or that you
either did something wrong or don't understand the results you're
seeing.
> This was tested with Perl 5.8.5 and 5.6.1
>
> Test Program:
>
> sub Foo() {
> print "array_test: @array_test\n";
>
> $shellcmd = "/bin/echo hi'";
> open SHELLCMD, "$shellcmd |" or
> die "Could not open shellcmd $!\n";
> while (<SHELLCMD>) { } # do nothing - works with backticks not with shell
> loop
> close SHELLCMD;
>
> print "array_test: @array_test\n";
>
> }
>
> @array_test = ("one");
> for (@array_test) {
> Foo();
>
> }
>
> Output:
>
> array_test: one
> array_test:
>
> Why does array_test become unitialized?
It doesn't. The only element of @array_test, however does. If you'd
enabled warnings, you would see Perl tell you that you're printing an
undefined value, rather than printing no values. You could also
examine the contents of @array_test more precisely with the
Data::Dumper module.
perldoc perlsyn
describes how for each loop works. When you don't give a loop
iterator variable, Perl localizes $_ and uses that. In your foreach
loop, $_ is an ALIAS to the element of the list you're iterating over,
meaning that changes to $_ will change the list itself.
In your subroutine, you are using $_ implicitly once more, this time
to iterate over the "/bin/echo hi |" shell command's output. In each
iteration of your while loop, $_ gets assigned to the current line of
output. When the output is exhausted, the readline operator (ie,
<SHELLCMD>) returns undef, and so $_ gets the value undef. But
remember that you've already aliased $_ to be the current element of
@array_test. So since you just changed $_, you've also changed the
current element of @array_test.
> Yet if I add a loop variable for
> @array_test ...
>
> for $bar (@array_test) {
> Foo();
>
> }
>
> It works:
>
> Output:
>
> array_test: one
> array_test: one
Right, because this example doesn't use the localized $_, so the
function call doesn't get a chance to change your array elements.
Best practice - don't rely on the implicit nature of $_ for either for
loops nor while loops. If you must use $_, then localize it
beforehand. If you'd put the statement "local $_;" before you began
your while loop, you'd be working with a temporary value of $_ that
was not aliased to the foreach's list, and this "bug" would not have
appeared.
Paul Lalli
P.S. To help you see what's happening, please take a look at this
modified program, based off your example:
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my @array_test;
sub Foo() {
print "array_test: ", Dumper(\@array_test);
my $shellcmd = "/bin/echo hi'";
open SHELLCMD, "$shellcmd |" or
die "Could not open shellcmd $!\n";
while (<SHELLCMD>) {
print "$. - ", Dumper(\@array_test);
}
close SHELLCMD;
print "array_test: ", Dumper(\@array_test);
}
@array_test = ("one");
for (@array_test) {
Foo();
}
------------------------------
Date: Wed, 13 Jun 2007 19:31:07 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Perl Bug???
Message-Id: <9eh073tabg5snptk91ff6ib1hvrej7unaq@4ax.com>
Paul Lalli wrote:
>Whenever you find yourself wanting to type something like that, you
>should really count to 10 and ask yourself what's more likely - that
>there's a new and undiscovered bug in the language that's been used
>worldwide for 20 years that you just happened to find, or that you
>either did something wrong or don't understand the results you're
>seeing.
Pooh. I'm sure then are dozens of bugs in perl. Perl evolves. New bugs
get added every year.
--
Bart.
------------------------------
Date: Wed, 13 Jun 2007 19:55:44 -0000
From: usenet@DavidFilmer.com
Subject: Re: Perl Bug???
Message-Id: <1181764544.515805.259560@n15g2000prd.googlegroups.com>
On Jun 13, 12:31 pm, Bart Lateur <bart.lat...@pandora.be> wrote:
> Pooh. I'm sure then are dozens of bugs in perl. Perl evolves. New bugs
> get added every year.
I don't think Paul was claiming that Perl has no bugs. I think he was
pointing out that it is unlikely that a noob would actually uncover a
genuine bug with nothing more than a small, simple test program (and
that immediately suspecting a language fault instead of user-error is
implausible).
--
The best way to get a good answer is to ask a good question.
David Filmer (http://DavidFilmer.com)
------------------------------
Date: Wed, 13 Jun 2007 16:21:03 -0400
From: "Mike Thorland" <Mike.Thorland@sas.com>
Subject: Re: Perl Bug???
Message-Id: <f4pjjh$a0a$1@foggy.unx.sas.com>
I never realized that in Perl loop variables allow you to directly change
the contents of an array. I always thought they were merely a copy.
Test Program:
@array_test = ("original value");
for $bar (@array_test) {
$bar = "new value";
}
print "array_test: @array_test\n";
Output:
array_test: new value
Thanks!
"Paul Lalli" <mritty@gmail.com> wrote in message
news:1181761903.532008.212050@i38g2000prf.googlegroups.com...
> On Jun 13, 2:34 pm, "Mike Thorland" <Mike.Thorl...@sas.com> wrote:
>> Subject: Perl Bug???
>
> Whenever you find yourself wanting to type something like that, you
> should really count to 10 and ask yourself what's more likely - that
> there's a new and undiscovered bug in the language that's been used
> worldwide for 20 years that you just happened to find, or that you
> either did something wrong or don't understand the results you're
> seeing.
>
>> This was tested with Perl 5.8.5 and 5.6.1
>>
>> Test Program:
>>
>> sub Foo() {
>> print "array_test: @array_test\n";
>>
>> $shellcmd = "/bin/echo hi'";
>> open SHELLCMD, "$shellcmd |" or
>> die "Could not open shellcmd $!\n";
>> while (<SHELLCMD>) { } # do nothing - works with backticks not with
>> shell
>> loop
>> close SHELLCMD;
>>
>> print "array_test: @array_test\n";
>>
>> }
>>
>> @array_test = ("one");
>> for (@array_test) {
>> Foo();
>>
>> }
>>
>> Output:
>>
>> array_test: one
>> array_test:
>>
>> Why does array_test become unitialized?
>
> It doesn't. The only element of @array_test, however does. If you'd
> enabled warnings, you would see Perl tell you that you're printing an
> undefined value, rather than printing no values. You could also
> examine the contents of @array_test more precisely with the
> Data::Dumper module.
>
> perldoc perlsyn
> describes how for each loop works. When you don't give a loop
> iterator variable, Perl localizes $_ and uses that. In your foreach
> loop, $_ is an ALIAS to the element of the list you're iterating over,
> meaning that changes to $_ will change the list itself.
>
> In your subroutine, you are using $_ implicitly once more, this time
> to iterate over the "/bin/echo hi |" shell command's output. In each
> iteration of your while loop, $_ gets assigned to the current line of
> output. When the output is exhausted, the readline operator (ie,
> <SHELLCMD>) returns undef, and so $_ gets the value undef. But
> remember that you've already aliased $_ to be the current element of
> @array_test. So since you just changed $_, you've also changed the
> current element of @array_test.
>
>> Yet if I add a loop variable for
>> @array_test ...
>>
>> for $bar (@array_test) {
>> Foo();
>>
>> }
>>
>> It works:
>>
>> Output:
>>
>> array_test: one
>> array_test: one
>
> Right, because this example doesn't use the localized $_, so the
> function call doesn't get a chance to change your array elements.
>
> Best practice - don't rely on the implicit nature of $_ for either for
> loops nor while loops. If you must use $_, then localize it
> beforehand. If you'd put the statement "local $_;" before you began
> your while loop, you'd be working with a temporary value of $_ that
> was not aliased to the foreach's list, and this "bug" would not have
> appeared.
>
> Paul Lalli
>
> P.S. To help you see what's happening, please take a look at this
> modified program, based off your example:
> #!/usr/bin/perl
> use strict;
> use warnings;
> use Data::Dumper;
>
> my @array_test;
> sub Foo() {
> print "array_test: ", Dumper(\@array_test);
>
> my $shellcmd = "/bin/echo hi'";
> open SHELLCMD, "$shellcmd |" or
> die "Could not open shellcmd $!\n";
> while (<SHELLCMD>) {
> print "$. - ", Dumper(\@array_test);
> }
> close SHELLCMD;
>
> print "array_test: ", Dumper(\@array_test);
>
> }
>
> @array_test = ("one");
> for (@array_test) {
> Foo();
> }
>
>
------------------------------
Date: Wed, 13 Jun 2007 13:40:10 -0700
From: Paul Lalli <mritty@gmail.com>
Subject: Re: Perl Bug???
Message-Id: <1181767210.523662.139350@d30g2000prg.googlegroups.com>
On Jun 13, 4:21 pm, "Mike Thorland" <Mike.Thorl...@sas.com> wrote:
> I never realized that in Perl loop variables allow you to directly
> change the contents of an array. I always thought they were merely
> a copy.
Like I said, `perldoc persyn`:
LABEL foreach VAR (LIST) BLOCK
. . .
If any element of LIST is an lvalue, you can modify it by
modifying VAR inside the loop. Conversely, if any element
of LIST is NOT an lvalue, any attempt to modify that element
will fail. In other words, the "foreach" loop index
variable is an implicit alias for each item in the list that
you're looping over.
> Thanks!
You're quite welcome.
Paul Lalli
------------------------------
Date: Wed, 13 Jun 2007 14:04:15 -0700
From: Paul Lalli <mritty@gmail.com>
Subject: Re: Perl Bug???
Message-Id: <1181768655.399416.206850@g37g2000prf.googlegroups.com>
On Jun 13, 3:31 pm, Bart Lateur <bart.lat...@pandora.be> wrote:
> Paul Lalli wrote:
> >Whenever you find yourself wanting to type something like that, you
> >should really count to 10 and ask yourself what's more likely - that
> >there's a new and undiscovered bug in the language that's been used
> >worldwide for 20 years that you just happened to find, or that you
> >either did something wrong or don't understand the results you're
> >seeing.
>
> Pooh. I'm sure then are dozens of bugs in perl. Perl evolves. New bugs
> get added every year.
I don't recall saying anything contrary to that.
When you write a program that doesn't work the way you expect,
however, suspecting a bug in the language is the LAST resort.
Suspecting that you made an error or don't understand is the first.
Paul Lalli
------------------------------
Date: Thu, 14 Jun 2007 03:22:39 +0200
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: perl vs C for CGI
Message-Id: <f4q69r$28ud$1@ns.felk.cvut.cz>
Peter J. Holzer wrote:
> On 2007-06-13 10:49, Petr Vileta <stoupa@practisoft.cz> wrote:
>> Maybe Apache 2.x, I don't know, but Apache 1.2 have problem with
>> windows like end-of-line. I have this on my Linux server and anytime
>> I forget to convert cgi file to unix format I get the same error
>> message.
>
> If you don't convert the *script* (as opposed to print statements
> within the script), apache probably can't even start the script
> because the linux kernel will try to invoke "/usr/bin/perl\r" which
> doesn't exist. You can test this by running the script from the
> command line.
> Since a script which doesn't run can't produce any headers, you'll get
> the "premature end of script headers" error. But the problem is that
> there are no headers at all not that they have the wrong line endings.
>
I have my Apache setting for not send any (automatic) headers and I assume
that in this setting Apache get system error message and send "premature end
of script headers" to the browser. I'm not system analyst ;-)
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
------------------------------
Date: Thu, 14 Jun 2007 04:48:09 -0000
From: saran.jegan@gmail.com
Subject: Re: perl vs C for CGI
Message-Id: <1181796489.341661.113890@i13g2000prf.googlegroups.com>
On Jun 14, 6:22 am, "Petr Vileta" <sto...@practisoft.cz> wrote:
> Peter J. Holzer wrote:
> > On 2007-06-13 10:49, Petr Vileta <sto...@practisoft.cz> wrote:
> >> Maybe Apache 2.x, I don't know, but Apache 1.2 have problem with
> >> windows like end-of-line. I have this on my Linux server and anytime
> >> I forget to convert cgi file to unix format I get the same error
> >> message.
>
> > If you don't convert the *script* (as opposed to print statements
> > within the script), apache probably can't even start the script
> > because the linux kernel will try to invoke "/usr/bin/perl\r" which
> > doesn't exist. You can test this by running the script from the
> > command line.
> > Since a script which doesn't run can't produce any headers, you'll get
> > the "premature end of script headers" error. But the problem is that
> > there are no headers at all not that they have the wrong line endings.
>
> I have my Apache setting for not send any (automatic) headers and I assume
> that in this setting Apache get system error message and send "premature end
> of script headers" to the browser. I'm not system analyst ;-)
> --
>
> Petr Vileta, Czech republic
> (My server rejects all messages from Yahoo and Hotmail. Send me your mail
> from another non-spammer site please.)
hello dudes,
Finally whats your point , do apache have some system specific
problems with windows, since my code is 100% ok ( since its running
well in linux ). am spending nearly a week in this , thanks for your
time
------------------------------
Date: Wed, 13 Jun 2007 16:29:06 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: variable scope
Message-Id: <I4KdnePYfP5Z4O3bnZ2dnUVZ_hqdnZ2d@comcast.com>
sonet wrote:
> If i use opendir(DIR,$path) not opendir(my $DIR,$path). The code
> will terminate. Becase the FILEHANDLE closed as the main loop is
> running.
>
> opendir(DIR,$path);
> while(my $file=readdir(DIR)){
You're using readdir() in scalar context. That does not work when
a single dirhandle is being used in a recursive manner.
If you insist on using DIR instead of a lexical variable, you should
use it and close it before any recursion takes place.
opendir(DIR,$path) or die;
my @files = readdir(DIR);
close DIR:
foreach my $file (@files) {
-Joe
------------------------------
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 V11 Issue 512
**************************************