[16344] in Perl-Users-Digest
Perl-Users Digest, Issue: 3756 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 20 11:05:30 2000
Date: Thu, 20 Jul 2000 08: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: <964105515-v9-i3756@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 20 Jul 2000 Volume: 9 Number: 3756
Today's topics:
Re: +++ Special Characters in Filenames +++ <bulletproof@5sl.org>
Re: [Apology] Duplicate posts from OpenBazaar <gellyfish@gellyfish.com>
Activating process in WinNT <juha.kiviluoma@vtt.fi>
Re: Bad file descriptor from Mail::Mailer <otis@my-deja.com>
Determine relative path from 2 absolute path <abuse@localhost>
Re: Determine relative path from 2 absolute path <pavel@gingerall.cz>
Re: Determine relative path from 2 absolute path <abuse@localhost>
Re: Determine relative path from 2 absolute path aqutiv@my-deja.com
Re: Determine relative path from 2 absolute path <pavel@gingerall.cz>
Re: file handle <aqumsieh@hyperchip.com>
Re: how to delete )) aqutiv@my-deja.com
Re: how to delete )) (Bernard El-Hagin)
HTML content in email <tech@schmic.com>
Re: HTML content in email <tech@schmic.com>
Re: HTML content in email <brendon@shipreg.com>
Re: HTML content in email aqutiv@my-deja.com
Re: HTML content in email <tech@schmic.com>
Re: HTML content in email <brendon@shipreg.com>
Re: HTML content in email <iltzu@sci.invalid>
Re: HTML content in email <cal@iamcal.com>
Re: HTML content in email <cal@iamcal.com>
Re: Include a script? <jraff@home.com>
Installing BerkeleyDB on RedHat 6 hagayd@my-deja.com
Re: Intelligent "chomp" ? iwelch@my-deja.com
Re: limit on canvas object? <lusol@Pandora.CC.Lehigh.EDU>
Re: limit on canvas object? <aqumsieh@hyperchip.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 20 Jul 2000 14:26:21 +0200
From: "M. Roming" <bulletproof@5sl.org>
Subject: Re: +++ Special Characters in Filenames +++
Message-Id: <3976EFED.A6D42AA6@5sl.org>
Gus wrote:
> Stupid characters in Subject:
Sorry :-)
>
>
> M. Roming <bulletproof@5sl.org> wrote:
>
> > I have got a problem with special characters in filenames.
>
> It looks like you've got a regular expresion requirement to me, or
> I may have misunderstood.
>
> > I am using
> > the ::getopt
> > Module to get the filename as an argument.The Filename is something like
> > this
> > -> $machine.dat
> > I thought it's possible to quote the special character '$'
> > with a construct like this :
>
> > ($datname=$opt{'o'}) =~ s#([\$\\])#\\$1#ge;
>
> > But it's still impossible to open the file. All characters before '.dat'
> > are cut off. It seems that the committal is wrong.
>
> If I understand, you have a string '$machine.dat' and you want 'machine.dat'
> so 's#\$##g' will do it.
>
> Just a thought: I take it you are /not/ doing something like
>
Yes I want this construct !!! - I know it must be quoted like this -> shell:$
./yourprogram \$foobar.dat
But my question is: Is it anyhow possible to call this function without quote
??????
>
> shell:$ ./yourprogram $foobar.dat
>
> which would cause the shell to try to expand $foobar, fail and substitute
> an empty string for $foobar before passing it to the script.
>
> [angus@faith angus]$ cat z.pl
> #!/usr/bin/perl
>
> foreach $arg (@ARGV) {
> print "arg", ++$x , " : $arg \n";
> }
> [angus@faith angus]$ ./z.pl a b
> arg1 : a
> arg2 : b
> [angus@faith angus]$ ./z.pl $foobar.dat
> arg1 : .dat
> [angus@faith angus]$ ./z.pl \$foobar.dat
> arg1 : $foobar.dat
>
> Regards,
> _Gus
>
> --
> gus@black.hole-in-the.net
> 0x58E18C6D
> 82 AA 4D 7F D8 45 58 05 6D 1B 1A 72 1E DB 31 B5
> http://black.hole-in-the.net/gus/
------------------------------
Date: Thu, 20 Jul 2000 12:32:43 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: [Apology] Duplicate posts from OpenBazaar
Message-Id: <LjCd5.570$Px6.52698@news.dircon.co.uk>
On 19 Jul 2000 05:24:36 GMT, ©¬J¼w Wrote:
> Greetings,
>
> I am the administrator of openbazaar.net. Due to the faulty setting of
> our news server, a huge amount of articles were fed back to the usenet
> yesterday. We hereby sincerely apologize for our serious mistake. And
> we will try everything out not let this kind of disaster happen again.
>
I wouldnt worry about it most people will be filtering posts from that
source in the future,
/J\
------------------------------
Date: Thu, 20 Jul 2000 15:14:48 +0300
From: Juha Kiviluoma <juha.kiviluoma@vtt.fi>
Subject: Activating process in WinNT
Message-Id: <3976ED38.66D3B5BD@vtt.fi>
hi
I open up a process (gnuplot) in Windows with the line
open GNU, "| pgnuplot" or die "Can't open gnuplot: $!";
This makes gnuplot active and I'd like to keep my command line active
since I'll be controlling the gnuplot from there (with the help of
Perl). How can I make command line active again? Opening a process in
the background doesn't work.
Regards,
Juha Kiviluoma
ps. I'll repost my previous unasnwered question here below if somebody
would know the answer this time :)
I've got a problem with ActiveState Perl 5.6 build 616 and gnuplot 3.7.1
running in Win NT. My piping output stops after several lines of output
into a gnuplot pipe. It stops in the middle of line without any apparent
reason even though I flush the buffer often. My example code looks like
this:
#!/bin/perl -w
open GNU, "| pgnuplot" or die "Can't open gnuplot: $!";
for my $x (0 .. 1000) {
print GNU "set title '$x'\n";
select((select(GNU), $| = 1)[0]); #flushing the output
}
close GNU;
Does the buffer overflow even though I flush it? The code outputs 134
lines into gnuplot and then stops. I can get it working if I ask for
user input from command line, but that's not too handy :( Any
suggestions?
------------------------------
Date: Thu, 20 Jul 2000 14:45:06 GMT
From: Otis Gospodnetic <otis@my-deja.com>
Subject: Re: Bad file descriptor from Mail::Mailer
Message-Id: <8l739c$mr6$1@nnrp1.deja.com>
In article <8l6feh$7n6$1@orpheus.gellyfish.com>,
Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> On Wed, 19 Jul 2000 15:26:35 GMT Otis Gospodnetic wrote:
> > Hi,
> >
> > I am using Graham Barr's Mail::Mailer module (part of MailTools) and
> > every once in a while the script that uses Mail::Send (which uses
> > Mail::Mailer underneath) dies with the following error:
> >
> > Bad file descriptor at /usr/lib/perl5/site_perl/5.005/Mail/Mailer.pm
> > line 269.
> >
> > Here is line 268:
> > 268 # Fork and start a mailer
> > 269 (defined($exe) && open($self,"|-"))
> > 270 || $self->exec($exe, $args, \@to)
> > 271 || die $!;
> >
> > I am using Mail::Send to send mail via SMTP directly (not 'mail'
> > nor 'sendmail'), like so:
> >
> > my $fh = $msg->open('smtp', Server => 'smtp.server.here');
> >
> > There is no consistency: sometimes it works without any problems,
and
> > sometimes it dies like this.
> > I am running this on Red Hat 6.2 with perl version 5.005_03.
> >
> > Does anyone know what could be causing this?
> >
>
> It is probably a problem with your mail server or your network. I
posted a
> patch to Mail::Mailer::smtp a couple of weeks ago that would enable
you
> to switch on the underlying Net::SMTP's debugging mode - you will
probably
> be able to find it via Deja News.
I thought that this could be the problem, but I thought Mail::Mailer
wouldn't just die on me like that :)
I've actually switched to Mail::Mailer (direct use of it, not via
Mail::Send) and put it in eval {}.
Thanks,
Otis
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 20 Jul 2000 18:52:48 +0800
From: "multiplexor" <abuse@localhost>
Subject: Determine relative path from 2 absolute path
Message-Id: <8l6l79$kvl2@imsp212.netvigator.com>
For example, I have 2 abs. paths here:
$source_url = 'http://www.domain.com/dir1/dir2/file1.htm';
$target_url = 'http://www.domain.com/dir1/file2.htm';
and I would like to determine the relative path from $source_url to
$target_url. It is used to determine what "href" value of <a> I should put
in "file1.htm" so that a vistor can go to $target_url by clicking on the
link. In this eg., the relative path should be "../file2.htm" in file1.htm.
Similarly, if the 2 paths are:
$source_url = 'http://www.domain.com/dir1/file2.htm';
$target_url = 'http://www.domain.com/dir1/dir2/file1.htm';
the relative path should be "dir2/file1.htm". If the 2 paths are in
different domain, absolute URL, $target_url, is used.
Any idea?
Thanks.
------------------------------
Date: Thu, 20 Jul 2000 13:26:11 +0200
From: Pavel Hlavnicka <pavel@gingerall.cz>
Subject: Re: Determine relative path from 2 absolute path
Message-Id: <3976E1D3.1060608@gingerall.cz>
You may find URI.pm module very usefull.
P.
"multiplexor" wrote:
> For example, I have 2 abs. paths here:
>
> $source_url = 'http://www.domain.com/dir1/dir2/file1.htm';
> $target_url = 'http://www.domain.com/dir1/file2.htm';
>
> and I would like to determine the relative path from $source_url to
> $target_url. It is used to determine what "href" value of <a> I should put
> in "file1.htm" so that a vistor can go to $target_url by clicking on the
> link. In this eg., the relative path should be "../file2.htm" in file1.htm.
>
> Similarly, if the 2 paths are:
>
> $source_url = 'http://www.domain.com/dir1/file2.htm';
> $target_url = 'http://www.domain.com/dir1/dir2/file1.htm';
>
> the relative path should be "dir2/file1.htm". If the 2 paths are in
> different domain, absolute URL, $target_url, is used.
>
> Any idea?
>
> Thanks.
>
>
------------------------------
Date: Thu, 20 Jul 2000 20:44:07 +0800
From: "multiplexor" <abuse@localhost>
Subject: Re: Determine relative path from 2 absolute path
Message-Id: <8l6ro1$kgt4@imsp212.netvigator.com>
Thanks for pointing me to a right source. I guess the URI::WithBase is what
I need but I don't quite understand the documentation. Would you like to
give me, a newbie, a simple example?
Sorry for any inconvenience.
"Pavel Hlavnicka" <pavel@gingerall.cz> wrote
> You may find URI.pm module very usefull.
> P.
>
>
> "multiplexor" wrote:
>
> > For example, I have 2 abs. paths here:
> >
> > $source_url = 'http://www.domain.com/dir1/dir2/file1.htm';
> > $target_url = 'http://www.domain.com/dir1/file2.htm';
> >
> > and I would like to determine the relative path from $source_url to
> > $target_url. It is used to determine what "href" value of <a> I should
put
> > in "file1.htm" so that a vistor can go to $target_url by clicking on the
> > link. In this eg., the relative path should be "../file2.htm" in
file1.htm.
> >
> > Similarly, if the 2 paths are:
> >
> > $source_url = 'http://www.domain.com/dir1/file2.htm';
> > $target_url = 'http://www.domain.com/dir1/dir2/file1.htm';
> >
> > the relative path should be "dir2/file1.htm". If the 2 paths are in
> > different domain, absolute URL, $target_url, is used.
> >
> > Any idea?
> >
> > Thanks.
> >
> >
>
------------------------------
Date: Thu, 20 Jul 2000 13:04:43 GMT
From: aqutiv@my-deja.com
Subject: Re: Determine relative path from 2 absolute path
Message-Id: <8l6td1$i2e$1@nnrp1.deja.com>
In article <8l6ro1$kgt4@imsp212.netvigator.com>,
"multiplexor" <abuse@localhost> wrote:
> Thanks for pointing me to a right source. I guess the URI::WithBase
is what
> I need but I don't quite understand the documentation. Would you like
to
> give me, a newbie, a simple example?
>
I was quite curious myself how to do it, So I've come to this solution:
$source_url = 'http://www.domain.com/dir1/file2.htm';
$relative = $target_url
= 'http://www.domain.com/dir1/dir2/dir3/file1.htm';
$source_domain = ($source_url =~ m[^(https?://(www.)?.+?)/])[0];
$source_path = ($source_url =~ m[^https?://.+?(/.+)$])[0];
$target_domain = ($target_url =~ m[^(https?://(www.)?.+?)/])[0];
$target_path = ($target_url =~ m[^https?://.+?(/.+)$])[0];
for (1..2) { #This loop is made just for the example purpose
print "source: $source_domain - $source_path\n";
print "target: $target_domain - $target_path\n";
$relative = FindReleative($source_path, $target_path) if
($source_domain eq $target_domain);
print "Relative path: $relative\n\n";
($source_path, $target_path) = ($target_path, $source_path); #Swap
pathes
}
sub FindReleative {
my ($Spath, $Tpath) = @_;
$InCommon = "";
my $relative = "";
$GoUp = 0;
@CompareS = split /\//, $Spath;
@CompareT = split /\//, $Tpath;
shift @CompareS; shift @CompareT; #First element is always empty.
if (@CompareS < @CompareT) { $ToLength = @CompareS; }
else { $ToLength = @CompareT; $GoUp = 1; }
$ToLength--;
for (0..$ToLength) {
$InCommon .= "/$CompareS[$_]" if ($CompareS[$_] eq $CompareT[$_]);
}
if ($GoUp) {
$diff = @CompareS - @CompareT;
for(1..$diff) { $relative .= ".."; $relative .= "/" if !($_ ==
$diff) }
}
else {
$relative = ".";
}
return $relative . substr ($Tpath, length($InCommon));
}
how's that? ;-)
Not sure how efficient it is, but It works.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 20 Jul 2000 16:27:36 +0200
From: Pavel Hlavnicka <pavel@gingerall.cz>
Subject: Re: Determine relative path from 2 absolute path
Message-Id: <39770C58.5040007@gingerall.cz>
It is simple.
use URI;
$u1 = new URI("http://server/foo/bar/moo.html");
$u2 = new URI("http://server/foo/buf/quak.html");
print $u1->rel($u2) . "\n";
print $u2->rel($u1) . "\n";
P.
"multiplexor" wrote:
> Thanks for pointing me to a right source. I guess the URI::WithBase is what
> I need but I don't quite understand the documentation. Would you like to
> give me, a newbie, a simple example?
>
> Sorry for any inconvenience.
>
>
> "Pavel Hlavnicka" <pavel@gingerall.cz> wrote
> > You may find URI.pm module very usefull.
> > P.
> >
> >
> > "multiplexor" wrote:
> >
> > > For example, I have 2 abs. paths here:
> > >
> > > $source_url = 'http://www.domain.com/dir1/dir2/file1.htm';
> > > $target_url = 'http://www.domain.com/dir1/file2.htm';
> > >
> > > and I would like to determine the relative path from $source_url to
> > > $target_url. It is used to determine what "href" value of <a> I should
> put
> > > in "file1.htm" so that a vistor can go to $target_url by clicking on the
> > > link. In this eg., the relative path should be "../file2.htm" in
> file1.htm.
> > >
> > > Similarly, if the 2 paths are:
> > >
> > > $source_url = 'http://www.domain.com/dir1/file2.htm';
> > > $target_url = 'http://www.domain.com/dir1/dir2/file1.htm';
> > >
> > > the relative path should be "dir2/file1.htm". If the 2 paths are in
> > > different domain, absolute URL, $target_url, is used.
> > >
> > > Any idea?
> > >
> > > Thanks.
> > >
> > >
> >
>
>
------------------------------
Date: Thu, 20 Jul 2000 14:19:33 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: file handle
Message-Id: <7ahf9kj348.fsf@merlin.hyperchip.com>
eastking@my-deja.com writes:
> in c ,I can use a variable as a file handle, Can I do this in perl?
You can either use a file glob:
my $fh = \*FH;
or, what I prefer, you can use the IO::File module which is part of the
standard Perl distribution.
--Ala
------------------------------
Date: Thu, 20 Jul 2000 11:30:08 GMT
From: aqutiv@my-deja.com
Subject: Re: how to delete ))
Message-Id: <8l6nrk$e7p$1@nnrp1.deja.com>
In article <8l3gtl$2bd$1@nnrp1.deja.com>,
tvn007@my-deja.com wrote:
> Hi,
>
> I have tried so many way but I cannot delete this characters ))
>
> Example: I have the file as shown below:
>
> (ab
> c)
> (xyx)
> (zzz)
> ))
>
> #my script has:
>
> $/ =")";
>
> How can I delete the )) in the file above. The )) is always
> at the end of file.
sorry if you see this twice, but as far as it looks, all messages I've
ever posted on this forum aren't actually here! dammit. well, I'm now
accessing through deja so I hope it's fine.
anyway, If you were
reading the file into an array that way:
@Array = <file>;
the last two elements are probably useless.
get rid of them with:
@array = splice @array, 0, -2;
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 20 Jul 2000 12:01:39 GMT
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: how to delete ))
Message-Id: <slrn8ndq8d.1qr.bernard.el-hagin@gdndev25.lido-tech>
On Thu, 20 Jul 2000 11:30:08 GMT, aqutiv@my-deja.com <aqutiv@my-deja.com> wrote:
>In article <8l3gtl$2bd$1@nnrp1.deja.com>,
> tvn007@my-deja.com wrote:
>> Hi,
>>
>> I have tried so many way but I cannot delete this characters ))
>>
>> Example: I have the file as shown below:
>>
>> (ab
>> c)
>> (xyx)
>> (zzz)
>> ))
>>
>> #my script has:
>>
>> $/ =")";
>>
>> How can I delete the )) in the file above. The )) is always
>> at the end of file.
>
>sorry if you see this twice, but as far as it looks, all messages I've
>ever posted on this forum aren't actually here! dammit. well, I'm now
>accessing through deja so I hope it's fine.
>
>anyway, If you were
>reading the file into an array that way:
>@Array = <file>;
>the last two elements are probably useless.
>get rid of them with:
>@array = splice @array, 0, -2;
__________________
#!/usr/bin/perl -w
use strict;
$/ = ")";
my @data = <DATA>;
@data = splice (@data, 0, -2);
print @data;
__DATA__
(ab
c)
(xyx)
(zzz)
))
__________________
This yields:
(ab
c)
(xyx)
(zzz)
)
Presumably this is because of \n at the end there. If you change the -2
to -3 it works fine, though. Of course you can't chomp (@data) and then
use -2 because the input separator is set to ")".
Bernard
--
perl -e '${qq=\x22=}=qq=\053=;$_="BeJUST_ANOTHERnaPERL_HACKERd\n";
${qq=\x2c=}=qq=\x72=;print split /[AC-Z_]$"/;'
------------------------------
Date: Thu, 20 Jul 2000 20:46:59 +1000
From: Ross Marston <tech@schmic.com>
Subject: HTML content in email
Message-Id: <3976D8A3.52347696@schmic.com>
I am trying to include fairly basic html content (just some href and
table tags) in an email sent out to a mailing list but I can't figure
out how to set the content type of the email. It is on a FreeBSD server
but unfortunately i cannot add modules (ie. the excellent MIME::Lite if
found at cpan)to the perl installation. Can anyone help?
Rossco
tech@schmic.com
------------------------------
Date: Thu, 20 Jul 2000 21:12:27 +1000
From: Ross Marston <tech@schmic.com>
Subject: Re: HTML content in email
Message-Id: <3976DE9B.4A37890@schmic.com>
Ross Marston wrote:
> I am trying to include fairly basic html content (just some href and
> table tags) in an email sent out to a mailing list but I can't figure
> out how to set the content type of the email. I am using sendmail and
> using CGI.pm to do most of the stuff in the script. It is on a FreeBSD
> server but unfortunately i cannot add modules (ie. the excellent
> MIME::Lite i found at cpan) to the perl installation. Can anyone help?
> Rossco
> tech@schmic.com
------------------------------
Date: Thu, 20 Jul 2000 14:43:25 +0200
From: "Brendon Caligari" <brendon@shipreg.com>
Subject: Re: HTML content in email
Message-Id: <8l6ona$117$1@news.news-service.com>
"Ross Marston" <tech@schmic.com> wrote in message
news:3976DE9B.4A37890@schmic.com...
>
>
> Ross Marston wrote:
>
> > I am trying to include fairly basic html content (just some href and
> > table tags) in an email sent out to a mailing list but I can't figure
> > out how to set the content type of the email. I am using sendmail and
> > using CGI.pm to do most of the stuff in the script. It is on a FreeBSD
> > server but unfortunately i cannot add modules (ie. the excellent
> > MIME::Lite i found at cpan) to the perl installation. Can anyone help?
> > Rossco
> > tech@schmic.com
>
I have tried the following and it worked for me.
Then I added an annoying javascript line in the head, and I really
didn't like the outcome on outlook express!!!
--------------------------
#!/usr/bin/perl
use strict;
my (
$MsgFrom,
$MsgTo,
$MsgSubject,
);
$MsgTo = 'bcaligari@shipreg.com';
$MsgFrom = 'brendon@shipreg.com';
$MsgSubject = 'the test';
open(MAILER, '|/usr/lib/sendmail -t');
print(MAILER "To: $MsgTo\n");
print(MAILER "From: $MsgFrom\n");
print(MAILER "Subject: $MsgSubject\n");
print(MAILER "Content-type: text/html\n");
print(MAILER "\n");
print(MAILER << 'THEMSG');
<html>
<head>
<title>whatever</title>
<script language="javascript">
window.open("http://www.cisco.com");
</script>
</head>
<body>
<center>
<h1>Hello</h1>
</center>
</body>
</html>
THEMSG
close(MAILER);
exit(0);
--------------------------
Brendon
++++
------------------------------
Date: Thu, 20 Jul 2000 11:37:00 GMT
From: aqutiv@my-deja.com
Subject: Re: HTML content in email
Message-Id: <8l6o8r$ejd$1@nnrp1.deja.com>
In article <3976D8A3.52347696@schmic.com>,
tech@schmic.com wrote:
> I am trying to include fairly basic html content (just some href and
> table tags) in an email sent out to a mailing list but I can't figure
> out how to set the content type of the email.
print SENDMAIL "Content-type: text/html\n\n";
works for me most of the time.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 20 Jul 2000 22:29:39 +1000
From: Ross Marston <tech@schmic.com>
Subject: Re: HTML content in email
Message-Id: <3976F0B3.CE7D0FE2@schmic.com>
aqutiv@my-deja.com wrote:
> print SENDMAIL "Content-type: text/html\n\n";
> works for me most of the time.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Thanks.
What about if i want to send both text and an attachment. (ie a multipart
page) maybe a bit of text and a gif or something like that. How do i
separtate the text and attachment sections?
Rossco
------------------------------
Date: Thu, 20 Jul 2000 17:07:16 +0200
From: "Brendon Caligari" <brendon@shipreg.com>
Subject: Re: HTML content in email
Message-Id: <8l715d$7ub$1@news.news-service.com>
"Ross Marston" <tech@schmic.com> wrote in message
news:3976F0B3.CE7D0FE2@schmic.com...
> aqutiv@my-deja.com wrote:
>
> > print SENDMAIL "Content-type: text/html\n\n";
> > works for me most of the time.
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
>
> Thanks.
> What about if i want to send both text and an attachment. (ie a multipart
> page) maybe a bit of text and a gif or something like that. How do i
> separtate the text and attachment sections?
> Rossco
>
in that case, read RFC822, RFC1521 / RFC1522
you'll need to write a little algorithm to encode files as base64, but
if you have time to spare you'll enjoy it
i recommend that if you want to do tests with email encoding
you get MDaemon....a cute mail server for win32
http://www.deerfield.com
it lets you 'copy' a file into it's queue directories and
kickstart processing of the mail...so it's a good testbed
brendon
------------------------------
Date: 20 Jul 2000 14:19:00 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: HTML content in email
Message-Id: <964102662.7657@itz.pp.sci.fi>
In article <3976D8A3.52347696@schmic.com>, Ross Marston wrote:
>I am trying to include fairly basic html content (just some href and
>table tags) in an email sent out to a mailing list but I can't figure
>out how to set the content type of the email. It is on a FreeBSD server
>but unfortunately i cannot add modules (ie. the excellent MIME::Lite if
>found at cpan)to the perl installation. Can anyone help?
So install the modules in a directory of your own. I think the Perl
FAQ has details on how to do this.
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The screwdriver *is* the portable method." -- Abigail
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: Thu, 20 Jul 2000 15:46:17 +0100
From: "Cal Henderson" <cal@iamcal.com>
Subject: Re: HTML content in email
Message-Id: <zgEd5.435$yE4.7361@news2-win.server.ntlworld.com>
"Ross Marston" <tech@schmic.com> wrote...
:
: What about if i want to send both text and an attachment. (ie a multipart
: page) maybe a bit of text and a gif or something like that. How do i
: separtate the text and attachment sections?
: Rossco
:
Check out Mime::Lite
http://theoryx5.uwinnipeg.ca/CPAN/data/MIME-Lite/MIME/Lite.html
--
Cal Henderson
sub a{my$a=reverse shift;$a=~y/b-z/a-y/;unshift@a,$a;}sub b{$c.=reverse
shift; while(length($c)>=$b[0]){a(substr($c,0,$b[0]));$c=substr($c,$b[0]);
shift@b;}}@b=(6,3,5,4,10,6,4,4,2,1);$a="l?jouipv"."ezvmxpbuxih";$a.=
",jofoqqibmzamsfsfxfjtuiIg";while($a ne ""){b(substr($a,0,2));$a=
substr($a,2);}print join(" ",@a);
------------------------------
Date: Thu, 20 Jul 2000 15:49:58 +0100
From: "Cal Henderson" <cal@iamcal.com>
Subject: Re: HTML content in email
Message-Id: <0kEd5.442$yE4.7165@news2-win.server.ntlworld.com>
"Cal Henderson" <cal@iamcal.com> wrote...
:
: Check out Mime::Lite
:
: http://theoryx5.uwinnipeg.ca/CPAN/data/MIME-Lite/MIME/Lite.html
:
Opps, didn't see the first post. In any case, Mime::Lite is perl only (no C
compilation needed) so you can just add it to your @INC and not worry about
installation. I hope.
--
Cal Henderson
sub a{my$a=reverse shift;$a=~y/b-z/a-y/;unshift@a,$a;}sub b{$c.=reverse
shift; while(length($c)>=$b[0]){a(substr($c,0,$b[0]));$c=substr($c,$b[0]);
shift@b;}}@b=(6,3,5,4,10,6,4,4,2,1);$a="l?jouipv"."ezvmxpbuxih";$a.=
",jofoqqibmzamsfsfxfjtuiIg";while($a ne ""){b(substr($a,0,2));$a=
substr($a,2);}print join(" ",@a);
------------------------------
Date: Thu, 20 Jul 2000 14:33:06 GMT
From: "jraff" <jraff@home.com>
Subject: Re: Include a script?
Message-Id: <C4Ed5.77202$lU5.522947@news1.rdc1.nj.home.com>
One can easily make the "Javascript functions" into subroutines loadable
from a "require" or "use" request.
http://www.cpan.org/doc/manual/html/pod/perlsub.html
http://www.cpan.org/doc/manual/html/pod/perlmod.html
http://www.cpan.org/doc/manual/html/pod/perlmodlib.html
---------------------------------------------------------------------
"Tom" <chaptera@hotmail.com> wrote in message
news:39765129.E63BBBA7@hotmail.com...
> Dear all,
>
> I have a program that will use the print to generate the html form on
> the web.
> Like this:
> prog1.pl
> -----
> use CGI;
> ...
> $js=<<END;
> <Script language=javascript>
> function a()
> ....
> ...
> function b()
> ....
> END
>
> prog2.pl
> -------
> use CGI;
> ...
> $js=<<END;
> <Script language=javascript>
> function a()
> ....
> ...
> function b()
> ....
> END
>
> prog1.pl & prog2.pl are also using the same javascript function.
> If I update the javascript function, it will need to update two
> programs.
>
> How can I do that? Can I store the javascript on other files, the call
> prog1.pl or prog2.pl to read the file and print on the html forms?
>
> thanks
>
> ---
> Tom
>
>
------------------------------
Date: Thu, 20 Jul 2000 12:09:55 GMT
From: hagayd@my-deja.com
Subject: Installing BerkeleyDB on RedHat 6
Message-Id: <8l6q69$fr1$1@nnrp1.deja.com>
Hi,
We were using BerkeleyDB.pm to communicate with Berkeley dB. It worked
fine on the Solaris OS. Then we wrote a time consuming script that
needed to run in parallel on a Linux cluster. When we have tried to
install it we encounter a problem that described in the CPAN
documentation :
Linux Notes
-----------
Newer versions of Linux (e.g. RedHat 6) ship with a C library that has
a version of Berkeley DB linked into it. This makes it very difficult
to
build DB_File with anything other than the version of Berkeley DB that
shipped with your Linux release. If you do try to use a different
version of Berkeley DB you will probably get the error described in the
"Incompatible versions of db.h and libdb" section of this file.
As yet I haven't found a satisfactory way around this problem. If you
do know a workaround to this problem which doesn't involve replacing
the built in version of Berkeley DB I would like to hear from you.
"
Does any one solve this problem?
Thanks in advance.
Hagay Dagan
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 20 Jul 2000 14:35:38 GMT
From: iwelch@my-deja.com
Subject: Re: Intelligent "chomp" ?
Message-Id: <8l72nq$mji$1@nnrp1.deja.com>
So, I think it is time to petition the perl maintainers to intelligize
chomp. The intent is almost invariably to chop off *all* trailing
control characters, no matter where the file originated. (Perhaps it
could be called "chopp"? ;-). )
Can someone let me know how to go about making this suggestion
appropriately?
/iaw
In article <8k7jp5$f3h$1@nnrp1.deja.com>,
iwelch@my-deja.com wrote:
>
>
> Is there a more intelligent chomp that chops off either ^M^J or ^J or
> ^M, i.e., works for files originating either on unix, dos, or macs?
> Yes, I know I can use a regex. I just wonder if there is something
> *faster*...
>
> /iaw
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 20 Jul 2000 12:26:14 GMT
From: "Stephen O. Lidie" <lusol@Pandora.CC.Lehigh.EDU>
Subject: Re: limit on canvas object?
Message-Id: <8l6r56$ks8@fidoii.CC.Lehigh.EDU>
In comp.lang.perl.tk Josiah Bryan <jdb@wcoil.com> wrote:
> If sample code would help, i can post some if requested.
pls post or mail
> Is there some sort of limit on the number of times
Probably, but ~= 250 seems rather tiny.... I will investigate...
--
@_=map{eval"100${_}"}split/!/,'/5!*2!+$]!/10+$]';use Tk;$m=tkinit;$t='just an'.
'other perl hacker';$z='createText';$c=$m->Canvas(-wi,$_[1],-he,25)->grid;$c->$
z(@_[2,3],-te,$t,-fi,'gray50');$c->$z($_[2]-$],$_[3]-$],-te,$t);$m->bind('<En'.
'ter>',sub{$y=int(rand($m->screenheight));$m->geometry("+$y+$y")});MainLoop;
------------------------------
Date: Thu, 20 Jul 2000 14:13:34 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: limit on canvas object?
Message-Id: <7ak8egj3ea.fsf@merlin.hyperchip.com>
"Josiah Bryan" <jdb@wcoil.com> writes:
> I'm trying to do some rotating polygon
> stuff with perl/tk and a simply canvas.
Then you would be interested in my Tk::RotCanvas module, available from
CPAN.
> I have ActiveState Perl 5.6 and Tk8.
>
> The problem seems that I can create
> around 250 or 240 polygons on the
> screen before it doesnt display anymore
> polygons. The script generates polygons
> with a $main->repeat(1,\&rotate_poly) call.
> The polygons are simply created with a
> call on the $canvas like
> $poly=$canvas->create(('polygon',...points...),-fill=>$color);
> and on each subsequant call, before ->creatIng
> a new poly, the prevous poly is deleted with
> $canvas->delete($poly).
So at any one time, there is exactly *one* polygon on the canvas?
> If sample code would help, i can post some if requested.
Yes of course. I tried to reproduce your problem with the following
simple code:
use Tk;
use strict;
my $mw = new MainWindow;
my $c = $mw->Canvas(qw/-bg black/)->pack;
my $poly;
my $count = 0;
$c->repeat(100, \&draw_it);
MainLoop;
sub draw_it {
print "Count is $count.\n";
$c->delete($poly) if $poly;
$poly = $c->create(qw/polygon 10 10 10 50 50 50 50 10 -fill blue/);
$c->update;
$count++;
}
But I didn't get what you're reporting.
--Ala
------------------------------
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 3756
**************************************