[19643] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1838 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 28 18:06:12 2001

Date: Fri, 28 Sep 2001 15:05:15 -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: <1001714714-v10-i1838@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 28 Sep 2001     Volume: 10 Number: 1838

Today's topics:
        a subtle Net::SMTP problem <wziemer@csulb.edu>
        can I run CGI C program using mod_perl? (eric ng)
    Re: Can I use ')' as field separator? <peb@bms.umist.ac.uk>
        CGI.pm (eric ng)
    Re: CGI.pm <echang@netstorm.net>
    Re: DBI/MySQL "$sth->fetch" help needed (John J. Trammell)
        file upload while()loop problem (GL)
    Re: Help: LWP/HTTPS/Proxy, problem with certificate nobull@mail.com
        how to determine if a label exists in a script (Bob Densmore)
    Re: how to determine if a label exists in a script <uri@sysarch.com>
    Re: how to determine if a label exists in a script <thomas@baetzler.de>
        HTML substitution <gte574u@prism.gatech.edu>
    Re: install perl module (eric ng)
    Re: install perl module <bart.lateur@skynet.be>
    Re: Launching an external win32 app using a perl script <tsee@gmx.net>
        Making A Windows Program from Perl (larry steinbeck)
    Re: maths <uri@sysarch.com>
    Re: maths <darkon@one.net>
    Re: maths (Eric Bohlman)
    Re: maths <darkon@one.net>
    Re: maths <tsee@gmx.net>
        mime::lite & duplicate emails? <dkoleary@home.com>
        MIMI:Lite <min_c_lee@yahoo.com>
    Re: MIMI:Lite (Logan Shaw)
        my $cat <lt@toetsch.at>
    Re: Not sure what type of cgi script I need! (Snipes)
    Re: Parsing a string (abaxaba)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 28 Sep 2001 11:35:34 -0700
From: Bill Ziemer <wziemer@csulb.edu>
Subject: a subtle Net::SMTP problem
Message-Id: <3BB4C2F6.599AB378@csulb.edu>

Here is the problem, the script:

#!/usr/bin/perl -w
use Net::SMTP;
my $smtp = Net::SMTP->new('smtp.csulb.edu', Debug=>1, Timeout=>40) or
print "died\n";
$smtp->quit;

Results in "died", and error message about can't call method from
undefined object. However, the command "telnet smtp.csulb.edu 25" works
just fine, as does the command "sendmail -vt".  I am running Redhat 7.0
enterprise.
The script works on an adajcent Redhat 7.0 workstation machine.  Looking
at the code for the new constructor, it seems that it opens a connection
to the first argument on port 25.  Any ideas or insight would be most
welcome.



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

Date: Fri, 28 Sep 2001 18:10:36 GMT
From: m_010@yahoo.com (eric ng)
Subject: can I run CGI C program using mod_perl?
Message-Id: <3bb4bc5e.5364013@enews.newsguy.com>

I have a CGI application written / compiled in c language.  what kind
of apache module I need to install inorder to run it? -OR- mod_perl
will do it too? 

does CGI in C compiled code has a signaficant faster startup /
execution time?

thanks


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

Date: Fri, 28 Sep 2001 16:13:14 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: Can I use ')' as field separator?
Message-Id: <3BB4938A.E0B70B73@bms.umist.ac.uk>

David Djajaputra wrote:
> 
> I want to extract the 13 (or similar field) from this Fortran string:
> 
> 1000 write(6,13) myvar
> 
> My approach is to first split it using the comma as the field
> separator:
> 
> @tempfield = split(/,/);
> 
> to obtain: $tempfield[1] = "13) myvar"
> 
> and then split it again using ')' as the field separator. The problem
> is that I can't seem to do this. Perl always complains about unmatched
> parentheses etc. My current solution is to split using anything other
> than numbers:
> 
> local $/ = undef;
> @field = split(/[^0-9]/, $tempfield[1]);

As I've (miss) quted Randal syaing before "use split when you know what
you want to throw away.  Use a pattern match when you know what you want
to keep".

So, in the one case you've given us to go off I would do the following
:-

$string = '1000 write(6,13) myvar';
($result) = $string =~ /\([0-9]+,([0-9]+)\) myvar/;

HTH

Paul


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

Date: Fri, 28 Sep 2001 19:49:43 GMT
From: m_010@yahoo.com (eric ng)
Subject: CGI.pm
Message-Id: <3bb4d410.11430015@enews.newsguy.com>

where can I find example source code on using CGI.pm? for example,
example source code come with CGI.pm ( use CGI.pm ).

thanks


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

Date: Fri, 28 Sep 2001 20:42:51 GMT
From: "E.Chang" <echang@netstorm.net>
Subject: Re: CGI.pm
Message-Id: <Xns912AAAE2421E5echangnetstormnet@207.106.93.86>

m_010@yahoo.com (eric ng) wrote in 
news:3bb4d410.11430015@enews.newsguy.com:

> where can I find example source code on using CGI.pm? for example,
> example source code come with CGI.pm ( use CGI.pm ).
 
http://stein.cshl.org/WWW/software/CGI/

-- 
EBC


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

Date: Fri, 28 Sep 2001 10:16:50 -0500
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: DBI/MySQL "$sth->fetch" help needed
Message-Id: <slrn9r9531.63e.trammell@haqq.hypersloth.net>

On Fri, 28 Sep 2001 15:01:47 GMT, Jay Flaherty <fty@mediapulse.com> wrote:
> "martinblack" <martinblack26@yahoo.com> wrote in message
> news:c025943b.0109271235.5c1c5537@posting.google.com...
>
> > $dbh->{'RaiseError'} = 1;
> 
> should also add:
> $dbh->{'PrintError'} = 1;
> You can also add these to the connect method as an anonymous hash:
>  $dbh = DBI->connect("$DBname:$DBhost", $DBusername, $DBpassword,
> {RasieError=>1,PrintError=>1}) or
> die "connection problem: $DBI::errstr\n";
> 

Redundant, in this case.  From DBI docs:

| If PrintError is also on then the PrintError is done
| before the RaiseError unless no __DIE__ handler has
| been defined, in which case PrintError is skipped
| since the die will print the message.



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

Date: 28 Sep 2001 14:37:29 -0700
From: gkl200@yahoo.com (GL)
Subject: file upload while()loop problem
Message-Id: <4fe9e2bd.0109281337.e414549@posting.google.com>

I seem to have a problem using two while() loops to do a file upload.
The first while loop counts and checks the size and the second writes
the file to the filesystem. There seems to be a problem when I use
more than one while() loop. it writes zero bytes, but when I remove
the first while() loop, it works fine.
Any help or hints would be appreciated. thanks


   $thefile = $query->param('file');
   
   while (<$thefile>) {
           # ++counter: add and get size
           print "file is too big" if ($count > $max);
   }

   # Copy a binary file to somewhere safe
   open (OUTFILE,">$uploadpath/$filename");
   while ($bytesread=read($thefile,$buffer,1024)) {
           print OUTFILE $buffer;
   }
   close $thefile;


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

Date: 28 Sep 2001 17:51:57 +0100
From: nobull@mail.com
Subject: Re: Help: LWP/HTTPS/Proxy, problem with certificate
Message-Id: <u9r8sr1cnm.fsf@wcl-l.bham.ac.uk>

namsuk_kim@lycos.com (Namsuk Kim) writes:

> I am using LWP to access an https site through an iPlanet proxy.

> The requested item could not be loaded by the proxy.
> The server's certificate has an invalid signature.

> The certificate is not right one due to this is test environment. 
> This whole thing is happening that LWP is relying on proxy to handle
> the certification exchange.  What I like to do is to handle
> certificate by myself so I wouldn't depend on the proxy server.

So one option is to stop using the proxy and use the HTTPS support in
LWP with certificate validation switched off.  Is there some reason
why this is not viable?

Another approch would be to issue the test site with a valid
certificate.  If you the iPlanet proxy requires that the certificate
not only be correctly signed but signed by a CA they trust then you
either need to pay such a CA or persuade them to trust you.  This is
drifting off-topic so I'll stop there.

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


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

Date: 28 Sep 2001 08:53:51 -0700
From: bob.densmore@twc.state.tx.us (Bob Densmore)
Subject: how to determine if a label exists in a script
Message-Id: <95a42e31.0109280753.22c481ea@posting.google.com>

I plan on using labels as step points in my scripts that will allow
scripts to be restarted at different points.  These are fairly simple
scripts that follow a linear progression.  If they abort, the problem
will be corrected and a restart label will be passed as an argument to
the script.  I want to perform an edit on the argument to determine if
the label really exists before jumping to the label.

How do I do that?

Bob


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

Date: Fri, 28 Sep 2001 16:08:10 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: how to determine if a label exists in a script
Message-Id: <x7d74b9u2h.fsf@home.sysarch.com>

>>>>> "BD" == Bob Densmore <bob.densmore@twc.state.tx.us> writes:

  BD> I plan on using labels as step points in my scripts that will allow
  BD> scripts to be restarted at different points.  These are fairly simple
  BD> scripts that follow a linear progression.  If they abort, the problem
  BD> will be corrected and a restart label will be passed as an argument to
  BD> the script.  I want to perform an edit on the argument to determine if
  BD> the label really exists before jumping to the label.

  BD> How do I do that?

use a dispatch table. this is a simple hash of keys (your labels) and
sub references. the top level code takes the label (i assume from the
command line or wherever you keep state) and then calls the sub indexed
by it. your subs then do the right thing.

do try this with goto's as it will be ugly and hard to maintain.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs  --------------------------  http://jobs.perl.org


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

Date: Fri, 28 Sep 2001 18:46:22 +0200
From: Thomas Bätzler <thomas@baetzler.de>
Subject: Re: how to determine if a label exists in a script
Message-Id: <c8a9rtshml0cldtgg8flg5ul0foif7j04d@4ax.com>

On Fri, 28 Sep 2001 16:08:10 GMT, Uri Guttman <uri@sysarch.com> wrote:
>do try this with goto's as it will be ugly and hard to maintain.

s/do/don't/;

:-)

HTH,
-- 
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl


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

Date: Fri, 28 Sep 2001 17:05:30 -0400
From: "Brady Doll" <gte574u@prism.gatech.edu>
Subject: HTML substitution
Message-Id: <9p2om1$3pn$1@news-int.gatech.edu>

I am attempting to replace a tag in an HTML file.
I wrote a method to seperate the HTML tags and
search for the tag.  For some reason, though, it isn't
searching all of the file.

I open the file and recurse through the lines and pass
whole lines from the file into my replace method.

sub replace
{
    ($line) = @_;    # line from HTML file
    local($temp, $replace);

    $_ = $line;

    while (/([^<]*)^<([^>]*)>/)
    {
        $replace = &parse_tag($2, $line);

        if ($replace ne "")
        {
            $temp = "$temp$1$2$replace";
        }
        else
        {
            $temp = "$temp$1<$2>";
        }

        $_ =~ s/(?:[^<]*)^<(?:[^>]*)>//;
    }

    return $temp;
}


When passed the line:
"<TITLE>News Update</TITLE>"
it only looks at the <TITLE> tag and ignores the rest
of the line.  I can't figure out why this happens.

when it gets into the while
the first time through

$2 = "TITLE"

and when
$_ =~ s/(?:[^<]*)^<(?:[^>]*)>//;
is run

$_ = "News Update</TITLE>"

but instead of going back through the loop it ends the
method.

This method does work with "<IMG SRC="image.jpg"><IMG SRC="image2.jpg">",
though.

Can someone help me figure out what is wrong with this so I can get it to
work
correctly.




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

Date: Fri, 28 Sep 2001 16:51:20 GMT
From: m_010@yahoo.com (eric ng)
Subject: Re: install perl module
Message-Id: <3bb5aa4a.735798@enews.newsguy.com>

How about if I don't have have root access to my unix system.  How can
I install perl module in my home directory? 

Since I think doing
>> perl Makefile.PL
>> make
>> make test
>> make install

will install module in system path directories.

thanks again.



On Fri, 28 Sep 2001 10:14:17 +0200, "felix" <mr.thanquol@gmx.de>
wrote:

>
>"eric ng" <m_010@yahoo.com> wrote in message
>news:3bb3d19f.31504671@enews.newsguy.com...
>> As far as I see, all perl module always has the following file:
>>
>> Makefile.PL
>> xxx.pm (where xxx is the module name)
>>
>> Is that all perl module installs the same way like follows:
>> perl Makefile.PL
>> make
>> make test
>> make install
>>
>> Can I just manually copy the xxx.pm file into any of the following
>> path -OR- copy to my home dir and use perl -I:
>> /usr/local/lib/perl5/5.00503/sun4-solaris
>> /usr/local/lib/perl5/5.00503
>> /usr/local/lib/perl5/site_perl/5.005/sun4-solaris
>> /usr/local/lib/perl5/site_perl/5.005
>>
>> Why I need to do a make? what's the make does?
>>
>> thanks
>
>
>I think a cool way to install perl modules is using perl itself!
>
>try this
>
>shell> perl -MCPAN -e 'install <modulename>'
>example:
>shell> perl -MCPAN -e 'install DBI'
>
>this will download the module from CPAN and interactivly install it!
>
>cheers
>fe
>
>



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

Date: Fri, 28 Sep 2001 21:33:55 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: install perl module
Message-Id: <o2r9rt0b9eb9p3phpjf52qkhq9g7tq9go7@4ax.com>

eric ng wrote:

>How about if I don't have have root access to my unix system.  How can
>I install perl module in my home directory? 

I know that's in the FAQ. Hmm... let's try "perldoc -q module". Here it
is:

  How do I keep my own module/library directory?

            When you build modules, use the PREFIX option when
            generating Makefiles:

                perl Makefile.PL PREFIX=/u/mydir/perl

-- 
	Bart.


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

Date: Fri, 28 Sep 2001 23:14:18 +0200
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: Launching an external win32 app using a perl script...
Message-Id: <9p2p6g$9lg$05$1@news.t-online.com>

"GuaRDiaN" <guardian@chello.be> schrieb im Newsbeitrag
news:3AEs7.1325$Ds3.7330@news.chello.be...
> Does anybody knows how I could start an external win32 application using a
> perl script?
> I'm usign Active State Perl under Win2k Advanced Server ...

system()?

Look at you perldocs, please.

Steffen





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

Date: Fri, 28 Sep 2001 14:09:57 -0500 (CDT)
From: larrysteinbeck@webtv.net (larry steinbeck)
Subject: Making A Windows Program from Perl
Message-Id: <1158-3BB4CB05-230@storefull-243.iap.bryant.webtv.net>

Status quo, Perl is the only programming language that I know. Is it
possible to write a marketable game or business application for Windows
98 in Perl (like the packaged PC programs you see for sale at computer
stores such as Media Play)?
 
Is it worth learning C++ in order to write a marketable Windows program?
Or, is it almost as good to write the application in Perl, and convert
it to an .exe file?

If so, what is the best way, or best perl module to use to accomplish
this? perl2exe? xs? inline C?

Best to all!
Lar




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

Date: Fri, 28 Sep 2001 15:31:23 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: maths
Message-Id: <x7g0979vrt.fsf@home.sysarch.com>

>>>>> "DW" == David Wall <darkon@one.net> writes:

  DW> between Perl and perl, and the nonexistence of PERL.

those aren't quirks. read the faq entry on the name perl. the name was
never originally an acronym which means PERL is meaniningless. the case
distinction is meaningful to differentiate the language from the
implementation. i may type perl in both cases but the context is usually
obvious.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs  --------------------------  http://jobs.perl.org


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

Date: Fri, 28 Sep 2001 18:50:01 -0000
From: David Wall <darkon@one.net>
Subject: Re: maths
Message-Id: <Xns912A96C998745darkononenet@207.126.101.97>

Uri Guttman <uri@sysarch.com> wrote on 28 Sep 2001:

>>>>>> "DW" == David Wall <darkon@one.net> writes:
> 
>   DW> between Perl and perl, and the nonexistence of PERL.
> 
> those aren't quirks. read the faq entry on the name perl. the name was
> never originally an acronym which means PERL is meaniningless. the case
> distinction is meaningful to differentiate the language from the
> implementation. i may type perl in both cases but the context is usually
> obvious.

I'm aware of the FAQ entry, and I follow and agree with its recommended 
usage, but usenet discussions involving that usage sometimes seem to have 
a 'religious' tone to them.  Sometimes people seem hyper-sensitive to the 
way perl is capitalized.  The distinctions are useful, I just find the 
convention interesting and occasionally amusing.

If you're taking me seriously, that's more than I'm doing.  If you're 
posting to make sure people don't take my flippant comments as being the 
words of an expert, then preach on.  :-)

-- 
David Wall
darkon@one.net


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

Date: 28 Sep 2001 19:51:09 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: maths
Message-Id: <9p2kbd$7ag$1@bob.news.rcn.net>

Chris <na@na> wrote:
> wow, what a friendly bunch you lot are.

> i have a script when i need a little help with  and look at the abuse i get.

You didn't get any abuse.  You were told that there was a place where you 
could find the answer to your question.  What somebody forgot to mention 
was that the answers in that place (the Perl FAQs) have been peer-reviewed 
and therefore you have a much better chance of getting a *correct* answer 
by reading the FAQs than by relying on what some random Usenet poster 
says.  That's the main reason most of the regulars here will refer people 
to the FAQs rather than trying to post their own answers; even the best of 
us can screw up at times.

> this is a news group, you dont own and cant control what gets posted. this
> isn't your news group.

If you interpret a referral to a known, high-quality resource as an 
attempt to "control what gets posted," then you're going to have an awful 
lot of temperamental problems with programming in general (in programming, 
you *can't* shrug off the computer's "judgment" as to whether or not what 
you did works).  Learn to use the resources that are available to you.

> i come on and post a simple question which i can resolve because my perl
> knowledge is limited.

And somebody else showed you a place where you could get that knowledge.

> if you dont think i deserve help then dont help me, dont just post message
> trying to sound hard, it doesn't impress anyone.

> the internet is great because it promotes the free and easy exchange of
> information, dont tell me that i cant ask for help with perl - who are you
> ?

Nobody's telling you you can't ask for help with Perl.  They're telling 
you where that help can be found.  I can understand that you might prefer 
a personal answer, but aside from the reliability issues I mentioned 
above, there's the little fact that *demanding* a personal answer from 
people who have no contractual obligation to you to provide one is rather 
like going to a potluck dinner and demanding that the food be cooked 
exactly to your preferences.  It's Just Not Done.

The big problem here is that if you petulantly demand that people
personally answer questions that have already been answered in the FAQs,
people will start ignoring you, and then when you have a question that's
too complicated to be answered by referring to the FAQs, the people in the
best position to help you out won't even see your question, and it will
either go unanswered or get answered by people who don't necessarily know
what they're talking about (which happens a lot more often than you might
imagine).


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

Date: Fri, 28 Sep 2001 20:05:21 -0000
From: David Wall <darkon@one.net>
Subject: Re: maths
Message-Id: <Xns912AA38F01413darkononenet@207.126.101.97>

ebohlman@omsdev.com (Eric Bohlman) wrote on 28 Sep 2001:
> The big problem here is that if you petulantly demand that people
> personally answer questions that have already been answered in the
> FAQs, people will start ignoring you, and then when you have a
> question that's too complicated to be answered by referring to the
> FAQs, the people in the best position to help you out won't even see
> your question, and it will either go unanswered or get answered by
> people who don't necessarily know what they're talking about (which
> happens a lot more often than you might imagine).

Yeah, and when I'm the person who doesn't necessarily know what he's 
talking about, I count on everyone else to correct me.  I like to help if 
I can, but if I make a mistake it's much better for someone to point it 
out than let it go uncorrected, both for me and for people reading my 
posts who might know less than me (as unlikely as that seems, sometimes).

-- 
David Wall
darkon@one.net


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

Date: Fri, 28 Sep 2001 23:11:09 +0200
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: maths
Message-Id: <9p2p0i$qgs$01$1@news.t-online.com>

"Eric Bohlman" <ebohlman@omsdev.com> schrieb im Newsbeitrag
news:9p2kbd$7ag$1@bob.news.rcn.net...

[snip]

> The big problem here is that if you petulantly demand that people
> personally answer questions that have already been answered in the FAQs,
> people will start ignoring you, and then when you have a question that's
> too complicated to be answered by referring to the FAQs, the people in the
> best position to help you out won't even see your question, and it will
> either go unanswered or get answered by people who don't necessarily know
> what they're talking about (which happens a lot more often than you might
> imagine).

Hey! I saw that! No reason to get personal here ;)

Other than that, I second David's reply.

Steffen





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

Date: Fri, 28 Sep 2001 18:26:20 GMT
From: Doug O'Leary <dkoleary@home.com>
Subject: mime::lite & duplicate emails?
Message-Id: <3BB4C08C.3984687B@home.com>

Hey;

I have a perl developer who's telling me that sendmail's broke because
he's getting duplicate emails from his perl program.  He's using
MIME::Lite.  I've looked at the email logs and the system is receiving
two separate emails from this script - slightly different timestamps
(off by a sec) and different message ids.  This, to me, points to the
perl script.

I'm fairly well versed in perl, but I've never used this particular
module before.  I checked out the script (very briefly) and, although
the style is radically different from the way I program, it seems to be
set up correctly.  

Does anyone know of any issues with this particular module that might
result in duplicate emails getting sent out?

Thanks for any tips/suggestions/hints.

Doug O'Leary

-- 
--------------
Douglas K. O'Leary
Senior UNIX Admin/Independent consultant
resume:  http://members.home.net/dkoleary/resume.html
--------------


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

Date: Fri, 28 Sep 2001 18:44:29 GMT
From: "Michael" <min_c_lee@yahoo.com>
Subject: MIMI:Lite
Message-Id: <hy3t7.563$Le.21520@sea-read.news.verio.net>

Can I send out an email attachment without using MIME:Lite?

Could it be included somewhere below as part of the stardard email format?
---------------------------
To: recipient@theirprovider.com
From: myself@myprovider.com
Subject: email subject
Content-type: text/plain

Message contents
---------------------------


Michael





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

Date: 28 Sep 2001 15:20:53 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: MIMI:Lite
Message-Id: <9p2m35$3l4$1@charity.cs.utexas.edu>

In article <hy3t7.563$Le.21520@sea-read.news.verio.net>,
Michael <min_c_lee@yahoo.com> wrote:
>Can I send out an email attachment without using MIME:Lite?

Sure.  Use a different set of MIME modules, like the MIME-tools
distribution.  (See http://search.cpan.org/search?dist=MIME-tools .)

Or write your own code to do it.

>Could it be included somewhere below as part of the stardard email format?

Attachments *are* part of the standard mail format.

If you'd like to know how to do it yourself, just go to
http://www.ietf.org/rfc.html and read the following RFC numbers:

	2822, 2045, 2046, 2047, 2048, 2049, 1844

Or, you could use a module, which I think is easier.

  - Logan
-- 
"Everybody
 Loves to see              
 Justice done
 On somebody else"     ( Bruce Cockburn, "Justice", 1981 )


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

Date: Fri, 28 Sep 2001 17:23:37 +0200
From: Leopold Toetsch <lt@toetsch.at>
Subject: my $cat
Message-Id: <slrn9r95fm.3mc.lt@toetsch.at>
Keywords: JAPH

 ... slipped over the keyboard, hitting a bunch of random chars -
thus it looks to me- so I thought, this could be a perl program.

After some reformatting and adding the shebang line, it seems to
be running on my system printing one line looking like 'JAPH';-) 

#!/usr/bin/perl -l                         # -lt <lt@toetsch.at>
$A.=chr&G;&A;map{$;=&G;$:=$A;while(/.*$:./){$F=1/3;$C{_D__B}=1-@ 
A;$,.=chr&F+$;;$;+=E()if&B}$,.=' 'if!&B-$C}<_>;sub G{65}$D.='n';
$_=$,;sub B{$:++eq$A}$F=$D;sub D{open _,$0}s;A;a;;$C='t';$F.=$F{
B}=$C;sub E{32}sub A{$D='ri';&D}eval"p$F";sub F{$F*length$&}#-lt

leo, 
have fun, comments welcome.
-- 
Leopold Toetsch <lt@toetsch.at> http://www.toetsch.at/linux/
-
You are on the brink of a small clean climbable pit.  A crawl leads
west.


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

Date: 28 Sep 2001 12:38:44 -0700
From: pilotsnipes@yahoo.com (Snipes)
Subject: Re: Not sure what type of cgi script I need!
Message-Id: <ae7dfa3b.0109281138.2e1ef7ce@posting.google.com>

> Except that he might want a web interface for letting the people
> subscribe/unsubscribe on different rosters. That would edit  the
> database, or as you call it, the config file.
> Both to construct the mails with several attachments, and to send the
> mail, I'd first look into Mime::Lite.

Thank you both for your suggestions. Whilst I know little (at the
moment) about the entire script and coding side of things, I'm not shy
of trying to tinker and learn. I'll be looking into both of these
suggestions.

> And, in order to reduce the load on on the SMTP server, group the people
> per roster combination, and send it to them all at once: put the
> addresses in the Bcc field.

Noted. Thank you.

Regards,

Snipes.


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

Date: 28 Sep 2001 14:55:55 -0700
From: msanderso@hotmail.com (abaxaba)
Subject: Re: Parsing a string
Message-Id: <b89e0a91.0109281355.2914ab2c@posting.google.com>

> Attribute="value"
> 
> I want to make a hash table out of the attributes and values...
> 
> $hash{'Attribute'} = "value";
> 
> I was attempting to make a reg. ex. to parse out both the attribute name and
> the value, however i'm not sure how to get the part of the string between
> the quotes with a reg. ex.
> 
> this was the code i was attempting to use, however the (.*) causes it to
> freeze.
> m/(?:\s*)([\w])(?:\=)(?:[\'\"])(.*)(?:[\'\"])/;
> 
> What should be put in place of the (.*)...is there anything or am I just
> going to have to result to a different method to parse this string then
> using a reg. ex.?

Assuming an ampersand [&] is the delimiter between n/v pairs in
$string, something like the following ought do the trick:

%hash = map {my ($k,$v) = split(/=/,$_);}(split (/&/, $string));


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

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


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