[22644] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4865 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 19 18:06:54 2003

Date: Sat, 19 Apr 2003 15:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 19 Apr 2003     Volume: 10 Number: 4865

Today's topics:
    Re: 400 Bad Request with https proxy and LWP (Tad McClellan)
    Re: ANN: International Perl Beginners Mailing List <dha@panix.com>
        design considerations for using DB_File tie hashes ??? (dan baker)
    Re: French ascii characters? <kemal644@yahoo.com>
    Re: French ascii characters? (Walter Roberson)
    Re: French ascii characters? <jurgenex@hotmail.com>
    Re: Help needed understanding bitwise operations <scottjk@softhome.net>
    Re: Help needed understanding bitwise operations <Jodyman@hotmail.com>
    Re: International Perl Beginners Mailing List <anthony@nospam.safferconsulting.com>
    Re: International Perl Beginners Mailing List <bob@aol.com>
    Re: International Perl Beginners Mailing List <anthony@nospam.safferconsulting.com>
    Re: my cgi works but won't execute external commands su (Tad McClellan)
    Re: Need advice on my first Perl script <bob@aol.com>
    Re: Need advice on my first Perl script <wcitoan@NOSPAM-yahoo.com>
    Re: need help with snmptraps in perl <bob@nowhere.com>
    Re: Number of List Items <delautensch@[nospam]wisc.edu>
        Odd HTML mails (Caie)
        Perl source install over redhat rpm <eddy@NOSPAMaxa.it>
    Re: Remembering previous values of the form. (Malcolm Dew-Jones)
        Session Script <chris_12003@yahoo.com>
    Re: Smart searching (Tad McClellan)
    Re: Still Stumped <delautensch@[nospam]wisc.edu>
    Re: webhosts that support perl well? (dan baker)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 19 Apr 2003 12:56:51 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: 400 Bad Request with https proxy and LWP
Message-Id: <slrnba33f3.c28.tadmc@magna.augustmail.com>

Robert <robert@nrc.net> wrote:
> I've read many other posts and documents on the ways to connect to
> https through a proxy, however with all the problems that I've seen
> posted, I haven't seen a resolution to this. I'm trying to connect
> through an http proxy to an https page. I can CONNECT but I can't GET
> or POST. For some reason it won't connect no matter what I try, I get
> this result:
> 
> Code: 400
> Message: Bad Request
> Request: HTTP::Request=HASH(0x82455a4)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


That is the textual representation of a reference. It is a
dead-giveaway that you are missing a _de_reference somewhere.

It also tells us that the reference is not a plain reference,
but an object of type HTTP::Request (ie. a blessed reference).


> #!/usr/bin/perl


It isn't very nice to ask people to find problems without first
asking a machine to find problems. It is demeaning to be asked
to do a machine's job.

   #!/usr/bin/perl
   use strict;
   use warnings;


> use LWP::UserAgent;
> use HTTP::Cookies; 
> use LWP::Debug ('+');
> use LWP::Protocol::https;
> use Net::SSL;
> use Net::SSLeay;
> use URI::https;


> $browser= LWP::UserAgent->new(requests_redirectable => ['GET', 'HEAD',
> 'POST'],);

> $response = $browser->request( $request );

From the docs for the UserAgent module:

   request is then passed to the UserAgent
   request() method, which dispatches it using the relevant
   protocol, and returns a HTTP::Response object.

so $response is an HTTP::Response object.


> 	print "Request: ", $response->request, "\n";
                           ^^^^^^^^^^^^^^^^^^

There is the not-dereferenced reference.

From the docs for the Response module:

   The request attribute is a reference the request that caused this
   response.

so $response->request is an HTTP::Request object (a reference), but
you have not de-referenced it.


What was it that you _wanted_ to print()?


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


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

Date: Sat, 19 Apr 2003 18:35:22 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: ANN: International Perl Beginners Mailing List
Message-Id: <slrnba35na.gkp.dha@panix2.panix.com>

In article
<Pine.LNX.4.33L2.0304181456370.24613-100000@vipe.technion.ac.il>, Shlomi
Fish wrote:

> On 18 Apr 2003, Randal L. Schwartz wrote:
> 
>> There is no need for *another* list.  Shlomi has not demonstrated the
>> need, except from a selfish "not invented here" position.
>>
> 
> The need is the high volume of the existing list.

But if your list is of sufficient quality, it will *also* suffer from
high volume.

The problem (or perhaps "problem") is not that a given list is high
volume, per se, but that any resource that people start using
extensively will become high volume.

I don't see that another general beginners list solves this in any way.

There are already man lists for specific subjects, which seem to address
your concern much better than a list that essentially duplicates the
function of an existing one.

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
 ... we didn't know what the hell we were doing, but we did it loud.
        - Andy Partidge on early XTC


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

Date: 19 Apr 2003 11:36:07 -0700
From: botfood@yahoo.com (dan baker)
Subject: design considerations for using DB_File tie hashes ???
Message-Id: <13685ef8.0304191036.4c1fefd4@posting.google.com>

hi folks... I'm in the preliminary stages of designing a membership
management system that will be driven with a html based interface and
wanted to get some high-level pros and cons and does and donts with
regard to methods for storing the data.

Its looking like the DB_File module in combination with tie-ing to
hashes is a pretty cool way to get a reasonably fast and lightweight
"fake" database as long as the data lends itself to indexed tables.
Some of my key considerations are:
- access speed for maybe up to 100k-500k records. Anything less than a
second doesnt really matter since the front end is web-driven.
- ability to write easy import/export utilities from ascii csv files
- portability of application source and (hopefully) datafiles between
*nix and win32 PC development platforms.

My alternative, since this application will have relatively small
numbers of records, would be faking data tables with plain ascii text
and writing some simple tools to read and write records.

I am wondering a couple things (as compared to faking it with flat
text files):

- at what point (how many records) does a tied DB_File hash get to be
"faster" than opening, reading, closing a plain text file ?

- how "stable" is the tied hash going to be ? its especially scarey to
me in that it is not man-readable, and any corruption would be
impossible to recover from.

- is the hash created by DB_File portable as is from *nix to win32 ?
Or, would I have to export to a csv ascii file, ftp, and import at the
other end ?

- does the DB_File version of tie handle all the flock-ing issues
behind the curtain? or, do I need to worry about doing that in my
application ? specifically, if multiple users are hammering away at
the application, are the records flocked, or the whole "table" as soon
as I "tie" it until I untie it?

- I'm a flocking newbie.... what actually happens when another users
process tries to tie to the hash when its in use ? does the system
wait and try again, or error out ?

Any other basic issues that ya'll have learned about considerations
for choosing a method for faking databases would be appreciated!

thanx,

Dan


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

Date: Sat, 19 Apr 2003 08:15:24 -0700
From: "tony76" <kemal644@yahoo.com>
Subject: Re: French ascii characters?
Message-Id: <b7rp62$20p8$1@nntp6.u.washington.edu>

Thanks all.

Whoa...  this ASCII issue is clearly larger than I anticipated.  For the
record, please note that I never used the phrase "French ASCII characters"
in my post.

The output to the command line, in words containing accented characters, are
all characters that I do not know the names of, mostly mathematical symbols.
The square root symbol, the e with an accent grave becomes some kind of zero
with dot in the center, and so on.  When the output is sent to a text file
(instead of the command line), all of the accented characters are displayed
correctly.

"Alan J. Flavell" <flavell@mail.cern.ch> wrote in message
news:Pine.LNX.4.53.0304191113440.26061@lxplus072.cern.ch...
> On Sat, Apr 19, Walter Roberson inscribed on the eternal scroll:
>
> > Although this may sound petty at first,
>
> I wouldn't say so.  The first step to a clear understanding of
> character coding problems is to learn how to talk about them.
>
> > there are no "French ASCII characters". ASCII is a 7 bit data
> > encoding, and the small number of "national symbols" of variation
> > allowed in it was never large enough to include the standard French
> > accented characters.
>
> [To be pedantic;]
>
> See 'National ISO-646' 7-bit codings; Google suggests
>
> http://www.terena.nl/library/multiling/euroml/section04.html
>
> However, this could be classed as archaeology nowadays.
>
> > It may just sound as if I'm arguing over semantics, but the semantics
> > are potentially important to your difficulty. You can't be using
> > French ASCII because French ASCII doesn't exist -- so you must
> > be using some other way of encoding those French characters.
>
> us-ascii _was_ one of the national flavours of iso-646, but became the
> IRV ('international reference version') in 1991.
>
> I'm sure none of this is directly relevant to the hon. Usenaut's
> problem, but occasionally it seems good to review the history.
>
> > You didn't really give us much to go on. Please don't just
> > tell us that it "started outputing garbage": do a forensic
> > analysis of the garbage and tell us more about it.
>
> Absolutely.
>




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

Date: 19 Apr 2003 18:09:39 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: French ascii characters?
Message-Id: <b7s3d3$rtr$1@canopus.cc.umanitoba.ca>

In article <b7rp62$20p8$1@nntp6.u.washington.edu>,
tony76 <kemal644@yahoo.com> wrote:
:Whoa...  this ASCII issue is clearly larger than I anticipated.  For the
:record, please note that I never used the phrase "French ASCII characters"
:in my post.

Your Subject: was "French ascii characters?" and your Subject: is part
of your post.

:When the output is sent to a text file
:(instead of the command line), all of the accented characters are displayed
:correctly.

Sounds like what the other poster said about different code pages
being used between DOS and GUIs (which I didn't know but doesn't
surprise me at all.)
-- 
   We don't need no side effect-ing
   We don't need no scope control
   No global variables for execution
      Hey! Did you leave those args alone?   -- decvax!utzoo!utcsrgv!roderick


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

Date: Sat, 19 Apr 2003 18:18:02 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: French ascii characters?
Message-Id: <upgoa.739$Df4.701@nwrddc03.gnilink.net>

tony76 wrote:
> Whoa...  this ASCII issue is clearly larger than I anticipated.  For
> the record, please note that I never used the phrase "French ASCII
> characters" in my post.

See your subject line. Actually it's still there.

> The output to the command line, in words containing accented
> characters, are all characters that I do not know the names of,
> mostly mathematical symbols. The square root symbol, the e with an
> accent grave becomes some kind of zero with dot in the center, and so
> on.  When the output is sent to a text file (instead of the command
> line), all of the accented characters are displayed correctly.

Then your Perl script prints the characters in Windows-1252 (or maybe
ISO-Latin-1 which is almost identical).
But your DOS prompt expects the DOS code page encoding 8-something-something
(don't have the correct number handy).

Sorry, DOS and Windows-1252 are not compatible. You need to make up your
mind which one you want to use.

BTW: You can use Text::Iconv to convert text between virtually any
encodings.

jue




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

Date: Sat, 19 Apr 2003 16:13:05 GMT
From: Dark Over Lord <scottjk@softhome.net>
Subject: Re: Help needed understanding bitwise operations
Message-Id: <56t2avgcn9r9m0brhdrboiqun7d2q07f7q@4ax.com>

On Sat, 19 Apr 2003 13:58:51 GMT, merlyn@stonehenge.com (Randal L.
Schwartz) wrote:

>>>>>> "Dark" == Dark Over Lord <scottjk@softhome.net> writes:
>
>Dark> Hello gang.
>Dark> I'm plowing through a book learning perl. But, I'm getting hung up
>Dark> understanding the use of bitwise operators. I just can't seem to
>Dark> visualize it. Other operators are easy for me to understand because
>Dark> they are easily demonstrated, but bitwise operations seem a tad too
>Dark> abstract to me. Can anyone help?
>
>Perhaps we should have more clearly marked that section "optional, and
>only if you already understand bitwise things from other places".
>Sorry. :)
>
>Here's the short version.
>
>10 decimal is 1010 binary
>12 decimal is 1100 binary
>
>if I were to "bitwise and" them, the result would have a "1" bit
>only everywhere that *both* of them had a "1" bit.  So, in vertical
>columns... it's "1 ... 0 ... 0 ... 0".  Now convert that back
>to a decimal... it's "8".
>
>Similarly, if I were to "bitwise or" them, the result would
>have a "1" bit only everywhere *either* of them had a "1" bit.
>That's "1 ... 1 ... 1 ... 0".  That's decimal 14.
>
>Does that help?  Look at each column.  And/or/whatever it.

Wow, straight from the author! Okay, let me see if I can reflect this
back.

bitwise AND: Where the bit is ON and they match return 1, all other
bits 0
1101
1010

result:
1000

bitwise OR: Where the bit is on regardless if they match return 1, all
other bits 0
1101
1010

result:
1111


Now, assuming that I am right (I hope!) What about different lengths?

Example:
10110101
1010

Are they right aligned or left? And would I have to pad them with 0s?




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

Date: Sat, 19 Apr 2003 18:09:38 GMT
From: "Jodyman" <Jodyman@hotmail.com>
Subject: Re: Help needed understanding bitwise operations
Message-Id: <Chgoa.32351$4P1.2914452@newsread2.prod.itd.earthlink.net>


"Dark Over Lord" <scottjk@softhome.net> wrote in message
[snip]
> Now, assuming that I am right (I hope!) What about different lengths?
>
> Example:
> 10110101
> 1010
>
> Are they right aligned or left? And would I have to pad them with 0s?

Assume you had 181 and 10, are they right aligned or left?  Do you have
to pad them with zeros?

181 or 10 = 191
10110101 or 1010 = 10111111

Think in binary not decimal.

hth,

Jodyman




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

Date: Sat, 19 Apr 2003 14:59:18 -0500
From: "Anthony Saffer" <anthony@nospam.safferconsulting.com>
Subject: Re: International Perl Beginners Mailing List
Message-Id: <3ea1aad9_1@nntp2.nac.net>

"Shlomi Fish" <shlomif@vipe.technion.ac.il> wrote in message
news:Pine.LNX.4.33L2.0304181115200.24211-100000@vipe.technion.ac.il...
>
> I started another international Perl beginners mailing list hosted at
> berlios.de:
>
> https://lists.berlios.de/mailman/listinfo/perl-begin-help
>
> I'd appreciate any experienced Perl programmers joining it so beginners
> can receive some expert help. And naturally, if you are a beginner and
> would like to join - you are more than welcome to do so.
>
> Best regards,
>
> Shlomi Fish

I have to agree with what others have said here. There really isn't a need
for a new mailing list targeting Perl beginners. The one that already exist
does an excellent job of that. I'm a reletive newbie to Perl. I have over 15
years programming experience with other languages but almost none with Perl.
With the help of the Perl beginners list, I was able to tackle a somewhat
complex project within about 4.5 months. This and I only had to ask 2 or 3
questions (I was able to find everthing else in the archives).

My advice to you is to jump in and contribute to the existing resources that
are out there. If what you really want is to contribute to the community in
a selfless way then work within the existing community. If, after you've
done that for a while, you STILL see a need then consider splintering off.

Just my $0.02
Anthony Saffer




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

Date: Sat, 19 Apr 2003 20:20:48 GMT
From: Optional <bob@aol.com>
Subject: Re: International Perl Beginners Mailing List
Message-Id: <3lb3avk2etrsfj8ou0ejkt6jr914g9ae6p@4ax.com>

I've heard a rumor that on Sat, 19 Apr 2003 14:59:18 -0500, "Anthony
Saffer" <anthony@nospam.safferconsulting.com> wrote the following:

>"Shlomi Fish" <shlomif@vipe.technion.ac.il> wrote in message
>news:Pine.LNX.4.33L2.0304181115200.24211-100000@vipe.technion.ac.il...
>>
>> I started another international Perl beginners mailing list hosted at
>> berlios.de:
>>
>> https://lists.berlios.de/mailman/listinfo/perl-begin-help
>>
[SNIP]
>
>Just my $0.02
>Anthony Saffer
>
Or  your 0.0183874 EUR
:)


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

Date: Sat, 19 Apr 2003 16:11:49 -0500
From: "Anthony Saffer" <anthony@nospam.safferconsulting.com>
Subject: Re: International Perl Beginners Mailing List
Message-Id: <3ea1bbda_2@nntp2.nac.net>

<snip>
> >Just my $0.02
> >Anthony Saffer
> >
> Or  your 0.0183874 EUR
> :)

Hey! That answers another question I had...LOL

A.




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

Date: Sat, 19 Apr 2003 12:41:34 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: my cgi works but won't execute external commands such as 'system(mkdir fred)' or 'open (filefandle, ">myfile.txt")'
Message-Id: <slrnba32ie.c28.tadmc@magna.augustmail.com>

Jolly Joe Jim Bob <jollyjoejimbob@hotmail.com> wrote:

> thank you so much for your input, 


Your welcome.

Please do not top-post again, if you want continued input.


> did i forget to mention that this is my
> first ever perl program ?


It wouldn't matter, as I don't see that that is relevant.

You ought to have a look at the Posting Guidelines as they suggest
several ways of improving your chances of getting a useful answer.

   http://mail.augustmail.com/~tadmc/clpmisc.shtml


> i do greatly respect your opinion on helping others first


I did not say anything about helping others first, so I don't
know why you bring it up.


> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrnba0njo.akm.tadmc@magna.augustmail.com...


>> If you expect people to volunteer to help you, then you should as
>> much as you can yourself *before* resorting to asking for their time.


Here I talked about helping the helpers *help you*, by doing the
list of "usual things" yourself before you ask for their time.

Doing "the usual things" often helps you discover the problem
yourself without needing to depend on others.


[snip list of things to try *before* posting to Usenet]



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


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

Date: Sat, 19 Apr 2003 15:17:30 GMT
From: Optional <bob@aol.com>
Subject: Re: Need advice on my first Perl script
Message-Id: <u8p2avgbf1qmpr3jh9fs8mmph9pjdndgte@4ax.com>

I've heard a rumor that on Fri, 18 Apr 2003 16:48:17 -0500,
tadmc@augustmail.com (Tad McClellan) wrote the following:

>>>tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrnb9v2r2.96s.tadmc@magna.augustmail.com>...
>>>> Scott Spencer <scott@doppelgangerdesign.com> wrote:
>>>> 
>>>> > keep only every 5th or 6 th file deleting the ones in between.
>
>
>[snip full-quote]
>
>

>> if ($file =~ /0.tif/ || $file =~ /5.tif/) {
>
>
>   if ($file =~ /[05]\.tif$/ ) {

So why do you need to escape a . with \ ?  Script works with or
without it.  

And why the $?  to match tif* ?  Didn't orginal post say all files
were named *.tif?  That's why foreach $file (<*.tif>) {  
Couldn't it be like this?
if (file =~ /[05].tif/) {

Not trying to argue, just want to learn more...


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

Date: Sat, 19 Apr 2003 15:50:57 -0000
From: "W. Citoan" <wcitoan@NOSPAM-yahoo.com>
Subject: Re: Need advice on my first Perl script
Message-Id: <slrnba2s2v.25t.wcitoan@wcitoan-via.supernews.com>

On Sat, 19 Apr 2003 15:17:30 GMT, Optional wrote:
>
> >   if ($file =~ /[05]\.tif$/ ) {
>  
>  So why do you need to escape a . with \ ?  Script works with or
>  without it.  
>  
>  And why the $?  to match tif* ?  Didn't orginal post say all files
>  were named *.tif?  That's why foreach $file (<*.tif>) {  
>  Couldn't it be like this?
>  if (file =~ /[05].tif/) {
>  
>  Not trying to argue, just want to learn more...

Because "." means any character so if you wish to match a period only
you must escape it.  The "$" at the end means end of expression so only
match items ending in "tif".

Yes, if you did "/[05].tif/" it will still match the desired files, but
it will also match:

  ...0atif
  ...0.tifANDMORE

Using "/[05]\.tif$/" is good defensive programming.  It ensures that
only items names you expect are matched.  It prevents an accidental
match to some other file.

While you might not think it likely an unitentional match will occur,
consider this:  sometime later, you (or someone else) comes along and
decides to write some notes, calls it "NOTES5-tif.txt" for some reason
or another, and puts it in that directory because it's convienent.  It
may not be likely, but it could happen, so why not prevent it?

- W. Citoan
-- 
hubub, hubub, HUBUB, hubub, hubub, hubub, HUBUB, hubub, hubub, hubub.


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

Date: Sat, 19 Apr 2003 13:45:58 -0500
From: bob <bob@nowhere.com>
Subject: Re: need help with snmptraps in perl
Message-Id: <3ea19959$1_1@127.0.0.1>

Have you tried searchng at www.cpan.org?

On Sat, 19 Apr 2003 01:09:24 -0500, Arne Goetje wrote:

> I want to write an snmptrap receiver in perl and want to process the
> received traps to do some actions.


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---


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

Date: Sat, 19 Apr 2003 16:29:46 -0500
From: "pooba53" <delautensch@[nospam]wisc.edu>
Subject: Re: Number of List Items
Message-Id: <b7sf4d$336$1@news.doit.wisc.edu>

Thanks for the information. Sorry to have annoyed you.
-Dan

"Jay Tilton" <tiltonj@erols.com> wrote in message
news:3e9dcfaa.99661600@news.erols.com...
> pooba53 <delautenschl@[nospam]wisc.edu> wrote:
>
> : I have a list that contains references. I'm trying to find out how many
> : items are in the list.
> :
> : Usually, if the list is @some_list,
>
> That's an array, not a list.  This is not an insignificant
> disctinction.  Using the correct terminology is crucial in accurately
> conveying your meaning.
>
> See perlfaq4, "What is the difference between a list and an array?"
>
> : you would say:
> :
> : $count = $#some_list
>
> No, that gives the index of the last element in the array.  To get the
> number of elements, use the array in a scalar context.
>
>     $count = @some_list;
>
> : but this does not work with a list of references.
>            ^^^^^^^^^^^^^
> See the subsection titled "Beware of saying 'doesn't work'" in the
> clpm posting guidelines.  That statement does nothing to explain the
> problem.
>
> That the elements of the array are references has no impact at all on
> the syntax for counting them.
>
> : My list is -----> @{$unique[0]}
>
> Perhaps you mean,
>
>     I have an array of array references.  How can I count the
>     number of elements in one of those referenced arrays?
>
> If that's it, simply dereference and use it in scalar context.
>
>     $count = @{$unique[0]};
>




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

Date: 19 Apr 2003 09:15:25 -0700
From: the_caie@hotmail.com (Caie)
Subject: Odd HTML mails
Message-Id: <87d7d0df.0304190815.706fc6eb@posting.google.com>

Hello Wizards and Muggles,

A quick question for you that is confusing me.  I'm developing a
program which takes a text document, does some fancy stylistic
calculations on it and generates a vareity of HTML pages with the
results.

The generated HTML is fine - all tables, jpegs, links and so on are
generated nicely.  The problem comes when I try to send these results
as an E-mail using the MIME::Lite module from CPAN.  This is the code
I'm using to generate the E-mail:

<SNIP>
# Call the external module MIME::Lite
use MIME::Lite;
# Construct E-mail object
my $msg = MIME::Lite->new(
                 To      =>$to,
                 From    =>$from,
                 Subject =>$subject,
                 Type    =>'multipart/mixed'
                 );
# Read in the HTM file
while(<BODYTEXT>) {
   $body .= $_;
}
close BODYTEXT;
$msg->attach(	
  			Type    => 'text/html',
    			Data    => $body
                 );
        
# Print out the MIME to an E-mail log file
open(MIMEOUT, ">/lastemail.log") or die "Unable to open LOG for
writing of MIME";
$msg->print(\*MIMEOUT);
close MIMEOUT;
	
# Send it
$msg->send();
</SNIP>

Basically I've created a HTM file with a copy of the HTML generated
during the program, this is then read in to a variable ($body) and
attached to the message.  When viewing the HTM file with the browser
there is nothing wrong - it is indeed an exact copy of what the
program has generated, however, when viewing the E-mail sent with
Outlook or in Hotmail it has gone a bit screwy.

Every couple of lines there appear exclamation marks in the middle of
words, and a table has decided to boycott a column header.  I suspect
this has something to do with the way I've attached the HTML to the
$msg object.  Do I have to add images and HTML seperatly, that is - do
I have to have an assortment of $msg->attach(...) for different types
of data?  Or am I just using the wrong header (I've tried
multipart/mixed as well as multipart/related - can't think of any
others off the top of my head that would sort it).

Any ideas?

Caie


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

Date: Sat, 19 Apr 2003 21:58:03 +0200
From: "Eddy" <eddy@NOSPAMaxa.it>
Subject: Perl source install over redhat rpm
Message-Id: <b7s9nv$th3$1@lacerta.tiscalinet.it>

On my RH 6.2 I have tryed to upgrade Perl to 5.8 with source version

It seems that the lib directories have mixed together  with the old rpm
version from redhat:

/usr/local/lib/perl5/5.8.0/

and

/usr/lib/perl5/5.00503/
/usr/lib/perl5/site_perl/5.005/i386-linux/

perl -V says:
@INC:
    /usr/local/lib/perl5/5.8.0/i686-linux
    /usr/local/lib/perl5/5.8.0
    /usr/local/lib/perl5/site_perl/5.8.0/i686-linux
    /usr/local/lib/perl5/site_perl/5.8.0
    /usr/local/lib/perl5/site_perl

I have found also that I have multiple copies of perllocal.pod -->

[root@www /]# locate perllocal.pod
/usr/lib/perl5/5.00503/i386-linux/perllocal.pod
/usr/lib/perl5/site_perl/5.005/i386-linux/perllocal.pod
/usr/local/lib/perl5/5.8.0/i686-linux/perllocal.pod
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/perllocal.pod

How can I "clean up" everything?
"rpm -e perl " fails because everything depends on perl,
if i delete the old /usr/lib/perl5/ some redhat programs stop working,
please help

thank you
Eddy







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

Date: 19 Apr 2003 14:22:11 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Remembering previous values of the form.
Message-Id: <3ea1be03@news.victoria.tc.ca>

Hemant Shah (shah@typhoon.xnet.com) wrote:

: Folks,

:    I am writing timesheet entry system using perl CGI.pm and Javascript,
:    on Linux.

:    I have completed the form that displays time already entered, and allows
:    the user to add/chage/delete time. My problem is trying to remember what
:    the timesheet looked like when it was displayed, so that I can somehow
:    compare it with the new values when user presses "Save" button.

Why?

If the user is allowed to save the values then why not simply save the
latest values, overwriting the previous values.  Values that's aren't
changed will be updated to the same value, but why is that a problem?

If you are concerned about efficiency in writing to the database then make
the sql do an update when newvalue != currentvalue.

Someone discussed doing this in javascript, which is fine because it can
be nicer for the user to do some tasks locally, but the cgi script should
never depend upon the values, so your cgi script must still decide how
best to handle the situation of updated data vs original data.



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

Date: Sat, 19 Apr 2003 14:16:58 -0700
From: "Chris" <chris_12003@yahoo.com>
Subject: Session Script
Message-Id: <va3fbf30v2ppd4@corp.supernews.com>

Does anyone know where I can find a sample script storing variables for a
Session?  I found documentation on sessions at cpan.org but didn't see any
scripts I could try running on my server.

Thanks,
Chris




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

Date: Sat, 19 Apr 2003 12:44:27 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Smart searching
Message-Id: <slrnba32nr.c28.tadmc@magna.augustmail.com>

Kasp <kasp@epatra.com> wrote:

> I intend to make a google-like interface (using CGI). The user can then type
> in some of the words of a file. For eg. suppose he is looking for a MP3
> called "Perl Rocks". Then I want some way of searching through the file
> names I have collected and search for this combination.
> 
> By intelligent search I mean that the results displayed should first attempt
> to show files having both the words common, followed by records having
> atleast one of the search words.
> 
> So suppose user says "A B", then I search for strings having (*A*B* |
> *B*A*).
> Then I search just for A | B.
> 
> However, this method's performance will degrade quickly as the number of
> words increases to "A B C", "A B C D"...and so on.

> Or could you
> suggest some way out.


Scoring.

Search for each of the words, assign a score (10 points say) for
each word that matches. Order the results by total score.


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


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

Date: Sat, 19 Apr 2003 16:24:06 -0500
From: "pooba53" <delautensch@[nospam]wisc.edu>
Subject: Re: Still Stumped
Message-Id: <b7sepp$31u$1@news.doit.wisc.edu>

I figured out using the:
push ( @{$AllGenes{$gene}}, @range);

What I then used to get the unique elements was a chunk of code another
gentleman posted a week or so ago that needed a tad bit of modification:

while (($key,$aref) = each %AllGenes)  {
    @unique = grep !$seen{$_}++, map @$_, $aref;
    $count = @unique;
    print OUTPUT"$key:$count\n";
}

The second line after the while loop is "killer"! I still don't fully
understand what it does, but it is a classy, powerful one-liner that made
the program work.

Thanks to all that helped with this. I've been Perling for about 6 years and
had never really done squat with array references. Most of my work has been
Perl/Tk client applications communicating with MySQL servers.

-Dan


"Bob Walton" <bwalton@rochester.rr.com> wrote in message
news:3EA05489.5070409@rochester.rr.com...
> pooba53 wrote:
>
> ...
> > I've tried the following within the loop that generates the output
below:
> >
> >
> > @range = ($begin..$end);
> > push ( @{$AllGenes{$gene}}, @range);
>
>
> You are pushing an array onto an array.  You probably want to push an
> array reference onto the array.  Maybe like:
>
> push ( @{$AllGenes{$gene}}, \@range);
>
> I think that will generate the structure you want.  You will end up with
> a hash called %AllGenes, each value of which is an array reference, each
> element of which array is a reference to another array.  Example:
>
>     use Data::Dumper;
>     @r1=(2..7);
>     @r2=(10..15);
>     @r3=(7..17);
>     push @{$hash{one}},\@r1;
>     push @{$hash{one}},\@r2;
>     push @{$hash{two}},\@r2;
>     push @{$hash{two}},\@r3;
>     print Dumper(\%hash);
>
> Note:  If you don't like the funky stuff this does with @r2 in the above
>
> example, make the push statements look like:
>
>     push @{$hash{one}},[@r1];
>
> instead.  That will push a reference to a copy of the array, rather a
> reference to the array itself, onto your hash.  That could be an issue
> if you build an array, push it, then modify it and push it again.  With
> the \@array method, you will push references to the *same* array, which
> would not be what you want.  When you got all done, you would find that
> all your data was the same -- the last stuff you put into the array.
>
>
> ...
>
>
> > -Dan
> ...
>
>
> --
> Bob Walton
>




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

Date: 19 Apr 2003 09:44:34 -0700
From: botfood@yahoo.com (dan baker)
Subject: Re: webhosts that support perl well?
Message-Id: <13685ef8.0304190844.2d623360@posting.google.com>

botfood@yahoo.com (dan baker) wrote in message news:<13685ef8.0303301719.33912bb9@posting.google.com>...
> I realize this is not a *pure* perl question..... but I'm looking for
> some feedback from perl programmers who may have found some reasonable
> web hosts that do a good job supporting sites with custom scripts.
>------------

thanks for the feedback so far, I'm going to followup on these and go
shopping. The two hosts that I've mostly used lately are both slipping
on customer support; both in speed and knowledge of response. Both are
migrating to cPanel account management which is mostly good, but hell
if you need something non-standard.

Anyway, thought I'd document the two I have been using just to put the
info in the thread.... superuser.net and affordablehost.com

superuser.net NEVER answers support email or phonecalls anymore at
all, so I think I'm going to have to plan on moving those accounts.

affordablehost.com is still mostly good... but has never had phone
support, and the email response has gotten slower and less effective.
issues can remain open for days now instead of hours.

anyway, if I find a REALLY good host, I'll post a followup.

things I look for are:
- cPanel management of users, email, etc
- freebies like statistics, maybe threaded BBS
- ability to install non-standard perl modules like ImageMagick
- ability to install custom scripts of course.....
- cost.... hopefully $10/mo or less
- response/resolution from support, hopefully less than 8 hrs, 24 for
sure
- backups , hopefully daily
- server mirrors, be great, but the low-cost guys dont usually have
them
- support of htaccess and cgi-bin in subdirs (for web-based admin and
"employee-only" areas.)
- hidden from other users of shared server via ftp


d


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 4865
***************************************


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