[17111] in Perl-Users-Digest
Perl-Users Digest, Issue: 4523 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 4 21:06:01 2000
Date: Wed, 4 Oct 2000 18:05:11 -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: <970707911-v9-i4523@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 4 Oct 2000 Volume: 9 Number: 4523
Today's topics:
Re: (Beginner) Perl split function... <lr@hpl.hp.com>
Re: (Beginner) Perl split function... <cernava@itexas.net>
Re: (Beginner) Perl split function... <lr@hpl.hp.com>
Re: A matter of style (was Re: Search and Destroy) <anmcguire@ce.mediaone.net>
Re: Blank line appending data to file <nige@npay.freeserve.co.uk>
Re: Code example in Cookbook <wyzelli@yahoo.com>
Re: Deleting files older than n days <sb@muccpu1.muc.sdm.de>
Re: Deleting files older than n days (Martien Verbruggen)
Re: ExtUtils::MakeMaker and g+w install permissions <randy@theoryx5.uwinnipeg.ca>
Re: ExtUtils::MakeMaker and g+w install permissions (John J. Trammell)
Re: File upload- <elephant@squirrelgroup.com>
Re: Help me get this code working <elephant@squirrelgroup.com>
Re: Help with CGI <flavell@mail.cern.ch>
Re: how do I set server socket timeouts with setsockopt <kingsley@omit.skymarket.remove.co.kill.uk>
Re: HTML Email <cernava@itexas.net>
Re: html embeded email <peter.sundstrom@eds.com>
Re: html embeded email <elephant@squirrelgroup.com>
Re: Need help with Win32::EventLog <elephant@squirrelgroup.com>
Re: Perl, Unix and printers (Brandon Metcalf)
Re: Perl, Unix and printers <david.obrien@ssmb.com.au>
Programming Perl 3rd & Perl 6.0 faatdilac@my-deja.com
Re: Programming Perl 3rd & Perl 6.0 (Craig Berry)
Re: Programming Perl 3rd & Perl 6.0 (Gwyn Judd)
Re: require a file in IIS 4.0 <elephant@squirrelgroup.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 4 Oct 2000 15:02:51 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: (Beginner) Perl split function...
Message-Id: <MPG.144548e1bc12cd0d98ae09@nntp.hpl.hp.com>
In article <8rg6rv$la0$1@nnrp1.deja.com> on Wed, 04 Oct 2000 21:19:02
GMT, aramis1250@my-deja.com <aramis1250@my-deja.com> says...
> [snip]
> > foreach (@PathOfFiles) {
> >
> > $filename = (/\w+$);
> >
> > } # end foreach
> >
>
> [/snip]
>
> don't forget the trailing slash:
>
> $filename = (/\w+$/);
>
> <bonk self on head></bonk self on head>
Two more bonks:
1. It assigns the truth value, not the matched value.
my ($filename) = /(\w+)$/;
Note the requied pairs of parentheses.
2. It is too restrictive, as I saidi my other post.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 4 Oct 2000 16:43:52 -0500
From: "Cernava" <cernava@itexas.net>
Subject: Re: (Beginner) Perl split function...
Message-Id: <8rg8af06kb@enews3.newsguy.com>
well I'm not going to guarantee this is it but I would do this:
while (@PathOfFiles)
{
@filename = split( /\//); #use an array instead of that verbal.
copy ($filename, $New_Dir/@filename[$#filename].bkp) #this should give
you the last split in the array. examp : /etc/httpd/conf/httpd.conf
"httpd.cong" <- should be the last in in the array so it should work :)
}
have fun
rich
<aplummer@my-deja.com> wrote in message news:8rg32m$hod$1@nnrp1.deja.com...
> I have a problem with an array split, as described below:
>
> while (@PathOfFiles)
> {
> $filename = split( /\//);
> copy ($filename, "$New_Dir/$filename.bkp")
> }
>
> Now, @PathOfFiles holds a large number of unix files, with
> their paths...
>
> @PathOfFiles = {
> "/etc/passwd",
> "/etc/dfs/dfstab",
> "/etc/hosts",
> ...
> }
>
> I need to get rid of the path, keep the filename, and copy those
> files to a certain directory, $New_Dir, with the new extension.
> How would I do this?
>
> I have been trying it with a split - to split up the array, and
> get at the last entry - but as you can see, I'm having problems
> getting it to work.
>
> Thanks!
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Wed, 4 Oct 2000 15:45:54 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: (Beginner) Perl split function...
Message-Id: <MPG.144552fb41b1390e98ae0a@nntp.hpl.hp.com>
In article <8rg8af06kb@enews3.newsguy.com> on Wed, 4 Oct 2000 16:43:52 -
0500, Cernava <cernava@itexas.net> says...
> well I'm not going to guarantee this is it but I would do this:
What would the guarantee be worth, on buggy untested code?
> while (@PathOfFiles)
> {
> @filename = split( /\//); #use an array instead of that verbal.
> copy ($filename, $New_Dir/@filename[$#filename].bkp) #this should give
> you the last split in the array. examp : /etc/httpd/conf/httpd.conf
> "httpd.cong" <- should be the last in in the array so it should work :)
> }
Hmmm...
$New_Dir/@filename[$#filename].bkp
Divide $Newdir by an array slice, then append the bareword 'bkp'?
"$New_Dir/$filename[$#filename].bkp"
or, more compactly,
"$New_Dir/$filename[-1].bkp"
Please, next time you want to help, compile your code with '-w' and
'use strict;', and run it on a test case or two.
> have fun
> rich
<SNIP of Jeopardy quote, which should serve as a warning anyway>
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 4 Oct 2000 18:08:52 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: A matter of style (was Re: Search and Destroy)
Message-Id: <Pine.LNX.4.21.0010041804410.9310-100000@hawk.ce.mediaone.net>
On Wed, 4 Oct 2000, David Steuber quoth:
DS> Tom Briles <sariq@texas.net> writes:
DS>
DS> ' perldoc perlstyle
DS>
DS> I hate to ask, but "Uncuddled elses?"
DS>
DS> What does cuddling an else look like?
DS>
DS> I've been doing this:
DS>
DS> if ($foo) {
DS> ...
DS> } elsif ($bar) {
[ snip ]
That is a cuddled else. Uncuddled elses look like:
if ($foo) {
...
}
elsif {
...
}
or BSD style:
if ($foo)
{
...
}
elsif ($foo)
{
...
}
DS> Most everything else makes sense. I generally indent only 3 though,
DS> not 4.
Consistency, and readability are the biggest things. As long as the code
reads (and runs) well, you are OK.
anm
--
perl -wMstrict -e '
$a=[[qw[J u s t]],[qw[A n o t h e r]],[qw[P e r l]],[qw[H a c k e r]]];$.++
;$@=$#$a;$$=[reverse sort map$#$_=>@$a]->[$|];for$](--$...$$){for$}($|..$@)
{$$[$]][$}]=$a->[$}][$]]}}$,=$";$\=$/;print map defined()?$_:$,,@$_ for @$;
'
------------------------------
Date: Wed, 4 Oct 2000 23:08:18 +0100
From: "Nige P" <nige@npay.freeserve.co.uk>
Subject: Re: Blank line appending data to file
Message-Id: <8rg9nv$rgq$1@newsg2.svr.pol.co.uk>
Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote
> Almost. You got the plain-text bit right but failed on the other usenet
> "no-no". It's generally considered a good thing to post replies *below*
> the text you are replying to as I am doing. Also you should only quote
> text that makes it helpful to anyone reading your answer. ie. you
> shouldn't quote everything they said, as well as everything they quoted
> as well as...but rather you should delete most of it, only leaving in
> the bits that are absolutely necessary. This makes it quicker to
> download as well as easier to understand.
>
Ha! Marvellous... thanks for your valuable input to a learner. I'm
getting a usenet education in to the bargain! I hope this is PC ?
> >Essentially $login is a variable used to enter the 'type xxxx' command
> >on the command line.... does that help?
> Not really. I'm afraid you really need to post a complete (but minimal)
> script that exhibits the behaviour. Can you take the script you have and
> cut it right down to the minimum parts that still exhibits the
> misbehaviour (and that will run by itself) and then post that? If not I
> fear nobody here will be able to help you.
I'll get a copy posted ASAP. There's really not much too it... it's built
around a bog standard Net::Telnet mod, but I'll get the script up
tomorrow.
------------------------------
Date: Thu, 5 Oct 2000 09:58:56 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Code example in Cookbook
Message-Id: <CUPC5.18$bP3.3345@vic.nntp.telstra.net>
<aramis1250@my-deja.com> wrote in message
news:8rg3de$i4c$1@nnrp1.deja.com...
> I've been reading through the Perl Cookbook, and came across
> the following snippit to extract information from apache common
> logs:
> # BEGIN code snippit
> while <LOGFILE> {
> my ($client, $identuser, $authuser, $date, $time, $tz, $method,
> $url, $protocol, $status, $bytes) = /^(\S+) (\S+) (\S+)
> \[([^:]+):(\d+:\d+:\d) ([^\]]+) "(\S+) (.8?) (\S+)" (\S+) (\S+)$/
> # my code here
> } # END while logfile
> # END code snippit
>
> The problem that I run into is that .... none of the variables in the
> first part ever get anything. What did I miss?
>
Opening the log file?
--
Wyzelli
push@x,$_ for(a..z);push@x,' ';
@z='092018192600131419070417261504171126070002100417'=~/(..)/g;
foreach $y(@z){$_.=$x[$y]}y/jp/JP/;print;
------------------------------
Date: 4 Oct 2000 22:01:18 GMT
From: Steffen Beyer <sb@muccpu1.muc.sdm.de>
Subject: Re: Deleting files older than n days
Message-Id: <8rg9be$hbb$1@solti3.sdm.de>
In article <8rfkjt$448$1@nnrp1.deja.com>, dottiebrooks@my-deja.com wrote:
> Does anyone have a script to delete files over n days old on NT? I'm
> working on a script that has
> use Time::ParseDate;
> use Time::localtime;
> use File::stat;
> ...
> $file_date = ctime(stat($file)->mtime);
> and it's giving me a
> Can't call method "mtime" on an undefined value at line ...
> which makes me think the stat may not be working.
This is all unnecessary!
The following script works (under Unix as well as Windows NT):
-------------------- cut here -------------------- cut here --------------------
#!perl -w
use strict;
my $days;
my $item;
my(@files) = ();
# Usage: weedoutfiles <days> <dir> [<dir> ...]
sub weedout
{
my($dir,$days) = @_;
my($item,$time,$diff);
my(@dirs) = ();
unless (opendir(DIR, $dir))
{
warn "Can't read directory '$dir': $!\n";
return;
}
print "Visiting directory '$dir'.\n";
ITEM:
while (defined ($item = readdir(DIR)))
{
next ITEM if ($item =~ /^\.\.?$/);
$item = "$dir/$item";
if (-d $item)
{
push( @dirs, $item );
}
elsif (-f $item)
{
unless (defined ($time = (stat($item))[9]))
{
warn "Can't stat file '$item': $!\n";
next ITEM;
}
$diff = int((time - $time) / 86400);
next ITEM if ($diff < $days);
push( @files, $item );
}
}
unless (closedir(DIR))
{
warn "Can't close directory '$dir': $!\n";
}
foreach $item (@dirs)
{
&weedout($item,$days);
}
}
$days = shift || 0;
$days = 1 if ($days < 1);
foreach $item (@ARGV)
{
&weedout($item,$days);
}
foreach $item (@files)
{
if (unlink($item))
{
print "Deleted file '$item'.\n";
}
else
{
warn "Could not delete file '$item': $!\n";
}
}
__END__
-------------------- cut here -------------------- cut here --------------------
> Thanks,
> Russ
You're welcome. Good luck!
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/whoami/ (Who am I)
http://www.engelschall.com/u/sb/gallery/ (Fotos Brasil, USA, ...)
http://www.engelschall.com/u/sb/download/ (Free Perl and C Software)
------------------------------
Date: Wed, 04 Oct 2000 23:42:18 GMT
From: mgjv@verbruggen.comdyn.com.au (Martien Verbruggen)
Subject: Re: Deleting files older than n days
Message-Id: <slrn8tng2e.19t.mgjv@verbruggen.comdyn.com.au>
On Wed, 04 Oct 2000 16:07:32 GMT,
dottiebrooks@my-deja.com <dottiebrooks@my-deja.com> wrote:
> Hi,
> Does anyone have a script to delete files over n days old on NT? I'm
> working on a script that has
It depends a bit on where you want to look. If you want to look on a
single directory, you'll need opendir and readdir. If you want to
follow a tree, you'd probably want File::Find
> use Time::ParseDate;
> use Time::localtime;
> use File::stat;
> ...
>
> $file_date = ctime(stat($file)->mtime);
Why the ctime?
> and it's giving me a
> Can't call method "mtime" on an undefined value at line ...
> which makes me think the stat may not be working.
Normally you'd get an undefined value from stat($file) if the file
doesn't exist. Are you maybe using this inside of a readdir loop
without making sure you prepend the directory you opened to the file
name? you probably should read the readdir documentation, which warns
explicitly against this. You could do something like this to find out
why the stat fails:
stat($file) or die "Cannot stat $file: $!";
The $! will tell you _why_ it failed.
It's hard to make any better guess without a look at your code.
Anyway, there was a thread in this very group, in which I posted a bit
of code, on the 3rd of october (only 2 days ago). The subject
'Comparing Timestamps', the id of my message:
slrn8tib4t.jr6.mgjv@martien.heliotrope.home
Use something like deja.com to find the article, and be amazed at how
similar that question is to yours. Didn't you read the posts in this
group before posting your question?
Martien
--
Martien Verbruggen |
Interactive Media Division | Can't say that it is, 'cause it
Commercial Dynamics Pty. Ltd. | ain't.
NSW, Australia |
------------------------------
Date: 4 Oct 2000 22:08:12 GMT
From: Randy Kobes <randy@theoryx5.uwinnipeg.ca>
Subject: Re: ExtUtils::MakeMaker and g+w install permissions
Message-Id: <8rg9oc$1cc$1@canopus.cc.umanitoba.ca>
In comp.lang.perl.misc, John J. Trammell <trammell@nitz.hep.umn.edu> wrote:
> I'd like to have Makefile.PL generate a Makefile that installs
> files with group-rw permissions.
> After reading the documentation, trying some options, cursing,
> then looking at the code, I boiled it down to these lines in
> ExtUtils::Install, routine pm_to_blib():
[ ... ]
> Now that I've basked in the glow of Figuring It Out, the problem
> remains: how to install these files with the right perms? Any
> ideas?
'perldoc ExtUtils::MakeMaker' describes the PERM_RW and PERM_RWX
attributes you can pass to WriteMakefile() - can that do what
you want?
best regards,
randy kobes
------------------------------
Date: 4 Oct 2000 22:30:42 GMT
From: trammell@nitz.hep.umn.edu (John J. Trammell)
Subject: Re: ExtUtils::MakeMaker and g+w install permissions
Message-Id: <slrn8tmhkd.pg5.trammell@nitz.hep.umn.edu>
On 4 Oct 2000 22:08:12 GMT, Randy Kobes <randy@theoryx5.uwinnipeg.ca> wrote:
>In comp.lang.perl.misc, John J. Trammell <trammell@nitz.hep.umn.edu> wrote:
>
>> I'd like to have Makefile.PL generate a Makefile that installs
>> files with group-rw permissions.
>> After reading the documentation, trying some options, cursing,
>> then looking at the code, I boiled it down to these lines in
>> ExtUtils::Install, routine pm_to_blib():
>[ ... ]
>> Now that I've basked in the glow of Figuring It Out, the problem
>> remains: how to install these files with the right perms? Any
>> ideas?
>
>'perldoc ExtUtils::MakeMaker' describes the PERM_RW and PERM_RWX
>attributes you can pass to WriteMakefile() - can that do what
>you want?
Yes, I saw those. They sure look sexy, but they aren't used to
set .pm file permissions. A quick grep through ExtUtils::MM_Unix
confirms this (apologies -- I didn't specify my platform earlier).
Those attributes do cascade to the files indicated with the
EXE_FILES argument though.
I've also looked into doing some sort of postinstall munging;
this looks prohibitively ugly though. :-(
--
John J. Trammell
johntrammell@yahoo.com
------------------------------
Date: Thu, 5 Oct 2000 10:19:46 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: File upload-
Message-Id: <MPG.1446742b6800c5659897f4@localhost>
Hanspeter Jakober wrote ..
>Hello
>
>With die Perl-Script <upload.pl> I upload files to my webserver (WIN-NT/ISS)
>so far so good. Now I would like to change the path where the files are
>stored on the webserver.
>
>Question: how can I changed the path where I like to store the files on the
>webserver and what kind of right needs the new directory.
>
>
>$Datei[1]="image.gif";
>open(DATEI, ">$image[1]");
^^..stick a path in there between the '>' and the '$'
and you need NT permissions of Add on the directory .. of course by
'you' I mean the account that the CGI program is executed under .. which
in IIS - by default - is a special IUSER_<machine name> account .. but
you're probably logging in if you're uploading - so you probably know
which account you're using anyway
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Thu, 5 Oct 2000 12:00:12 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: Help me get this code working
Message-Id: <MPG.14468bbaa06f7fe9897f8@localhost>
mrstevejones@my-deja.com wrote ..
>Please help with this code:
>I wrote this with help from this board and a Perl book.
>I keep getting and error:
>Uninitialized value at actualexe line 24
>The purpose of this prog. is to open a 3 field CSV file, search for the
>given dpsr and and that records hours to the total and return the total
>hours.
it's almost certainly caused because you have at least one blank line in
your CSV file (possibly just one - probably the last line)
>#!/usr/local/bin/perl -w
use strict;
# chomp is safer than chop - see perlfunc for why
chomp( my $mysearch = <STDIN>);
>my $total = 0;
>open ACTDATA, "/toll/webserver/htdocs/ncs/prodesk/actualcsv.csv" or
>die "Unable to open Actuals Data file: $!\n";
>
>while(my($projid,$dpsr,$hours)=split/,/,<ACTDATA>)
>{
# if we don't have a defined $dpsr then skip to the next iteration
next unless defined $dpsr;
> if($dpsr == $mysearch) ## <---- error here(I think)
> {
> $total += $hours;
> }
>
> print $total, "\n";
>}
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Wed, 4 Oct 2000 23:58:35 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Help with CGI
Message-Id: <Pine.GHP.4.21.0010042011400.12836-100000@hpplus03.cern.ch>
On Wed, 4 Oct 2000, Jeffrey Scott Dunfee II wrote:
> I have a cgi script written in perl used for a feedback form on a web
> page.
I shall be frank. Nothing personal: if you're seriously interested,
then it seems to me that you need a strong answer.
Do you mean you're writing one, or you picked up some stuff of unknown
provenance off a random scripts download site somewhere?
[...]
> Anyways, the problem is
> encountered when it tries to print the html back to the web browser, it
> gets through the e-mail section, sends the e-mail but when it hits the
> first print statement for the html it asks to open the file or save it
> to disk
Looks to me as if the problem is you're trying to get a CGI to work
without the necessary background knowledge. What tutorials etc.
are you working from? What background do you have in debugging this
sort of thing?
Since you're working from Perl, you really should take a look at the
relevant section of the Perl FAQs about CGI scripts. Since you're
writing CGI scripts, you really should get to know Nick Kew's fine
CGI FAQ, especially the part about troubleshooting.
> (I'm using netscape on this one, it works in I.E, but the users
> don't want to switch so I'm stuck making it work for netscape).
This raises the worrisome possibility that you don't really understand
the web either, since "Netscape" in this context stands for "any
conforming browser", whereas IE notoriously misbehaves. You appear to
be yearning for the chance of making yourself dependent on IE's
misbehaviour. Not good.
Look, I'm no defender of Netscape 4: in general it's an unmaintainable
heap of crap. But in this respect it follows the specifications,
whereas MSIE flaunts its misbehaviour. You should be using something
based on Mozilla, or Lynx, as your reference browser for this kind of
issue. MSIE is designed to fool you that all is well, maybe in the
hope of fooling naive users that the correctly-behaved clients are
defective. Not good.
As somone who's aiming to write an extension to a web server (that's
what a CGI script is, in some sense), you might feel the need to be
aware of some of this.
> do "cgi-lib.pl" || die "Fatal Error: Can't load cgi library";
> &ReadParse;
Please don't waste any more time on this obsolete cargo, but get to
know the modern tools for this kind of thing, and you'll never look
back. In Perl: that's CGI.pm. When the resident troll pops up to try
to convince you otherwise, you'll get confirmation that I was right...
> open(FEEDBACK,'>>C:\InetPub\mailroot\compose\feedback.txt');
Failed to test for success etc. In fact, the script seems to ignore
pretty much all of the things that are routinely recommended here for
people to help themselves. Usenet isn't a write-only medium: you're
supposed to read the other answers too, and learn from them.
> print FEEDBACK "IP Address: $ENV{'REMOTE_ADDR'}\n";
> print FEEDBACK "Host Name: $ENV{'REMOTE_HOST'}\n";
> print FEEDBACK "Name: $in{'FULLNAME'}\n";
and so on.
That's cruel on the eyes. You (or whoever wrote that stuff)
desperately needs to learn about Here-documents. It's not as if they
don't get mentioned here every day or two. You're not taking
advantage of the resources available - is how it looks.
The trivial problem that you're currently having with your script is
that it fails to write the required Content-type: header to standard
output. The _real_ problem is, that it would best be started over.
It would really be good if the group could find out how you got
yourself into this, so we could help you and others to keep out of it.
There are some fine tutorials, books etc. around, but there's also a
lot of junk: take a look in the Perl FAQ and see if you find something
recommended there which appeals to you.
[On top of that, the message "Your feedback was successfully sent" is
a fraud, isn't it? What really happens, as far as I can see, is "We
tried to write your feedback into the sending queue, where it maybe
overwrote the previous sender's mail; but we didn't bother to test
whether it even got that far, let alone actually got sent".]
Now I expect I'll get flamed to kingdom come for this, but it seems to
me that the situation calls for a frank response, and if you can't
make use of that, then that's just too bad.
good luck
------------------------------
Date: Wed, 4 Oct 2000 23:20:10 +0100
From: "Kingsley Tart" <kingsley@omit.skymarket.remove.co.kill.uk>
Subject: Re: how do I set server socket timeouts with setsockopt?
Message-Id: <c8OC5.13605$uq5.268283@news6-win.server.ntlworld.com>
Thanks Bart, works a treat :-)
Cheers :-)
------------------------------
Date: Wed, 4 Oct 2000 16:20:57 -0500
From: "Cernava" <cernava@itexas.net>
Subject: Re: HTML Email
Message-Id: <8rg6vn04rh@enews3.newsguy.com>
well let get to the point.
what you will have to do is set the Content-type in the emails header to
text/html so the program will reqognize it has an html document. So how do
yo do this is:
if you are useing sendmail it is like that
open(MAIL,"|/usr/lib/sendmail -t");
print MAIL "To: $emailto\n";
print MAIL "From: $emailfromaddress\n";
print MAIL "Subject: $emailsubject\n";
print MAIL "Content-type: text/html\n\n"; #<-this is the part that is giving
you trubel Notes: that ever header data data has a \n after it so it know
when the next header element is. The last one allways has two \n\n to end
the header.
print MAIL "$emailmaincontent";
have fun
rich
------------------------------
Date: Thu, 5 Oct 2000 11:22:05 +1300
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: html embeded email
Message-Id: <8rgapr$vms$1@hermes.nz.eds.com>
Sunil Dua wrote in message <8rf840$oln$1@nnrp1.deja.com>...
>Dear List members
This is a newsgroup.
>
>I want to send html pages as the body of my mail through perl on linux
>plateform. does anybody have any idea as to how to achieve this. I
>shall be very greatful to you.
Grab MIME::Lite. It has excellent documentation and plenty of examples on
how to send HTML mail.
------------------------------
Date: Thu, 5 Oct 2000 11:32:28 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: html embeded email
Message-Id: <MPG.14468539c4df31419897f5@localhost>
Anders Lund wrote ..
>> I want to send html pages as the body of my mail through perl on linux
>> plateform. does anybody have any idea as to how to achieve this. I
>> shall be very greatful to you.
>
>Use one of the modules for sending mail, Mail::Send or Mail::Mailer, and
>put your html (file) in the body...
you forgot to mention the Content-type header .. or were you
intentionally thwarting the originator's attempt to infect email with
HTML ?
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Thu, 5 Oct 2000 11:43:09 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: Need help with Win32::EventLog
Message-Id: <MPG.144687b43b2a82a19897f6@localhost>
tor@kmd.dk wrote ..
>I'm using the following example code to genereate a entry in the
>EventLog.
>When I open up the EventLog, the entry is there, but
>when i try to get details it says:
>The system can not find the file specified.
>
>Why is that
>
>Torfinn -- > tor@kmd.dk
>
>------------ The Code -------------
>use strict;
>use Win32::EventLog;
>
># create a new EventLog object
>my $logfile = "Application";
>my $log = Win32::EventLog->new($logfile);
>die "Can't open $logfile: $!" unless $log;
>
># populate our event with data
>my $info = {
> 'Category' => 1,
> 'EventType' => EVENTLOG_INFORMATION_TYPE,
> 'EventID' => 1,
> 'Strings' => "A Perl Event",
> 'Data' => 'Perl',
Source => 'A string describing your program',
> };
>
>$log->Report($info) || warn "Unable to report event: $!";
>$log->CloseEventLog;
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: 4 Oct 2000 22:10:40 GMT
From: bmetcalf@nortelnetworks.com (Brandon Metcalf)
Subject: Re: Perl, Unix and printers
Message-Id: <8rg9t0$p18$1@bcrkh13.ca.nortel.com>
gerg@ncal.verio.com writes:
> "Godzilla!" <godzilla@stomp.stomp.tokyo> writes:
> >
> >You cannot disable then enable a printer queue.
> >
>
> Godzilla, your statement is completely wrong for
> SVR4 Unix systems. Even the context I deleted
> does not make that statement correct.
Greg, you must learn that freakzilla is always wrong. She made it into
my killfile a long time ago - your reply was the only reason I saw this.
Please ignore the troll.
Brandon
------------------------------
Date: Thu, 05 Oct 2000 11:47:35 +1000
From: Dave O'Brien <david.obrien@ssmb.com.au>
Subject: Re: Perl, Unix and printers
Message-Id: <39DBDDB7.4030602@ssmb.com.au>
Brandon Metcalf wrote:
> gerg@ncal.verio.com writes:
>
> > "Godzilla!" <godzilla@stomp.stomp.tokyo> writes:
> > >
> > >You cannot disable then enable a printer queue.
> > >
> >
> > Godzilla, your statement is completely wrong for
> > SVR4 Unix systems. Even the context I deleted
> > does not make that statement correct.
>
> Greg, you must learn that freakzilla is always wrong. She made it into
> my killfile a long time ago - your reply was the only reason I saw this.
>
> Please ignore the troll.
>
> Brandon
Yeah I got suckered by her as well
------------------------------
Date: Wed, 04 Oct 2000 21:57:40 GMT
From: faatdilac@my-deja.com
Subject: Programming Perl 3rd & Perl 6.0
Message-Id: <8rg94g$ncd$1@nnrp1.deja.com>
Since Perl 6.0 is going to be rewritten from scratch, is it worth
buying Programming Perl 3rd?
faatdilac
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 04 Oct 2000 23:29:34 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Programming Perl 3rd & Perl 6.0
Message-Id: <stnfauhgp3g787@corp.supernews.com>
faatdilac@my-deja.com wrote:
: Since Perl 6.0 is going to be rewritten from scratch, is it worth
: buying Programming Perl 3rd?
The internals are being rewritten from scratch, but the goal is basically
a functional superset of Perl 5.6. So Camel 3 should still be useful for
some time to come.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "Quidquid latine dictum sit, altum viditur."
|
------------------------------
Date: Wed, 04 Oct 2000 23:46:50 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Programming Perl 3rd & Perl 6.0
Message-Id: <slrn8tngb8.3ki.tjla@thislove.dyndns.org>
I was shocked! How could faatdilac@my-deja.com <faatdilac@my-deja.com>
say such a terrible thing:
>Since Perl 6.0 is going to be rewritten from scratch, is it worth
>buying Programming Perl 3rd?
Well I think so since 6 won't likely be done for at least a couple of
years I would say.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
She asked me, "What's your sign?"
I blinked and answered "Neon,"
I thought I'd blow her mind...
------------------------------
Date: Thu, 5 Oct 2000 11:46:30 +1000
From: jason <elephant@squirrelgroup.com>
Subject: Re: require a file in IIS 4.0
Message-Id: <MPG.1446887e92c66e5e9897f7@localhost>
jhardy@cins.com wrote ..
>I seem to be having a problem with "require" in IIS 4.0
>
>I get the following error message no matter what script I run:
>
>I am sorry but I was unable to require
>./Librarys/web_store.setup.db.table at line 75 in
>C:\InetPub\wwwroot\artfind\public_html\cgi\Web_store\web_store.pl. Would
>you please make sure that you have the path
>correct and that the permissions are set so that I have read access?
>Thank you.
>
>I have checked the paths and permissions?
>
>I am using PERL 5.6.0 build 618
>
>is there another command to be used under WIN32
nup .. same command
my guess is that your Perl program has a different idea of the directory
that it is in than you do .. often it seems under IIS on Win32 the
current directory is set as 'c:\winnt' rather than anything to do with
either the program or IIS
perhaps you could try doing a 'chdir' before the require statement so
that you know that you're in the directory that you need to be in
alternatively - supply an absolute path to the file that you want to
require
--
jason -- elephant@squirrelgroup.com --
------------------------------
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 4523
**************************************