[12152] in Perl-Users-Digest
Perl-Users Digest, Issue: 5752 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 22 15:07:23 1999
Date: Sat, 22 May 99 12:00:19 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 22 May 1999 Volume: 8 Number: 5752
Today's topics:
Re: best way to database stuff using Perl? <matt@aubaine.net>
Couldn't find a bundle file in Bundle-libnet-1.00 (Harry Bosma)
Re: Couldn't find a bundle file in Bundle-libnet-1.00 <gellyfish@gellyfish.com>
Re: DBD-Iformix Problem <gellyfish@gellyfish.com>
Re: DBI - why doesn't this select statement work? <Jeremy@Malcolm.wattle.id.au>
Dumb questions for Jeremy about s/// <JFedor@datacom-css.com>
Re: Dumb questions for Jeremy about s/// <gellyfish@gellyfish.com>
Re: Dumb questions for Jeremy about s/// <JFedor@datacom-css.com>
Execute a command from perl... <denny@chuang.com>
Re: Execute a command from perl... <tchrist@mox.perl.com>
Re: Execute a command from perl... <gellyfish@gellyfish.com>
Re: foreach and print, Please help (Fuzzy Warm Moogles)
Re: How do I use a regular expression to ignore Java st (Steve Grantz)
Re: How to catch the return value in Perl? <gellyfish@gellyfish.com>
Re: How to print mailing labels in columns <Jeremy@Malcolm.wattle.id.au>
Re: How to print mailing labels in columns <gellyfish@gellyfish.com>
Re: MacPerl and QuarkXPress??? (Chris Nandor)
Re: Newbie Blat help! <Jeremy@Malcolm.wattle.id.au>
Re: perl email (M.)
Re: perl email <gellyfish@gellyfish.com>
Re: perl email <tchrist@mox.perl.com>
Re: Premature end of Script header and Apache and Inter <Jeremy@Malcolm.wattle.id.au>
Record splitting <barsara@peakaccess.net>
s/// <JFedor@datacom-css.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 21 May 1999 14:47:16 -0600
From: "Matt Warnock" <matt@aubaine.net>
Subject: Re: best way to database stuff using Perl?
Message-Id: <7i4gsu$glc$1@newsboy.fiber.net>
Its on CPAN and works just great. Postgres comes with RH5.2 (haven't looked
on 6.0 yet).
smnayeem@my-dejanews.com wrote in message <7i0j3q$ig3$1@nnrp1.deja.com>...
>
>Oracle, Ingres and MySQL are all very good no doubt. But theres one
>little difference between these and Perl and Linux, they are not free.
>Isnt there any free GOOD RDBMS i can use with perl? PostGres is free but
>anyone knows where i can find a DBI driver for Postgres?
------------------------------
Date: Sat, 22 May 1999 13:23:10 GMT
From: hbosma@xs4all.nl (Harry Bosma)
Subject: Couldn't find a bundle file in Bundle-libnet-1.00
Message-Id: <3746ac0f.10901662@news.xs4all.nl>
A few days ago I downloaded and installed the latest ActivePerl
distribution on my Windows 95 machine. I wanted to install a few XML
modules and I understood that the best way to do it was by using the
CPAN functionality.
I think I got everything more or less working but when I do a "install
Bundle::libnet" (which is advised every other line of feedback) I get
the following error message:
Couldn't find a bundle file in MySourcePath\Bundle-libnet-1.00 at
CPAN.pm line 1717.
What does this mean and is there a solution?
Harry
P.S. Where or how do I find exactly which version I have installed?
Visit Healing Dreams:
http:/www.xs4all.nl/~hbosma/healing_dreams/
------------------------------
Date: 22 May 1999 14:47:32 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Couldn't find a bundle file in Bundle-libnet-1.00
Message-Id: <7i6g24$261$1@gellyfish.btinternet.com>
On Sat, 22 May 1999 13:23:10 GMT Harry Bosma wrote:
> A few days ago I downloaded and installed the latest ActivePerl
> distribution on my Windows 95 machine. I wanted to install a few XML
> modules and I understood that the best way to do it was by using the
> CPAN functionality.
>
Nah, the best way of installing modules for ActiveState is via their
PPM (Perl Package Manager ) - this is documented in the HTML documents
that are available throught the shortcut in your Start Menu. You can
do something like:
C:\>ppm install XML-Parser
(assuming you have an internet conenction)
and it will go off and get all of the files install them and update the
index of documentation.
It does largely the same thing as the CPAN module except it works round
the fact that a vast number of Perl users on Win32 dont have a C compiler
and thus need precompiled versions of modules with XS components.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 22 May 1999 14:18:19 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: DBD-Iformix Problem
Message-Id: <7i6ebb$23g$1@gellyfish.btinternet.com>
On Wed, 19 May 1999 11:32:21 +0200 carsten wrote:
> I have succesfully installed DBI.
> Now I want to install DBD-Informix.
> I use SuSE-Linux 6.0
>
> But I get the error:
> perl Makefile.PL
>
<snip>
> /usr/informix/lib/esql/libixos.so: undefined reference to `crypt'
> collect2: ld returned 1 exit status
> Failed to link test program esqltest
Hmmm. It looks like your libc doesnt have libcrypt compiled in - I have
built DBD::Informix succesfully on S.u.S.E 5.2 and had no problems
(except that the test looks for 'stores' as a test database and the one
installed is 'stores7' ).
I think that my recommendation would be to recompile your libc bearing
in mind that libcrypt has to be downloaded separately because of paranoia.
If you dont want to go that far then you should be able to compile libcrypt
as a standalone library and supply -lcrypt to the linker at some point.
Anyhow I'm not going to try and recompile DBD::Informix right now to
find out 'cause the FA cup is about to start.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 22 May 1999 21:52:01 +0800
From: "Jeremy Malcolm" <Jeremy@Malcolm.wattle.id.au>
Subject: Re: DBI - why doesn't this select statement work?
Message-Id: <7i6co1$vu4$1@news.iinet.net.au>
Yes it was a stupid error like that - there's *two* silly questions
that I've asked and solved on the same day. (I'm not normally like
this, I normally try harder before posting - search deja.com if you
don't believe me! :-) Anyway to punish myself I'll go answering some
other folks' silly questions for half an hour now. :-)
- --
JEREMY MALCOLM Jeremy@Malcolm.wattle.id.au http://malcolm.wattle.id.au
SIG of the day: [ ] Contact [ ] Web [ ] PGP [x] Taglines #1 [ ] #2
Reality is for those who can't face science fiction. | Power corrupts;
absolute power is kind of neat. | "It's in Tibetan!" - The Doctor (5G)
"A lawyer is like a river." - Kosh | Life is like a simile | Dynsdale!
Version: PGPfreeware 6.0.2i
iQB1AwUBN0ZGAb/mBljD2JABAQEs5gL/S7S6LM5rIVLzNn49VZxWXjvz+tBir+Pp
86s7aCUglRZPZyInoK7Ypn7q6yheD2479kO+4m6zYPnD7M6XGlL4Q7OFrmjcPdgO
akpjbwL0Y4bfVd+Kw38JrrubYxMKIA0Q
=UKVL
-----END PGP SIGNATURE-----
------------------------------
Date: Sat, 22 May 1999 14:18:09 -0400
From: "Jody Fedor" <JFedor@datacom-css.com>
Subject: Dumb questions for Jeremy about s///
Message-Id: <7i6qp0$6q0$1@plonk.apk.net>
Since Jeremy's paying pennance here are some dumb questions:
I have a file with Vendor ID & Name in format:
100 ALPS
110 APPLE
etc.... At first I didn't know there was a tab between 0 and A, I
thought it was spaces.
I used $rec =~ s/ /:/;
where there were 5 spaces between / and /. only 2 records where there
weren't tabs were converted to 100:ALPS etc.
I modified it to look for multiple spaces
$rec =~ s/\s*/:/; <-- looking for any number of space and
replace with :
I was also looking to change or find a way to change the rest of the letters
after the first letter to lower case except after a space ie. Texas
Instruments the T and I should be left as Upper case letters.
TIA
------------------------------
Date: 22 May 1999 18:34:05 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Dumb questions for Jeremy about s///
Message-Id: <7i6tat$2la$1@gellyfish.btinternet.com>
On Sat, 22 May 1999 14:18:09 -0400 Jody Fedor wrote:
> Since Jeremy's paying pennance here are some dumb questions:
>
I think Jeremy was just up late - its 7 in the morning there now ;-}
> I have a file with Vendor ID & Name in format:
>
> 100 ALPS
> 110 APPLE
>
> etc.... At first I didn't know there was a tab between 0 and A, I
> thought it was spaces.
>
> I used $rec =~ s/ /:/;
> where there were 5 spaces between / and /. only 2 records where there
> weren't tabs were converted to 100:ALPS etc.
>
> I modified it to look for multiple spaces
>
> $rec =~ s/\s*/:/; <-- looking for any number of space and
> replace with :
>
> I was also looking to change or find a way to change the rest of the letters
> after the first letter to lower case except after a space ie. Texas
> Instruments the T and I should be left as Upper case letters.
>
OK - why dont you try this out:
#!/usr/bin/perl -w
use strict;
while (<DATA>)
{
s/^(.+?)\s+(.)(.*)$/$1:\U$2\L$3/;
print;
}
__END__
100 BLAH
110 THING
108 RatBag
98 CARPARK
5 fishfood
Read the perlre manpage.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 22 May 1999 15:08:40 -0400
From: "Jody Fedor" <JFedor@datacom-css.com>
Subject: Re: Dumb questions for Jeremy about s///
Message-Id: <7i6tnj$8g7$1@plonk.apk.net>
Jonathan Stowe wrote in message <7i6tat$2la$1@gellyfish.btinternet.com>...
> s/^(.+?)\s+(.)(.*)$/$1:\U$2\L$3/;
wouldn't this be easier?
$rec =~ s/(\w+)/\u\L$1/g;
The only problem with this is the word 3COM is now 3com and UBI is Ubi and
3M is 3m.
Oh well, I'll have to do those by hand.
Thanks for your solution too!
------------------------------
Date: Sun, 23 May 1999 01:00:07 +0800
From: <denny@chuang.com>
Subject: Execute a command from perl...
Message-Id: <7i6ojo$qa0$1@news.misnet.net>
Hi all,
How do I execute a unix command from perl?
Are there any examples to check out?
Thank you!
denny@taching.com.tw
------------------------------
Date: 22 May 1999 12:14:01 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Execute a command from perl...
Message-Id: <3746f3e9@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, <denny@chuang.com> writes:
:How do I execute a unix command from perl?
Get a firing squad?
:Are there any examples to check out?
It's difficult to conceive of a more basic function that this one.
Well, length of a string, I guess.
Did you someone miss the perlfunc manpage? What about the FAQ?
--tom
--
I'm sure that that could be indented more readably, but I'm scared of
the awk parser. --Larry Wall in <6849@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: 22 May 1999 18:40:45 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Execute a command from perl...
Message-Id: <7i6tnd$2lv$1@gellyfish.btinternet.com>
On Sun, 23 May 1999 01:00:07 +0800 denny@chuang.com wrote:
> Hi all,
>
>
> How do I execute a unix command from perl?
>
Hmmm. There are many ways and all of them described in the
documentation on your system.
I would start by typing:
perldoc -f system
At your command prompt and read what what it says and then adapt what you
have learnt thus far to exapand your search for information.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 22 May 1999 14:45:12 GMT
From: tgy@chocobo.org (Fuzzy Warm Moogles)
Subject: Re: foreach and print, Please help
Message-Id: <3746c01d.204840640@news.oz.net>
On Sat, 22 May 1999 08:35:09 GMT, Eric Bohlman <ebohlman@netcom.com> wrote:
>tvn007@my-dejanews.com wrote:
>: Hi,
>
>: Would someone please help me to make the print statement shorter ?
>
>: I have too many conditions that I have to put | $_ eq ..... | $_ eq
>: in the print statement as you can see below.
>
>: foreach (@PIN_NAME) {
>: print "PIN $_ stuck @ $values{$_}\n" unless $values{$_} eq 'unstuck'
>: | $_ eq 'I1' | $_ eq 'I2' | $_ eq 'XY' | $_ eq 'AB' | $_ eq 'PX' |
>: $_ eq 'PT' | $_ eq 'UU' | $_ eq 'OO' ;
>
>: }
>
>2) Use a hash:
>
> my @unstickable{qw(I1 I2 XY AB PX PT UU OO)} = (1) x 8;
> print "PIN $_ stuck @ $values{$_}\n" unless $values{$_} eq 'unstuck'
> || $unstickable{$_};
This may or may not work:
@values{qw/I1 I2 XY AB PX PT UU OO/} = ('unstuck') x 8;
print "PIN $_ stuck @ $values{$_}\n" if $values{$_} ne 'unstuck';
--
Fuzzy | tgy@chocobo.org | Will hack Perl for a moogle stuffy! =^.^=
------------------------------
Date: Sat, 22 May 1999 14:21:43 GMT
From: sgrantz@visi.com (Steve Grantz)
Subject: Re: How do I use a regular expression to ignore Java style comments in a file?
Message-Id: <X3z13.164$j65.24660@ptah.visi.com>
Jacob Yackenovich (jyacken@ibm.net) wrote:
: I have tried to use regular expressions to pattern
: match //, but seeing as how the contents of the pattern to be matched are
: bounded by / and /, I have ran into somewhat of a brick wall.
To match metacharacters, escape them with the reverse solidus
print "I found a C++ style comment, ma!" if (/\/\//);
Of course, that is an ugly looking regex, so you can exploit the
ability to use other delimiters in match operation like so:
print "I found it without looking up solidus in a dictionary!" if (m|//|);
: The Perl books
: that I have referenced (Cookbook, Programming, Learning, Nutshell, 21 days,
: etc...) all turn up empty to a solution. Any ideas on how to overcome this
: one?
The perlop manpage has the full discourse on the m// operator
and its options.
Hope this helps,
Steve
--
I despise those 'God Speaks' billboards.
That's why Satan Speaks at
http://www.visi.com/~sgrantz
------------------------------
Date: 22 May 1999 15:31:04 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to catch the return value in Perl?
Message-Id: <7i6ijo$268$1@gellyfish.btinternet.com>
On Fri, 21 May 1999 06:31:17 GMT Dave Cross wrote:
>
> [moving further off topic]
>
> ...but of course we all know that having '.' on your path is a very
> bad idea.
>
[ moving even further off topic :0]
.. if you dont know its there.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 22 May 1999 20:25:42 +0800
From: "Jeremy Malcolm" <Jeremy@Malcolm.wattle.id.au>
Subject: Re: How to print mailing labels in columns
Message-Id: <7i67m5$f70$1@news.iinet.net.au>
Sorry I should have tried harder before posting to the list: I thought it
would be harder to do with formats than it was:
while ( $count <= $rv ) { # $rv is the total number of records
$twice = "";
while ( $twice < 2 ) {
$count++;
@member{@{$sth -> {NAME}}} = $sth->fetchrow_array; # Gets the next record
$name[$twice] = "$member{title} $member{first} $member{last}";
$address[$twice] = $member{street};
$address2[$twice] = "$member{suburb} $member{state} $member{post_code}";
$twice++;
}
write (STDOUT) }
format STDOUT =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$name[0], $name[1]
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$address[0], $address[1]
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$address2[0], $address2[1]
.
--
JEREMY MALCOLM Jeremy@Malcolm.wattle.id.au http://malcolm.wattle.id.au
SIG of the day: [ ] Contact [ ] Web [ ] PGP [x] Taglines #1 [ ] #2
Reality is for those who can't face science fiction. | Power corrupts;
absolute power is kind of neat. | "It's in Tibetan!" - The Doctor (5G)
"A lawyer is like a river." - Kosh | Life is like a simile | Dynsdale!
------------------------------
Date: 22 May 1999 13:33:34 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to print mailing labels in columns
Message-Id: <7i6bne$1vp$1@gellyfish.btinternet.com>
On Sat, 22 May 1999 18:34:00 +0800 Jeremy Malcolm wrote:
>
> I've been looking for an easy way to print mailing labels in columns.
> Formats won't do it, and Array::PrintCols won't do it. Does anyone
> have any suggestions?
>
I assume you're talking about printing on label sheets where you have
a number across the page right ?
The trick is that you need to build up your print line to contain the
requisite number of items across and as you have noticed formats dont
cut it easily.
Anyhow as strangely Perl is possibly the only language I have used that
I havent done this task in here it is (using my old standby data - you
will need to alter that bit to suit ).
#!/usr/bin/perl -w
use strict;
use vars qw(@line $count);
open(DATA,"phonebook.txt") || die "Cant open data - $!\n";
my $width = 30 ; # characters between left margin of labels
my $across = 3 ; # Labels across the sheet
my $vertical = 5; # Lines between labels
my $lmargin = 5; # Left margin width of sheet in characters
while(<DATA>)
{
chomp;
my ( $surname,
$forename,
$title,
$number,
$location,
$dept ) = split /,/,$_ ;
my $fullname = "$forename $surname";
$line[0] .= sprintf("%-${width}s",$fullname);
$line[1] .= sprintf("%-${width}s",$title);
$line[2] .= sprintf("%-${width}s",$dept);
$line[3] .= sprintf("%-${width}s",$location);
if (++$count == $across )
{
foreach ( @line)
{
print " " x $lmargin,$_,"\n";
$_ = "";
}
print "\n" x $vertical;
$count = 0;
}
}
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sat, 22 May 1999 12:41:14 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: MacPerl and QuarkXPress???
Message-Id: <pudge-2205990841180001@192.168.0.77>
In article <3745cbaa.5656835@news.skynet.be>, bart.lateur@skynet.be (Bart
Lateur) wrote:
# Mats Pettersson wrote:
#
# >I couldn't find any info how to intergrate apple-script with perl or if
# >it is possible in any way.
#
# You DON'T want to do that. Copmpilation of a simple 5 line Applescript
# in Perl can take up to a few seconds, depending on your machine. It
# needs to be done again and again, every time a script snippet is run. It
# takes forever.
If you are going to run the same AppleScript over and over, you can save
time with Mac::OSA::Simple (or Mac::OSA, if you want to do it yourself):
#!perl -w
use strict;
use Mac::OSA::Simple;
my $script = compile_applescript(<<EOS);
tell app "Finder"
open item "HD"
close window 1
end tell
EOS
for (0..9) {
$script->execute;
}
One it is compiled, it will execute about as quickly as raw Apple events
or a compiled AppleScript (since it _is_ a compiled AppleScript :).
As to Mac::Glue, I have an alpha on the way RSN. Here's an example of the
same script above. Syntax is still morphing, but this currently works:
#!perl -w
use strict;
use Mac::Glue;
my $finder = new Mac::Glue 'Finder';
for (0 .. 9) {
$finder->open ( $finder->o(item => "HD") );
$finder->close( $finder->o(window => 1 ) );
}
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Sat, 22 May 1999 22:00:07 +0800
From: "Jeremy Malcolm" <Jeremy@Malcolm.wattle.id.au>
Subject: Re: Newbie Blat help!
Message-Id: <7i6d79$1cl$1@news.iinet.net.au>
I can't find Blat on the Web unless it's a Windows NT executable (not
perl) by that name, but send it to me along with your HTML file and
I'll try to sort it out. I suspect the problem is that the script is
looking for fields with different names than what your Web page is
providing.
- --
JEREMY MALCOLM Jeremy@Malcolm.wattle.id.au http://malcolm.wattle.id.au
SIG of the day: [ ] Contact [ ] Web [ ] PGP [x] Taglines #1 [ ] #2
Reality is for those who can't face science fiction. | Power corrupts;
absolute power is kind of neat. | "It's in Tibetan!" - The Doctor (5G)
"A lawyer is like a river." - Kosh | Life is like a simile | Dynsdale!
Version: PGPfreeware 6.0.2i
iQB1AwUBN0ZH6L/mBljD2JABAQFnegMAjytqox62kPIGSqs0DzQziWwBaAWQIZtv
Hi83e6jzvZA8TnIx0Gr9YdOS9FkyEHQ/JqECZ3H2V6zbqJEi62Ew6nq7GPkJtNn6
B+jjPzel5Uubd13FnROxGNGT2MINhpnM
=jrzB
-----END PGP SIGNATURE-----
------------------------------
Date: Sat, 22 May 1999 16:46:38 GMT
From: pub @ alma . ch (M.)
Subject: Re: perl email
Message-Id: <3746dd96.119116566@news.urbanet.ch>
>>how do you send an email from a perl script?
>Two ways of doing it. First, just open a pipe to sendmail:
Many more than that :-)
>$mailprog = "/usr/bin/sendmail";
unportable!
>Second, use Mail::Send module:
Third:
use Mail::Sendmail;
%mail = ( From => 'From Me <me@here.com>',
To => 'Someone you@there.com',
Subject => 'Subject goes here',
Message => "Message body goes here."
);
sendmail(%mail) || die $Mail::Sendmail::error;
(it will also do MIME Quoted printable encoding automatically, retry
in case of an SMTP server failure, etc...)
Fourth, fifth, etc: MIME::Lite, Mail::Sender, Net::SMTP, ...
------------------------------
Date: 22 May 1999 18:13:04 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perl email
Message-Id: <7i6s3g$2g6$1@gellyfish.btinternet.com>
On Sat, 22 May 1999 18:50:12 +0800 Jeremy Malcolm wrote:
>
> Two ways of doing it. First, just open a pipe to sendmail:
>
> $mailprog = "/usr/bin/sendmail";
> $recipient = "email@address.goes.here";
> open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\n";
> print MAIL "To: $recipient\n";
> print MAIL "Subject: Subject goes here\n\n"; # Note two \n's before
> body
> print MAIL "Body goes here\n";
> close (MAIL);
>
It might be worth mentioning here that if you are going to supply
the recipient in the input stream of headers to 'sendmail' then it
might be better to replace the $recipient on the command line there
with a '-t' especially if the address has come from some untrustworthy
source (such as a user :). Infact I might go as far as to say that if
you dont use '-t' then the 'To: ' header is redundant, but that would
be a matter for the sendmail manpage ;-}
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 22 May 1999 12:13:04 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: perl email
Message-Id: <3746f3b0@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
"Barth, Brian (EXCHANGE:BNRTP:0S31)" <picoop2@americasm01.nt.com> writes:
:how do you send an email from a perl script?
Certianly the FAQ talks about how to send mail from Perl.
Assuming you understand that "sending an email" is merely a needlessly
namby-pamby and cursedly cutesie-tootsie neologism for the mere act of
"sending mail", this should easy to find.
If not... well, guess what?
--tom
--
Anyone can be taught to sculpt.
Michaelangleo would have had to have been taught how not to.
The same is true of great programmers
------------------------------
Date: Sat, 22 May 1999 22:03:58 +0800
From: "Jeremy Malcolm" <Jeremy@Malcolm.wattle.id.au>
Subject: Re: Premature end of Script header and Apache and Internal Server Error
Message-Id: <7i6ded$2j4$1@news.iinet.net.au>
Add "use Carp;" to the top of your Perl scripts. Proper, helpful Perl
error messages will then be logged to your Apache logfile.
- --
JEREMY MALCOLM Jeremy@Malcolm.wattle.id.au http://malcolm.wattle.id.au
SIG of the day: [ ] Contact [ ] Web [ ] PGP [x] Taglines #1 [ ] #2
Reality is for those who can't face science fiction. | Power corrupts;
absolute power is kind of neat. | "It's in Tibetan!" - The Doctor (5G)
"A lawyer is like a river." - Kosh | Life is like a simile | Dynsdale!
Version: PGPfreeware 6.0.2i
iQB1AwUBN0ZIz7/mBljD2JABAQFYBAMAsI9RzeNcn2gMOgOq12UPqbO/lGLYra47
E5kSgb49JRQceZ+rSdNuQi9seaQRH0pXZCWrYR19fSQQmehCtwiYJHM9ebXz5AUh
dERqvhslbAdW4OLQiKr1eqhbiBoTO9cV
=tsGd
-----END PGP SIGNATURE-----
------------------------------
Date: Sat, 22 May 1999 10:15:12 -0400
From: barsarap <barsara@peakaccess.net>
Subject: Record splitting
Message-Id: <3746BBF0.7DE7E95F@peakaccess.net>
Hello.
I'm working on a small project at work, currently I'm pulling data from
a binary file with a utility that we have. The end result will require
me to split the file into two separate fields. So for example I have 4
fields accross and about 89 lines down. What I need to do is, at every
19th or so line I need to double up the fields creating two fields of
the same type record on one 'page'. Please reply to
slavik1973@yahoo.com, I dont have access to the newsgroups at work
Thanks
Steve M
------------------------------
Date: Sat, 22 May 1999 14:44:50 -0400
From: "Jody Fedor" <JFedor@datacom-css.com>
Subject: s///
Message-Id: <7i6sau$7mu$1@plonk.apk.net>
Is there better information on s/// than perldoc or "Pearl Programming"?
Is there a place that has lots of examples and then explains what each one
is and how it works?
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 5752
**************************************