[16216] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3628 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 11 21:05:30 2000

Date: Tue, 11 Jul 2000 18:05:18 -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: <963363918-v9-i3628@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 11 Jul 2000     Volume: 9 Number: 3628

Today's topics:
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! (Craig Berry)
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! <uri@sysarch.com>
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! p3rlc0dr@my-deja.com
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! p3rlc0dr@my-deja.com
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! p3rlc0dr@my-deja.com
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! p3rlc0dr@my-deja.com
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! p3rlc0dr@my-deja.com
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! <lr@hpl.hp.com>
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! (Brandon Metcalf)
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! <DNess@Home.Com>
    Re: Beyond perl? Need advice... <lr@hpl.hp.com>
    Re: Beyond perl? Need advice... <flavell@mail.cern.ch>
    Re: Beyond perl? Need advice... (Tad McClellan)
    Re: Beyond perl? Need advice... <DNess@Home.Com>
    Re: Beyond perl? Need advice... (Craig Berry)
        closures containing object mess up reference count <Brett.W.Denner@lmco.com>
    Re: Cookie & redirect (David Efflandt)
        DBI->connect question <jeep@waltz.rahul.net>
    Re: easy one for xperienced users.. hard for me... <jasoniversen@my-deja.com>
    Re: easy one for xperienced users.. hard for me... (Tad McClellan)
    Re: easy one for xperienced users.. hard for me... <jasoniversen@my-deja.com>
    Re: easy one for xperienced users.. hard for me... <jasoniversen@my-deja.com>
    Re: Embedding Logo (images) in Email generated by Perl  <kevin@vailstar.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 11 Jul 2000 22:22:01 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <smn7g9j4nd653@corp.supernews.com>

p3rlc0dr@my-deja.com wrote:
: Ive been reading this board

Use of the proper terminology will help you to persuade people.  This is a
'newsgroup'.  Also, your odd lack of punctuation, grammar and spelling
problems, and use of IRC-ish abbreviations will cause people to tune you
out.  Note this is *not* a "grammar flame", but rather an attempt to help
you better convey your message. 

: for awhile and Im very disaponted with the
: atitudes and acts of many of the so-called "PERL elites".

I'm not sure who calls us/them that.  Most highly experienced Perlers are
rather charmingly self-deprecating (with a few very notable exceptions).

: When a
: person comes to this board and asks for help do they get it NO!!!!!!!!

Yes, they do, if they show that they have made a reasonable effort to help
themselves first.  Doing just the minimum groundwork required by the rules
of good netiquette -- for example, reading the Perl FAQ, and at least a
few days' worth of newsgroup postings -- will almost guarantee that a
newcomer gets a warm welcome.

: Y NOT?!?!

Because so few do that.

: Maybe its the ATITUDE and ARROGENSE of the ppl on this board who think
: that PERL being liked as a language to write webpages in

Minor point of clarification:  A good deal of the Perl code we all write
has nothing whatsoever to do with the web, although it is quite popular in
web-related work.

: gives them the right to make fun of and slight novice users who seek
: help on this board.

We don't slight novices.  We slight rude people, novice or otherwise.
There's a big difference.

[snip]
: What gives YOU "PERL ELITES" the right to treat nice people badly when
: they ask a simple question here?

If that simple question is answered in the FAQ, or was answered in another
thread earlier that day, the poster in question is not "nice".  Rather, he
or she is an arrogant, boorish oaf who thinks nothing of wasting the
(volunteered!) time of thousands of other people with redundant questions. 

: PERL is so good and useful but this so-called comunity is mean and
: unfriendly.  WHY MUST YOU BE THAT WAY?  Please change and B GOOD!

If I am holding a party, and you arrive, listen to ongoing conversations,
then join one and engage in a polite discussion with the other guests, I
will be glad that you came.  If you barge in screaming "Where are the
drinks?!" at the top of your lungs, ignoring people who try to point out
the bar to you, I will ask you to leave -- and not politely, either.

: "There is no such thing as being a stupid woman."

Would that it were so...alas, they seem to run about the same rate men do. 

-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Beauty and strength, leaping laughter and delicious
   |   languor, force and fire, are of us." - Liber AL II:20


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

Date: Tue, 11 Jul 2000 22:26:57 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <x7g0pgl2vj.fsf@home.sysarch.com>

>>>>> "DN" == David Ness <DNess@Home.Com> writes:

  DN> I am a perl amateur who has often received real help on c.l.p.m While I was
  DN> not always enthralled by the tone of responses I got, I was very happy to get
  DN> the responses because they were generally:
  DN>    (1) terse;
  DN>    (2) correct;
  DN>    (3) helpful.
  DN> Most of the `arrogance' displayed on c.l.p.m seems to me to have been well
  DN> earned, and has been helpful in getting (me, at least) to try to follow the
  DN> disciplines (-w, strict, cut and paste examples, don't retype them...) that
  DN> ultimately make communication on this newsgroup much more effective than on
  DN> most other groups where I seek help.

hear! hear!!

you get 1,2 and 3 if you follow what he said. simple and effective.

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: Tue, 11 Jul 2000 23:05:08 GMT
From: p3rlc0dr@my-deja.com
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <8kg96r$cp9$1@nnrp1.deja.com>

In article <396b8ac2@news.victoria.tc.ca>,
  yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) wrote:
>
> Please be careful if you use Matt's code.

Whats wrong with his code its really helpful in his book?!

--
Ganesha, p3rlc0dr and WEB MISTRESS
Guestbooks, hit counters, shopping carts: Get Matt's Script Archive
"There is no such thing as being a stupid woman."




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


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

Date: Tue, 11 Jul 2000 23:07:10 GMT
From: p3rlc0dr@my-deja.com
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <8kg9am$crd$1@nnrp1.deja.com>

In article <brian-ya02408000R1107001701420001@news.panix.com>,
  brian@smithrenaud.com (brian d foy) wrote:
>
> Perl has been around longer.  as the other technologies reach farther
> into the less experienced segments of the market, the same will
happen.

Thank you for being a nice person Brian.  I like your message alot.

--
Ganesha, p3rlc0dr and WEB MISTRESS
Guestbooks, hit counters, shopping carts: Get Matt's Script Archive
"There is no such thing as being a stupid woman."




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


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

Date: Tue, 11 Jul 2000 23:12:30 GMT
From: p3rlc0dr@my-deja.com
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <8kg9ki$d6e$1@nnrp1.deja.com>

In article <396B95D3.C41235D3@Home.Com>,
  David Ness <DNess@Home.Com> wrote:
> the responses because they were generally:
>    (1) terse;
>    (2) correct;
>    (3) helpful.

I am gald that comp.lang.perl.misc was friendly and good for you.  Its
sad that not every person who sends this board a note gets a nice
response.

> Most of the `arrogance' displayed on c.l.p.m seems to me to have been
well

Ive met many people who are technicly smart and nice to.  Im yet to
meet a nice expert in PERL.

Thank you for your nice message.

--
Ganesha, p3rlc0dr and WEB MISTRESS
Guestbooks, hit counters, shopping carts: Get Matt's Script Archive
"There is no such thing as being a stupid woman."




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


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

Date: Tue, 11 Jul 2000 23:16:39 GMT
From: p3rlc0dr@my-deja.com
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <8kg9sa$d9o$1@nnrp1.deja.com>

In article <x7g0pgl2vj.fsf@home.sysarch.com>,
  Uri Guttman <uri@sysarch.com> wrote:
> >>>>> "DN" == David Ness <DNess@Home.Com> writes:
>   DN> Most of the `arrogance' displayed on c.l.p.m seems to me to
have been well
>   DN> earned, and has been helpful in getting (me, at least) to try
to follow the
> hear! hear!!
>
> you get 1,2 and 3 if you follow what he said. simple and effective.

Are you talking that 'arrogance' is okay at any time?  If so I would
like to have you in my employ NO.

PS - Somone earlier here corected my words and spelling.  Is it a
custom here to not use proper case letters?

--
Ganesha, p3rlc0dr and WEB MISTRESS
Guestbooks, hit counters, shopping carts: Get Matt's Script Archive
"There is no such thing as being a stupid woman."


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


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

Date: Tue, 11 Jul 2000 23:29:12 GMT
From: p3rlc0dr@my-deja.com
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <8kgajn$dvp$1@nnrp1.deja.com>

In article <smn7g9j4nd653@corp.supernews.com>,
  cberry@cinenet.net (Craig Berry) wrote:
> p3rlc0dr@my-deja.com wrote:
> : Ive been reading this board
>
> Use of the proper terminology will help you to persuade people.  This
is a
> 'newsgroup'.  Also, your odd lack of punctuation, grammar and spelling
> problems, and use of IRC-ish abbreviations will cause people to tune

Thank you for being nice to me Craig.  Im trying to make my English
better and it can be not easy at times.  Im able to write programs in
PERL but I have tough when writing in English.

> I'm not sure who calls us/them that.  Most highly experienced Perlers
are
> rather charmingly self-deprecating (with a few very notable
exceptions).

I do not know why Abigail is mean or why Randal did not want to say
hello to me.  That is how I mean.

> Because so few do that.

I have seen mean people who dont like TOMTYDI.

> Minor point of clarification:  A good deal of the Perl code we all
write
> has nothing whatsoever to do with the web, although it is quite
popular in
> web-related work.

I read a nice book of Matt Wright.  Matt says Perl is the web code.

> We don't slight novices.  We slight rude people, novice or otherwise.
> There's a big difference.

But is it not more hard to do this?!

--
Ganesha, p3rlc0dr and WEB MISTRESS
Guestbooks, hit counters, shopping carts: Get Matt's Script Archive
"There is no such thing as being a stupid woman."





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


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

Date: Tue, 11 Jul 2000 17:00:58 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <MPG.13d55514fc3d1e0898abbc@nntp.hpl.hp.com>

In article <8kg9sa$d9o$1@nnrp1.deja.com> on Tue, 11 Jul 2000 23:16:39 
GMT, p3rlc0dr@my-deja.com <p3rlc0dr@my-deja.com> says...
> In article <x7g0pgl2vj.fsf@home.sysarch.com>,
>   Uri Guttman <uri@sysarch.com> wrote:

 ...

> > hear! hear!!
> >
> > you get 1,2 and 3 if you follow what he said. simple and effective.

 ...

> PS - Somone earlier here corected my words and spelling.  Is it a
> custom here to not use proper case letters?

You will have to allow an exception for Uri.  The shift keys on his 
keyboards broke some time ago, and he is too lazy or too cheap to fix or 
replace them.

> --

If you put a magic invisible space after those two dashes, most 
newsreaders will recognize that as a signature and cut it and what 
follows automatically.

 ...

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 12 Jul 2000 00:30:06 GMT
From: bmetcalf@nortelnetworks.com (Brandon Metcalf)
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <8kge6e$6dp$1@bcrkh13.ca.nortel.com>

p3rlc0dr@my-deja.com writes:

 > PS - Somone earlier here corected my words and spelling.  Is it a
 > custom here to not use proper case letters?

You were corrected on the use of PERL.  There's no such thing as PERL.

Brandon


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

Date: Wed, 12 Jul 2000 00:45:55 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <396BBFB5.F7F722B6@Home.Com>

p3rlc0dr@my-deja.com wrote:
> 
> 
> Are you talking that 'arrogance' is okay at any time?  If so I would
> like to have you in my employ NO.
>

Probably not. In my career people have generally been in my employ rather
than vice-versa. 

And summing across a lot of experience I can safely say that I learned a good
deal of what I know from arrogant people. The first lesson I learned as an
MIT freshman was that I wasn't going to like everyone who happened to know
more than I did, so I'd have the choice of either passing on them and the
knowledge I might get from them, or getting over worrying about arrogance.
I chose the latter.

> 
> PS - Somone earlier here corected my words and spelling.  Is it a
> custom here to not use proper case letters?
> 

It is always proper to be `proper'. However `proper case letters' doesn't
mean anything to me. If you mean `uppercase letters'


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

Date: Tue, 11 Jul 2000 15:40:28 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Beyond perl? Need advice...
Message-Id: <MPG.13d542332a07cfb398abb9@nntp.hpl.hp.com>

In article <8kg4aq$96k$1@nnrp1.deja.com> on Tue, 11 Jul 2000 21:41:50 
GMT, dejajason@my-deja.com <dejajason@my-deja.com> says...
> In article <MPG.13d5214125adbaa998abb4@nntp.hpl.hp.com>,
>   Larry Rosler <lr@hpl.hp.com> wrote:
> > In article <8kfl5l$skp$1@nnrp1.deja.com> on Tue, 11 Jul 2000 17:23:23
> > GMT, dejajason@my-deja.com <dejajason@my-deja.com> says...
> >
> > ...
> >
> > > Milliseconds?!  I just finished converting a program from perl to C
> > > and it turned an 18 minutes run-time into 36 seconds.
> >
> > Really?  Did you change any algorithms, or just do a simple
> > translation?
> >
> > It would be very instructive if you were to publish the parts of the
> > program that executed 30 times slower in Perl than in C.
> 
> I'm not sure how the algorithm applies to the point.  Perl programs will
> always require more resources than equivalent programs in a native
> compiled language like C or C++.  It's just the nature of the
> architecture.  I've yet to see a case where the opposite is true but it
> would be interesting to see if one exists.

How about code that extracts substrings using regexes, rather than 
character-by-character analysis?

 ...

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 12 Jul 2000 00:51:05 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Beyond perl? Need advice...
Message-Id: <Pine.GHP.4.21.0007120047480.19722-100000@hpplus03.cern.ch>

On Tue, 11 Jul 2000 dejajason@my-deja.com wrote:

> > It would be very instructive if you were to publish the parts of the
> > program that executed 30 times slower in Perl than in C.

> I'm not sure how the algorithm applies to the point.  Perl programs will
> always require more resources than equivalent programs in a native
> compiled language like C or C++.

If you think you can dismiss a factor of 30 just like that, then I
don't think I need to read further.




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

Date: Tue, 11 Jul 2000 18:29:33 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Beyond perl? Need advice...
Message-Id: <slrn8mn7ud.4q5.tadmc@magna.metronet.com>

On Tue, 11 Jul 2000 21:41:50 GMT, dejajason@my-deja.com <dejajason@my-deja.com> wrote:
>In article <MPG.13d5214125adbaa998abb4@nntp.hpl.hp.com>,
>  Larry Rosler <lr@hpl.hp.com> wrote:
>> In article <8kfl5l$skp$1@nnrp1.deja.com> on Tue, 11 Jul 2000 17:23:23
>> GMT, dejajason@my-deja.com <dejajason@my-deja.com> says...
>>
>> ...
>>
>> > Milliseconds?!  I just finished converting a program from perl to C
>and
>> > it turned an 18 minutes run-time into 36 seconds.
>>
>> Really?  Did you change any algorithms, or just do a simple
>translation?
>>
>> It would be very instructive if you were to publish the parts of the
>> program that executed 30 times slower in Perl than in C.
>
>I'm not sure how the algorithm applies to the point.  


Eh?

You are discussing the running time of a program.

Algorithms are *central* to bounding the running time.


If the Perl and C programs do not use the same algorithm,
then a meaningful comparison cannot be done.


>Perl programs will
>always require more resources than equivalent programs in a native
                ^^^^^^^^^^^^^^
>compiled language like C or C++.  


I doubt anyone could (or is) arguing with that.

It is the _how much_ "more" that is being met with some skepticism.

i.e. It appears to me that Larry cannot believe that that big a
     difference can be realized by merely translating to a
     compiled language.

     Since the speedup seems unreasonable, he is probing to
     ensure that there is not some other reason for the speedup.



So, do both programs use the exact same algorithm?


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 12 Jul 2000 00:33:25 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: Beyond perl? Need advice...
Message-Id: <396BBCC7.413E010E@Home.Com>

dejajason@my-deja.com wrote:
>
[snip]
> 
> I'm not sure how the algorithm applies to the point.  Perl programs will
> always require more resources than equivalent programs in a native
> compiled language like C or C++.  It's just the nature of the
> architecture.  I've yet to see a case where the opposite is true but it
> would be interesting to see if one exists.
> 

I believe that there are lots of cases where, practically speaking, languages
like perl regularly do outperform compiled attempts. We see this quite
commonly in the APL, J and K communities and I think the observations apply
to perl as well.

While I would agree that ultimately assembler code could represent some
minimum reduction, any compiled langauge will make its own compromises, and
further compromises will be made by the programmer who cannot, after all,
invest an incredible amount of time and energy in solving each particular 
problem.

To make the case concrete, think of an example where the technology of hashing
proved to be particularly effective. I doubt if any hashing scheme implemented 
even by a good C/C++ programmer would be as effective as the routines in perl 
that have been beaten to death by lots of very considerable talents over a
long time and hundreds of versions.

In the APL, J and K world, most of the loops needed to do high powered matrix
operations have been beaten to death and optimized to a fair-thee-well. The 
compiler code generated to handle these situations---in virtually every
`commercial' compiler---is usually crude by comparison. While I cannot speak 
with any authority about the innards of perl, it seems to me quite likely that 
there are many practical situations where good perl implementations might 
outperform C/C++.


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

Date: Wed, 12 Jul 2000 00:35:57 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Beyond perl? Need advice...
Message-Id: <smnfbduend685@corp.supernews.com>

Larry Rosler (lr@hpl.hp.com) wrote:
: How about code that extracts substrings using regexes, rather than 
: character-by-character analysis?

It is a tautology that sufficiently well-written C code will always be
equally or more efficient than equivalent Perl code.  After all, the Perl
compiler and interpreter are themselves written in C.

It is also the case that for many examples, notably those things that Perl
is very good at (regexes, string manipulation, dynamic data structures,
and so forth), it is prohibitively hard for most programmers to beat
Perl's performance using hand-coded C.

This same argument came up quite often between compiled-language and
assembler afficionados, a couple of decades ago.  The same comparison
applies; assembly *can* be more efficient, but compiled code usually
actually *is* more efficient.

-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Beauty and strength, leaping laughter and delicious
   |   languor, force and fire, are of us." - Liber AL II:20


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

Date: Tue, 11 Jul 2000 17:03:19 -0500
From: Brett Denner <Brett.W.Denner@lmco.com>
Subject: closures containing object mess up reference count
Message-Id: <396B99A7.B5C49D2D@lmco.com>

I'm writing an object-oriented program that relies on certain objects going
away
when the reference count goes to zero.

After my first pass, I discovered that some of the objects had reference
counts of 5 or 6 when they should have been 1 or 2.  It seems that 
my objects have methods which contain closure which themselves contain
the object; like this, for example:

# example 1
sub method
{
  my $Self = shift;
  <snip>
  $w->bind( '<Return>', sub { $Self->other_method() } );
}

Evidently the closure increases the reference count of $Self.

I tried to fix this by weakening a copy of $Self and using that
in the closure, like this:

# example 2
use WeakRef;
sub method
{
  my $Self = shift;
  weaken(my $WeakSelf = $Self);
  <snip>
  $w->bind( '<Return>', sub { $WeakSelf->other_method() } );
}

Unfortunately, when my code exits it bombs with a panic message (from
perldiag):

       panic: magic_killbackrefs
           (P) Failed an internal consistency check while trying
           to reset all weak references to an object.

Two questions:
(1) Is there a better way to use WeakRef (second example) to fix my
reference-count problem?
(2) Is there another way to get around this problem?

Thanks,

Brett Denner





-- 
 Brett W. Denner                    Brett.W.Denner@lmco.com
 Lockheed Martin Aeronautics Co.    817-935-1144 (Voice)
 PO Box 748, MZ 9332                817-935-1212 (Unattended Fax)
 Fort Worth, TX 76101


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

Date: 11 Jul 2000 23:51:52 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Cookie & redirect
Message-Id: <slrn8mnco8.3od.efflandt@efflandt.xnet.com>

On 11 Jul 2000 19:31:26 GMT, Anthony DeLorenzo <gonzo@vex.net> wrote:
>For what it's worth, the HTTP specification does not allow any other 
>headers (including cookies) to be sent when a re-direct is sent. You 
>could use code like this:
>
>print header ( -cookie=>$cookie, -location=>$url );
>
>This should NOT work according to the HTTP specification, however 
>in practice many common user agents will allow it.

I came up with the same thing (which works with apache and netscape) when
someone could not get cookie header and redirect to work separately.  
This is how the header looks from a Perl script that grabs it from apache
(newsreader wordwrapped cookie header):

HTTP/1.1 302 Found
Date: Tue, 11 Jul 2000 23:40:05 GMT
Server: Apache/1.3.9 (Unix)  (Red Hat/Linux)
Set-Cookie: AAA_hotel=City%3AChicago%2FHotel%3AHoliday%20Inn; path=/;
expires=Tue, 11-Jul-2000 23:40:05 GMT
Location: ReadMe.cgi
Connection: close
Content-Type: text/html

Note that this cookie example expires 'now', so it can only be read once
from the redirected location, then it is gone.

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://hammer.prohosting.com/~cgi-wiz/  http://cgi-help.virtualave.net/



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

Date: 12 Jul 2000 00:50:25 GMT
From: Jeff Lacki <jeep@waltz.rahul.net>
Subject: DBI->connect question
Message-Id: <8kgfch$ad8$1@samba.rahul.net>

Does anyone have a way to protect the DBI->connect() call so
that if the DB server is not running (for whatever reason),
perl doesnt just bail out with an error?

I tried something like:

# connect to DB
my $dbh = DBI->connect($dsn,$user,$passwd,				<---line 108
            { RaiseError => 1, AutoCommit => 1 });

if (!defined($dbh)) { db_temp_down(); }

however the code never gets beyond the first line (connect).

I just get this in the apache err log:

DBI->connect failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) at /home/httpd/cgi-bin/internal_edit_db.pl line 108

tia
Jeff


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

Date: Tue, 11 Jul 2000 23:10:01 GMT
From: jason iversen <jasoniversen@my-deja.com>
Subject: Re: easy one for xperienced users.. hard for me...
Message-Id: <8kg9fu$d3o$1@nnrp1.deja.com>



> Jason, you have not included lots of information that is really
> necessary in order to recommend a solution to your problem.  Here is a
> short list:
>
> 1.  Are your data files small enough that they can be loaded into
> memory?  If not, the techniques will differ markedly from the
techniques
> available if they can comfortably be loaded into memory.

they're only about 100k, so they'd easily sit in memory. some may get as
large as 200k, but generally sit in the 50-100k range.

>
> 2.  Are the data files already sorted by structure name?  If so, a
merge
> technique could be used.

no, they're not sorted. it'd have be utilise the hash method you
propose.

> 3.  What is the maximum nesting depth of braces in your structures?

only a nesting depth of 3.

> 4.  What is your final goal?  File C in the same format with the
> contents of file B updated by file A?

exactly. C must have no duplicates and sorting can be arbitrary.


> 5.  What is syntactically significant in your data?  The indentation?
> The quotes? The brackets?  The whitespace?  Lines?  Are there blank
> lines between "command"'s as hinted at by the blank first line of the
> file?

white space is unimportant. i cannot guarantee there will be a blank
line preceding the command{} structure. all thats guranteed is that
it'll appear on it's own line.


thank you for your code snippet. i am de-tangling it now so i can
pretend to understand it!



--
jason iversen


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


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

Date: Tue, 11 Jul 2000 18:31:16 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: easy one for xperienced users.. hard for me...
Message-Id: <slrn8mn81k.4q5.tadmc@magna.metronet.com>

On Tue, 11 Jul 2000 23:35:44 +0200, Bart Lateur <bart.lateur@skynet.be> wrote:
>jason iversen wrote:
>
>>i have two files, A & B. all i want to do is merge the B with the A.
>>
>>they have the same structure, are text files and are laid out thusly:
>>

>>i just want all the command{} structures in file A to replace (or add if
>>nonexistant) the same named command{} structures in file B.
>
>I can't make a thing out of your explanation


I couldn't either.

So I just moved on to answer a problem that was specified
clearly enough to answer.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 12 Jul 2000 00:13:56 GMT
From: jason iversen <jasoniversen@my-deja.com>
Subject: Re: easy one for xperienced users.. hard for me...
Message-Id: <8kgd7p$fmk$1@nnrp1.deja.com>

hi again.

ok, so maybe my explanation wasnt wonderful, but you got it clearly.

this is getting closer... it nearly works, except for the last record.
if you execute this with

  perlscript.pl fileB fileA > fileC




    #!/usr/local/bin/perl -w
    $/='command';    #assumes "command"'s separated by null lines
    while(<>){
         unless(/\n\s*name\s*"([^ ]+)"/){next}
         $h{$1}=$_;
     }
     print "\ncommand"; #maintain initial null line
     for(keys %h){
         print $h{$_};
     }


file A (between the ..'s)

 ..
command {
    help {
      "A"
    }
    name	"2"
    label	"2a"
    default	"2a"
    rman
}

command {
    help {
      "A"
    }
    name	"4"
    label	"4"
    default	"4"
    rman
}
 ..






file B

 ..
command {
    help {
      "A"
    }
    name	"1"
    label	"1"
    default	"1"
    rman
}

command {
    help {
      "A"
    }
    name	"2"
    label	"2"
    default	"2"
    rman
}

command {
    help {
      "A"
    }
    name	"3"
    label	"3"
    default	"3"
    rman
}
 ..


should yeild file C
 ..

command {
    help {
      "A"
    }
    name	"1"
    label	"1"
    default	"1"
    rman
}

command {
    help {
      "A"
    }
    name	"2"
    label	"2a"
    default	"2a"
    rman
}

command {
    help {
      "A"
    }
    name	"3"
    label	"3"
    default	"3"
    rman
}

command {
    help {
      "A"
    }
    name	"4"
    label	"4"
    default	"4"
    rman
}

 ..

but for some reason, the last record of file A is a bit messed - it
doesnt have the command line. if you know if why the last record is
being scribbled, please share! i'm going to keep whacking it, though.

thanks again,




--
jason iversen


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


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

Date: Wed, 12 Jul 2000 00:31:38 GMT
From: jason iversen <jasoniversen@my-deja.com>
Subject: Re: easy one for xperienced users.. hard for me...
Message-Id: <8kge9a$gfc$1@nnrp1.deja.com>



> I can't make a thing out of your explanation, but anyway: using the
".."
> operator may probably help you in parsing these files. Something like:
>
> 	while(<>) {
> 	    if(/^(\w+)\s*\{/ .. /^\s*\}/) {
> 	        # you're inside such a "structure" definition now
> 	    } else {
> 	        # bare phrase
> 	    }
> 	}


hi bart,

thank you for your help - i'm sorry i couldnt explain it more clearly. i
am actually looking to merge these "structures"(or records) with those
in a second file. the unique key is the "name" field inside the record.

i have gotten closer with the response from Bob, but are still having
small troubles with it.

thanks very much for your help.

--
jason iversen


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


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

Date: Tue, 11 Jul 2000 19:36:38 -0400
From: Kevin Michael Vail <kevin@vailstar.com>
Subject: Re: Embedding Logo (images) in Email generated by Perl Script
Message-Id: <kevin-A5ABCF.19363811072000@news.his.com>

In article <8kfnvp$v0q$1@nnrp1.deja.com>, t0873 <t0873@my-deja.com> 
wrote:

> I have email system written in Perl which generates text messages using
> Text Template and sends out email. If I want to embed a logo or any gif
> in these message , how do I do that. I do not want to attach the GIF
> file.
> When the user/customer recieves email, it should have logo/gif images
> in the body of the email message.

If any company sent *me* email with an embedded image they would find 
that I would quickly become an ex-customer.  And if I weren't already a 
customer and someone sent me unsolicited mail it would ensure that I 
would never become one, image or no.  You may want to reconsider this.
-- 
Kevin Michael Vail | a billion stars go spinning through the night,
kevin@vailstar.com | blazing high above your head.
 . . . . . . . . .  | But _in_ you is the presence that
 . . . . . . . . . | will be, when all the stars are dead.  (Rainer Maria Rilke)


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

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


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