[16776] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4188 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 31 11:05:35 2000

Date: Thu, 31 Aug 2000 08:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <967734313-v9-i4188@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 31 Aug 2000     Volume: 9 Number: 4188

Today's topics:
        "Premature end of script headers" <jgoldst@my-deja.com>
    Re: "Premature end of script headers" <care227@attglobal.net>
    Re: "Premature end of script headers" (Martien Verbruggen)
    Re: Am I d.u.m.b??? <mrpkahle@dingoblue.net.au>
        RE: Am I d.u.m.b??? <jorge@feelglobal.com>
    Re: Am I dumb? <bcaligari@my-deja.com>
    Re: Am I dumb? <mrpkahle@dingoblue.net.au>
    Re: Am I dumb? (David Wall)
    Re: Am I dumb? (Martien Verbruggen)
        Bug in Perl regular expressions? jba_lixx@my-deja.com
    Re: Bug in Perl regular expressions? (Randal L. Schwartz)
    Re: Bug in Perl regular expressions? (Mark-Jason Dominus)
    Re: Bug in Perl regular expressions? <smerr612@mailandnews.com>
    Re: Bug in Perl regular expressions? mexicanmeatballs@my-deja.com
    Re: Bug in Perl regular expressions? <bcaligari@my-deja.com>
        DBD (Ramey Muforo)
    Re: Fat comma quoting [was: Re: Bulk add to a hash.. Th <uri@sysarch.com>
    Re: File handles with scalar value (Mark-Jason Dominus)
    Re: generate the html doc. <mrpkahle@dingoblue.net.au>
    Re: Help !!! (HPUX11+Oracle8+DBD) ishulz@lycosmail.com
    Re: help..I don't know what is this??? eduardo_m@my-deja.com
    Re: help..I don't know what is this??? <fritz.heinrichmeyer@fernuni-hagen.de>
    Re: How get all parameters of cgi-form? <mrpkahle@dingoblue.net.au>
    Re: How to read a dir with recursive directories? <hmerrill@my-deja.com>
    Re: How to read a dir with recursive directories? (Martien Verbruggen)
    Re: interchanging variables <ren.maddox@tivoli.com>
        Japanese Girl Needs Help. <kaori@japanesegirl.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 31 Aug 2000 13:20:15 GMT
From: JL Goldstein <jgoldst@my-deja.com>
Subject: "Premature end of script headers"
Message-Id: <8olm1s$c80$1@nnrp1.deja.com>

There must be some documentation of this error somewhere, so I'm
probably going to get flamed for asking this question, but since I don't
know where to find the answer I'm going to risk it.

I've got a Perl CGI script that works just fine. However, I check the
server's error log every so often just for chuckles, and I found a
"Premature end of script headers" warning for this script. What does
this apparently non-fatal error mean?

--
----
Any sufficiently advanced magic is indistinguishable from Perl.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 31 Aug 2000 10:05:59 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: "Premature end of script headers"
Message-Id: <39AE6647.ACC3A22D@attglobal.net>

JL Goldstein wrote:
> 
> There must be some documentation of this error somewhere, so I'm
> probably going to get flamed for asking this question, but since I don't
> know where to find the answer I'm going to risk it.

Its in the FAQ.  Hell, its in alot of FAQ's.  Several good ones are
mentioned in the Perl FAQ.  (perldoc -q 500)

> I've got a Perl CGI script that works just fine. However, I check the
> server's error log every so often just for chuckles, and I found a
> "Premature end of script headers" warning for this script. What does
> this apparently non-fatal error mean?

Off topic.  Best asked in comp.infosystems.www.authoring.cgi


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

Date: Fri, 1 Sep 2000 01:08:00 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: "Premature end of script headers"
Message-Id: <slrn8qspm0.ucf.mgjv@martien.heliotrope.home>

On Thu, 31 Aug 2000 13:20:15 GMT,
	JL Goldstein <jgoldst@my-deja.com> wrote:
> There must be some documentation of this error somewhere, so I'm
> probably going to get flamed for asking this question, but since I don't
> know where to find the answer I'm going to risk it.
> 
> I've got a Perl CGI script that works just fine. However, I check the
> server's error log every so often just for chuckles, and I found a
> "Premature end of script headers" warning for this script. What does
> this apparently non-fatal error mean?

Not a Perl error. All Perl errors should be documented in the perldiag
documentation, which you can read by typing something like

# perldoc perldiag

at your shell prompt. If an error doesn't appear in that documentation,
you can be almost certain that it's not a perl error. If you still don't
know, you can be absolutely certain it's not a perl error.

Martien
-- 
Martien Verbruggen              | Since light travels faster than
Interactive Media Division      | sound, isn't that why some people
Commercial Dynamics Pty. Ltd.   | appear bright until you hear them
NSW, Australia                  | speak?


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

Date: Fri, 1 Sep 2000 00:15:04 +1000
From: "Phill Kahle" <mrpkahle@dingoblue.net.au>
Subject: Re: Am I d.u.m.b???
Message-Id: <39ae59b4$0$26541$7f31c96c@news01.syd.optusnet.com.au>

Perl for win32 knows to flip them.   I will try though. thanks for the help.


"Adrian A. Baumann" <baumann@isw.unibe.chwithoutspam> wrote in message
news:8oll1b$q78$1@news1.sunrise.ch...
> One word: Backslashes...
> Try it with a forward slash instead.
>
>
> Phill Kahle <mrpkahle@dingoblue.net.au> wrote in message
> news:39ae5617$0$26546$7f31c96c@news01.syd.optusnet.com.au...
> > Can someone please help me.   I have wrtien a small quick program to
read
> a
> > file of the cdrom drive.  Now it should be very simple to do but I can't
> > seem to read anything.  It's works fine with the A drive and C: but not
> the
> > cdrom.   Any answers please?
> >
> > The error is that the file can't be found but the file is there at the
> right
> > locations.
> >
> > I have a pioneer DVD.
> > I have win2000.
> > I have the latest perl.
> >
> > here is a small example program.
> >
> > open(IN, "d:\dir1\example.txt") || die "can't open the file";
> > $a="$a$_" while(<IN>);
> >
> >
> >
> >
> >
> >
>
>




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

Date: Thu, 31 Aug 2000 10:13:54 -0400
From: "Jorge Bachler O." <jorge@feelglobal.com>
Subject: RE: Am I d.u.m.b???
Message-Id: <39ae66f4@dnewserver.firstcom.cl>

HI,

open(IN, "d:\\dir1\\example.txt")

Adrian A. Baumann <baumann@isw.unibe.chwithoutspam> escribió en el mensaje
de noticias 8oll1b$q78$1@news1.sunrise.ch...
> One word: Backslashes...
> Try it with a forward slash instead.
>
>
> Phill Kahle <mrpkahle@dingoblue.net.au> wrote in message
> news:39ae5617$0$26546$7f31c96c@news01.syd.optusnet.com.au...
> > Can someone please help me.   I have wrtien a small quick program to
read
> a
> > file of the cdrom drive.  Now it should be very simple to do but I can't
> > seem to read anything.  It's works fine with the A drive and C: but not
> the
> > cdrom.   Any answers please?
> >
> > The error is that the file can't be found but the file is there at the
> right
> > locations.
> >
> > I have a pioneer DVD.
> > I have win2000.
> > I have the latest perl.
> >
> > here is a small example program.
> >
> > open(IN, "d:\dir1\example.txt") || die "can't open the file";
> > $a="$a$_" while(<IN>);
> >
> >
> >
> >
> >
> >
>
>




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

Date: Thu, 31 Aug 2000 13:00:29 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: Am I dumb?
Message-Id: <8olkt2$as3$1@nnrp1.deja.com>

In article <39ae4fac$0$26533$7f31c96c@news01.syd.optusnet.com.au>,
  "Phill Kahle" <mrpkahle@dingoblue.net.au> wrote:
> Can someone please help me.   I have wrtien a small quick program to
read a
> file of the cdrom drive.  Now it should be very simple to do but I
can't
> seem to read anything.  It's works fine with the A drive and C: but
not the
> cdrom.   Any answers please?
>
> The error is that the file can't be found but the file is there at
the right
> locations.
>
> I have a pioneer DVD.
> I have win2000.
> I have the latest perl.
>
> here is a small example program.
>
> open(IN, "d:\dir1\example.txt") || die "can't open the file";
> $a="$a$_" while(<IN>);
>
>

backslash the backslash
open(IN, "d:\\dir1\\example.txt")
or use forward slashes (works with activeperl build 616 for sure
(because it's the one i'm using)
open (IN "d:/dir1/example.txt")

Brendon


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 1 Sep 2000 00:16:37 +1000
From: "Phill Kahle" <mrpkahle@dingoblue.net.au>
Subject: Re: Am I dumb?
Message-Id: <39ae5a12$0$26526$7f31c96c@news01.syd.optusnet.com.au>

ok thanks Brendon

"Brendon Caligari" <bcaligari@my-deja.com> wrote in message
news:8olkt2$as3$1@nnrp1.deja.com...
> In article <39ae4fac$0$26533$7f31c96c@news01.syd.optusnet.com.au>,
>   "Phill Kahle" <mrpkahle@dingoblue.net.au> wrote:
> > Can someone please help me.   I have wrtien a small quick program to
> read a
> > file of the cdrom drive.  Now it should be very simple to do but I
> can't
> > seem to read anything.  It's works fine with the A drive and C: but
> not the
> > cdrom.   Any answers please?
> >
> > The error is that the file can't be found but the file is there at
> the right
> > locations.
> >
> > I have a pioneer DVD.
> > I have win2000.
> > I have the latest perl.
> >
> > here is a small example program.
> >
> > open(IN, "d:\dir1\example.txt") || die "can't open the file";
> > $a="$a$_" while(<IN>);
> >
> >
>
> backslash the backslash
> open(IN, "d:\\dir1\\example.txt")
> or use forward slashes (works with activeperl build 616 for sure
> (because it's the one i'm using)
> open (IN "d:/dir1/example.txt")
>
> Brendon
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.




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

Date: 31 Aug 2000 09:45:58 -0400
From: darkon@one.net (David Wall)
Subject: Re: Am I dumb?
Message-Id: <8FA16B8AFdarkononenet@206.112.192.118>

mrpkahle@dingoblue.net.au (Phill Kahle) wrote in
<39ae4fac$0$26533$7f31c96c@news01.syd.optusnet.com.au>: 
>The error is that the file can't be found but the file is there at the
>right locations.
>
>I have a pioneer DVD.
>I have win2000.
>I have the latest perl.
>
>here is a small example program.
>
>open(IN, "d:\dir1\example.txt") || die "can't open the file";

Did you have warnings turned on? (e.g.; using 'perl -w program_name' to run 
it, or 'use warnings;' in the program.)

See perlfaq5, "Why can't I use "C:\temp\foo" in DOS paths?"  (Yes, I know 
it's win2000 -- but it inherited some weird ideas from DOS.)

>$a="$a$_" while(<IN>);

There are easier ways to do this.  You might check out .= or $/

As for the subject (Am I dumb?), how should I know?  I don't know you.  
It's not a very informative subject line, anyway.

But please, at least read the FAQs.  I know there are alot of them, and 
it's easy to miss or forget something, but you'll be rewarded by having 
lots of your questions answered before you even think of them.  And all 
those docs (perlfunc, perlstyle, etc) are quite informative.  One reason I 
don't post here very often is because I've found answers to most of my 
questions in the docs or in the Perl books I have -- and that keeps me from 
using other people's time by asking questions whose answers were already 
available to me.

-- 
David Wall
darkon@one.net


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

Date: Fri, 1 Sep 2000 00:39:37 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Am I dumb?
Message-Id: <slrn8qso0p.ucf.mgjv@martien.heliotrope.home>

On Thu, 31 Aug 2000 23:32:16 +1000,
	Phill Kahle <mrpkahle@dingoblue.net.au> wrote:
> 
> here is a small example program.
> 
> open(IN, "d:\dir1\example.txt") || die "can't open the file";
> $a="$a$_" while(<IN>);

That doesn't work on your C: drive or A: drive either. You are fibbing.

This same issue comes up umpty times a month on this forum. A backslash
in a double-quoted string is special. TO get a backslash in a string
from a double-quoted interpolation, you need two. Better to use a single
quoted string, and even better to use / instead of \. MSDOS based
systems are perfectly happy to accept that, it's just the braindead
excuse for a shell that doesn't, and half the programs.

You check for a failure on the open, which is laudable, but you should
probably include $!, so that you know WHAT went wrong, and why.

open(IN, 'd:/dir1/example.txt') or 
	die "Can't open d:/dir1/example.txt: $!";

Oh, and if what you want is get the whole file in a scalar, then do it
as gets discussed here about twice a week:

$/ = undef;
$scalar = <IN>;

or

local($/);
$scalar = <IN>;

And don't use $a or $b outside of sort subroutines, or you might end up
with surprises.

# perldoc -f open
# perldoc perlop
# perldoc perldata
# perldoc -f sort
#
# perldoc perlvar

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | I took an IQ test and the results
Commercial Dynamics Pty. Ltd.   | were negative.
NSW, Australia                  | 


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

Date: Thu, 31 Aug 2000 14:15:07 GMT
From: jba_lixx@my-deja.com
Subject: Bug in Perl regular expressions?
Message-Id: <8olp8n$g3i$1@nnrp1.deja.com>

Hi,

this isn't an urgent problem, because I've already done a little
workaround, but I'd still like to know if I'm missing something in the
code or if there's a bug in Perl's regex-features.

Here we go:

We have a database that stores soccer results in strings like this:

"2:1"

That would mean the home team scored 2 and the away team scored 1.

Now for WWW-display we needed the two scores seperately, so a colleague
of mine wrote the following regex, which doesn't only split but also
check for numeric values (actually redundant since we're already doing
that at the insertion point):

(The above string is in $scoretext)

($scoretext=~ /^(\d+):(\d+)/) && ($score1= $1) && ($score2 = $2)

This works fine as long as we have scores like "2:3", "1:0" , "1:1" etc.

The only time we have a problem is when we have a score with a leading
zero like "0:4"

In this case, $score1 is "0", which is correct, but $score2 is still
empty.

I solved this by simply doing a split() on the ":" instead, so the site
works as intended, but I still don't knw why the first version didn't
do the trick.

Any ideas anyone?

Jens Baumeister


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 31 Aug 2000 07:52:10 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Bug in Perl regular expressions?
Message-Id: <m166oh8ov9.fsf@halfdome.holdit.com>

>>>>> "jba" == jba lixx <jba_lixx@my-deja.com> writes:

jba> ($scoretext=~ /^(\d+):(\d+)/) && ($score1= $1) && ($score2 = $2)

jba> This works fine as long as we have scores like "2:3", "1:0" , "1:1" etc.

jba> The only time we have a problem is when we have a score with a leading
jba> zero like "0:4"

jba> In this case, $score1 is "0", which is correct, but $score2 is still
jba> empty.

Exactly.  I would expect exactly that behavior.  No bug.
Think: what does

  ($score1 = "0") && die "ho ho"

do?  Does it die?  (hint: NOOOOOOOOO)

So you are never executing the second assignment!

I'd write this as:

  if (my($score1, $score2) = $scoretext =~ /(\d+):(\d+)/) {
    found $score1 and $score2
  } else {
    did not find scores as expected
  }

print "Just another Perl hacker," unless $score1;

-- 
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: Thu, 31 Aug 2000 14:55:24 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: Bug in Perl regular expressions?
Message-Id: <39ae71dc.4800$3d1@news.op.net>

In article <8olp8n$g3i$1@nnrp1.deja.com>,  <jba_lixx@my-deja.com> wrote:
>I'd still like to know if I'm missing something in the code or if
>there's a bug in Perl's regex-features.

You're missing something.  Your confusion is not even about the regex;
you are confused about the && operator.

>($scoretext=~ /^(\d+):(\d+)/) && ($score1= $1) && ($score2 = $2)
        
When the score is '0:3', then $1 is set to 0 and $2 is set to 3.

&& means 'and'.  A&&B&&C means to compute the expressions A, B, and C,
>in that order, and to stop at the first expression that is false.

For example, if the pattern match above fails, then $score1 and
$score2 are not assigned at all.

If the result of the ($score1 = $1) expression is false, then $score2
is not assigned.

If $1 contains 0, then the result of the ($score1 = $1) expression is
>0, which is false.  Then $score2 is not assigned.

One way to fix this is:

        ($scoretext=~ /^(\d+):(\d+)/) && ($score1=$1 , $score2=$2)

The comma in between the two assignments says to do both things in
order, regardless of the values being assigned.

However, I suggest that you stop using && in such a strange way.  What
you really meant is to assign the two variables if the pattern match
was successful:

        if ($scoretext=~ /^(\d+):(\d+)/) {
           $score1=$1; 
           $score2=$2;
        }

You should say what you mean.

Finally, this operation is so common that Perl has a well-known
shorthand for it:

        ($score1, $score2) = ($scoretext=~ /^(\d+):(\d+)/);

This does the same thing, except that if the pattern match fails,
$score1 and $score2 are undefined.  This is the most normal and usual
way to accomplish this.


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

Date: Thu, 31 Aug 2000 14:49:57 GMT
From: Steven Merritt <smerr612@mailandnews.com>
Subject: Re: Bug in Perl regular expressions?
Message-Id: <8olrac$iur$1@nnrp1.deja.com>

In article <8olp8n$g3i$1@nnrp1.deja.com>,
  jba_lixx@my-deja.com wrote:
> We have a database that stores soccer results in strings like this:
>
> "2:1"

<SNIP>

> (The above string is in $scoretext)
>
> ($scoretext=~ /^(\d+):(\d+)/) && ($score1= $1) && ($score2 = $2)
>
> This works fine as long as we have scores like "2:3", "1:0" , "1:1"
etc.
>
> The only time we have a problem is when we have a score with a leading
> zero like "0:4"

That's ok, you didn't really want to include the times the home team
lost anyway. ;)

Here's a thought.  The && operator short circuits and doesn't evaluate
the remaining conditions if one of them isn't true(and the || operator
short circuits as soon as one of them _is_ true).  So when it runs into
a $score1= '0' this evals as false and it won't execute the second
condition, it's a waste of time because the whole thing will fail due
to the nature of the logical AND.  Here's a one-liner to demonstrate
this behavior.

perl -e 'if (eval ($score = 0)) {print "Evals true";} else {print "evals
false";}'

(sure it's an useless use of eval, but I think it shows the point more
clearly than a simple if ($score = 0) because some newbie may get that
confused with a comparison(ok, a very newbie who hasn't yet divorced
himself from '=' means 'equal' yet))

> I solved this by simply doing a split() on the ":" instead, so the
site
> works as intended, but I still don't knw why the first version didn't
> do the trick.

The second method is probably better in terms of maintainability and
readability even though you may lose some speed, benchmark both methods
and see what you'd rather do. I'd think the speed difference would be
minimal.


--
King of Casual Play
The One and Only Defender of Cards That Blow

My newsreader limits sigs to four lines, but I cleverly bypassed this by


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 31 Aug 2000 14:45:28 GMT
From: mexicanmeatballs@my-deja.com
Subject: Re: Bug in Perl regular expressions?
Message-Id: <8olr22$ikc$1@nnrp1.deja.com>

In article <8olp8n$g3i$1@nnrp1.deja.com>,
  jba_lixx@my-deja.com wrote:
> We have a database that stores soccer results in strings like this:
> "2:1"
> (The above string is in $scoretext)
> ($scoretext=~ /^(\d+):(\d+)/) && ($score1= $1) && ($score2 = $2)
> This works fine as long as we have scores like "2:3", "1:0" , "1:1"
etc.
> The only time we have a problem is when we have a score with a leading
> zero like "0:4"
> In this case, $score1 is "0", which is correct, but $score2 is still
> empty.
>

The expression ($score1=$1) will be false when $1 is 0, the second
'and' is short-circuited and hence ($score2=$2) is never executed.

($score1,$score2) = ($scoretext=~ /^(\d+):(\d+)/);

--
Jon
perl -e '$_="MrqEdunhuClqdph1frp"; print map {chr(ord($_)-3)} split //;'


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 31 Aug 2000 14:51:18 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: Bug in Perl regular expressions?
Message-Id: <8olrct$j12$1@nnrp1.deja.com>

In article <8olp8n$g3i$1@nnrp1.deja.com>,
  jba_lixx@my-deja.com wrote:
>
> ($scoretext=~ /^(\d+):(\d+)/) && ($score1= $1) && ($score2 = $2)
>

try something less cryptic such as
if ($scoretext =~ m/^(\d+):(\d+)/) {
        ($score1, $score2) = ($1, $2);
}

you are using a potentially zero (false) value in a boolean
expression...bad idea.

brendon




Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 31 Aug 2000 14:50:52 GMT
From: remigius.muforo@telops.gte.com (Ramey Muforo)
Subject: DBD
Message-Id: <8olrcc$jtq$1@news.gte.com>

HELP,

Where can I get instalable binary of DBD for Oracle8i on AIX 4.3.3 

I have problem with the Makefile that was created by "perl Makefile.PL", 
when I tried to build it from the source code DBD 1.14. It gives me the 
following errors:

""Makefile", line 2320: make: Dependency line needs colon or double colon 
operator.
make: Fatal errors encountered -- cannot continue."


I looked at it. I was unable to figure anything out.

Please help
Ramey



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

Date: Thu, 31 Aug 2000 14:46:37 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Fat comma quoting [was: Re: Bulk add to a hash.. Thanks for the help!]
Message-Id: <x71yz5qyia.fsf@home.sysarch.com>

>>>>> "KCI" == Keith Calvert Ivey <kcivey@cpcug.org> writes:

  KCI> Uri Guttman <uri@sysarch.com> wrote:
  >> 
  >> and of course there is another special case. a leading - is allowed in
  >> the tokens (can't call it a bareword then) autoquoted by =>. this comes
  >> from the common use of -foo as a key/attribute in sub calls.

  KCI> I thought it was the other way around: the common use of -foo in
  KCI> sub calls came from the fact that you could do it.  And a
  KCI> bareword is still a bareword if it has an operator in front of
  KCI> it.


my impression is that many modules like tk and cgi used -foo for keys a
long time before +> was fixed to handle a leading -. i recall complaints
about why it doesn't work with them, and now it does. i bet a little
searching of the deltas would clear this up. i have to run so i can't do
it now.

  KCI> Anyway, it's not a special dispensation for unary -.  The =>
  KCI> operator quotes barewords before it even when they have other
  KCI> operators applied to them.  These produce no complaints from
  KCI> strict or -w:

  KCI>     print 'foo' . bar => 123;
  KCI>     print length baz => 'abc';

interesting. 

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Thu, 31 Aug 2000 14:47:26 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: File handles with scalar value
Message-Id: <39ae6ffd.4788$389@news.op.net>
Keywords: Grenoble, eternity, kinglet, volatile

In article <8ol7fj$ksb$1@lublin.zrz.tu-berlin.de>,
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>Uh... is that how it is done?  

The source code is on your disk.

>In the open statement, Perl treats $filehandle_name as a symref, 

In

        open FOO, "..."

perl *also* treats the filehandle name as a symref.  FOO is a literal
string, which is interpreted symbolically as a reference to the glob *FOO.



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

Date: Fri, 1 Sep 2000 00:14:09 +1000
From: "Phill Kahle" <mrpkahle@dingoblue.net.au>
Subject: Re: generate the html doc.
Message-Id: <39ae597e$0$26527$7f31c96c@news01.syd.optusnet.com.au>

you need to get the .pl or .cgi to use the normal print command but in the
first line that you print, put

Content-Type: text/html


"Tom" <chaptera@hotmail.com> wrote in message
news:39AE2778.6842E1F7@hotmail.com...
> Hi all,
>
> I have a question about using perl.
> I want to use perl generating the html file but it will have error.
> The html page only show like this:
> <script language=javascript>
> function banner(msg,ctrlwidth) {
>        for (i=0;i
>        {msg=" "+msg}
>        ............
>     }
> ..........
>
>
> perl.program
> =========
> $js<<END
> <script language=javascript>
> function banner(msg,ctrlwidth) {
>        for (i=0;i<=ctrlwidth;i++)
>        {msg=" "+msg}
>        ............
>     }
> END
>
> print header();
> print $js;
> ..........
>
>
> Thank you very much.
>
> Tom.
>




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

Date: Thu, 31 Aug 2000 13:34:50 GMT
From: ishulz@lycosmail.com
Subject: Re: Help !!! (HPUX11+Oracle8+DBD)
Message-Id: <8olmtr$d46$1@nnrp1.deja.com>

In article <8olh0f$67a$1@nnrp1.deja.com>,
  ishulz@lycosmail.com wrote:
> Right now I've tried to rebuild perl,DBI and DBD as static. perl and
> DBI againg reinstalled fine (and tested ok). DBD was compiled and
> linked as well, but when I tried to test it it died:

 ..................

>    nautabnum (data)
>    naeetcu (data)
>    naeetau (data)
>    appc_c_version (code)
> collect2: ld returned 1 exit status
> *** Error exit code 1
>
> Stop.


I found abovementioned symbols (in *.o files in oracle-lib directory),
build static library and feed it to 'make test'-builder. Not it say:

_______
DBD/Oracle/extralibs.all` -lnsl -lnm -lndbm -ldld -lm -lc -lndir -
lcrypt -lsec
/usr/bin/ld: Unsatisfied symbols:
   ntlini (code)
collect2: ld returned 1 exit status
*** Error exit code 1

Stop.
make: *** [perl] Error 1
---------
Where can I get the symbol???

And again: is it possible to get it (HPUX11+Ora8+DBD) up and working?

Thank.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 31 Aug 2000 13:02:11 GMT
From: eduardo_m@my-deja.com
Subject: Re: help..I don't know what is this???
Message-Id: <8oll07$asu$1@nnrp1.deja.com>

Thanks to everyone....It was a lot of help for me.....

In article <39ADBFE1.610512F@ipac.caltech.edu>,
  tim@ipac.caltech.edu wrote:
> eduardo_m@my-deja.com wrote:
> > $sth->execute();
> >
> > if ($@) {
> >     $dbh->rollback();
> > }
> >
> > I know how works this, but I want to know what the "$@" means...Is
> > something like a way to know if an error has ocurred????....
>
> Are you sure that wasn't
>
> eval { $sth->execute() };
>
> if ($@) {
>     $dbh->rollback();
> }
>
> ???
>
> In addition to the comments of others in this thread, read the DBI
> documentation; it contains an example like the above for doing safe
> transactions.
>
> --
>
> -- Tim Conrow         tim@ipac.caltech.edu       626-395-8435
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 31 Aug 2000 15:13:42 +0200
From: Heinrichmeyer <fritz.heinrichmeyer@fernuni-hagen.de>
Subject: Re: help..I don't know what is this???
Message-Id: <ufn1htd14p.fsf@jfh00.fernuni-hagen.de>

maybe the file has to be openend readonly.
-- 
Fritz Heinrichmeyer mailto:fritz.heinrichmeyer@fernuni-hagen.de
FernUniversitaet Hagen, LG ES, 58084 Hagen (Germany)
tel:+49 2331/987-1166 fax:987-355 http://www-es.fernuni-hagen.de/~jfh


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

Date: Fri, 1 Sep 2000 00:18:33 +1000
From: "Phill Kahle" <mrpkahle@dingoblue.net.au>
Subject: Re: How get all parameters of cgi-form?
Message-Id: <39ae5a85$0$26538$7f31c96c@news01.syd.optusnet.com.au>

yeah sorry.   use cgi.pm  and the file is called cgi-lib.pl

MY MISTAKE

"Lincoln Marr" <lincolnmarr@nospam.europem01.nt.com> wrote in message
news:8olkj3$58q$1@qnsgh006.europe.nortel.com...
> I think you'll find it's cgi-lib.pl and it was originally built for Perl
> 4.... the norm these days is to use CGI.pm which is a lot easier, if it's
> too heavy duty for what you want there's a lighter CGI module too (can't
> remember it's name though).
> Just make sure that in your Perl script you have the html with all the
input
> fields names set to the parameter names. But this is more a question for
> comp.infosystems.www.authoring.cgi really....
>
>
> "Phill Kahle" <mrpkahle@dingoblue.net.au> wrote in message
> news:39ae52d8$0$26529$7f31c96c@news01.syd.optusnet.com.au...
> > It's easy just to use cgi-lib.pm
> >
> > So include it in your program with the require command and then use a
read
> > phrase routine in the cgi-lib to throw all the prams into a hash.
> >
> > "Paul Dortman" <paul@pco.iis.nsk.su> wrote in message
> > news:8ol57u$2979$1@news.itfs.nsk.su...
> > > Hello,
> > >
> > > It's strange but I could not find the way to do it. I need array of
all
> > > parameters of cgi form.
> > > I tried   $q->param, but it did not work.
> > >
> > > I use 'post' method.
> > >
> > > Thanks for help
> > >
> > >
> > > Paul
> > >
> > >
> >
> >
>
>




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

Date: Thu, 31 Aug 2000 13:07:32 GMT
From: Hardy Merrill <hmerrill@my-deja.com>
Subject: Re: How to read a dir with recursive directories?
Message-Id: <8olla6$bfl$1@nnrp1.deja.com>

In article <5Mlr5.8365$gi.115631@maule>,
  "Rodrigo Cortés" <roco3d@pmail.net> wrote:
> What is the faster way to do this and list the archives?

Probably the easiest way(I don't know if it's the fastest) to
recursively list the contents of a directory would be to use the
File::Find module.  Read about it either in

  - Programming Perl - 2nd edition, p.439-440
  - Perl Cookbook, p.322-324

or do this command at the command line:

   perldoc File::Find

HTH.

--
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 1 Sep 2000 00:23:23 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: How to read a dir with recursive directories?
Message-Id: <slrn8qsn2b.ucf.mgjv@martien.heliotrope.home>

On Thu, 31 Aug 2000 00:34:40 -0400,
	Rodrigo Cortés <roco3d@pmail.net> wrote:
> What is the faster way to do this and list the archives?

I think that you probably would be initerested in the File::Find module,
although I am not 100% certain. It should be installed as part of the
Perl package.

# perldoc File::Find

If that isn't what you want, then you might just want to roll your own
stuff using opendir, readdir and closedir.

# perldoc -f opendir
# perldoc -f readdir
# perldoc -f closedir

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Useful Statistic: 75% of the people
Commercial Dynamics Pty. Ltd.   | make up 3/4 of the population.
NSW, Australia                  | 


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

Date: 31 Aug 2000 08:35:34 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: interchanging variables
Message-Id: <m3n1ht4kpl.fsf@dhcp11-177.support.tivoli.com>

abigail@foad.org (Abigail) writes:

> Nice try, but you're fooling yourself.
> 
[pulled up from below script]
> NUL characters don't show up easily on a terminal - but they are still there.

Oops... well, not that it's really worth pursuing, but I suppose that
if we disallow nulls in the input, we can simply toss them out of the
output....

    #!/opt/perl/bin/perl -w
    use strict;
    my($a, $b, $c) = qw(bazsdf foox bar);

    printf "We have: $a (%d) $b (%d) $c (%d)\n", map {length} $a, $b, $c;
    printf "We want: $b (%d) $c (%d) $a (%d)\n", map {length} $b, $c, $a;

    # First, realize that ($a, $b, $c) = ($b, $c, $a) can be broken
    # down into ($a, $b) = ($b, $a) and ($b, $c) = ($c, $b)

    $a ^= $b; $b ^= $a; $a ^= $b;    # swap $a and $b
    $b ^= $c; $c ^= $b; $b ^= $c;    # now swap the new $b with $c

    s/\0//g for $a, $b, $c;

    printf "We got : $a (%d) $b (%d) $c (%d)\n", map {length} $a, $b, $c;
    __END__
    We have: bazsdf (6) foox (4) bar (3)
    We want: foox (4) bar (3) bazsdf (6)
    We got : foox (4) bar (3) bazsdf (6)

Of course, I suppose that's cheating.... :)

-- 
Ren Maddox
ren@tivoli.com


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

Date: Thu, 31 Aug 2000 10:33:51 -0400
From: "Kaori Ayn Honeywell" <kaori@japanesegirl.com>
Subject: Japanese Girl Needs Help.
Message-Id: <Icur5.17300$Y51.187981@iad-read.news.verio.net>

Hello,

Require PERL programming that allows
visitors to my web site to enter their name
and email address into a form.

The data from the form is saved to a table
for database retrieval.

Please reply to my email address
Kaori@JapaneseGirl.com

Thank you,

Kaori Ayn Honeywell




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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4188
**************************************


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