[8189] in Perl-Users-Digest
Perl-Users Digest, Issue: 1807 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 4 12:14:24 1998
Date: Wed, 4 Feb 98 09:01:35 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 4 Feb 1998 Volume: 8 Number: 1807
Today's topics:
Optimizing dependency generation (Matthew H. Gerlach)
Passing Javascript variables to Perl CGI? <petcrows@bigfoot.com>
Re: Perl and DBM problem <escrubb@att.net>
Re: Perl dies with segmentation fault and leaves a core <Jacqui.Caren@ig.co.uk>
Re: perl(unix) + iODBC <Jacqui.Caren@ig.co.uk>
Re: Please, help - rsh problem. (Andrew Williams)
Q: OLE SDK 1.5 / ODBC / Perl 5.003 -> DB Access, how? (Robin Bastian)
Re: Quickie: regexp for valid e-mail addresses (Bart Lateur)
Re: Quickie: regexp for valid e-mail addresses (Mike Stok)
Re: Quickie: regexp for valid e-mail addresses <rootbeer@teleport.com>
Re: replacing things i perl (Richard Bellavance)
Re: sending emails with perl ? <Jacqui.Caren@ig.co.uk>
Re: unix command (Andrew M. Langmead)
Re: Want to determine the subnet networks from a networ <jdporter@min.net>
Who knows about Base64 oder Uudecoder in Perl? <TobiasBugala@swol.de>
Re: Win32::ODBC and Oracle 7.3 (Allan Paicius)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 4 Feb 1998 16:31:28 GMT
From: gerlach@netcom.com (Matthew H. Gerlach)
Subject: Optimizing dependency generation
Message-Id: <gerlachEnv4KG.DCz@netcom.com>
Hi Folks,
For my current employer, I support an embedded software developement
system under UNIX and win95. Without perl and gnu make this would
probably be a very painful activity.
Anyway, since we don't have a useful C preprocessor running under Win95,
I use the perl script below to create dependencies for the make system.
I have been using this script for going on two years quite happily, but
I would like to speed it up if possible. I have found it to be twice
as slow and X11's makedepend tool and 50% slower than "gcc -M". Any
suggestions on places to optimize will be happily accepted and tried.
Thanks,
Matthew H. Gerlach
P.S. I am not the original auther. Some nice person on the Net sent it
to me. Unfortunately, I have lost that person's name but am eternally
thankful.
#
#
# makedep.pl
#
# This perl script will print to standard output
# a depenency list suitable for "make".
#
# Usage:
#
# % makedep.pl [-OS output suffix] [-OD output directory] \
# [-SD source directory] [Include Path] file_list
#
# file_list is the list of files for which a dependency must
# be genereated.
#
# [-OS] sets the suffix of the object filename. It defaults to ".o".
#
# [-OD] sets the directory of the object filename. Defaults to current dir.
#
# [Include Path] is an option set of one or include path specifications.
# Each path specification is of the form "-I directory_path".
#
# #include syntax we are looking for
#$Syntax = '^[ \t]*#[ \t]*include[ \t][ \t]*"([^"]*)"' ;
$Syntax = '^#include\s+["<]([^">]*)[">]' ;
# IncludePath is a list of the directories to search for includes
@IncludePath = ();
# CFileList is a list of files that need to be scanned for #include
@CFileList = ();
# Below is the default suffix for the object file printed in the
# dependency list. This default is overriden with -OS
#
$ObjSuffix = ".o";
$SourceDirectory = "";
#
# This first thing this script does is parse the command line
# for Include Path specifications, options, and files.
#
while (@ARGV)
{
$arg = shift @ARGV;
#
# if the arg is -I
# then we need to add the next arg to the include path list
if ($arg eq "-I")
{
$dir_name = shift @ARGV;
if (-d $dir_name)
{
push(@IncludePath, $dir_name);
}
else
{
print "could not find include directory $dir_name\n";
}
}
elsif ($arg =~ /-I/)
{
$arg =~ s/-I//;
push(@IncludePath, $arg);
}
elsif ($arg eq "-OS")
{
$ObjSuffix = shift @ARGV;
}
elsif ($arg eq "-OD")
{
$ObjDir = shift @ARGV;
}
elsif ($arg eq "-SD")
{
$SourceDirectory = shift @ARGV;
}
# otherwise we have a file name that needs to be added to
# the file list
#
else
{
#
# this first case is for the lamness in DOS.
# command.com doesn't expand *.c but lets the
# program do it for you.
#
if ($arg =~ /\*/)
{
&parse_meta($arg);
}
elsif (-f "$SourceDirectory$arg")
{
push(@CFileList, $arg);
}
else
{
print STDERR "could not find file $SourceDirectory$arg\n";
exit(1);
}
}
}
#
# for each file in the file list
# scan it for #includes
# print out the list of #includes
#
for (@CFileList)
{
# print "$_\n";
@Includes = ();
&scan( $_ );
&print_dep( $_, @Includes );
}
exit(0);
#
# parse_meta
#
# This function takes care of one of the many problems
# with DOS. In particular command.com does not expand things
# like *.c; so it is up to use to figure out what *.c means.
#
sub parse_meta
{
local($arg) = @_;
local($FileDir);
local($FileName);
local(@allfiles);
#local(@SplitName);
$FileDir = &get_dir($arg);
$FileName = "\\" . &get_file($arg);
if ($FileDir eq "")
{
$FileDir = ".";
}
#print "FileDir = $FileDir FileName = $FileName\n";
opendir(DIR, $FileDir) || die "could not open directory $FileDir\n";
@allfiles = readdir(DIR);
closedir(DIR);
#
# foreach file in the directory
# check that it is a ".c" file
#
for (@allfiles)
{
# if filename ends with ".c"
if (/.c$/)
{
#print "SN[1] = $SplitName[1]\n";
#print "pushing $FileDir/$_\n";
push(@CFileList, "$FileDir/$_");
}
else
{
#print "SN[1] = $SplitName[1]\n";
#print "not pushing $_\n";
}
}
}
#
# scan
#
# This function is the guts of the dependency generation.
# It is a recursive function that searches for #include's in
# the file list. If it runs into an include file, it then opens that file to
# search for more #include's.
#
sub scan {
local( $filename ) = @_ ;
local( $included, $found, $_ );
local( @list ) = ();
local($IncludeDir);
local($IncludePathName);
if (!-e $filename)
{
$filename = $SourceDirectory . $filename;
}
if (!open( INPUT, $filename ))
{
print STDERR "unable to open $filename: $!\n" ;
exit(2);
}
while ( <INPUT> ) {
if ( /${Syntax}/ ) {
$included = $1;
if ( $included !~ /^[.\/]/ ) {
undef $found;
# if the include file name doesn't exist
# in the current directory,
# then check the include path for the file.
if (-e $included)
{
$found = $included;
}
else
{
foreach $IncludeDir (@IncludePath)
{
$IncludePathName = "$IncludeDir/$included";
if (-e $IncludePathName)
{
$found = $IncludePathName;
last;
}
}
}
if ( defined($found) )
{
$included = $found;
}
else
{
print STDERR "Could not find $included\n";
exit(1);
}
}
## see if its already on the list
undef $found ;
for ( $[ .. $#Includes ) {
$found = $_, last if ( $Includes[$_] eq $included );
}
## nope! put it on
if ( ! defined( $found ) ) {
push( @Includes, $included );
push( @list, $included );
}
}
}
close( INPUT );
## scan through each of the files that turned up
for ( @list ) {
&scan( $_ );
}
}
sub print_dep {
local( $filename, @includes ) = @_ ;
local( $_ );
$target = &get_file($filename);
$target =~ s/\.[^.]*$/$ObjSuffix/ ;
if (defined($ObjDir))
{
$target = $ObjDir . "/" . $target;
}
if ( $filename !~ /^[.\/]/ ) {
$filename = $filename;
}
print "${target}: " ;
print join( " \\\n\t", ("$SourceDirectory$filename", @includes) );
print "\n\n" ;
}
# get_dir
#
# This function takes a string in the form of a
# directory path and just returns a string that has file part
# striped off. It is assumed that path is of the form:
# "some/path/witha/file"
#
# Given the above parameter, "some/path/witha" would be returned
sub get_dir {
local($base) = @_;
local($i);
local($splitdir);
local($dir);
@splitdir = split('/', $base);
$dir = '';
for ($i = 0; $i < $#splitdir ; $i++) {
$dir = $dir . "/" . $splitdir[$i];
}
# now we must remove the leading '/'
$dir = substr($dir, 1);
}
#
# This function takes a string in the form of a directory path
# and returns a string that is just the file part. Given a string of the
# form "./some/path/witha/filename", "filename" will be returned.
#
sub get_file {
local($base) = @_;
local($splitdir);
local($file);
@splitdir = split('/', $base);
$file = $splitdir[$#splitdir];
}
------------------------------
Date: Wed, 04 Feb 1998 09:01:18 -0600
From: Jonathan Higbee <petcrows@bigfoot.com>
To: rclark@wolfenet.com,petcrows@bigfoot.com
Subject: Passing Javascript variables to Perl CGI?
Message-Id: <886603945.855572489@dejanews.com>
Greetings.
I would like to log to a file all the referring http pages that
access my site as well as the user's host name. The HTTP_REFERER
variable is not available in Perl CGI on my ISPs server, but the
Javascript document.referrer does work ok.
Thus how to I pass JScript document.referrer to a Perl CGI, and if I
wanted to pass other JScript items how can that be done? Some people
have suggested that JScript variables can be accessed in Perl CGI
by simple using $variable_name in the Perl. However I have tested that
and it doesn't seem to work. I declare a var testing = "yes"; in JScript
and then do a print $testing in Perl, but nothing comes out. Is that
method really supposed to work?
Here is the logger.cgi program I'm basing the project on:
#!/usr/local/bin/perl
# logger.cgi
# version 1.0
#
# Copyright Rod Clark rclark@wolfenet.com
# Create a file called main.log. Must have write permissions
# set to main.log
$mainlog = "main.log";
$shortdate = `date +"%D %T %Z"`;
chop ($shortdate);
print "Content-type: text/plain\n\n";
print "This is a test";
open (MAINLOG, ">>$mainlog");
print MAINLOG "Time: $shortdate\n";
print MAINLOG "User: $ENV{'REMOTE_IDENT'}\n";
print MAINLOG "Host: $ENV{'REMOTE_HOST'}\n";
print MAINLOG "Addr: $ENV{'REMOTE_ADDR'}\n";
print MAINLOG "With: $ENV{'HTTP_USER_AGENT'}\n";
print MAINLOG "Page: $ENV{'DOCUMENT_URI'}\n";
print MAINLOG "From: $ENV{'HTTP_REFERER'}\n\n";
print "Time: $shortdate\n";
print "User(REMOTE_IDENT): $ENV{'REMOTE_IDENT'}\n";
print "Host(REMOTE_HOST): $ENV{'REMOTE_HOST'}\n";
print "Addr(REMOTE_ADDR): $ENV{'REMOTE_ADDR'}\n";
print "With(HTTP_USER_AGENT): $ENV{'HTTP_USER_AGENT'}\n";
print "Page(DOCUMENT_URI): $ENV{'DOCUMENT_URI'}\n";
print "From(HTTP_REFERER): $ENV{'HTTP_REFERER'}\n\n";
print $testing;
close (MAINLOG);
exit;
-----
Jonathan Higbee
http://www.ieighty.net/~jhigbee
petcrows@bigfoot.com
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Wed, 04 Feb 1998 11:22:58 -0500
From: Cornelius Griffin <escrubb@att.net>
Subject: Re: Perl and DBM problem
Message-Id: <6ba4l2$25j@bgtnsc02.worldnet.att.net>
One suggestion would be to use tie:: There is further documentation on it in
perltie. I use WinNT so this looks a little different,but, For example:
use SDBM_File;
sub O_CREAT { 0x0100 }
sub O_BINARY { 0x8000 }
sub O_RDWR { 0x0002 }
tie( %var_hash, "SDBM_File", "filename", O_RDWR | O_CREAT | O_BINARY, 0666 ) or
die( "Can't tie: $!" );
$var_hash{'foo'} = "whatever";
untie ( %var_hash );
Again the 'sub O_CREAT....', etc, is specific to WinNT. You'll probably
just need '0666' for your FreeBSD system. Hope this helps.
Neal.
Rodion Levotchka wrote:
> Hello!
>
> I've bought a book 'Learninng Perl' and read there about using DBM bases.
> I'm tring to open a dbm file and link i to hash but always getting message:
>
> AnyDBM_File doesn't define a TIEHASH method at dbmtest.pl line ...
>
> The text of programm is:
>
> --------------------------------------------------------------------
> #!/usr/local/bin/perl
>
> dbmopen (%books,"libbase",0666) || die "can't open libbase: $!";
> $books{new} = "Just_the_string_to_add";
> dbmclose(%books) || die "can't close libbase: $!";
> --------------------------------------------------------------------
>
> I'm using Perl 5.00404 and FreeBSD 2.1.7.1. What's wrong? What should i do?
> Please, help!!!
>
> I would really appreciate a copy of your answers sent via e-mail.
>
> Thanks
>
> Rod.
------------------------------
Date: Wed, 4 Feb 1998 14:17:45 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: Perl dies with segmentation fault and leaves a core
Message-Id: <EnuyDM.JtB@ig.co.uk>
In article <Pine.GSO.3.96.980116151307.669S-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
>On Fri, 16 Jan 1998, Bob wrote:
>
>> Is there anything that a user script can do to cause a Segmentation
>> fault and core dump, or is it a perl bug?
>
>Yes, and yes. :-) You should probably file a bug report. Hope this helps!
Only *after* reading the relevant documentation and making sure the program
is not *supposed* to dump, or that it is not an FAQ, etc...
jacqui@oink: perldoc -f dump
=item dump LABEL
This causes an immediate core dump. Primarily this is so that you can
use the B<undump> program to turn your core dump into an executable binary
after having initialized all your variables at the beginning of the
program. When the new binary is executed it will begin by executing a
C<goto LABEL> (with all the restrictions that C<goto> suffers). Think of
it as a goto with an intervening core dump and reincarnation. If LABEL
is omitted, restarts the program from the top. WARNING: any files
opened at the time of the dump will NOT be open any more when the
program is reincarnated, with possible resulting confusion on the part
of Perl. See also B<-u> option in L<perlrun>.
:
All the best,
Jacqui
--
Email: Jacqui.Caren@ig.co.uk http://www.ig.co.uk/
Fax : +44 1483 419 419 http://www.perlclinic.com/
Phone: +44 1483 424 424 http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom
------------------------------
Date: Wed, 4 Feb 1998 13:08:52 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: perl(unix) + iODBC
Message-Id: <Enuv6t.JIw@ig.co.uk>
In article <69h91j$618$1@tst.hk.super.net>,
Kenneth LO <kenlo@hk.super.net> wrote:
>Anyone uses perl on unix with iODBC ? I tried the iODBC extension module by
>J. Michael Mahan (mahanm@nextwork.rose-hulman.edu) but it can't work with
>the iODBC-myODBC package by Giovanni Maruzzelli (http://www.matrice.it)
>
>
Do you have a problem with DBI + DBD::ODBC?
See http://www.hermetica.com/technologia/DBI/
for more info.
There are also various database drivers (DBD::*) for DBI and if you are
lucky there may even be one for your (R)DBMS...
All the best,
Jacqui
--
Email: Jacqui.Caren@ig.co.uk http://www.ig.co.uk/
Fax : +44 1483 419 419 http://www.perlclinic.com/
Phone: +44 1483 424 424 http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom
------------------------------
Date: Wed, 04 Feb 1998 15:37:59 GMT
From: andrew@edoc.com (Andrew Williams)
Subject: Re: Please, help - rsh problem.
Message-Id: <34dc8b26.89407562@news.clark.net>
On Tue, 03 Feb 1998 04:06:24 GMT, ekogan@mindspring.com (Eugene Kogan)
wrote:
>Please, anyone! Any help would be greatly appreciated!
>I am having a problem with rsh. I execute rsh from my Solaris worksta.
>by a perl script using system() call that executes a C-program on the
>remote machine that setuid() to root, executing a start shell script
>(also by a system() call) for a proxy server installed on the remote
>machine that is also Solaris 2.5. The problem is that while the whole
>process is done without any problems, the rsh never returns, it just
>hangs even after the proxy is restarted. The C program is fine. I
>tested it - when executed from a shell it returns with no problems at
>all. Another thing, the rsh returns only when I stop the proxy server
>(i.e., after I execute stop shell script that kills all proxy
>children)
*whew* rsh, trusted hosts, system(), and setuid()
Ever read a system security book?
------------------------------
Date: Wed, 04 Feb 1998 15:47:47 GMT
From: rbastian@horus.mch.sni.de (Robin Bastian)
Subject: Q: OLE SDK 1.5 / ODBC / Perl 5.003 -> DB Access, how?
Message-Id: <34d882ac.26051861@horus.mch.sni.de>
Hi,
can someone help me?
I have installed Perl 5.003 (ActiveState),
and Microsofts new OLE SDK 1.5 to get
access to databases via ADO.
This all runs on my Win95 PC (and should
later run on our Win NT 4.0 Server).
First, I want to get access to a small
Dbase (.dbf) Database for testing.
I've configured the ODBC Driver, have
selected the right directory, the
ODBC connection named "DBASE_ADO"
and tested it as User DSN and/or System DSN.
The source code of dbase.pl (very simple, isn't it :)
*--------------------------------------begin
use OLE;
$engine = CreateObject OLE 'ADODB.Connection' or die "Error: $!";
$engine->Open("DBASE_ADO") or die "Error: $!";
.
*--------------------------------------end
But I always get an error at line "$engine->Open(...":
"Error: No such file or directory at C:\Perl\dbase.pl line 4."
The SQL-Logfile shows the following Errors:
*sql.log--------------------------------------begin
[...]
SQLHDBC 0x013c1430
SQLINTEGER 103
<SQL_ATTR_LOGIN_TIMEOUT>
SQLPOINTER 0x0000000f (BADMEM)
SQLINTEGER -6
dbase fffba70b:fffba23b ENTER SQLDriverConnectW
HDBC 0x013c1430
HWND 0x00000000
WCHAR * 0x6a9a7284 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x6a9a7284
SWORD -3
SWORD * 0x00000000
UWORD 0 <SQL_DRIVER_NOPROMPT>
dbase fffba70b:fffba23b EXIT SQLDriverConnectW with
return code -1 (SQL_ERROR)
HDBC 0x013c1430
HWND 0x00000000
WCHAR * 0x6a9a7284 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x6a9a7284
SWORD -3
SWORD * 0x00000000
UWORD 0 <SQL_DRIVER_NOPROMPT>
DIAG [S1000] [Microsoft][ODBC Access 97 ODBC driver
Driver]General error Unable to open registry key 'DriverId'. (51)
DIAG [IM006] [Microsoft][ODBC Driver Manager] Driver's
SQLSetConnectAttr failed (0)
DIAG [IM006] [Microsoft][ODBC Driver Manager] Driver's
SQLSetConnectAttr failed (0)
[...]
dbase fffba70b:fffba23b EXIT SQLGetDiagRecW with
return code 100 (SQL_NO_DATA_FOUND)
SQLSMALLINT 2
SQLHANDLE 0x013c1430
SQLSMALLINT 3
SQLWCHAR * 0x0064f0a4 (NYI)
SQLINTEGER * 0x0064f0c4
SQLWCHAR * 0x0064eca4 (NYI)
SQLSMALLINT 512
SQLSMALLINT * 0x0064f0bc
dbase fffba70b:fffba23b ENTER SQLFreeConnect
HDBC 0x013c1430
[...]
*sql.log---------------------------------end
Whats going wrong?
The version (like Microsofts ADO-Documentation)
*----
$engine->Open("DRIVER={Microsoft dBase driver (*.dbf)};
Data Source=DBASE_ADO") or die "Fehler $!";
*----
fails, too.
Is a further package/module needed?
Is this a problem german windows 95 / US OLE SDK 1.5?
Any idea?
thanks,
ciao
Robin
------------------------------
Date: Wed, 04 Feb 1998 14:44:01 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Quickie: regexp for valid e-mail addresses
Message-Id: <34d97e21.14768014@news.tornado.be>
clay@panix.com (Clay Irving) wrote:
>Sure... Write a Perl program to send a message to the address specified.
>But.... What have you accomplished? You still don't know if the address is
>valid.
Perhaps I didn't make myself clear. How do mails get delivered? Via
programs. These seem to work. If these can figure out where to send the
mail, it must be possible to the same in Perl. Right?
Bart.
------------------------------
Date: 4 Feb 1998 10:34:45 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Quickie: regexp for valid e-mail addresses
Message-Id: <6ba1ql$16b$1@stok.co.uk>
In article <34de518e.3357235@news.tornado.be>,
Bart Lateur <bart.mediamind@tornado.be> wrote:
>My question: how do mailer programs process them?
>
>My thoughts: If a mailer program can process them correctly, it must be
>possible to write a Perl script that does the same.
The people who write mailer programs probably use a broader range of
technques that (ir)regular expressions. If you have a reasonable BNF like
description of valid addresses then lex/yacc or pccts or a hand crafted
recursive descent parser can process the addresses to make sure that they
have valid syntax ... quite often it's a mail delivery agend which
discovers that an address with valid syntax might not be a "valid
address."
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Wed, 4 Feb 1998 08:35:59 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Bart Lateur <bart.mediamind@tornado.be>
Subject: Re: Quickie: regexp for valid e-mail addresses
Message-Id: <Pine.GSO.3.96.980204083217.6372D-100000@user1.teleport.com>
On Wed, 4 Feb 1998, Bart Lateur wrote:
> Subject: Re: Quickie: regexp for valid e-mail addresses
> My thoughts: If a mailer program can process them correctly, it must be
> possible to write a Perl script that does the same.
Yes, although not (currently) via a mere pattern. Perl's patterns, though
powerful, can't properly implement RFC822. But you can do RFC822 checking
in Perl, slowly and painfully.
Someone will make a module to do this one day. Then the big problem will
be that there are valid addresses which don't match RFC822!
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 4 Feb 1998 11:35:16 -0500
From: charlot@CAM.ORG (Richard Bellavance)
Subject: Re: replacing things i perl
Message-Id: <6ba5c4$cte@ocean.CAM.ORG>
In article <Pine.LNX.3.95.980205151047.12950A-100000@torsk.feskar.net>,
Martin Raknerud <marthy@feskar.net> wrote:
>
>Im trying to make a small perl script that will read true a textfile,
>printing the "normal" text to the screen our an output until it comes to
>some sort of keyword, in wich it will replace the keyword or the
>keysentence with something else and continue on the next line.
>
I do this quite often. Here's the kind of loop I use:
open(IN, $n) || die("Can't open $n: $!");
while(<IN>) {
s/keyword1/value_of_keyword1/g;
s/keyword2/value_of_keyword2/g;
print;
}
close(IN);
Of course, this doesn't cover the case when a keyword spans two lines.
Hope this helps !
Richard.
--
Richard Bellavance -- charlot@cam.org -- http://www.cam.org/~charlot/
"All along this path I tread / My heart betrays my weary head
With nothing but my love to save / From the cradle to the grave"
(Eric Clapton, "From the cradle")
------------------------------
Date: Wed, 4 Feb 1998 13:03:43 GMT
From: Jacqui Caren <Jacqui.Caren@ig.co.uk>
Subject: Re: sending emails with perl ?
Message-Id: <Enuuy7.JGn@ig.co.uk>
In article <69r10e$nv1@netaxs.com>,
DIAL-MB-Edward Finch <efinch@sun.vais.net> wrote:
>I should have known - not only is TMTOWTDI, TMTOMTDIW (there's more
>than one module to do it with) ;-) Would someone be kind enough to
>compare/contrast Net::SMTP, MailTools, Mail::Mailer, etc.?
Never used Mail::Mailer (yet). If sounds very nice, I nned to find out
how you detect SMTP errors after you finish "printing" your body.
Time to do a perldoc Mail::Mailer :-)
Anyway the gist re Net::SMTP and Mail::Internet is
Mail::Internet allows to build and send a single message.
Net::SMTP is the lowerlevel building block used to talk SMTP via a
(rather nice) OO interface.
It is very very easy to use Net::SMTP to deliver a whole sequence of
messages, but Mail::Internet has a cost overhead because it will
establish a new SMTP connection for each message. (FWIU)
So, if you want to build an email and deliver it use Mail::Internet
or Mail:;Mailer. Usually 2-3 lines of perl code...
If you want to send a stream of email consider overloading Net::SMTP
or using Net::SMTP directly. This takes around 20 lines of perl
(assuming no cryptic perl - I expect randall could produce a one-line
equivalent though :-)
Jacqui
--
Email: Jacqui.Caren@ig.co.uk http://www.ig.co.uk/
Fax : +44 1483 419 419 http://www.perlclinic.com/
Phone: +44 1483 424 424 http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom
------------------------------
Date: Wed, 4 Feb 1998 16:41:52 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: unix command
Message-Id: <Env51s.I0r@world.std.com>
Monte Ohrt <monte@ispi.net> writes:
>you execute unix shell commands with back tics:
>print "the current date is `date`\n";
Quotes don't nest like that in perl. (They do in most shells though.)
~>perl -
print "the current date is `date`\n";
the current date is `date`
~>
The backticks do work on their own.
print "the current date is ",`date`,"\n";
~
--
Andrew Langmead
------------------------------
Date: Wed, 04 Feb 1998 10:24:38 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Want to determine the subnet networks from a network:subnet combo.
Message-Id: <34D88836.6402@min.net>
Martin Vorlaender wrote:
>
> John Porter (jdporter@min.net) wrote:
> : Here's short and sweet solution.
>
> Beware, however, that this won't work if the netmask has "holes" in it,
> e.g. 255.255.216.0. (I know this generally is a Bad Thing(TM) to do, but
> it's perfectly legal).
Yes, you're right. (I was hoping no one would notice.)
One could easily take the list my routine generates, and grep it against
the netmask...
John Porter
------------------------------
Date: Wed, 04 Feb 1998 17:36:03 +0100
From: Tobias Bugala <TobiasBugala@swol.de>
Subject: Who knows about Base64 oder Uudecoder in Perl?
Message-Id: <34D898F2.9EB@swol.de>
I think I've already seen s.th. like that in the Camel-Book, but I can't
find it. Does anybody know of it?
TOBI
------------------------------
Date: Wed, 04 Feb 1998 15:37:06 GMT
From: apaicius@1234.ix.netcom.com (Allan Paicius)
Subject: Re: Win32::ODBC and Oracle 7.3
Message-Id: <6ba212$9u4@dfw-ixnews7.ix.netcom.com>
In article <6b88pg$ser@dfw-ixnews10.ix.netcom.com>, apaicius@1234.ix.netcom.com (Allan Paicius) wrote:
>
>I have Win32::ODBC module developed by Dave Roth et al.
>I am looking for any information on my situation.
>
>1. I have ODBC working with MS SQL 6.5 and Informix 7.3.
> - Inserting records.
> - Update on records.
> - Had to do some mods on my SQL Statments between the two formats.
>
>2. Currently trying to test on ORACLE 7.3.
>
> $state = qq(SELECT lname FROM tem);
db2->sql($state); <----- Left out of orig message. doo!
> $tst_con=$db2->FetchRow();
> ($f1) = $db2->Data();
> print qq( [$f1] -- data\n );
>
> I get blank returned on $f1 .. If I use SQLPlus 3.3 (yuk) it works.
> If I use $db2->DumpData; .. shows me the table column and blank below.
>
>Does have any ideas for the cause or maybe it was never tested for ORACLE.
>I know that there is a DBD::ORACLE... should I go that route ?
>
>Thank you in advance for any help you may provide.
>
>Allan Paicius
>
>apaicius@1234.ix.netcom.com
>
>Remove 1234 on e-mail ..... can't stand the spam.
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 1807
**************************************