[22340] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4561 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 13 06:06:02 2003

Date: Thu, 13 Feb 2003 03:05:08 -0800 (PST)
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, 13 Feb 2003     Volume: 10 Number: 4561

Today's topics:
    Re: Accessing files in html folder from cgi script (Craig)
    Re: Accessing files in html folder from cgi script <me@privacy.net>
    Re: binary data and utf8 (I think) <bwalton@rochester.rr.com>
    Re: extracting JS links with Perl <ubl@schaffhausen.de>
    Re: grep with line number ? <kamran@norsar.no>
        How I control my relays over the LAN <andrew.rich@bigpond.com>
    Re: Impossible to do CRLF->LF on Windows/Activestate? <kirkspam@alienbill.com>
    Re: Is perl -s broken in perl 5.8.0 or fixed? (Anno Siegel)
    Re: newbie date comparison <Jodyman@hotmail.com>
    Re: newbie date comparison <Jodyman@hotmail.com>
    Re: newbie date comparison <me@privacy.net>
    Re: newbie date comparison (Anno Siegel)
    Re: newbie date comparison <me@privacy.net>
    Re: Perl script to create new user in Linux. <josef.moellers@fujitsu-siemens.com>
    Re: Perl+Tk+MySQL for Win32 that *works*? <randy@theoryx5.uwinnipeg.ca>
    Re: Perl+Tk+MySQL for Win32 that *works*? (Jim Seymour)
    Re: PersistentPerl never resolves first time through <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
    Re: Please explain this weird error message (Tad McClellan)
    Re: Please explain this weird error message (Tad McClellan)
    Re: Please explain this weird error message (Anno Siegel)
    Re: puzzling operator priorities <dtweed@acm.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 13 Feb 2003 00:29:24 -0800
From: craigdessoy@hotmail.com (Craig)
Subject: Re: Accessing files in html folder from cgi script
Message-Id: <9c4d8212.0302130029.108bd9a5@posting.google.com>

yes you've found me out - i'm a bit of a newbie when it comes to this
kind of stuff!  below is my script.  it works fine when despatches.csv
is in the cgi-bin (even from the browser!), but i can't find a path
that works when it's in the html folder (being the folder in which my
main web pages i.e. php scripts reside.  i have placed despatches.csv
in here because it is written to by one of the php scripts).
the cgi-script will be triggered by a cron and email the csv file once
a day using mime::lite. actually i discovered mainwebsite_html is a
symlink to var/www/html, so tried replacing with that but still no
joy.  by absolute address i meant the full address i.e. http:// etc.
the software error, i.e. Software error: var/www/html/despatches.csv:
not readable is presumably generated by the (ensim) server?
any thoughts?
cheers~
craig

#!/usr/bin/perl -w

use CGI;
use CGI::Carp qw(fatalsToBrowser);
use MIME::Lite;

$query=new CGI;

print $query->header;


    $msg = MIME::Lite->new(
                 From     =>'me@myhost.com',
                 To       =>'craigdessoy@hotmail.com',
                 Cc       =>'blah@blahblah.com',
                 Subject  =>Tesing testing',
                 Type     =>'text/plain',
                 Encoding =>'base64',
                 Path     =>'var/www/html/despatches.csv'
		 );

    $msg->send;


Brian McCauley <nobull@mail.com> wrote in message news:<u9lm0lz69h.fsf@wcl-l.bham.ac.uk>...
> craigdessoy@hotmail.com (Craig) writes:
> 
> > i am trying to send an email from a cgi script (in the cgi-bin), which
> > attaches a csv file
> 
> What module are you using how?
> 
> > located in the html folder.
> 
> What is "the html folder"?
> 
> > for this i am using /mainwebsite_html/file.csv
> 
> Is the absolute file path '/mainwebsite_html' a valid directory name
> for the entity you call  "the html folder"?
> 
> > when i run this script from the browser
> 
> Cough, cough, cough...
> 
> > or command line i get a software error: /mainwebsite_html/file.csv not
> > readable.
> 
> This does not look like a native Perl error.  What software is
> generating this error.
> 
> > i tried an absolute address and got the same error.
> 
> What do you mean by "absolute address"?
> 
> > permissions are set at 755.
> > does anyone have any suggestions?
> 
> I suggest you are perhaps unclear about the distiction between file
> names and URLs.  But it's rather hard to say without anything concrete
> to go on.


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

Date: Thu, 13 Feb 2003 20:06:03 +1100
From: "Tintin" <me@privacy.net>
Subject: Re: Accessing files in html folder from cgi script
Message-Id: <b2fn5t$1bvh5f$1@ID-172104.news.dfncis.de>


"Craig" <craigdessoy@hotmail.com> wrote in message
news:9c4d8212.0302130029.108bd9a5@posting.google.com...

[Please don't top post]

> > > or command line i get a software error: /mainwebsite_html/file.csv not
> > > readable.
>
> yes you've found me out - i'm a bit of a newbie when it comes to this
> kind of stuff!  below is my script.  it works fine when despatches.csv
> is in the cgi-bin (even from the browser!), but i can't find a path
> that works when it's in the html folder (being the folder in which my
> main web pages i.e. php scripts reside.  i have placed despatches.csv
> in here because it is written to by one of the php scripts).
> the cgi-script will be triggered by a cron and email the csv file once
> a day using mime::lite. actually i discovered mainwebsite_html is a
> symlink to var/www/html, so tried replacing with that but still no
> joy.  by absolute address i meant the full address i.e. http:// etc.
> the software error, i.e. Software error: var/www/html/despatches.csv:
> not readable is presumably generated by the (ensim) server?
> any thoughts?
> cheers~
> craig
>
> #!/usr/bin/perl -w
>
> use CGI;
> use CGI::Carp qw(fatalsToBrowser);
> use MIME::Lite;
>
> $query=new CGI;
>
> print $query->header;
>
>
>     $msg = MIME::Lite->new(
>                  From     =>'me@myhost.com',
>                  To       =>'craigdessoy@hotmail.com',
>                  Cc       =>'blah@blahblah.com',
>                  Subject  =>Tesing testing',
>                  Type     =>'text/plain',
>                  Encoding =>'base64',
>                  Path     =>'var/www/html/despatches.csv'
> );
>
>     $msg->send;

Note that the path you are using will be relative to where the script is
running from (in most cases).

I'm sure you don't have a var/www/html directory sitting under your cgi-bin
directory.

To find out where you exist, either use:

#!/bin/sh
echo "Content-Type: text/plain"
echo
echo "I live in `pwd`"

or

#!/usr/bin/perl
use FindBin qw($Bin);
print "Content-Type:  text/plain\n\n";
print "I live in $Bin\n";




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

Date: Thu, 13 Feb 2003 03:59:47 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: binary data and utf8 (I think)
Message-Id: <3E4B17B5.2050808@rochester.rr.com>

Michael Lapsley wrote:

 ...
> I have just spent a frustrating evening trying to figure out why
> a BMP manipulation program produces corrupt files almost twice
> the size they should be on one machine, but not on another.
> 
> The culprit machine is running 5.6.1 (linux).  This code fragment
 ...


> Michael.
 ...


I verify the same results you got using AS build 633 under Windoze 98SE. 
  It appears to be the wide hex char encoding that is doing this. 
Changing it to hex-char encoding (as defined by perlop) seems to fix it. 
  That is, remove the {} from the string, as in:

     $bmpheader="\x42\x4d\xbe\x0c\x00...

Apparently with wide hex char encoding, bytes with the top bit set 
generate an extra byte, probably as per UTF8, regardless of the use or 
non-use of the various pragmas.
-- 
Bob Walton



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

Date: Thu, 13 Feb 2003 11:54:58 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: extracting JS links with Perl
Message-Id: <b2g0pb$jpj$1@news.dtag.de>

Wolfgang Fischer wrote:
> Hi,
> to be absolutely sure that you get all links, you have to execute the
> javascript code. That's the only option to find links like that
> window.open('http://www.'+'google.com/');
> Maybe you can find a possibility to execute JavaScript from your perl
> program.

[Please don't top post]

 ...which would be a great extension for WWW::Mechanize. It should be 
possible by writing a wrapper around mozilla, KHTML/KJS or WebCore 
(MacOS X only). I would if I could. My C skills are no-existant though, 
but I might give it a try to wrap CammelBones around WebCore.

->malte



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

Date: Thu, 13 Feb 2003 07:58:25 +0100
From: kamran <kamran@norsar.no>
Subject: Re: grep with line number ?
Message-Id: <3E4B4211.10A4@norsar.no>

I am overwhelmed. This is the best newsgroup I have
ever visited. Everywhere else I am either met with silence
when displaying my lack of knowledge or told to go
read the FAQ or get myself a good book.

Thank you all

Kamran


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

Date: Thu, 13 Feb 2003 20:45:10 +1000
From: "Andrew Rich" <andrew.rich@bigpond.com>
Subject: How I control my relays over the LAN
Message-Id: <AqK2a.46647$jM5.116944@newsfeeds.bigpond.com>

#!/usr/bin/perl
use IO::Socket;
use IO::Socket::INET;
use Net::hostent;
use DBI;

my $port=shift || die "Usage server.pl <port>\n";
my $server = IO::Socket::INET->new( Proto => 'tcp',
LocalPort => $port,
Listen => SOMAXCONN,
Reuse => 1);
die "can't setup server" unless $server;
print "[Server $0 is running]\n";
while ($client = $server->accept())
{

$client->autoflush(1);
sleep 2;
while ( <$client>)
{
        if (m/on/)
        {
        system("./lptout 2");
        }
        else
        {
        if (m/off/)
        {
        system("./lptout 0");
        }
        }

print ;
}
sleep 5;
close $client;
}



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

Date: Thu, 13 Feb 2003 03:31:37 GMT
From: Kirk Is <kirkspam@alienbill.com>
Subject: Re: Impossible to do CRLF->LF on Windows/Activestate?
Message-Id: <tkE2a.460$Y2.17040@news.tufts.edu>

Bob Walton <bwalton@rochester.rr.com> wrote:
> There is another, deeper question, though:  Why do you want to make 
> Unix-format or MAC-format text files on a PC?  Does not the software you 
> are using to transport files between platforms solve this problem 
> automatically for you?

It's to help a cow-orker, who's the build engineer here.
For some reason, he needs these builds to be done on a Windows machine,
but be able to be Unix ready from there.


-- 
QUOTEBLOG: http://kisrael.com   SKEPTIC MORTALITY: http://kisrael.com/mortal
"The time has come," the walrus said, / "To speak of manic things,
 Of shots and shouts, and sealing dooms / Of commoners and kings."--Thurber  


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

Date: 13 Feb 2003 10:06:22 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Is perl -s broken in perl 5.8.0 or fixed?
Message-Id: <b2fqmu$r3t$1@mamenchi.zrz.TU-Berlin.DE>

Max <pbarone@harris.com> wrote in comp.lang.perl.misc:
> Solaris 8
> When using perl -s, with my 5.8.0 version, the scripts using Getopt do
> not recognize command line arguments. See this:

That is to be expected.  Perlrun says about -s:

    dashes (--help).  Any switch found there is removed
    from @ARGV and sets the corresponding variable in the
    Perl program.  The following program prints "1" if

So -s removes the arguments that look like switches before getopts()
gets to see them.

Why would you use two different methods for switch parsing at once?

Anno


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

Date: Thu, 13 Feb 2003 00:14:19 GMT
From: "Jodyman" <Jodyman@hotmail.com>
Subject: Re: newbie date comparison
Message-Id: <vrB2a.13647$tO2.1288826@newsread1.prod.itd.earthlink.net>


"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message

> Jodyman <Jodyman@hotmail.com> wrote in comp.lang.perl.misc:
>
> [...]
>
> > if ($new_month < 10) { $new_month = "0$new_month"; }
> > if ($new_day < 10) { $new_day = "0$new_day"; }
> > if ($new_year < 10) { $new_year = "0$new_year"; }
[snip]
>
> or do all three in one go:
>
>     $_ = sprintf "%02d", $_ for $new_month, $new_day, $new_year;
       ^^^^                        ^^^^^^
Anno, can you explain what his is doing and how it works?  Didn't find
the answer in perldoc -f sprintf.

TIA,

Jody




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

Date: Wed, 12 Feb 2003 23:20:49 GMT
From: "Jodyman" <Jodyman@hotmail.com>
Subject: Re: newbie date comparison
Message-Id: <lFA2a.13565$tO2.1281482@newsread1.prod.itd.earthlink.net>


"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
> Jodyman <Jodyman@hotmail.com> wrote in comp.lang.perl.misc:
>
> [...]
>
> > if ($new_month < 10) { $new_month = "0$new_month"; }
> > if ($new_day < 10) { $new_day = "0$new_day"; }
> > if ($new_year < 10) { $new_year = "0$new_year"; }
>
> Will this bit of cargo cult never go away?
>
> There is a perfect tool named "sprintf" that formats numbers in every
> common way.  Only with date manipulation this clumsy method of tacking
> on zeroes seems to be common practice.
>
>     $new_month = sprintf "%02d", $new_month;
>     # etc.
>
> or do all three in one go:
>
>     $_ = sprintf "%02d", $_ for $new_month, $new_day, $new_year;

Thanks Anno,  you da man!

Jody




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

Date: Thu, 13 Feb 2003 15:31:31 +1100
From: "Tintin" <me@privacy.net>
Subject: Re: newbie date comparison
Message-Id: <b2f734$1cfo35$1@ID-172104.news.dfncis.de>


"Jodyman" <Jodyman@hotmail.com> wrote in message
news:vrB2a.13647$tO2.1288826@newsread1.prod.itd.earthlink.net...
>
> "Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
>
> > Jodyman <Jodyman@hotmail.com> wrote in comp.lang.perl.misc:
> >
> > [...]
> >
> > > if ($new_month < 10) { $new_month = "0$new_month"; }
> > > if ($new_day < 10) { $new_day = "0$new_day"; }
> > > if ($new_year < 10) { $new_year = "0$new_year"; }
> [snip]
> >
> > or do all three in one go:
> >
> >     $_ = sprintf "%02d", $_ for $new_month, $new_day, $new_year;
>        ^^^^                        ^^^^^^
> Anno, can you explain what his is doing and how it works?  Didn't find
> the answer in perldoc -f sprintf.

It's a different way to write

$_ = sprintf "%02d%02d%02d", $new_month, $new_day, $new_year;

Anno's version saves a few keystrokes by using a for loop.

While we're at it, please try to avoid ambiguous date formats.  Use the ISO
date format (ie: YYYYMMDD) as it is unambiguous and sorts easily.




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

Date: 13 Feb 2003 08:31:21 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: newbie date comparison
Message-Id: <b2fl4p$n6o$1@mamenchi.zrz.TU-Berlin.DE>

Tintin <me@privacy.net> wrote in comp.lang.perl.misc:
> 
> "Jodyman" <Jodyman@hotmail.com> wrote in message
> news:vrB2a.13647$tO2.1288826@newsread1.prod.itd.earthlink.net...
> > "Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message

> > > or do all three in one go:
> > >
> > >     $_ = sprintf "%02d", $_ for $new_month, $new_day, $new_year;
> >        ^^^^                        ^^^^^^
> > Anno, can you explain what his is doing and how it works?  Didn't find
> > the answer in perldoc -f sprintf.
> 
> It's a different way to write
> 
> $_ = sprintf "%02d%02d%02d", $new_month, $new_day, $new_year;

No, that's not what it does.  $_ is unchanged after the loop, but the 
variables $new_month, $new_day and $new_year now contain the formatted
date.  It uses the fact that in a for-loop $_ is an alias to the
current list element, so assigning to $_ really assigns to $new_month,
etc.

Anno


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

Date: Thu, 13 Feb 2003 20:07:16 +1100
From: "Tintin" <me@privacy.net>
Subject: Re: newbie date comparison
Message-Id: <b2fn85$1bvv48$1@ID-172104.news.dfncis.de>


"Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
news:b2fl4p$n6o$1@mamenchi.zrz.TU-Berlin.DE...
> Tintin <me@privacy.net> wrote in comp.lang.perl.misc:
> >
> > "Jodyman" <Jodyman@hotmail.com> wrote in message
> > news:vrB2a.13647$tO2.1288826@newsread1.prod.itd.earthlink.net...
> > > "Anno Siegel" <anno4000@lublin.zrz.tu-berlin.de> wrote in message
>
> > > > or do all three in one go:
> > > >
> > > >     $_ = sprintf "%02d", $_ for $new_month, $new_day, $new_year;
> > >        ^^^^                        ^^^^^^
> > > Anno, can you explain what his is doing and how it works?  Didn't find
> > > the answer in perldoc -f sprintf.
> >
> > It's a different way to write
> >
> > $_ = sprintf "%02d%02d%02d", $new_month, $new_day, $new_year;
>
> No, that's not what it does.  $_ is unchanged after the loop, but the
> variables $new_month, $new_day and $new_year now contain the formatted
> date.  It uses the fact that in a for-loop $_ is an alias to the
> current list element, so assigning to $_ really assigns to $new_month,
> etc.


Whoops.  Sorry for posting that without checking (or thinking)




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

Date: Thu, 13 Feb 2003 09:09:27 +0100
From: Josef =?iso-8859-1?Q?M=F6llers?= <josef.moellers@fujitsu-siemens.com>
Subject: Re: Perl script to create new user in Linux.
Message-Id: <3E4B52B7.76FFC573@fujitsu-siemens.com>

Kjetil wrote:
> =

> Ok, I suppose I should ask for a shell-script then.

> "Josef M=F6llers" <josef.moellers@fujitsu-siemens.com> skrev i melding
> news:3E4A2DF5.90E2D6E7@fujitsu-siemens.com...
> Kjetil wrote:

> > Does anyone have a Perl-script (or a receipt) to make new Linux-users=
?
> =

> Hmmm, new Linux-users aren't made with Perl-Scripts. Pearls might help,=

> though.

Shells only work with primitive island tribe women ... but then, they
don't have anything to run Linux on, have they? OTOH Pearls grow in
shells, so you might be on the right track.

To be serious:
As Eric Moors pointed out, "What's wrong with useradd/adduser"?
If you _must_ set a password, take a look at 'expect', it was developed
to run interactive applications from a script.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize
						-- T.  Pratchett


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

Date: Wed, 12 Feb 2003 20:48:10 -0600
From: "Randy Kobes" <randy@theoryx5.uwinnipeg.ca>
Subject: Re: Perl+Tk+MySQL for Win32 that *works*?
Message-Id: <uHD2a.42007$7_.180167@news1.mts.net>

"Jim Seymour" <gort@LinxNet.com> wrote in message
news:v4lpag4f0vja93@corp.supernews.com...
> In article <slrnb4leov.cej.randy@theoryx5.uwinnipeg.ca>,
> randy@theoryx5.uwinnipeg.ca (Randy Kobes) writes:
> [snip]
> >
> > So it sounds like the problem is is that you haven't installed
> > mysql itself .... DBD::mysql is just the database driver.
> [snip]
> One of us (and I can easily believe it's me) is confused.  The
> actually MySQL dbm is on another machine.  The following bit of code,
> from a very early learning experiment I did, works either against a
> MySQL server running on localhost or on any remote host.
[ .. ]
Aahh ... I was assuming a local database - sorry about that. Under
ftp://theoryx5.uwinnipeg.ca/pub/other/  I just put a copy of
libmySQL.dll from a mysql 3.xx installation - try placing that
under C:\Perl\site\lib\auto\DBD\mysql\ (where the Perl
mysql.dll library is) and see if that works.

I thought about including this in the DBD::mysql package,
but I don't like to include dlls for which a user may have
another copy or version. I'll look into trying to include
it in an interactive post-install script.
[ ...]
> > As Jeff also expressed in another reply, your attitude
> > seems surprising ...
>
> Write it off to severe frustration.  And if I've offended: please
> accept my apologies.  In fact: in my last follow-up I neglected to
> thank you for your help.  I almost *never* forget to do that.  So
> please also accept my belated thanks.

No problem ... and you're welcome :) These things can be
frustrating - that's understandable ....

best regards,
randy





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

Date: Thu, 13 Feb 2003 04:38:06 -0000
From: gort@LinxNet.com (Jim Seymour)
Subject: Re: Perl+Tk+MySQL for Win32 that *works*?
Message-Id: <v4m89eqsp2od90@corp.supernews.com>

In article <uHD2a.42007$7_.180167@news1.mts.net>,
	"Randy Kobes" <randy@theoryx5.uwinnipeg.ca> writes:
[snip]
> Aahh ... I was assuming a local database - sorry about that.

No way for you to know.  One could as well argue your mention of a
libmySQL.dll that I never saw should have clued *me* in.  But I never
gave a thought to the fact that the DBD::mysql package depended on
libraries that weren't there! It just so-happens that every system
I've played with Perl/MySQL on *happened* to either have MySQL
installed upon it or was a system that had access to the requisite
libraries via NFS.

I *am* kind of surprised this is the first time this has come up,
though.  I would have thought what I'm trying to do and the way I'm
trying to use the package would be relatively common?

>                                                              Under
> ftp://theoryx5.uwinnipeg.ca/pub/other/  I just put a copy of
> libmySQL.dll from a mysql 3.xx installation - try placing that
> under C:\Perl\site\lib\auto\DBD\mysql\ (where the Perl
> mysql.dll library is) and see if that works.

That did it, Randy!  Thanks!

> I thought about including this in the DBD::mysql package,
> but I don't like to include dlls for which a user may have
> another copy or version. I'll look into trying to include
> it in an interactive post-install script.

Just throwing a thought out...

Obviously I don't know PPM well.  (Hardly at all.)  But does it
support enforcing dependencies?  RPM, as you're probably aware, will
refuse to install things if there are missing dependencies.  So will
Sun's package manager.  So do all of the Perl source packages I've
installed under *nix.  Leads to "recursive" install hell sometimes,
but better than what's happened to me lately, perhaps.  If so, I'm
wondering if it wouldn't make sense to make libmySQL a separate PPM
package and make the others dependent on it?

> 
[snip]
> 
> No problem ... and you're welcome :) These things can be
> frustrating - that's understandable ....

I appreciate your understanding, your patience and your help.
Particularly considering my grouchiness :/.

Regards,
Jim
-- 
Jim Seymour                    | PGP Public Key available at:
WARNING: The "From:" address   | http://www.uk.pgp.net/pgpnet/pks-commands.html
is a spam trap.  DON'T USE IT! |
Use: jseymour@LinxNet.com      | http://jimsun.LinxNet.com


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

Date: Thu, 13 Feb 2003 09:06:38 +0100
From: Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
Subject: Re: PersistentPerl never resolves first time through
Message-Id: <newscache$2jm8ah$2oo$1@news.emea.compuware.com>

Todd Boss wrote (Tuesday 11 February 2003 22:12):

> Hello.
> 
> we're using PersistentPerl (formerly known as SpeedyCGI) to help speed
> up a large perl-based web app.  Solaris box, Iplanet webserver,
> connecting to an Oracle database via DBI::Oracle.
> 
> We're seeing two critical issues:
> 1. The first time a web browser connects to the website running
> perperl, the browser never pulls the site up.  You have to physically
> hit the stop and reload buttons on the browser (doesn't matter what
> browser) before the site comes up.  After that things are fine.  We
> can repeat this process at will by touching the main perl program that
> runs.


I have this exact issue. But with me it is a webserver problem. When using
boa this happens, when using Apache, it doesn't. I suspect it to be related
to a "broken CGI channel" (whatever that means. I just invented this term
up). Apache seems to be able to run a fresh new SpeedyCGI process on the
"broken channel" while boa can not. Perhaps Iplanet behaves as boa does?



> 2. If there is a compilation error in the code ... the perperl process
> can't ever load a page again ... we either have to kill the backend
> processes or touch the main perl program to force the backends to
> reload... which of course causes us the issue in point #1.


This seems logical after my explanation. With me it is the same thing.
That's why I always run a perl -c on my CGI programs before running them
through boa.


HTH.

-- 
KP



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

Date: Wed, 12 Feb 2003 23:48:07 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Please explain this weird error message
Message-Id: <slrnb4mccn.1vq.tadmc@magna.augustmail.com>

Shane McDaniel <shanem@nospam.ll.mit.edu> wrote:

> keep shooting yourself in
> the foot and sometimes the Perl interpreter won't tell you.


But it will make the appropriate exclamation for you:

   Message-Id: <slrn8hlfpr.k1b.tadmc@magna.metronet.com>

:-)


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Wed, 12 Feb 2003 23:52:26 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Please explain this weird error message
Message-Id: <slrnb4mckq.1vq.tadmc@magna.augustmail.com>

Alan J. Flavell <flavell@mail.cern.ch> wrote:

> Perhaps the group could also hold a sweepstake on the least
> useful Subject: header.


   % foolish subjects
   Score:: -9000
           Subject: ^help!?$
           Subject: ^perl question!?$


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 13 Feb 2003 10:16:15 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Please explain this weird error message
Message-Id: <b2fr9f$r3t$2@mamenchi.zrz.TU-Berlin.DE>

Luis Fernandes  <elf@ee.ryerson.ca> wrote in comp.lang.perl.misc:
> Version:
> This is perl, v5.6.1 built for sun4-solaris
> 
> 
> Program:
> ------------------------------------------------------------------------
> #!/usr/local/bin/perl
> $prfile="ps";
> $prfile=~s/ps/PostScript File/;
> printf("$prfile\n");

It is not a good idea to use printf() to print out its first argument.
It is a *format* for the following arguments and is subject to 
interpretation.  Use plain print().  If you need to print a string
with printf() the correct form is "printf '%s', $string;".

Anno


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

Date: Thu, 13 Feb 2003 05:09:27 GMT
From: Dave Tweed <dtweed@acm.org>
Subject: Re: puzzling operator priorities
Message-Id: <3E4B2783.DDAAE338@acm.org>

ebchang wrote:
> Thanks, that certainly explains it.  But further fiddling with Deparse
> leads to another question.  Using Deparse shows that both '$x = 5 && $y =
> 7' and '$x = (5 && ($y = 7))' are parsed as $x = $y = 7.  However it says
> that $x = ((5 && $y) = 7) is also parsed as $x = $y = 7, which seems
> reasonable.  But the value actually assigned to $x is 1 for that last
> expression, not 7, suggesting that it is really parsed differently.  I'm
> puzzled afresh.

The inner parentheses give the inner assignment a list context. The scalar
result of such an assignment is the number of list items assigned, which
is one in this case.

-- Dave Tweed


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

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.  

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 4561
***************************************


home help back first fref pref prev next nref lref last post