[15823] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3236 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 2 14:05:44 2000

Date: Fri, 2 Jun 2000 11: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: <959969118-v9-i3236@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 2 Jun 2000     Volume: 9 Number: 3236

Today's topics:
    Re: Alternatives to Perl - DB/WWW interface (David N. Welton)
    Re: Alternatives to Perl - DB/WWW interface <gellyfish@gellyfish.com>
        ArsDigita Bootcamp review htmlguy@my-deja.com
    Re: Can not expire cookies !! <flavell@mail.cern.ch>
    Re: CC problems with Coldfusion Apache module <mark.hamlin@artdigital.co.uk>
    Re: CC problems with Coldfusion Apache module <mark.hamlin@artdigital.co.uk>
    Re: CC problems with Coldfusion Apache module <durusau@delphi.com>
        CGI.pm param function troubles <derek@ccil.org>
    Re: CGI.pm param function troubles <care227@attglobal.net>
    Re: CGI.pm param function troubles <tfm@sei.cmu.edu>
    Re: CGI.pm param function troubles <care227@attglobal.net>
    Re: CGI.pm param function troubles <flavell@mail.cern.ch>
    Re: CGI.pm param function troubles <derek@ccil.org>
    Re: CGI.pm param function troubles <dmeyers@panix.com>
    Re: CGI.pm param function troubles <care227@attglobal.net>
    Re: code cleanup (Jon Drukman)
    Re: Compiling Perl-CGIs (Colin Watson)
        DBI and Apache 1.3 lennie_jarratt@my-deja.com
        DBI.pm CGI.pm tutorial needed <prlawrence@lehigh.edu>
        Email this story to a friend - html to text rk27@my-deja.com
    Re: Email this story to a friend - html to text <tony_curtis32@yahoo.com>
    Re: file dates being reported incorrectly..... <lr@hpl.hp.com>
    Re: Get the time, plus one hour (was: code cleanup) <bill@billcampbell.com>
    Re: Get the time, plus one hour (was: code cleanup) <abe@ztreet.demon.nl>
        Interpreting Benchmark <ra_jones@my-deja.com>
    Re: Interpreting Benchmark nobull@mail.com
    Re: mysql insertid (Jon Drukman)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 02 Jun 2000 17:29:21 +0200
From: davidw@linuxcare.com (David N. Welton)
Subject: Re: Alternatives to Perl - DB/WWW interface
Message-Id: <878zwo3xv2.fsf@eugene.prosa.it>

Mark Hamlin <mark.hamlin@artdigital.co.uk> writes:

> The first plus about PHP you'll probably mention is the fact that
> the code is embedded in the HTML document - Is there a perl system
> which will provide a similar setup.  I was reading about
> FastTemplates earlier which is of great interest.

There are indeed perl systems that do similar things, embperl and
something else.  There are also ways to embed any number of languages
directly in the Apache server.  Mod_dtcl and neowebscript come to
mind, or AOLServer if you wish to use a different server.

My personal experience is that mod_perl is pretty bloated.  You can,
however, do a great deal of things with it, such as writing Apache
modules in Perl.  If you don't need that functionality, something
lighter might be to your liking.

Ciao,
-- 
David N. Welton, Responsabile Progetti Open Source, Linuxcare Italia spa
tel +39.049.8043411 fax +39.049.8043412 cel +39.348.2879508
davidw@linuxcare.com, http://www.linuxcare.com/
Linuxcare. Support for the revolution.


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

Date: Fri, 02 Jun 2000 15:48:17 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Alternatives to Perl - DB/WWW interface
Message-Id: <5HQZ4.1796$6T1.379332@news.dircon.co.uk>

In comp.lang.perl.misc Mark Hamlin <mark.hamlin@artdigital.co.uk> wrote:
> Can anyone point me to articles giving a critical comparison of Perl and
> PHP and maybe a mention on Cold Fusion as well, preferbaly with a slant
> on DB & Web interfacing?
> 

Wrong place to ask.  This group has nothing to sdo with PHP or Cold Fusion.

/J\


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

Date: Fri, 02 Jun 2000 17:15:41 GMT
From: htmlguy@my-deja.com
Subject: ArsDigita Bootcamp review
Message-Id: <8h8q3c$v0m$1@nnrp1.deja.com>

I attended the ArsDigita (the people who do photo.net &
scorecard.org) bootcamp at Berkeley held in May and wrote a
review  posted<a
href="http://www.macwebmasters.com/arsdigita/review">
here</a>. If you think you
might be interested in attending then take a look.
the url is http://www.macwebmasters.com/arsdigita/review

Thanks

Ben


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


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

Date: Fri, 2 Jun 2000 17:55:26 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Can not expire cookies !!
Message-Id: <Pine.GHP.4.21.0006021749520.14892-100000@hpplus01.cern.ch>

On Fri, 2 Jun 2000, methos wrote:

> I know this may not be an acceptable suggestion,
> but try writing to the cookie without using cgi.pm

So that's three main weapons from the usual bogosity checklist:

* "Try" this - why? - aren't you sure whether it's going to work?

* "cgi.pm" instead of CGI.pm

* upside-down posting.

If the questioner has any sense, they'll take this as a recommendation
to use CGI.pm.

[...]

> I haven't done cookies in 4 years, so my syntax may be way off,

_Four_ main weapons:  "try" this, "cgi.pm", Jeopardy posting, and
"may be way off".  Nobody expects the S...  Inqu...




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

Date: Fri, 02 Jun 2000 16:30:54 +0100
From: Mark Hamlin <mark.hamlin@artdigital.co.uk>
Subject: Re: CC problems with Coldfusion Apache module
Message-Id: <3937D32E.8A731977@artdigital.co.uk>

When I take ucb out of the path I simply get a less informative message:

sun2-hamlinm$echo $PATH
/usr/sbin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/bin:/usr/ccs/bin:.:/usr/local/bin:/usr/apache/bin

sun2-hamlinm$ls
libcf.a           Makefile          mod_coldfusion.c
sun2-hamlinm$which cc
no cc in /usr/sbin /usr/bin /usr/dt/bin /usr/openwin/bin /bin /usr/ccs/bin
 . /usr/local/bin /usr/apache/bin
sun2-hamlinm$make
apxs -c   ./libcf.a /usr/lib/libCrun.so.1 mod_coldfusion.c
cc -DEAPI -DMOD_PERL -DUSE_EXPAT -O -G -Kpic -I/usr/apache/include  -c
mod_coldfusion.c
apxs:Break: Command failed with rc=16711680
*** Error code 1
make: Fatal error: Command failed for target `mod_coldfusion.so'
sun2-hamlinm$




Richard Homolka wrote:

> Technically not a stupid placeholder, but a stupid wrapper script around
> the compiler you need to purchase from Sun.  The wrapper sets flags for
> the BSD compiles, by giving you the BSD includes and the (buggy) BSD
> libraries.
>
> Theoretically of use when Solaris 2.0 first came out and all the
> software was written for BSD SunOS 4.0, but of dubious value now.
>
> Solutions:
> Remove /usr/ucb from your path, depends on if you need anything else
> from that directory.
> Bug Sun to give better error messages in the /usr/ucb/cc script.  As it
> is now, pretty cryptic.  How does "Language optional software not
> installed" tell me "Hey cheapskate, need to buy the Sun compiler"
>
> --
> ---------------------------------------------------------------------
> Richard Homolka        Iozo.com                        (415) 348-1975
> rhomolka@iozo.com      http://www.iozo.com



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

Date: Fri, 02 Jun 2000 16:34:03 +0100
From: Mark Hamlin <mark.hamlin@artdigital.co.uk>
Subject: Re: CC problems with Coldfusion Apache module
Message-Id: <3937D3EB.D617DDFD@artdigital.co.uk>

Do I need to purchase a new compiler?

Kind Regards,
Mark Hamlin


Mark Hamlin wrote:

> When I take ucb out of the path I simply get a less informative message:
>
> sun2-hamlinm$echo $PATH
> /usr/sbin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/bin:/usr/ccs/bin:.:/usr/local/bin:/usr/apache/bin
>
> sun2-hamlinm$ls
> libcf.a           Makefile          mod_coldfusion.c
> sun2-hamlinm$which cc
> no cc in /usr/sbin /usr/bin /usr/dt/bin /usr/openwin/bin /bin /usr/ccs/bin
> . /usr/local/bin /usr/apache/bin
> sun2-hamlinm$make
> apxs -c   ./libcf.a /usr/lib/libCrun.so.1 mod_coldfusion.c
> cc -DEAPI -DMOD_PERL -DUSE_EXPAT -O -G -Kpic -I/usr/apache/include  -c
> mod_coldfusion.c
> apxs:Break: Command failed with rc=16711680
> *** Error code 1
> make: Fatal error: Command failed for target `mod_coldfusion.so'
> sun2-hamlinm$
>
> Richard Homolka wrote:
>
> > Technically not a stupid placeholder, but a stupid wrapper script around
> > the compiler you need to purchase from Sun.  The wrapper sets flags for
> > the BSD compiles, by giving you the BSD includes and the (buggy) BSD
> > libraries.
> >
> > Theoretically of use when Solaris 2.0 first came out and all the
> > software was written for BSD SunOS 4.0, but of dubious value now.
> >
> > Solutions:
> > Remove /usr/ucb from your path, depends on if you need anything else
> > from that directory.
> > Bug Sun to give better error messages in the /usr/ucb/cc script.  As it
> > is now, pretty cryptic.  How does "Language optional software not
> > installed" tell me "Hey cheapskate, need to buy the Sun compiler"
> >
> > --
> > ---------------------------------------------------------------------
> > Richard Homolka        Iozo.com                        (415) 348-1975
> > rhomolka@iozo.com      http://www.iozo.com



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

Date: Fri, 02 Jun 2000 11:54:27 -0700
From: Joe Durusau <durusau@delphi.com>
Subject: Re: CC problems with Coldfusion Apache module
Message-Id: <393802E3.31DD54B2@delphi.com>

	Either buy a compiler, or if you already have one, use
it (suns would be in /opt/SUNWspro/bin if you did buy it), or
downlowd a free copy of gcc and its cousins.

Speaking only for myself,

Joe Durusau


Mark Hamlin wrote:
> 
> Do I need to purchase a new compiler?
> 
> Kind Regards,
> Mark Hamlin
> 
> Mark Hamlin wrote:
> 
> > When I take ucb out of the path I simply get a less informative message:
> >
> > sun2-hamlinm$echo $PATH
> > /usr/sbin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/bin:/usr/ccs/bin:.:/usr/local/bin:/usr/apache/bin
> >
> > sun2-hamlinm$ls
> > libcf.a           Makefile          mod_coldfusion.c
> > sun2-hamlinm$which cc
> > no cc in /usr/sbin /usr/bin /usr/dt/bin /usr/openwin/bin /bin /usr/ccs/bin
> > . /usr/local/bin /usr/apache/bin
> > sun2-hamlinm$make
> > apxs -c   ./libcf.a /usr/lib/libCrun.so.1 mod_coldfusion.c
> > cc -DEAPI -DMOD_PERL -DUSE_EXPAT -O -G -Kpic -I/usr/apache/include  -c
> > mod_coldfusion.c
> > apxs:Break: Command failed with rc=16711680
> > *** Error code 1
> > make: Fatal error: Command failed for target `mod_coldfusion.so'
> > sun2-hamlinm$
> >
> > Richard Homolka wrote:
> >
> > > Technically not a stupid placeholder, but a stupid wrapper script around
> > > the compiler you need to purchase from Sun.  The wrapper sets flags for
> > > the BSD compiles, by giving you the BSD includes and the (buggy) BSD
> > > libraries.
> > >
> > > Theoretically of use when Solaris 2.0 first came out and all the
> > > software was written for BSD SunOS 4.0, but of dubious value now.
> > >
> > > Solutions:
> > > Remove /usr/ucb from your path, depends on if you need anything else
> > > from that directory.
> > > Bug Sun to give better error messages in the /usr/ucb/cc script.  As it
> > > is now, pretty cryptic.  How does "Language optional software not
> > > installed" tell me "Hey cheapskate, need to buy the Sun compiler"
> > >
> > > --
> > > ---------------------------------------------------------------------
> > > Richard Homolka        Iozo.com                        (415) 348-1975
> > > rhomolka@iozo.com      http://www.iozo.com


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

Date: Fri, 02 Jun 2000 14:58:05 GMT
From: Derek D'Angelo <derek@ccil.org>
Subject: CGI.pm param function troubles
Message-Id: <8h8i1k$od2$1@nnrp1.deja.com>

Here's my code, I get nothing with the param function.. can anyone help?

#!/usr/local/bin/perl
use CGI;
$obj = new CGI;
print $obj->header();
print $obj->start_html("param function test");
print '<form name="params">';
print '<input type=text name="stuff">';
print '<input type=text name="stuff2">';
print '<input type=submit value="tah-dah">';
print '</form>';
if($obj->param())# it does enter this loop
{
   print "\n\nThis is what you typed: ";
   print $obj->param("params");# I get nothing
#This is the query_string parse routine
   $qs = $ENV{'QUERY_STRING'};
   @qs = split(/&/,$qs);
   foreach $i (0 .. $#qs)
   {
     $qs[$i] =~ s/\+/ /g;
     $qs[$i] =~ s/%(..)/pack("c",hex($1))/ge;
     ($name, $value) = split(/=/,$qs[$i],2);
     $qs{$name} = $value;
   }
   print "\n\nThis is also what you typed: ";
   print $qs; # I get the info here
}
print $obj->end_html;

--
derek@ccil.org


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


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

Date: Fri, 02 Jun 2000 11:15:31 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: CGI.pm param function troubles
Message-Id: <3937CF93.5D95A480@attglobal.net>

Derek D'Angelo wrote:
> 
> Here's my code, I get nothing with the param function.. can anyone help?
> 
> {
>    print "\n\nThis is what you typed: ";
>    print $obj->param("params");# I get nothing

Do you actually have a param called params?  If not, then
you'll not have a return for that call to param().  If you
are trying to get all the values passed to your script,
you call param() in this manner:

	@names = $query->param

Check the CGI.pm doc for details on how this works.  Calling
param() with an argument will return the value of that specific
paramater.  If no such paramater exists, then you get nada, hence
your error.

HTH


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

Date: Fri, 02 Jun 2000 11:19:57 -0400
From: Ted Marz <tfm@sei.cmu.edu>
Subject: Re: CGI.pm param function troubles
Message-Id: <3937D09D.AE1ABE31@sei.cmu.edu>

Uh, I think that param('name') returns things specified for form input
items, not for the top level form itself.

Method and action are two significant <form> attributes.  
name  (unless things have changed) "is used to associate a name with the
form.  This name can subsequently be used in JavaScript code to
reference and manipulate the form and its input elements."

to see what params exist, try using the dump method of CGI

all of this is documented in the POD of CGI.

Ted


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

Date: Fri, 02 Jun 2000 11:30:28 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: CGI.pm param function troubles
Message-Id: <3937D314.80CF7C22@attglobal.net>

Derek D'Angelo wrote:
> 
> Here's my code, I get nothing with the param function.. can anyone help?

I didn't read it very carefully the first time.  I see some
other things worth pointing out. Mostly style that Ive learned 
here from the pros.
 
> #!/usr/local/bin/perl   <---  always use '-w'

> use CGI;       <--   use CGI qw(:standard); dump the OO interface

> $obj = new CGI; <-- no need for this when you import the standard
                      (at least) methods.  I'll show you:

 print header(),
       start_html('param function test'),
       startform(-action=>'URL_to_send_to', 
                 -method=>POST);             #could be GET too
                  
> #print '<input type=text name="stuff">';
> #print '<input type=text name="stuff2">';
> #print '<input type=submit value="tah-dah">';
> #print '</form>';

The above can be better written as:

print textfield(-name=>'stuff'),   # can specify size here too.  
      textfield(-name=>'stuff2'),
      submit(-name=>'tah-dah'), 
      end_form;


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

Date: Fri, 2 Jun 2000 17:46:45 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: CGI.pm param function troubles
Message-Id: <Pine.GHP.4.21.0006021728080.14892-100000@hpplus01.cern.ch>

On Fri, 2 Jun 2000, Ted Marz wrote:

> all of this is documented in the POD of CGI.

By the way, there is a better HTML-based documentation of CGI.pm.
See it at L.Stein's own web site:
http://stein.cshl.org/WWW/software/CGI/cgi_docs.html

For a while, I was confused by an HTML-ised version of the POD
(presumably it's built automatically along with all the other PODs as
part of a Perl distribution), which isn't so good.

Compare the above URL with, say, the version in the ActiveState
package, it might be e.g file:///C|/Perl/html/lib/CGI.html
on a typical install, to see what I mean.



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

Date: Fri, 02 Jun 2000 17:09:47 GMT
From: Derek D'Angelo <derek@ccil.org>
Subject: Re: CGI.pm param function troubles
Message-Id: <8h8pod$uj7$1@nnrp1.deja.com>

Whenever I try using the use CGI qw(:standard); directive it never
works.

this is the error message I just got on the script you've already
pourded over (thanks everyone)

Your script produced this error: Unable to create sub named
"*Member::header" at ./param.pl line 13


In article <3937D314.80CF7C22@attglobal.net>,
  Drew Simonis <care227@attglobal.net> wrote:
> Derek D'Angelo wrote:
> >
> > Here's my code, I get nothing with the param function.. can anyone
help?
>
> I didn't read it very carefully the first time.  I see some
> other things worth pointing out. Mostly style that Ive learned
> here from the pros.
>
> > #!/usr/local/bin/perl   <---  always use '-w'
>
> > use CGI;       <--   use CGI qw(:standard); dump the OO interface
>
> > $obj = new CGI; <-- no need for this when you import the standard
>                       (at least) methods.  I'll show you:
>
>  print header(),
>        start_html('param function test'),
>        startform(-action=>'URL_to_send_to',
>                  -method=>POST);             #could be GET too
>
> > #print '<input type=text name="stuff">';
> > #print '<input type=text name="stuff2">';
> > #print '<input type=submit value="tah-dah">';
> > #print '</form>';
>
> The above can be better written as:
>
> print textfield(-name=>'stuff'),   # can specify size here too.
>       textfield(-name=>'stuff2'),
>       submit(-name=>'tah-dah'),
>       end_form;
>

--
derek@ccil.org


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


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

Date: 02 Jun 2000 13:22:14 -0400
From: David Meyers <dmeyers@panix.com>
Subject: Re: CGI.pm param function troubles
Message-Id: <yobg0qwyp4p.fsf@panix3.panix.com>

Drew Simonis <care227@attglobal.net> writes:


> > use CGI;       <--   use CGI qw(:standard); dump the OO interface

I think this is more a matter of taste.
I personally prefer not to pollute my namespace.

> > $obj = new CGI; <-- no need for this when you import the standard
>                       (at least) methods.  I'll show you:

To keep my typing to a minimum, though, I usually use:

my $q = new CGI;

--d


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

Date: Fri, 02 Jun 2000 13:50:24 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: CGI.pm param function troubles
Message-Id: <3937F3E0.8C19CC25@attglobal.net>

Derek D'Angelo wrote:
> 
> Whenever I try using the use CGI qw(:standard); directive it never
> works.
> 
> this is the error message I just got on the script you've already
> pourded over (thanks everyone)
> 
> Your script produced this error: Unable to create sub named
> "*Member::header" at ./param.pl line 13
> 

Have you tried changing the call "print $obj->header();" to just
"print $obj->header;" ?


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

Date: Fri, 02 Jun 2000 17:01:32 GMT
From: jsd@hudsucker.gamespot.com (Jon Drukman)
Subject: Re: code cleanup
Message-Id: <slrn8jfqfu.1mc.jsd@hudsucker.gamespot.com>

In article <0gGZ4.138886$55.2945335@news2.rdc1.on.home.com>, Bill wrote:
>I'm still new to PERL. Below, I've posted my very S L O P P Y and slow
>solution to my attempt to obtain the time 1 hour from the current time in a
>particular format. I think I have indented it such that someone would easily
>be able to offer suggestions on cleaning it up ? My main problem wasn't in
>obtaining 1 hour from the current time so much as figuring out how to put it
>in the required format. I am using Win2000 for my system "date" and "time"
>calls.

Your assumption that there is a better way is correct.  If you ever find
yourself thinking "there must be an easier way" - you are most likely correct.

Here's a two line solution (tested on Win2000):

use POSIX 'strftime';
print strftime("%a, %d-%b-%Y %H:%M:%S GMT\n", gmtime(time+3600));

As with most programming problems nowadays, the trick isn't knowing how
to write actual code, but rather knowing where to look to find the code that
someone has undoubtedly already written to solve your problem.

In fact, I'd say learning perl is the easy part - learning where the modules
and functions are that will make your job easier is the hard part!

How could you have found out about the existence of the POSIX strftime
function?  Personally, I'd have started by searching the archives of this
newsgroup for things like "time formatting" or "date formatting".  If you
had done that you would have found articles from two or three days ago
discussing this very problem.

(Note for golfers: the FreeBSD implementation of strftime provides
the alias %T for %H:%M:%S - it's not available on Windows though.)

Good luck.

-- 
Jon Drukman
Director of Technology
Gamespot/videogames.com




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

Date: 2 Jun 2000 15:44:28 GMT
From: cjw44@flatline.org.uk (Colin Watson)
Subject: Re: Compiling Perl-CGIs
Message-Id: <8h8kos$he3$1@riva.ucam.org>

Martin Plücker <mail@MAPLe-Soft.de> wrote:
>Is there some method to compile Perl-CGIs so that they can be run with the
>interpreter but the sources can't be seen or modified anymore?

Please read:

  perldoc -q 'hide the source'

Thanks,

-- 
Colin Watson                                     [cjw44@flatline.org.uk]
"I still remember the way that you laughed / When you pushed me down
 that elevator shaft" - "You Don't Love Me Anymore", Weird Al Yankovic


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

Date: Fri, 02 Jun 2000 17:45:32 GMT
From: lennie_jarratt@my-deja.com
Subject: DBI and Apache 1.3
Message-Id: <8h8rru$fka$1@nnrp2.deja.com>

I am trying to access my database via DBI on an
Apache 1.3.12 server.  I cannot get it to load the
 .so files for DBI.  How can I set this up?
BTW, the program runs fine from the command line,
just not from Apache.

Thanks,

Lennie


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


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

Date: Fri, 2 Jun 2000 11:47:45 -0400
From: "Phil R Lawrence" <prlawrence@lehigh.edu>
Subject: DBI.pm CGI.pm tutorial needed
Message-Id: <8h8kv2$f9s@fidoii.CC.Lehigh.EDU>

I see in deja that most people tend to respond to this question in two
parts:  Here's a good DBI book, and here's a good CGI book.

I need examples of how to use them together.  I'm decent at DBI already, but
new to CGI.pm.  For example, what should I do with the password that my user
submits?  You name it, I need to figure it out.

Any leads appreciated.  I'll eventually get something working using seperate
materials, but I wish I could stand on someone's shoulders...

Phil




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

Date: Fri, 02 Jun 2000 16:19:28 GMT
From: rk27@my-deja.com
Subject: Email this story to a friend - html to text
Message-Id: <8h8mpu$s7s$1@nnrp1.deja.com>



Hi,

I would like to add a feature to my website where the clients can email
a story to their friends. I want the email to be sent in *plain text*. I
have already written the code to grab the contents of a website in html
and email it but I would like to convert the html to plain text before I
mail it.

Thanks,

Rajesh


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


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

Date: 02 Jun 2000 11:34:26 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Email this story to a friend - html to text
Message-Id: <87itvsghyl.fsf@limey.hpcc.uh.edu>

>> On Fri, 02 Jun 2000 16:19:28 GMT,
>> rk27@my-deja.com said:

> I would like to add a feature to my website where the
> clients can email a story to their friends. I want the
> email to be sent in *plain text*. I have already written
> the code to grab the contents of a website in html and
> email it but I would like to convert the html to plain
> text before I mail it.

Try the HTML::Parser, HTML::TreeBuilder and
HTML::FormatText modules.

hth
t
-- 
"Trying is the first step towards failure"
                                           Homer Simpson


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

Date: Fri, 2 Jun 2000 10:32:57 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: file dates being reported incorrectly.....
Message-Id: <MPG.13a18fa14e795ff398ab1c@nntp.hpl.hp.com>

In article <393988f7.4709544@news.skynet.be> on Fri, 02 Jun 2000 
10:45:11 GMT, Bart Lateur <bart.lateur@skynet.be> says...
> scumjr wrote:
> 
> >> I find it suspicious that 31 Dec 69 is the day before the
> >> Unix epoch. Might that be a clue?
> >
> >Not a clue to me??  What is the Unix Epoch?
> 
> Time in it's bare form, is stored as a number, in seconds. Seconds since
> when? Since the Big Bang? Now that would be an extremely big number
> (plus, not very deterministic). To keep things managable, and get a
> relatively small number, there is a reference time: Time Zero, AKA the
> Epoch. On Unix, it is Jan 1st 1970 at 00:00:00 hours. Other systems may
> have copied that. All times are in seconds since The Epoch, which
> currently fits in a 32 bit integer.

Which unfortunately is treated as signed in most implementations, which 
allows one to deal with time back to 1901 but reduces the future range.

> Yes, there may be some bumps in a not too distant future, around 2034 I
> think. We hope that 64 bit integers, or at least 64 bit time
> calculations, are common by then.

   I:\>perl -le "print scalar gmtime +(1 << 31) - 1"
   Tue Jan 19 03:14:07 2038

The ultimate problem is not 64-bit integers and calculation, but 32-bit 
storage in external data.

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


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

Date: Fri, 02 Jun 2000 15:06:38 GMT
From: "Bill" <bill@billcampbell.com>
Subject: Re: Get the time, plus one hour (was: code cleanup)
Message-Id: <24QZ4.141768$55.2974082@news2.rdc1.on.home.com>

>#!/usr/bin/perl -w
>use strict;
>my($n,$m,$d,$t,$y)=(split(/ +/,scalar gmtime(time+60*60)));
>printf "one hour from now is \"%3s, %02d-%3s-%4d %8s GMT\"",($n,$d,$m,$y,$t);


Thank you all for the help you've afforded me thus far. I have one more question
regarding GMT. When I set this code for 1 hour from now GMT, does it expire
according to GMT or will it expire relative to my local time (EST). The above
code sets the expiry time to 5 hours from my local time.

As this code pertains to cookie expiration, will the cookie expire in 1 hour or
5 ?





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

Date: Fri, 02 Jun 2000 19:48:02 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: Get the time, plus one hour (was: code cleanup)
Message-Id: <p2sfjsspkkh3irhm426quguie4putgqc46@4ax.com>

On Fri, 02 Jun 2000 15:06:38 GMT, "Bill" <bill@billcampbell.com> wrote:

> >#!/usr/bin/perl -w
> >use strict;
> >my($n,$m,$d,$t,$y)=(split(/ +/,scalar gmtime(time+60*60)));
> >printf "one hour from now is \"%3s, %02d-%3s-%4d %8s GMT\"",($n,$d,$m,$y,$t);
> 
 ... 
>                                                                      The above
> code sets the expiry time to 5 hours from my local time.
No it doesn't, as it says GMT and not EST.
Could it be that: EST = GMT -0400?

-- 
Good luck,
Abe


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

Date: Fri, 02 Jun 2000 15:51:49 GMT
From: ra jones <ra_jones@my-deja.com>
Subject: Interpreting Benchmark
Message-Id: <8h8l6d$qv2$1@nnrp1.deja.com>

Could someone assist my interpretation of benchmarking?

I have the following at the head of a perl script:

use Benchmark;
$tr0 = new Benchmark;

and the following at the bottom (above the sub-routines):

$tr1 = new Benchmark;
$td = timediff($tr1, $tr0);
open(log,">>benchmark.txt");
print log "Benchmark:",timestr($td),"\n";
close(log);

A specimen result for one script:

	Benchmark: 0 wallclock secs ( 0.01 usr +  0.00 sys =  0.01 CPU)

and for a different script executed twice (asking it to perform
different tasks):

Run#1 -	Benchmark: 2 wallclock secs ( 0.43 usr +  0.03 sys =  0.46 CPU)
Run#2 -	Benchmark: 1 wallclock secs ( 0.57 usr +  0.04 sys =  0.61 CPU)

The question is, does the first script take 0.01 seconds (ie 10
milliseconds) to execute? For the second script, why does 0.46 CPU
(seconds?) equate to 2 wallclock secs, but 0.61 CPU equate to 1
wallclock secs? How long is the second script taking to complete its
task?

Flames (as in: read the ***** FAQ - I have) & sensible answers most
welcome ;-)

--
ra jones (posted via deja.com)

address for e-mail reply:
rajones(at)mail(dot)com


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


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

Date: 02 Jun 2000 18:11:26 +0100
From: nobull@mail.com
Subject: Re: Interpreting Benchmark
Message-Id: <u97lc83t4x.fsf@wcl-l.bham.ac.uk>

ra jones <ra_jones@my-deja.com> writes:

	Benchmark: 0 wallclock secs ( 0.01 usr +  0.00 sys =  0.01 CPU)


> The question is, does the first script take 0.01 seconds (ie 10
> milliseconds) to execute?

No it uses 10ms of CPU time (give or take the ganularity of the
measure). 

> and for a different script executed twice (asking it to perform
> different tasks):

> Run#1 -	Benchmark: 2 wallclock secs ( 0.43 usr +  0.03 sys =  0.46 CPU)
> Run#2 -	Benchmark: 1 wallclock secs ( 0.57 usr +  0.04 sys =  0.61 CPU)

> For the second script, why does 0.46 CPU
> (seconds?) equate to 2 wallclock secs, but 0.61 CPU equate to 1
> wallclock secs?

The clock on my wall (and the Perl "wallclock" function time()) ticks
once a second. As such if I use it to time the duration of something
it can be almost a second out in either direction.

Start: 17:52:30.000
End:   17:52:31.999

Wallclock seconds elapsed 1, actual seconds elapsed 1.999

Start: 17:52:32.999
End:   17:52:33.000

Wallclock seconds elapsed 2, actual seconds elapsed 1.001

Secondly your perl script may not be the only task running on the
system so you may not get 100% of the CPU time.

Thirdly your script may need to do some IO.

> How long is the second script taking to complete its
> task?

Between 1001ms and 2999ms the first time.
Between 610ms and 1999ms the second time.

And the moral of the story is: use benchmarks that take longer.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Fri, 02 Jun 2000 17:16:52 GMT
From: jsd@hudsucker.gamespot.com (Jon Drukman)
Subject: Re: mysql insertid
Message-Id: <slrn8jfrcq.1mc.jsd@hudsucker.gamespot.com>

In article <MPG.13a25083bef92df8989702@news>, jason wrote:
>kenny@barmeister.com writes ..
>>I am trying to get the insertid of the last insert I did in a MySQL
>>table.  The column is auto incremented and the primary key.  I have used
>>both:
>>
>>my $new_id = $dbh->{'mysql_insertid'};
>>my $new_id = $sth->{insertid};
>>
>>However I am not getting any results with these.  Has anyone else run
>>into this??  I would appreciate any help anyone could give me on this.
>
>I don't know anything about these special hash elements that you seem to 
>be referencing above .. and I don't know where you got them from or if 
>you just made them up

RTFM.  (perldoc DBD::mysql particularly).  Here's the relevant snippet:

mysql_insertid
MySQL has the ability to choose unique key values automatically.
If this happened, the new ID will be stored in this attribute.
This attribute is not valid for DBD::mSQL. An alternative way
for accessing this attribute is via $dbh->{'mysql_insertid'}.
(Note we are using the $dbh in this case!) 


I believe however that this was added relatively recently, so older
MySQL installations do not support it.  For maximum portability, you
should use the SELECT LAST_INSERT_ID() method.

-- 
Jon Drukman
Director of Technology
GameSpot




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

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


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