[18221] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 389 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 1 14:10:55 2001

Date: Thu, 1 Mar 2001 11:10:21 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <983473821-v10-i389@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 1 Mar 2001     Volume: 10 Number: 389

Today's topics:
    Re: print "</tr><tr>" vs. print $tr (Rafael Garcia-Suarez)
    Re: print "</tr><tr>" vs. print $tr <schaefer@zanshin.com>
    Re: print "</tr><tr>" vs. print $tr <stan_no_spam_for_me@alamo.nmsu.edu>
    Re: print "</tr><tr>" vs. print $tr <stan_no_spam_for_me@alamo.nmsu.edu>
    Re: print "</tr><tr>" vs. print $tr <bart.lateur@skynet.be>
    Re: print "</tr><tr>" vs. print $tr <flavell@mail.cern.ch>
        problem with mkdir <wo_ah_ho@yahoo.com>
        REGEX GURU HELP NEEDED.... <gnadan@nyc.rr.com>
    Re: shell environement variables <neldredge@hmc.edu>
        Shell to perl conversion. <vjayl@emc.com>
        wierd syntax/end of file error <cj@nvisiongr.com>
        wierd syntax/end of file error <cj@nvisiongr.com>
    Re: wierd syntax/end of file error <tony_curtis32@yahoo.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 01 Mar 2001 16:15:10 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: print "</tr><tr>" vs. print $tr
Message-Id: <slrn99stbq.61c.rgarciasuarez@rafael.kazibao.net>

Stan McCann wrote in comp.lang.perl.misc:
> 
> Yes, I did try.  I also know that cgi.pm isn't correct, I'm a lazy typer
> and only use caps when I have to.

Lazy typers (as myself) should use good editors. Laziness is welcome in
the Perl world, as long as it's an itch for finding and implementing
improvements to existing tools, and not an excuse to poor coding or
typing practices.

Do you use vi? Put in your vi startup file :
  :ab cgi CGI

-- 
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/vim/


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

Date: Thu, 1 Mar 2001 09:13:08 -0800
From: Bart Schaefer <schaefer@zanshin.com>
Subject: Re: print "</tr><tr>" vs. print $tr
Message-Id: <Pine.LNX.4.20.0103010911040.22195-100000@aztec.zanshin.com>

On Wed, 28 Feb 2001, Bernie Cosell wrote:

> Actually, I end up looking at the HTML output a fair bit, also, and so I've
> gone to:
>    print "<tr>\n" ;
>    print "   <td>cell 1</td>\n" ;
>    print "   <td>cell 2</td>\n" ;
>    print "</tr>\n";
> 
> If something goes awry and I need to 'view source' I *HATE* it if I have to
> sort out a single 800-char-long line of stuff, so I line-break and indent
> the HTML as carefully as I do the same for my Perl code.  different
> compulsions for different folks..:o)

Have a look at the HTML::LoL module, available from CPAN.  Here's an
excerpt from its documentation:

EXAMPLE 

  &hl(sub { print shift },
      [table => {border => 2, width => '80%'},
       [tr =>
        [td => {nowrap => &hl_bool(1)}, 'This & that'],
        [td => {nowrap => &hl_bool(0)}, '<b>This is not bold</b>'],
        [td => [b => 'But this is']],
        [td => &hl_noquote('<b>And so is this</b>')]]]);


prints: 

  <table width="80%" border="2">
   <tr>
    <td nowrap>This &amp; that</td>
    <td>&lt;b&gt;This is not bold&lt;/b&gt;</td>
    <td><b>But this is</b></td>
    <td><b>And so is this</b></td>
   </tr>
  </table>



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

Date: Thu, 01 Mar 2001 10:02:44 -0700
From: Stan McCann <stan_no_spam_for_me@alamo.nmsu.edu>
Subject: Re: print "</tr><tr>" vs. print $tr
Message-Id: <3A9E80B4.D9EF7CE0@alamo.nmsu.edu>

Abigail wrote:
> 
> AH, ok, so you don't expect other people to read what you type.
> 
> Fine. Then I'll make sure I'll rever ead you again.
> 
> *plonk*
> 
> If you're too lazy to type correctly, don't bother showing up on usenet.
> 

Reread this post and tell me who shouldn't bother to show up on usenet
again due to their incorrect typing?

Of course, you'll "rever ead" this message since you plonked me.  I'm
happy to be plonked by one that seems to plonk everyone.  Yes, I've been
lurking in this forum for quite a while and seen many many plonks by
you.  Thank you.

Stan McCann


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

Date: Thu, 01 Mar 2001 09:53:10 -0700
From: Stan McCann <stan_no_spam_for_me@alamo.nmsu.edu>
Subject: Re: print "</tr><tr>" vs. print $tr
Message-Id: <3A9E7E76.191D1E71@alamo.nmsu.edu>

Anno Siegel wrote:
> 
> Looks like a case of PEBKAC to me.
> 
That's exactly what it was.  After further reading of the web docs
(which are much better than the man pages), I found what I was missing.

Stan McCann


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

Date: Thu, 01 Mar 2001 17:38:03 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: print "</tr><tr>" vs. print $tr
Message-Id: <h82t9tkjeiu7se121c2hr90lgnpj3h9cu7@4ax.com>

Stan McCann wrote:

>After further reading of the web docs
>(which are much better than the man pages), I found what I was missing.

Er... aren't these the same? I mean, the HTML docs are generated out of
the POD's. No human interference.

-- 
	Bart.


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

Date: Thu, 1 Mar 2001 19:08:27 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: print "</tr><tr>" vs. print $tr
Message-Id: <Pine.LNX.4.30.0103011902540.4620-100000@lxplus003.cern.ch>

On Thu, 1 Mar 2001, Bart Lateur wrote:

> Stan McCann wrote:
>
> >After further reading of the web docs
> >(which are much better than the man pages), I found what I was missing.
>
> Er... aren't these the same?

L.Stein maintains the documentation of CGI.pm in HTML, and you can
view it on the WWW (URL was posted alerady on this thread).  The POD
that is in the source code had been allowed to fall into disrepair.

> I mean, the HTML docs are generated out of the POD's.

I was initially confused by that too.  I finally realised that his
maintained HTML was much better than the HTML version that's generated
out of the semi-derelict CGI.pm POD as part of the Perl installation.
And he confirmed as much in email.

However, I'm told that he and the Perl porters are now aware of the
problem and intend to resolve it.





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

Date: Thu, 1 Mar 2001 13:54:01 -0500
From: "Jason Wong" <wo_ah_ho@yahoo.com>
Subject: problem with mkdir
Message-Id: <97m5u4$ads$1@bcrkh13.ca.nortel.com>

I tried to create a directory in a remote machine (web hosting folder) using
the following codes, which works fine on my own computer:

#!/usr/bin/perl
#testdir.pl

require "cgi-lib.pl";
&ReadParse;

$newdir = "E:/Inetpub/wwwroot/wsc/eng/bmcwest/cgi-bin/testing";
mkdir $newdir;

but i got this error:

CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:

Not enough arguments for mkdir at
E:\Inetpub\wwwroot\wsc\eng\bmcwest\cgi-bin\testdir.pl line 12, near
"$newdir;"
Execution of E:\Inetpub\wwwroot\wsc\eng\bmcwest\cgi-bin\testdir.pl aborted
due to compilation errors.

any idea? is it because I can't create a sub-folder in a shared WinNT
folder?
but if I create a folder using windows explorer it's fine.

Thanks in advance

Jason Wong






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

Date: Thu, 1 Mar 2001 13:27:44 -0500
From: "news.voyagernet.com" <gnadan@nyc.rr.com>
Subject: REGEX GURU HELP NEEDED....
Message-Id: <97m4c7$qjd$1@nnrp2.phx.gblx.net>


Hey all,

I just started working with REGEX's and it is lotsa fun, but kinda
complicated. I am trying to create a REGEX that will let me pull apart a
sting that would have a name in it.

The name could be in the format:

FNAME LNAME
LNAME, FNAME
FNAME LNAME, SUFFIX ( Jr, III )
and any other "standard formats" for writing out a full name.

There could be multiple whitespace characters trailing and or leading around
the different components and I need to strip them out. I have written a
regex that can handle the first two situations, but  including the third one
and other possible "standard" formats is proving to be very difficult.

Should I not try to accomplish all this with on regex and break it out into
more steps?

Any/All help would be appreciated!!  Please reply off list as well on
list....

Bill






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

Date: 01 Mar 2001 09:10:59 -0800
From: Nate Eldredge <neldredge@hmc.edu>
Subject: Re: shell environement variables
Message-Id: <838zmpifdo.fsf@mercury.st.hmc.edu>

mayer32@relay.bfl.at ( hans mayer ) writes:

["setting" environment variables by starting a new shell]

> i assume, you are not happy with the 2 additionl running jobs.
> but this is not a performance problem.
> if they do nothing, they are swapped out after time.

For 2, yes.  But this doesn't scale.  What if the script needed to run
hundreds or thousands of times?

Also, it is irritating to be dumped in a subshell, because many
settings you made in the original shell won't be there.

-- 

Nate Eldredge
neldredge@hmc.edu


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

Date: Thu, 1 Mar 2001 13:56:12 -0500
From: "V.Jay Lescoe" <vjayl@emc.com>
Subject: Shell to perl conversion.
Message-Id: <97m60u$r032@emcnews1.lss.emc.com>

Hello,

How would one accomplish this shell excerpt in perl? (I am currently
perusing perldocs.com
for the answer but I can't seem to figure it out.) Please reply directly to
me. vjayl@emc.com
Thanks!

vjl

$OMNIHOME/bin/nco_sql -server NCOMSPRIM -user automation -password
automation <<EOF >> $OMNIHOME/log/CM-sql.fail.log

update alerts.status set BVLStatus = 'FAILED' where Serial = $1 ;
go
exit
EOF





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

Date: Thu, 1 Mar 2001 11:41:47 -0500
From: Chris Jensen <cj@nvisiongr.com>
Subject: wierd syntax/end of file error
Message-Id: <3AA07E71@MailAndNews.com>

i just started getting an error at the end of a script telling me i have a 
syntax error and i'm missing a right bracket(?).  here's the error log 
entry:

Missing right bracket at /usr/local/etc/httpd/cgi-bin/psr_input.cgi line 
141, 
at end of line
syntax error at /usr/local/etc/httpd/cgi-bin/psr_input.cgi line 141, at EOF
Execution of /usr/local/etc/httpd/cgi-bin/psr_input.cgi aborted due to 
compilation errors.
[Thu Mar  1 11:09:03 2001] access to 
/usr/local/etc/httpd/cgi-bin/psr_input.cgi failed for 208.131.27.12, reason: 
Premature end of script headers

here's line 141 of my script:

print "</body></html>";

it's the last line of the file.  i've never gotten this error before, any 
ideas?

TIA!
chris



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

Date: Thu, 1 Mar 2001 11:42:53 -0500
From: Chris Jensen <cj@nvisiongr.com>
Subject: wierd syntax/end of file error
Message-Id: <3AA08238@MailAndNews.com>

i just started getting an error at the end of a script telling me i have a 
syntax error and i'm missing a right bracket(?).  here's the error log 
entry:

Missing right bracket at /usr/local/etc/httpd/cgi-bin/psr_input.cgi line 
141, 
at end of line
syntax error at /usr/local/etc/httpd/cgi-bin/psr_input.cgi line 141, at EOF
Execution of /usr/local/etc/httpd/cgi-bin/psr_input.cgi aborted due to 
compilation errors.
[Thu Mar  1 11:09:03 2001] access to 
/usr/local/etc/httpd/cgi-bin/psr_input.cgi failed for 208.131.27.12, reason: 
Premature end of script headers

here's line 141 of my script:

print "</body></html>";

it's the last line of the file.  i've never gotten this error before, any 
ideas?

BACKGROUND INFO:  WebTen 3.0.3 webserver (apache 1.3 on mac, perl 5.005)

TIA!
chris



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

Date: 01 Mar 2001 10:54:04 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: wierd syntax/end of file error
Message-Id: <877l29qvkj.fsf@limey.hpcc.uh.edu>

>> On Thu, 1 Mar 2001 11:47:49 -0500,
>> Chris Jensen <cj@nvisiongr.com> said:

> i just started getting an error at the end of a script
> telling me i have a syntax error and i'm missing a right
> bracket(?).  here's the error log entry:

> Missing right bracket at
> /usr/local/etc/httpd/cgi-bin/psr_input.cgi line 141, at
> end of line syntax error at
> /usr/local/etc/httpd/cgi-bin/psr_input.cgi line 141, at
> EOF Execution of
> /usr/local/etc/httpd/cgi-bin/psr_input.cgi aborted due
> to compilation errors.  [Thu Mar 1 11:09:03 2001] access
> to /usr/local/etc/httpd/cgi-bin/psr_input.cgi failed for
> 208.131.27.12, reason: Premature end of script headers

> here's line 141 of my script:

> print "</body></html>";

> it's the last line of the file.

That was just the point at which the error was detected.
Check earlier in the script for the real culprit.  Have
you enabled -w and "use strict;"?  These will probably
help you locate the problem locally before running it
through CGI (guess: missing/mismatched end double-quote in
a string).

hth
t
-- 
The avalanche has already started.
It is too late for the pebbles to vote.


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

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 V10 Issue 389
**************************************


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