[17632] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5052 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 7 06:06:06 2000

Date: Thu, 7 Dec 2000 03:05:13 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <976187113-v9-i5052@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 7 Dec 2000     Volume: 9 Number: 5052

Today's topics:
    Re: A sort of another color -- a Tale, not a question ; (Eric Bohlman)
    Re: ActiveStatePerl and Perl Expect module RGiersig@cpan.org
    Re: Beginner's question (Abigail)
    Re: Beginner's question (Logan Shaw)
    Re: Beginner's question (Martien Verbruggen)
    Re: Can I submit the contents of a form into the same c (Eric Bohlman)
        Connecting to a Oracle 8i database via Perl <mischay@gmx.de>
    Re: Connecting to a Oracle 8i database via Perl (Logan Shaw)
    Re: FAQ 4.49:   How do I permute N elements of a list? <johnlin@chttl.com.tw>
    Re: help getting started with Active perl win32 (Eric Bohlman)
    Re: Help: How to read files from the end? <uri@sysarch.com>
    Re: HELP: regexing html <kip@skiltrip.com>
    Re: How can I read a variable without evaluating it ? <mjcarman@home.com>
        IOT/Abort trap running using setuid wrapper AIX <ronr@my-deja.com>
    Re: IOT/Abort trap running using setuid wrapper AIX (Martien Verbruggen)
    Re: Lost in a sea of obfuscation... (David H. Adler)
    Re: MD5 module problems with Activestate Perl <mkuin@globalrangers.com>
    Re: Number of elements in ref array? <mjcarman@home.com>
    Re: PerlScript in ASP: Dead in the water sumengen@hotelspectra.com
        recursive directory listing <demise@nospam_austin.rr.com>
    Re: recursive directory listing <krahnj@acm.org>
        sending email to script? <toon@repost.com>
    Re: sending email to script? (Rafael Garcia-Suarez)
    Re: sending email to script? <tick.toff@spam.com>
        simple question: how to split a string? jnc@oxys-sprl.com
    Re: simple question: how to split a string? (Rafael Garcia-Suarez)
    Re: Use PERL or Java? Which is faster? (David H. Adler)
    Re: Use PERL or Java? Which is faster? <hmorgenstern@hotmail.com>
        Which Package Net::FTP <bkaiser@trans-it.de>
    Re: Willing to review a 90 line Perl program? (Eric Bohlman)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 7 Dec 2000 10:19:10 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: A sort of another color -- a Tale, not a question ;)
Message-Id: <90no6u$d0g$1@bob.news.rcn.net>

The WebDragon <nospam@nospam.com> wrote:
>   $filename =~ /(.*?).zip/o;

The o modifier is useless here, as there are no variables in the regex.

>   # I did this because the database this output is drawn from truncates 
> the titles :/ and I wanted full filenames. 
>   ($title = $1) =~ tr/A-Z/a-z/;

In general, it's a very bad idea to use the $digit variables anywhere
other than an if block that tests whether the match succeeded, since if it
failed the variables will retain their values from the last successful
match.  Now it may be that you can actually prove that the match will
succeed (if, for example, $filename was the result of a glob for files
ending in .zip), but I'd still program defensively here; if you were to
change the way the names were obtained, you could get bitten by a very
hard-to-find bug.

>   if (param() && (param('sortby') eq 'rating') ) {
>       $master_maps_list{$gametype}{ &coerce2($rating) . $coercename } = 
>     [$filename, $title, $size, $review, $rating];
>   } else {
>       $master_maps_list{$gametype}{ $coercename } = 
>     [$filename, $title, $size, $review, $rating];
>   }

I'd use a conditional expression to refactor this so the lists don't have
to be repeated (and both changed if you have to add elements):

$master_maps_list
  {$gametype}
  {((param() && (param('sortby') eq 'rating')? &coerce2($rating) : "")
   .$coercename}
  = [$filename, $title, $size, $review, $rating];


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

Date: Thu, 07 Dec 2000 09:24:54 GMT
From: RGiersig@cpan.org
Subject: Re: ActiveStatePerl and Perl Expect module
Message-Id: <90nl13$2l$1@nnrp1.deja.com>

In article <6iiX5.715$V6.79377@nntp3.onemain.com>,
  "Dennis Wilson" <lincwils@teleport.com> wrote:
> Has anyone found this module on Activestate's site? I saw it listed,
but
> when I tried to get it with ppm, it was not found.

This doesn't surprise me.  Expect for Perl was developed for
Unix systems and would have to be ported specifically for NT,
and NT is not even near Unix.  I took a look at the Tcl/Expect
NT port to see how they did the command spawning, and found some
real deep hacks there.  I will see if I can make provisions for
an NT port when I redesign and rewrite the Expect module somewhen
in the future, but I cannot make any promises regarding its
feasibility.

If you need something like Expect, your best bet for NT is
the Tcl/Expect port, available at

  http://bmrc.berkeley.edu/people/chaffee/expectnt.html

Hope this helps,

Roland


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 7 Dec 2000 09:09:47 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Beginner's question
Message-Id: <slrn92ukur.4kt.abigail@tsathoggua.rlyeh.net>

On 5 Dec 2000 20:03:30 -0600, Logan Shaw (logan@cs.utexas.edu) wrote in comp.lang.perl.misc <URL: news:<90k6pi$e3i$1@pip.cs.utexas.edu>>:
++ 
++ That, of course, is not possible.  You need a functioning computer to
++ run Perl scripts.


Nah, anyone can admire a Perl program and run it in their heads.



Abigail


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

Date: 7 Dec 2000 03:19:21 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Beginner's question
Message-Id: <90nkmp$pse$1@pip.cs.utexas.edu>

In article <slrn92ukur.4kt.abigail@tsathoggua.rlyeh.net>,
Abigail <abigail@foad.org> wrote:
>Nah, anyone can admire a Perl program and run it in their heads.

Yes, but returning to the subject of the original post, this would not
be too useful for *testing* scripts.

  - Logan


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

Date: Thu, 7 Dec 2000 20:33:32 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Beginner's question
Message-Id: <slrn92umbc.20m.mgjv@martien.heliotrope.home>

On 7 Dec 2000 09:09:47 GMT,
	Abigail <abigail@foad.org> wrote:
> On 5 Dec 2000 20:03:30 -0600, Logan Shaw (logan@cs.utexas.edu) wrote in comp.lang.perl.misc <URL: news:<90k6pi$e3i$1@pip.cs.utexas.edu>>:
> ++ 
> ++ That, of course, is not possible.  You need a functioning computer to
> ++ run Perl scripts.
> 
> 
> Nah, anyone can admire a Perl program and run it in their heads.

Is your head Turing-complete?

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Can't say that it is, 'cause it
Commercial Dynamics Pty. Ltd.   | ain't.
NSW, Australia                  | 


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

Date: 7 Dec 2000 10:32:01 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Can I submit the contents of a form into the same cgi script which   generated the form?
Message-Id: <90nov1$d0g$3@bob.news.rcn.net>

Gordon Vrdoljak <vrdoljak@uclink.berkeley.edu> wrote:
> if ($week == 1) {$file = $schedfiles[0];}
> if ($week == 2) {$file = $schedfiles[1];}
> if ($week == 3) {$file = $schedfiles[2];}
> if ($week == 4) {$file = $schedfiles[3];}
> if ($week == 5) {$file = $schedfiles[4];}  

See any pattern here?



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

Date: Thu, 07 Dec 2000 08:42:22 +0100
From: Michael <mischay@gmx.de>
Subject: Connecting to a Oracle 8i database via Perl
Message-Id: <3A2F3F5E.AF5EA37C@gmx.de>

Hello,

can anybody tell me, which perl -modules I need to install, if I want to
connect to an Oracle-Database using perl? Which version of perl do I
need to install?

Thanks for your help,

Michael



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

Date: 7 Dec 2000 03:17:10 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Connecting to a Oracle 8i database via Perl
Message-Id: <90nkim$ppt$1@pip.cs.utexas.edu>

In article <3A2F3F5E.AF5EA37C@gmx.de>, Michael  <mischay@gmx.de> wrote:
>can anybody tell me, which perl -modules I need to install, if I want to
>connect to an Oracle-Database using perl? Which version of perl do I
>need to install?

The latest version of Perl should do fine, as should 5.005.

You'll need to install two modules to be able to access your Oracle
database.  The first is the DBI, which is a set of generic database
access routines.  The second is the database driver (backend) for
Oracle.

Here are some URLs to pages where you can download the distributions:

	http://search.cpan.org/search?dist=DBI
	http://search.cpan.org/search?dist=DBD-Oracle

To build and install them, you'll probably need some sort of Oracle
client libraries on the machine, if experience with other databases is
any indication.

  - Logan


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

Date: Thu, 7 Dec 2000 10:15:49 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Re: FAQ 4.49:   How do I permute N elements of a list?
Message-Id: <90ms18$2or@netnews.hinet.net>

"PerlFAQ Server" <faq@denver.pm.org> wrote:

>   How do I permute N elements of a list?
>         #!/usr/bin/perl -n
>         # tsc-permute: permute each word of input
>         permute([split], []);
>         sub permute {
>             my @items = @{ $_[0] };
>             my @perms = @{ $_[1] };
>             unless (@items) {
>                 print "@perms\n";
>             } else {
>                 my(@newitems,@newperms,$i);
>                 foreach $i (0 .. $#items) {
>                     @newitems = @items;
>                     @newperms = @perms;
>                     unshift(@newperms, splice(@newitems, $i, 1));
>                     permute([@newitems], [@newperms]);
>                 }
>             }
>         }

According to this algorithm, I write a revised (it's shorter and easier to
use) version:

use strict;

sub permute {
    return [@_] unless @_ > 1;
    map {
        my @items = @_;
        my $element = splice(@items,$_,1);
        map { [$element,@$_] } permute(@items);
    } 0..$#_;
}

print "@$_\n" for permute 'A'..'E';
__END__

How do you think about it?  (adopted?)

John Lin





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

Date: 7 Dec 2000 10:28:39 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: help getting started with Active perl win32
Message-Id: <90noon$d0g$2@bob.news.rcn.net>

SuperGumby <tick.toff@spam.com> wrote:
> <snip>

> here-documents ? pardon newbie, but what's a 'here-document'

Take a look at the section entitled "Scalar Value Constructors" in the
perldata man page (starting in the paragraph that begins "A line-oriented
form of quoting...).



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

Date: Thu, 07 Dec 2000 06:53:49 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Help: How to read files from the end?
Message-Id: <x7sno0bu2q.fsf@home.sysarch.com>

>>>>> "MD" == Michel Dalle <michel.dalle@usa.net> writes:

  MD> In article <90lbr5$27m1@imsp212.netvigator.com>, "Lucas"
  MD> <wstsoi@hongkong.com> wrote: [snip]
  >> For some reasons, I need to read some recent logs from the log
  >> files, how could I read the logs from the end of file, but not the
  >> start?

  MD> Looks like File::Tail from CPAN would be a solution for your
  MD> problem.

  MD> Otherwise, look at the PPT tail command at :
  MD> http://language.perl.com/ppt/src/tail/index.html

neithe of those would work. they don't read the file line by line
backwards as the OP requested.

use File::ReadBackwards from cpan.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Thu, 7 Dec 2000 01:11:45 -0500
From: "jKip" <kip@skiltrip.com>
Subject: Re: HELP: regexing html
Message-Id: <t2uaf9ms7ven7c@corp.supernews.com>

good call!




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

Date: Mon, 04 Dec 2000 12:47:44 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: How can I read a variable without evaluating it ?
Message-Id: <3A2BE6D0.64A5573C@home.com>

Marcelo Montagna wrote:
> 
> I have a hash like
> 
> MyHash = (
>         FirstName       => $FORM{fname},
>         Email           => $FORM{email}
> );
> 
> Now, I'd like to know what value is assigned to each key, without
> evaluating it, I mean, something that will return exactely
> "$FORM{email}" (Dollar sign, letter "F",...etc) as a string 
> and not its value.

What makes you so sure that's what your hash contains? How did you get
the data in there? If you did this:

$MyHash{FirstName} = $FORM{fname};

then you've stored a *copy* of $FORM{fname} in your hash. You have *not*
stored the string '$FORM{fname}' If you want to do that, single quote it
to make it a literal:

$MyHash{FirstName} = '$FORM{fname}';
 
Of course, that's a bit daft, as at some point you'll probably want to
know what the value of $FORM{fname} is, and if you try to get at it from
a string stored in %MyHash you'll have to use symbolic references, which
are Evil. So you shouldn't do that, and if you really want a reference,
store a hard one:

$MyHash{FirstName} = \$FORM{fname};

Of course, this still doesn't allow you to see the symbolic name of what
it's pointing to, but I don't think you really need that. If you tell us
what you're trying to do, we can probably show you the Right Way.

-mjc


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

Date: Thu, 07 Dec 2000 08:47:02 GMT
From: Ronald J.H. Rood <ronr@my-deja.com>
Subject: IOT/Abort trap running using setuid wrapper AIX
Message-Id: <90niq6$ufr$1@nnrp1.deja.com>

Hi,

I made a little perl script that uses net::Ping to do icmp pings. For
this reason it needs to use root privilege. So I made a little binary,
made it setuid root:system to call my script.

All I get is IOT/Abort trap

using
perl 5.6.0
aix 4.3.3.0

Why is this ? and how can I solve this ?

When I logon as root the perl script works as designed but I don't want
to logon to root often ...

thanks,
Ronald
http://ronr.nl/unix-dba
The best way to accellerate a computer 'running' windows is by
gravitation


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 7 Dec 2000 20:40:26 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: IOT/Abort trap running using setuid wrapper AIX
Message-Id: <slrn92umoa.20m.mgjv@martien.heliotrope.home>

On Thu, 07 Dec 2000 08:47:02 GMT,
	Ronald J.H. Rood <ronr@my-deja.com> wrote:
> Hi,
> 
> I made a little perl script that uses net::Ping to do icmp pings. For
> this reason it needs to use root privilege. So I made a little binary,
> made it setuid root:system to call my script.
> 
> All I get is IOT/Abort trap

But Perl isn't giving you any errors, is it? Migth it be your system
doing this? Might you be doing something wrong somewhere? Hard to tell.
I don't see any code. I don't see any messages.

If you write your suid program correctly, you will be root when you call
the perl script. If not, then you won't.

ou should maybe read the perlsec documentation for some more information
on this.

> using
> perl 5.6.0
> aix 4.3.3.0
> 
> Why is this ? and how can I solve this ?

AIX is weird. But I don't think it's that weird.

> When I logon as root the perl script works as designed but I don't want
> to logon to root often ...

Ever heard of sudo? Was created specifically for this particular case.

> The best way to accellerate a computer 'running' windows is by
> gravitation

Rocket fuel does a good job as well.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | life ain't fair, but the root
Commercial Dynamics Pty. Ltd.   | password helps. -- BOFH
NSW, Australia                  | 


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

Date: 7 Dec 2000 07:52:19 GMT
From: dha@panix6.panix.com (David H. Adler)
Subject: Re: Lost in a sea of obfuscation...
Message-Id: <slrn92ugdj.4j0.dha@panix6.panix.com>

On 6 Dec 2000 20:39:58 GMT, Eli the Bearded <elijah@workspot.net>
wrote:

>Well, my recent tact has been to find perl features and then say, how
>can I write a JAPH with this?

Yeah, but, like, you're a scary dude.  :-)

dha, has been frightened by e-t-b before...

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"I go where I will and I do what I can" - Henry Fool


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

Date: Thu, 7 Dec 2000 12:01:51 +0100
From: "Mark Kuin" <mkuin@globalrangers.com>
Subject: Re: MD5 module problems with Activestate Perl
Message-Id: <90nqn3$gc4$1@news1.xs4all.nl>

Have you installed the MD5 module?

Type
ppm install Digest-MD5
at the dos-prompt

"Peter Sundstrom" <peter.sundstrom@eds.com> wrote in message
news:90mvil$c9$1@hermes.nz.eds.com...
> I'm running Activestate Perl
>
> This is perl, v5.6.0 built for MSWin32-x86-multi-thread
> (with 1 registered patch, see perl -V for more detail)
>
> Copyright 1987-2000, Larry Wall
>
> Binary build 618 provided by ActiveState Tool Corp.
> http://www.ActiveState.com
> Built 21:03:54 Sep 13 2000
>
>
> If I use a simple script with just:
>
> use  Digest::MD5;
>
> it comes back with
>
> Can't locate Digest/Perl/MD5.pm in @INC (@INC contains: C:/Perl/lib
> C:/Perl/site/lib .) at C:/Perl/site/lib/Digest/MD5.pm line 20.
> Compilation failed in require at C:\temp\md.pl line 3.
> BEGIN failed--compilation aborted at F:\tempn\md.pl line 3.
>
>
> Looking at C:/Perl/site/lib/Digest/MD5.pm it has:
>
> if ($@) {
>     # Try to load the pure perl version
>     require Digest::Perl::MD5;
>
> I'm obviously missing that.  Should it be there and/or should it continue
> without it?
>
>
>
>




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

Date: Mon, 04 Dec 2000 16:48:51 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: Number of elements in ref array?
Message-Id: <3A2C1F53.4AC0CA53@home.com>

billgerba@my-deja.com wrote:
> 
> Is there an easy way to get the number of elements in (what I 
> guess you might call) a ref array?

Hrm. Do you mean perhaps a reference to an array?

> Example:
> 
> $NAME = 'PREFIX' . $x;
> 
> for $y (0..$#NAME) {
>      ...
> }

I have to infer a bit from what you've written, but that looks
suspiciously like you're trying to use soft (symbolic) references.
Don't. Yes, it's possible; but it's ugly, messy, slower, and downright
evil. Use hard references instead:

my $aref = [0 .. 9];

foreach my $n (0 .. $#{$aref}) {
    print $aref->[$n], "\n";
}

But that's too C-ish. The Perlish way is to iterate over the array
directly and forget about indexing:

foreach my $item (@{$aref}) {
    print $item, "\n";
}

There are other, even more idiomatic ways, but this is the basic
technique you should learn first.

> Of course, $#NAME doesn't work in this case like it would with a
> regular array, and AFAIK $$# and the like don't seem to work either.
> Is there a way to do this?  

Yes, but if you really needed to do it that way, you wouldn't need to
ask how here; and if you don't need to use symrefs then you shouldn't.
Another popular saying here is that you should never use symrefs unless
you know *why* you shouldn't use them. :)

> Also, is there a proper term for what I'm calling a ref array?

Yes, we call them "array references." If you say "ref array" or
"reference array" here, people will probably think that you mean "an
array of references" instead of "a reference to an array."

cf. the 'perlref' manpage (perldoc perlref) for more info on using
references. q.v. the 'perlreftut' manpage.

-mjc


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

Date: Thu, 07 Dec 2000 07:19:22 GMT
From: sumengen@hotelspectra.com
Subject: Re: PerlScript in ASP: Dead in the water
Message-Id: <90ndlo$pv9$1@nnrp1.deja.com>

ASP supports this:
<SCRIPT LANGUAGE="PerlScript" RUNAT="Server">
 ...
</SCRIPT>

In article <slrn92tqfc.u7.tim@localhost.localdomain>,
  tim@localhost.localdomain (Tim Hammerquist) wrote:
> SuperGumby <tick.toff@spam.com> wrote:
> > another newbie to the rescue
> [ snip ]
> > <SCRIPT LANGUAGE="PerlScript">
> > $window->document->write('Hello world!<br><br>');
> > my $var1 = 23;
> > $window->document->Write("value: $var1");
> > </SCRIPT>
>
> Very nice _client side_, but I got the impression he was attempting to
> embed PerlScript code inside an ASP page for _server side_
> interpretation.
>
> In addition to being incapable of performing server-side processing,
> client-side PerlScript also requires every single client viewing a web
> page to have MSIE and ActivePerl installed.  As well as being an
> unreasonable assumption/prerequisite for clients, you're also limiting
> your audience to only Win32 platforms.
>
> I used ASP PerlScript for a couple years while I was forced to use an
> MS/IIS4 server, so I know it works.  Are there any other circumstancial
> details you can provide?  At a glance, it seems that your code is fine.
>
> Any more details you can come up with will help with a diagnosis.  =)
>
> --
> -Tim Hammerquist <timmy@cpan.org>
> The optimist thinks this is the best of all possible worlds.
> The pessimist fears it is true.
> 	-- Robert Oppenheimer
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 07 Dec 2000 05:20:25 GMT
From: "Daniel" <demise@nospam_austin.rr.com>
Subject: recursive directory listing
Message-Id: <t6FX5.18958$sS2.382051@typhoon.austin.rr.com>

I am trying to get a recursive directory listing. I am using:

print "Enter root directory: ";
chomp ($rootdir = <STDIN>);
chdir ($rootdir) || die "Cannot find $rootdir: $!";
foreach (<*>) {print "$_\n";}

to prompt the user for a directory and list the contents. It only lists the
content of the directory. Is there a simple way to make this recursive so I
get a full directory listing including subdirectories and contents?

Thanks for humoring a newbie question.

Daniel

remove nospam_ from my email addy to respond to me directly




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

Date: Thu, 07 Dec 2000 06:56:55 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: recursive directory listing
Message-Id: <3A2F351E.4B50A8DF@acm.org>

Daniel wrote:
> 
> I am trying to get a recursive directory listing. I am using:
> 
> print "Enter root directory: ";
> chomp ($rootdir = <STDIN>);
> chdir ($rootdir) || die "Cannot find $rootdir: $!";
> foreach (<*>) {print "$_\n";}
> 
> to prompt the user for a directory and list the contents. It only lists the
> content of the directory. Is there a simple way to make this recursive so I
> get a full directory listing including subdirectories and contents?

#!/usr/bin/perl -w
use strict;
use File::Find;

my $rootdir;
print 'Enter root directory: ';
chomp( $rootdir = <STDIN> );
die "Cannot find $rootdir: $!" unless -d $rootdir;

find( \&wanted, $rootdir );

sub wanted {
    print "$File::Find::name\n";
}

__END__

John


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

Date: Thu, 07 Dec 2000 07:46:20 GMT
From: toon <toon@repost.com>
Subject: sending email to script?
Message-Id: <071220000853454385%toon@repost.com>

Hi,

is it possible to have an email sent by, let's say Outlook, to a
perl/cgi script on the server and have this message parsed by the
script?


toon


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

Date: Thu, 07 Dec 2000 08:02:37 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: sending email to script?
Message-Id: <slrn92uh2l.2sg.rgarciasuarez@rafael.kazibao.net>

toon wrote in comp.lang.perl.misc:
> 
> is it possible to have an email sent by, let's say Outlook, to a
> perl/cgi script on the server and have this message parsed by the
> script?

CGI programs are executed by web servers, not by mail servers.

If you want the reception of an email to trigger the execution of a
program, check how it can be done with your mail server. Usually it's
done through some aliasing mechanism.

This question is not Perl-related. Ask in a better newsgroup (one about
your mail server).

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: Thu, 07 Dec 2000 08:23:35 GMT
From: "SuperGumby" <tick.toff@spam.com>
Subject: Re: sending email to script?
Message-Id: <bOHX5.7741$xW4.64122@news-server.bigpond.net.au>

my very recent introduction to perl was an NT server which runs Eudora mail
client, which can inspect the subject of an incoming post and execute a perl
script based on this subject.

with all the SMTP and NET modules and the magic I have seen perl doing in
some of the discussions in this group I think your question is reasonable.

toon wrote in message <071220000853454385%toon@repost.com>...
>Hi,
>
>is it possible to have an email sent by, let's say Outlook, to a
>perl/cgi script on the server and have this message parsed by the
>script?
>
>
>toon




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

Date: Thu, 07 Dec 2000 10:38:41 GMT
From: jnc@oxys-sprl.com
Subject: simple question: how to split a string?
Message-Id: <90npbi$2ur$1@nnrp1.deja.com>

Hi

I have a very simple question: how can I split a string
according to a know pattern:

I have the following string: Generic_106541-11
and I want to obtain the digits after the - sign.

Thanks a lot

Jean-Noel Colin


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 07 Dec 2000 11:02:21 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: simple question: how to split a string?
Message-Id: <slrn92urjl.9ie.rgarciasuarez@rafael.kazibao.net>

jnc@oxys-sprl.com wrote in comp.lang.perl.misc:
> 
> I have a very simple question: how can I split a string
> according to a know pattern:

Surprinsingly, Perl has a split function, documented in perlfunc. This
doc is accessible from the command-line via "perldoc -f split" or in
perlfunc.html if you happen to have the HTML documentation installed.

> I have the following string: Generic_106541-11
> and I want to obtain the digits after the - sign.

How to do it using split:

  my (undef,$digits) = split /-/, $string;

Other way to do it:

  my ($digits) = $string =~ /-(.*)/;

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: 7 Dec 2000 08:04:18 GMT
From: dha@panix6.panix.com (David H. Adler)
Subject: Re: Use PERL or Java? Which is faster?
Message-Id: <slrn92uh42.4j0.dha@panix6.panix.com>

On 7 Dec 2000 02:48:22 GMT, Peter Schuller <peter.schuller@infidyne.com> wrote:
>>> No comparison. Perl is blindingly fast. Java is slow.
>
>Huh?

Perhaps he means programmer time, rather than compilation/running
time... :-)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
All hail El Cabeza Del Oro!  <http://www.panix.com/~dha/elcabeza.html>


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

Date: Thu, 7 Dec 2000 11:58:25 +0200
From: "hoz" <hmorgenstern@hotmail.com>
Subject: Re: Use PERL or Java? Which is faster?
Message-Id: <90nn05$hen$1@web1.cup.hp.com>

I think running in a web (CGI) environment java servlets is better. Servlets
are scalable and multithreaded. Using mod_perl is better then just perl in
terms of performance but scalability is a major factor. Also connections to
the DB matter too, i.e. JDBC or DBI
(which is better?). I remember reading some benchmarks out there comparing
all cgi technologies, perl, servlets, php, asp, jsp, c etc...
here is one that compares java and C
http://www.aceshardware.com/Spades/read.php?article_id=153
-hoz

"Al Dev" <alavoor@yahoo.com> wrote in message
news:3A2E6155.C2273626@yahoo.com...
> I am planning to use either or PERL or Java for a new web application
> which will
> run on RedHat Linux.
>
> Any suggestions on which runs faster - PERL or Java??
> Speed is more important (top priority)
>




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

Date: Thu, 7 Dec 2000 11:41:29 -0000
From: "Bjoern Kaiser" <bkaiser@trans-it.de>
Subject: Which Package Net::FTP
Message-Id: <90npgl$7j6$1@desperado.vew-telnet.net>

Hi
I'm using ActivePerl which packages do i have to install
to use Net::FTP

thx




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

Date: 7 Dec 2000 10:41:17 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Willing to review a 90 line Perl program?
Message-Id: <90npgd$d0g$4@bob.news.rcn.net>

Ted <ted_graham@my-deja.com> wrote:
> {
>   $count++;
>   if( $count%$messageCount == 0)
>   {
>     print "Processing line $count of $totalLines in $file...\n";
>   }

perl will count your lines for you; see the description of '$.' in
perlvar.  Note, though, that if you follow the suggestion to seek() back
to the beginning of the file, $. won't get reset.



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

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


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