[6340] in Perl-Users-Digest
Perl-Users Digest, Issue: 962 Volume: 7
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 17 07:07:13 1997
Date: Mon, 17 Feb 97 04:00:19 -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 Mon, 17 Feb 1997 Volume: 7 Number: 962
Today's topics:
Re: $ls = `ls $file`; but not in NT Perl (Brian L. Matthews)
Re: (Q) return inside a grep BLOCK (Brian L. Matthews)
ANNOUNCE: Win32::ODBC v970208 <rothd@roth.netX>
Re: CGI/PERL, JAVA Applet, HTM parameter problem (Brian L. Matthews)
Re: Comparing two dates (Neb)
Re: Compiling perl modules on SCO <grantw@walters.co.nz>
Re: fflush() in Perl? (Lack Mr G M)
grep returns no value <ljohnson@isys.ca>
grep returns no value <ljohnson@isys.ca>
Re: grep returns no value (Piotr Piatkowski)
IPC::Open2 difficult using. (Diana McCarthy)
Re: mysql interface (Andreas Koenig)
Need help for 2 easy PERL questions, please (Neb)
Need help for 2 easy PERL questions, please (Neb)
Need help for 2 easy PERL questions, please (Neb)
Need help for 2 easy PERL questions, please (Neb)
Need help for 2 easy PERL questions, please (Neb)
Need help for 2 easy PERL questions, please (Neb)
Need help for 2 easy PERL questions, please (Neb)
Need help for 2 easy PERL questions, please (Neb)
perl 5.001 and digital unix 4.0b (Kristoff Bonne)
Re: perl 5.001 and digital unix 4.0b (Kristoff Bonne)
Re: Perl on Microsoft IIS, NT Server 4.0 <stemo@powersim.no>
Perl5 for Windows 95 <nobody@logica.com>
Re: Pig Latin (Hugo van der Sanden)
Re: Pig Latin (Honza Pazdziora)
Re: Regexp to do minimal email validation <rra@cs.stanford.edu>
Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Feb 1997 23:06:43 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: $ls = `ls $file`; but not in NT Perl
Message-Id: <5e9023$pbr$1@halcyon.com>
In article <3307B306.439F@bgraham.com>, Bo Graham <bgraham@bgraham.com> wrote:
|$ls = `ls $file`; works in unix but not in Windows version of perl.
Not surprising. Backticks simply run the given command and slurp its
output. Stock Windows systems don't come with an ls, so perl can't
run it.
|.. How do I do this then?
You could write your own ls. You could use opendir/readdir and/or stat.
You could use the Find module. And if you're really just doing
$ls = `ls $file`, just replace it with $ls = $file (although I suspect
you're doing something more complex and just simplified for the posting.)
Brian
--
Brian L. Matthews Illustration Works, Inc.
For top quality, stock commercial illustration, visit:
http://www.halcyon.com/artstock
------------------------------
Date: 16 Feb 1997 23:01:34 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: (Q) return inside a grep BLOCK
Message-Id: <5e8voe$p36$1@halcyon.com>
In article <bierman-1602971416200001@bierpe3.apple.com>,
Peter Bierman <bierman@apple.com> wrote:
|Why does return inside a grep BLOCK return me out of the entire sub that
|I'm in?
Because that's what return does. It bails out of the current subroutine.
When you're in a grep BLOCK, the current subroutine is still the one
containing the call to grep. A BLOCK is not necessarily a subroutine,
and in the case of grep, it surely isn't.
|Is there any simpler way to write a complex grep BLOCK than nesting lots
|of if (foo) else 0; to return a value or false?
You could take your grep block and make it into a subroutine, and then
have your grep block just call the subroutine. I'd be worried about
performance though. Another option is to toss grep altogether. Something
like:
foreach (@ids)
{
next if ...;
next if ...;
push @matches, $_;
}
Where the if's look like the if's you had in your original code.
Brian
--
Brian L. Matthews Illustration Works, Inc.
For top quality, stock commercial illustration, visit:
http://www.halcyon.com/artstock
------------------------------
Date: 17 Feb 1997 04:33:54 GMT
From: "Roth Consulting" <rothd@roth.netX>
Subject: ANNOUNCE: Win32::ODBC v970208
Message-Id: <01bc1c8b$5e2869f0$0100a8c0@www>
A new version of Win32::ODBC has been uploaded to CPAN and is
currently available from:
ftp://ftp.roth.net/pub/ntperl/Win32odbc_v970208.zip
This addresses a fix in the error reporting mechanism and has
patched a few internal functions.
There is now an ODBC listserver available. Send an email message
to win32odbc-request@roth.net with a message of SUBSCRIBE.
--
================================================================
Dave Roth ...glittering prizes and
Roth Consulting endless compromises, shatter
rothd@roth.net the illusion of integrity
My email address is disguised to fool automailers. Remove the
trailing 'X' to send me email.
****************************************************************
Use of this message or email address for commercial purposes
(including "junk" mailings) is strictly prohibited and protected
under current international copyright laws and United States
Code, Title 47, Chapter 5, Subchapter II.
------------------------------
Date: 16 Feb 1997 22:47:54 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: CGI/PERL, JAVA Applet, HTM parameter problem
Message-Id: <5e8uuq$odp$1@halcyon.com>
In article <5e72rn$pvm@paperboy.ids.net>, <ken_t@ids.net> wrote:
|It seems as if once the client program gets the final xxx.htm, it just
|pulls the last copy of it from memory.
|Is there any way to fix this?
Undoubtedly. But because it's a browser (or server?) problem, and
has really nothing to do with perl, you'll have better luck finding
an answer by asking in one of the comp.infosystems.www.* newsgroups.
Brian
--
Brian L. Matthews Illustration Works, Inc.
For top quality, stock commercial illustration, visit:
http://www.halcyon.com/artstock
------------------------------
Date: Sun, 16 Feb 1997 13:58:38 -0500
From: berube@odyssee.net (Neb)
Subject: Re: Comparing two dates
Message-Id: <MPG.d7122e96cab4120989682@news.microtec.net>
In article <3307610D.41C6@cyber.xs4all.nl>, basj@cyber.xs4all.nl says...
> Nathan V. Patwardhan wrote:
>
> With comparing I meant a function to see which is oldest date
> between the two (or vice versa).
>
> >
> > basj@cyber.xs4all.nl wrote:
> >
> > : Is there a function for this or will I have to split the dates in
> > : components and compater them individually (hope not) ?
> >
> > I don't see what's wrong with using localtime(). :-) It's not very
> > difficult to split the time into hours, minutes, and seconds, then compare
> > the result with another entry.
> >
> > HTH!
> >
> > --
> > Nathan V. Patwardhan
> > nvp@shore.net
> > "send me mail"
> > --Jamie Zawinski
>
> --
> basj@cyber.xs4all.nl
> PGP 2.6.3i KeyID 7010044D / -- I'm Powered By Silicon Graphics -- /
> http://www.xs4all.nl/~basj
>
sorry, this is a test just a test.
--
Benjamin Berube
berube@odyssee.net
http://www.odyssee.net/~berube
------------------------------
Date: Mon, 17 Feb 1997 22:36:59 +1300
From: Grant Walters <grantw@walters.co.nz>
To: Krzysztof Murkowski <murek@ml.put.poznan.pl>
Subject: Re: Compiling perl modules on SCO
Message-Id: <330826BB.4AC5@walters.co.nz>
Krzysztof Murkowski wrote:
>
> Hello,
>
> I have to use perl and two modules - Wais and SFGate on SCO OpenServer.
> I'm looking for person who can help me per *email* solving many problems
> with building this software on SCO. I think email is better than news,
> because there are may logs produced by make etc. to send and it can be
> borring for other people. But if you think news are better just let me
> know.
>
> Best greetings from Poland.
>
I'll give you a hand. I've got PERL, free-Wais and SFgate working on
SCO Openserver.
What do you need?
Regards
GRANT WALTERS
------------------------------
Date: 17 Feb 1997 10:26:57 GMT
From: gml4410@ggr.co.uk (Lack Mr G M)
Subject: Re: fflush() in Perl?
Message-Id: <5e9bph$t0c@ukwsv3.ggr.co.uk>
In article <bmf3e5.id4.ln@localhost>, tadmc@flash.net (Tad McClellan) writes:
|> Henry Wu (henryw@seasick.sps.mot.com) wrote:
|> : I have a simple question. Is there a function in Perl corresponding to
|> : the C fflush() function? I used mutiple "print" statements in a Perl
|> : script, but the results didn't show on STDOUT instantly until the end of
|> : the program. So I want to flush the STDOUT after each "print"
|> : statement. Can anyone out there give me a clue? Thanks.
|> ^^^^^^^^^^^^^^
|>
|> man perlfunc and perlvar (search for flush)
|>
|> You didn't really need to post to get a clue, just check the free
|> documentation that is included with the perl distribution...
But the documentation doesn't mention fflush. And autoflush is, in
fact, a (slight) overkill if he is doing line-oriented output.
To get *line* buffered output you can do this:
use FileHandle;
FH->setvbuf(undef, _IOLBF, 0);
provided your system has setvbuf.
--
----------- Gordon Lack ----------------- gml4410@ggr.co.uk ------------
The contents of this message *may* reflect my personal opinion. They are
*not* intended to reflect those of my employer, or anyone else.
------------------------------
Date: 17 Feb 1997 07:02:13 GMT
From: "Lee Johnson" <ljohnson@isys.ca>
Subject: grep returns no value
Message-Id: <5e8vpl$gio@nr1.toronto.istar.net>
When I execute the following code, the file /home/logs/logs.txt goes from a
very large file, to a file that contains 0 bytes. Am I missing something
obvious?? I know that the file contain a few lines that contains the word
nancy in hem i.e.
000.000.000.00:21000f4f:#04:970112:235947:ppp:login:nancy
I'm tying to strip the file and replace it with only the lines that contain
a given word.
Here's what's given me trouble:
#open the log file, strip all entries except those that #ontain the word
nancy
$file='/home/logs/logs.txt';
@today_log = grep/nancy/, <$file>;
open (LOG, ">$file") ||print("Hey:$!\n");
print LOG $today_log;
Thanks for the help;
Lee
------------------------------
Date: 17 Feb 1997 07:03:46 GMT
From: "Lee Johnson" <ljohnson@isys.ca>
Subject: grep returns no value
Message-Id: <5e8vsi$gio@nr1.toronto.istar.net>
When I execute the following code, the file /home/logs/logs.txt goes from a
very large file, to a file that contains 0 bytes. Am I missing something
obvious?? I know that the file contain a few lines that contains the word
nancy in hem i.e.
000.000.000.00:21000f4f:#04:970112:235947:ppp:login:nancy
I'm tying to strip the file and replace it with only the lines that contain
a given word.
Here's what's given me trouble:
#open the log file, strip all entries except those that #ontain the word
nancy
$file='/home/logs/logs.txt';
@today_log = grep/nancy/, <$file>;
open (LOG, ">$file") ||print("Hey:$!\n");
print LOG $today_log;
Thanks for the help;
Lee
------------------------------
Date: 17 Feb 1997 10:34:37 +0100
From: kompas@galaxy.uci.agh.edu.pl (Piotr Piatkowski)
Subject: Re: grep returns no value
Message-Id: <5e98nd$oeb@galaxy.uci.agh.edu.pl>
Lee Johnson <ljohnson@isys.ca> wrote:
: #open the log file, strip all entries except those that #ontain the word
: nancy
: $file='/home/logs/logs.txt';
: @today_log = grep/nancy/, <$file>;
I'm not sure if it will work, I would write it:
open(FILE, $file);
@today_log = grep /nancy/, <FILE>;
: open (LOG, ">$file") ||print("Hey:$!\n");
: print LOG $today_log;
@today_log and $today_log are two different things.
Use:
print LOG join "\n", @today_log
HTH
--
Piotr Pi1tkowski, Uczelniane Centrum Informatyki, AGH Krakow, POLAND
------------------------------
Date: 17 Feb 1997 10:07:01 GMT
From: dianam@cogs.susx.ac.uk (Diana McCarthy)
Subject: IPC::Open2 difficult using.
Message-Id: <5e9ak5$fn6@infa.central.susx.ac.uk>
Summary:
Keywords:
I want to send and data to and from a process. I understand that IPC::Open2
should allow me to do that and I believe the command I want to use works just
like "bc" - i.e. sends and receives a line at a time. I cannot get my code to
work with "bc" never mind with my command. I think it may be my lack of
understanding of how to create the file handles before the open2 call. If
anyone can see what I am doing wrong I would be very grateful for any
guidance. My code and program output is given below:
Thanks for your time
Diana
#!/local/perl5/bin/perl
use IPC::Open2;
$pid = open2(\*IN, \*OUT, "bc");
print IN "5";
@result = <OUT>;
print "the result is @result\n";
close(OUT);
close(IN);
When I run this I get:
"the result is"
I have tried also using @result as a scalar and I have tried doing use
FileHandle with "new FileHandle".
------------------------------
Date: 17 Feb 1997 08:38:21 GMT
From: koenig@franz.ww.TU-Berlin.DE (Andreas Koenig)
Subject: Re: mysql interface
Message-Id: <5e95dt$krl$1@brachio.zrz.TU-Berlin.DE>
[posted and courtesy copy sent to cited author]
In article <330985f4.68121854@news.alt.net>,
Matthew Ahrens <matt@callnet.com> wrote:
>I was checking out the mySQL web page, because of my frustrations using
>mSQL, so i looked on CPAN for a perl interface for mySQL but could not find
>one.
It comes with the mysql engine. It's a hacked up _old_ MsqlPerl
in disguise. There's also a hacked up DBD::mSQL in the package.
>should I try to run msqltomysql (or whatever that utility is for converting
>C code from msql to mysql calls) on the source for the Msql perl module?
Anything you try, please keep me informed. In principle I'd like to
support both mSQL and mysql out of the same distribution file, but
maybe it's better to go separate ways. Maybe Alligator's next version
has the solution, I'm desparately waiting for it (if he's listening?-)
andreas
------------------------------
Date: Sun, 16 Feb 1997 14:03:12 -0500
From: berube@odyssee.net (Neb)
Subject: Need help for 2 easy PERL questions, please
Message-Id: <MPG.d7123ff20c2cbde989684@news.microtec.net>
Hi there PERL programmers !
I need your help for 2 PERL questions. Maybe these questions will seem
really easy to answer for you, so help me answer them !
Here's the first question. Using a CGI-perl script based on the
"cgi-lib.pl", I want to send an email. I CAN send the email. Here's how
I
do it :
---code starts here---
$command="mail berube\@odyssee.net < $name_of_file";
system($command);
---code ends here---
[where "name_of_file" is the file that contains the body message for the
email]
When I do this, it sends a email to my email address no-problemo. The
problem is the following : the email doesn't have a "subject". So, when
I
check my mail, I receive an email with no subject. This ain't no good at
all. I tried to include the line:
Subject: This is the subject !
in the body of the message. It does only put the subject in the body of
the message and doesn't help much more. So, how can I give a SUBJECT to
the email ???
The next question is even easier. How can a script call an other script
or
www page with a function ? Like, suppose I got a HTML form that call
SCRIPT_1. SCRIPT_1 loads, do a little something (let's suppose it write
a
file) and then it must call an other script called SCRIPT_2. So, the
question is : how can I do that, so that when I use the HTML form, it
goes
from SCRIPT_1 --> SCRIPT_2 without me noticing it ???
Thanx for the help !! I my questions are not clear enough for you to
answer, write me so I can explain you better. Thank you !!!
Benjamin
--
Benjamin Berube
berube@odyssee.net
http://www.odyssee.net/~berube
------------------------------
Date: Sun, 16 Feb 1997 14:00:48 -0500
From: berube@odyssee.net (Neb)
Subject: Need help for 2 easy PERL questions, please
Message-Id: <MPG.d71236860eaaf2989683@news.microtec.net>
Hi there PERL programmers !
I need your help for 2 PERL questions. Maybe these questions will seem
really easy to answer for you, so help me answer them !
Here's the first question. Using a CGI-perl script based on the
"cgi-lib.pl", I want to send an email. I CAN send the email. Here's how
I
do it :
---code starts here---
$command="mail berube\@odyssee.net < $name_of_file";
system($command);
---code ends here---
[where "name_of_file" is the file that contains the body message for the
email]
When I do this, it sends a email to my email address no-problemo. The
problem is the following : the email doesn't have a "subject". So, when
I
check my mail, I receive an email with no subject. This ain't no good at
all. I tried to include the line:
Subject: This is the subject !
in the body of the message. It does only put the subject in the body of
the message and doesn't help much more. So, how can I give a SUBJECT to
the email ???
The next question is even easier. How can a script call an other script
or
www page with a function ? Like, suppose I got a HTML form that call
SCRIPT_1. SCRIPT_1 loads, do a little something (let's suppose it write
a
file) and then it must call an other script called SCRIPT_2. So, the
question is : how can I do that, so that when I use the HTML form, it
goes
from SCRIPT_1 --> SCRIPT_2 without me noticing it ???
Thanx for the help !! I my questions are not clear enough for you to
answer, write me so I can explain you better. Thank you !!!
Benjamin
--
Benjamin Berube
berube@odyssee.net
http://www.odyssee.net/~berube
------------------------------
Date: Sun, 16 Feb 1997 14:04:47 -0500
From: berube@odyssee.net (Neb)
Subject: Need help for 2 easy PERL questions, please
Message-Id: <MPG.d71245d895431b989686@news.microtec.net>
Hi there PERL programmers !
I need your help for 2 PERL questions. Maybe these questions will seem
really easy to answer for you, so help me answer them !
Here's the first question. Using a CGI-perl script based on the
"cgi-lib.pl", I want to send an email. I CAN send the email. Here's how
I
do it :
---code starts here---
$command="mail berube\@odyssee.net < $name_of_file";
system($command);
---code ends here---
[where "name_of_file" is the file that contains the body message for the
email]
When I do this, it sends a email to my email address no-problemo. The
problem is the following : the email doesn't have a "subject". So, when
I
check my mail, I receive an email with no subject. This ain't no good at
all. I tried to include the line:
Subject: This is the subject !
in the body of the message. It does only put the subject in the body of
the message and doesn't help much more. So, how can I give a SUBJECT to
the email ???
The next question is even easier. How can a script call an other script
or
www page with a function ? Like, suppose I got a HTML form that call
SCRIPT_1. SCRIPT_1 loads, do a little something (let's suppose it write
a
file) and then it must call an other script called SCRIPT_2. So, the
question is : how can I do that, so that when I use the HTML form, it
goes
from SCRIPT_1 --> SCRIPT_2 without me noticing it ???
Thanx for the help !! I my questions are not clear enough for you to
answer, write me so I can explain you better. Thank you !!!
Benjamin
--
Benjamin Berube
berube@odyssee.net
http://www.odyssee.net/~berube
------------------------------
Date: Sun, 16 Feb 1997 14:04:41 -0500
From: berube@odyssee.net (Neb)
Subject: Need help for 2 easy PERL questions, please
Message-Id: <MPG.d7124542b40aaac989685@news.microtec.net>
Hi there PERL programmers !
I need your help for 2 PERL questions. Maybe these questions will seem
really easy to answer for you, so help me answer them !
Here's the first question. Using a CGI-perl script based on the
"cgi-lib.pl", I want to send an email. I CAN send the email. Here's how
I
do it :
---code starts here---
$command="mail berube\@odyssee.net < $name_of_file";
system($command);
---code ends here---
[where "name_of_file" is the file that contains the body message for the
email]
When I do this, it sends a email to my email address no-problemo. The
problem is the following : the email doesn't have a "subject". So, when
I
check my mail, I receive an email with no subject. This ain't no good at
all. I tried to include the line:
Subject: This is the subject !
in the body of the message. It does only put the subject in the body of
the message and doesn't help much more. So, how can I give a SUBJECT to
the email ???
The next question is even easier. How can a script call an other script
or
www page with a function ? Like, suppose I got a HTML form that call
SCRIPT_1. SCRIPT_1 loads, do a little something (let's suppose it write
a
file) and then it must call an other script called SCRIPT_2. So, the
question is : how can I do that, so that when I use the HTML form, it
goes
from SCRIPT_1 --> SCRIPT_2 without me noticing it ???
Thanx for the help !! I my questions are not clear enough for you to
answer, write me so I can explain you better. Thank you !!!
Benjamin
--
Benjamin Berube
berube@odyssee.net
http://www.odyssee.net/~berube
------------------------------
Date: Sun, 16 Feb 1997 14:05:08 -0500
From: berube@odyssee.net (Neb)
Subject: Need help for 2 easy PERL questions, please
Message-Id: <MPG.d7124713b5d827698968a@news.microtec.net>
Hi there PERL programmers !
I need your help for 2 PERL questions. Maybe these questions will seem
really easy to answer for you, so help me answer them !
Here's the first question. Using a CGI-perl script based on the
"cgi-lib.pl", I want to send an email. I CAN send the email. Here's how
I
do it :
---code starts here---
$command="mail berube\@odyssee.net < $name_of_file";
system($command);
---code ends here---
[where "name_of_file" is the file that contains the body message for the
email]
When I do this, it sends a email to my email address no-problemo. The
problem is the following : the email doesn't have a "subject". So, when
I
check my mail, I receive an email with no subject. This ain't no good at
all. I tried to include the line:
Subject: This is the subject !
in the body of the message. It does only put the subject in the body of
the message and doesn't help much more. So, how can I give a SUBJECT to
the email ???
The next question is even easier. How can a script call an other script
or
www page with a function ? Like, suppose I got a HTML form that call
SCRIPT_1. SCRIPT_1 loads, do a little something (let's suppose it write
a
file) and then it must call an other script called SCRIPT_2. So, the
question is : how can I do that, so that when I use the HTML form, it
goes
from SCRIPT_1 --> SCRIPT_2 without me noticing it ???
Thanx for the help !! I my questions are not clear enough for you to
answer, write me so I can explain you better. Thank you !!!
Benjamin
--
Benjamin Berube
berube@odyssee.net
http://www.odyssee.net/~berube
------------------------------
Date: Sun, 16 Feb 1997 14:04:51 -0500
From: berube@odyssee.net (Neb)
Subject: Need help for 2 easy PERL questions, please
Message-Id: <MPG.d712462c61f9875989687@news.microtec.net>
Hi there PERL programmers !
I need your help for 2 PERL questions. Maybe these questions will seem
really easy to answer for you, so help me answer them !
Here's the first question. Using a CGI-perl script based on the
"cgi-lib.pl", I want to send an email. I CAN send the email. Here's how
I
do it :
---code starts here---
$command="mail berube\@odyssee.net < $name_of_file";
system($command);
---code ends here---
[where "name_of_file" is the file that contains the body message for the
email]
When I do this, it sends a email to my email address no-problemo. The
problem is the following : the email doesn't have a "subject". So, when
I
check my mail, I receive an email with no subject. This ain't no good at
all. I tried to include the line:
Subject: This is the subject !
in the body of the message. It does only put the subject in the body of
the message and doesn't help much more. So, how can I give a SUBJECT to
the email ???
The next question is even easier. How can a script call an other script
or
www page with a function ? Like, suppose I got a HTML form that call
SCRIPT_1. SCRIPT_1 loads, do a little something (let's suppose it write
a
file) and then it must call an other script called SCRIPT_2. So, the
question is : how can I do that, so that when I use the HTML form, it
goes
from SCRIPT_1 --> SCRIPT_2 without me noticing it ???
Thanx for the help !! I my questions are not clear enough for you to
answer, write me so I can explain you better. Thank you !!!
Benjamin
--
Benjamin Berube
berube@odyssee.net
http://www.odyssee.net/~berube
------------------------------
Date: Sun, 16 Feb 1997 14:05:03 -0500
From: berube@odyssee.net (Neb)
Subject: Need help for 2 easy PERL questions, please
Message-Id: <MPG.d71246d861a44f8989689@news.microtec.net>
Hi there PERL programmers !
I need your help for 2 PERL questions. Maybe these questions will seem
really easy to answer for you, so help me answer them !
Here's the first question. Using a CGI-perl script based on the
"cgi-lib.pl", I want to send an email. I CAN send the email. Here's how
I
do it :
---code starts here---
$command="mail berube\@odyssee.net < $name_of_file";
system($command);
---code ends here---
[where "name_of_file" is the file that contains the body message for the
email]
When I do this, it sends a email to my email address no-problemo. The
problem is the following : the email doesn't have a "subject". So, when
I
check my mail, I receive an email with no subject. This ain't no good at
all. I tried to include the line:
Subject: This is the subject !
in the body of the message. It does only put the subject in the body of
the message and doesn't help much more. So, how can I give a SUBJECT to
the email ???
The next question is even easier. How can a script call an other script
or
www page with a function ? Like, suppose I got a HTML form that call
SCRIPT_1. SCRIPT_1 loads, do a little something (let's suppose it write
a
file) and then it must call an other script called SCRIPT_2. So, the
question is : how can I do that, so that when I use the HTML form, it
goes
from SCRIPT_1 --> SCRIPT_2 without me noticing it ???
Thanx for the help !! I my questions are not clear enough for you to
answer, write me so I can explain you better. Thank you !!!
Benjamin
--
Benjamin Berube
berube@odyssee.net
http://www.odyssee.net/~berube
------------------------------
Date: Sun, 16 Feb 1997 14:04:57 -0500
From: berube@odyssee.net (Neb)
Subject: Need help for 2 easy PERL questions, please
Message-Id: <MPG.d712469c418cc8f989688@news.microtec.net>
Hi there PERL programmers !
I need your help for 2 PERL questions. Maybe these questions will seem
really easy to answer for you, so help me answer them !
Here's the first question. Using a CGI-perl script based on the
"cgi-lib.pl", I want to send an email. I CAN send the email. Here's how
I
do it :
---code starts here---
$command="mail berube\@odyssee.net < $name_of_file";
system($command);
---code ends here---
[where "name_of_file" is the file that contains the body message for the
email]
When I do this, it sends a email to my email address no-problemo. The
problem is the following : the email doesn't have a "subject". So, when
I
check my mail, I receive an email with no subject. This ain't no good at
all. I tried to include the line:
Subject: This is the subject !
in the body of the message. It does only put the subject in the body of
the message and doesn't help much more. So, how can I give a SUBJECT to
the email ???
The next question is even easier. How can a script call an other script
or
www page with a function ? Like, suppose I got a HTML form that call
SCRIPT_1. SCRIPT_1 loads, do a little something (let's suppose it write
a
file) and then it must call an other script called SCRIPT_2. So, the
question is : how can I do that, so that when I use the HTML form, it
goes
from SCRIPT_1 --> SCRIPT_2 without me noticing it ???
Thanx for the help !! I my questions are not clear enough for you to
answer, write me so I can explain you better. Thank you !!!
Benjamin
--
Benjamin Berube
berube@odyssee.net
http://www.odyssee.net/~berube
------------------------------
Date: Mon, 17 Feb 1997 08:55:54 GMT
From: kristoff.bonne@is.belgacom.be (Kristoff Bonne)
Subject: perl 5.001 and digital unix 4.0b
Message-Id: <5e965g$u4f@sugar.h.belgacom.be>
Greetings to all.
First of all, I am rather new to perl, so please no flames.
I am trying out a snmp-library (check out
'http://www.tf-ten.switch.ch/~simon/snmp/perl/') for perl 5.001 on a
DEC-box, running digital unix V4.0.
Now, the test-programs runs OK, but if I change the programs and
execute a SNMP-get twice, perl gives a 'core dumped'.
Now, I don't know, but getting a 'core' from a INTERPRETER don't look
very healthy to me.
MY QUESTION:
But, I asked around, and a collegue of mine told me he heared 'there
are some problems with perl-5 for alpha', but couldn't give me any
more info.
Can anybody tell me more?
Some technical info:
The dec-box is a DEC 3000 M3000LX-system.
The OS is Digital Unix V4.0 Rev. 386, firmware revision 6.4, PALcode
1.35.
The 'perl' is 5.001 as it came on the 'digital unix Freeware' CD-ROM
that came with the system.
Cheerio! Kr. Bonne.
--
Kristoff Bonne, Belgacom ISD/telanet Netwerk Planning en - Beheer
(C=BE;A=RTT;P=RTTIPC;S=Bonne;G=Kristoff) fax : +32 2 2025590
kristoff.bonne@is.belgacom.be Voice mail : +32 70 615492
**** #include <standard/disclaimer.h> ****
------------------------------
Date: Mon, 17 Feb 1997 11:14:02 GMT
From: kristoff.bonne@is.belgacom.be (Kristoff Bonne)
Subject: Re: perl 5.001 and digital unix 4.0b
Message-Id: <5e9e8c$2qo@sugar.h.belgacom.be>
Greetings,
kristoff.bonne@is.belgacom.be (Kristoff Bonne) wrote:
>I am trying out a snmp-library (check out
>'http://www.tf-ten.switch.ch/~simon/snmp/perl/') for perl 5.001 on a
>DEC-box, running digital unix V4.0.
>Now, the test-programs runs OK, but if I change the programs and
>execute a SNMP-get twice, perl gives a 'core dumped'.
...
>MY QUESTION:
>But, I asked around, and a collegue of mine told me he heared 'there
>are some problems with perl-5 for alpha', but couldn't give me any
>more info.
>Can anybody tell me more?
I still like to add this:
I've just tried the same thing on a linux-box (perl 5.001, on a redhat
linux 2.0.1), and I have no problems there!
Cheerio! Kr. Bonne.
--
Kristoff Bonne, Belgacom ISD/telanet Netwerk Planning en - Beheer
(C=BE;A=RTT;P=RTTIPC;S=Bonne;G=Kristoff) fax : +32 2 2025590
kristoff.bonne@is.belgacom.be Voice mail : +32 70 615492
**** #include <standard/disclaimer.h> ****
------------------------------
Date: Mon, 17 Feb 1997 12:45:19 +0100
From: Steinar Moen <stemo@powersim.no>
Subject: Re: Perl on Microsoft IIS, NT Server 4.0
Message-Id: <330844CF.780C@powersim.no>
Ben Mehling wrote:
> To invoke the .dll without having the "Save as..." dialog appear you
> need to help perl out. Make sure to print the appropriate headers:
>
> "HTTP/1.0 200 OK\nContent-type: text/html\n\n";
>
Thank you, Ben!
I have tried this, but still I'm getting the "Save as..." dialog.
The script http://www.powersim.no/cgi-bin/hello.pl has the following
content:
print "HTTP/1.0 200 OK\nContent-type: text/html\n\n"
print "<HTML>\n";
print "<HEAD>\n";
print "<TITLE>Hello World</TITLE>\n";
print "</HEAD>\n";
print "<BODY>\n";
print "<H4>Hello World</H4>\n";
print "<P>\n";
print "Your IP Address is $ENV{REMOTE_ADDR}.\n";
print "<P>";
print "<H5>Have a nice day</H5>\n";
print "</BODY>\n";
print "</HTML>\n";
Still it doesn't go directly to the browser. Do anybody see any reason
for this?
If I accept to download the file, it contains my IP-number, as the
script should display.
Kind regards, Steinar Moen
------------------------------
Date: 17 Feb 1997 10:06:55 GMT
From: "Nobody" <nobody@logica.com>
Subject: Perl5 for Windows 95
Message-Id: <01bc1cba$01c03600$e022ea9e@P01223.logica.co.uk>
I'm deperately trying to find a copy of perl5 for Windows 95 -
Can anyone hepl ?
Many Thanks
Mat
------------------------------
Date: 17 Feb 1997 08:09:08 GMT
From: hv@crypt.compulink.co.uk (Hugo van der Sanden)
Subject: Re: Pig Latin
Message-Id: <5e93n4$o0k@zinc.compulink.co.uk>
Greg Bacon (gbacon@cs.uah.edu) wrote:
:FWIW:
:
:oreo% cat test.pl
:#! /usr/bin/perl
:use Benchmark;
:timethese(100000,
: {
: 'regex' => '$_ = "exit\n"; $a = /^exit$/',
: 'cmp' => '$_ = "exit\n"; chomp; $a = $_ eq "exit"',
: 'index' => '$_ = "exit\n"; $a = (index $_, "exit" == 0)',
: 'substr' => '$_ = "exit\n"; $a = (substr($_, 0, 4) eq "exit")',
: }
:);
:oreo% test.pl
:Benchmark: timing 100000 iterations of cmp, index, regex, substr...
: cmp: 3 secs ( 2.89 usr 0.00 sys = 2.89 cpu)
: index: 3 secs ( 1.94 usr 0.00 sys = 1.94 cpu)
: regex: 3 secs ( 3.79 usr 0.00 sys = 3.79 cpu)
: substr: 4 secs ( 3.01 usr 0.00 sys = 3.01 cpu)
Interesting that you didn't consider avoiding the chomp on the 'cmp'
version; I get:
crypt % cat t0
#!/usr/bin/perl
use Benchmark;
timethese(100000, {
'regex' => '$_ = "exit\n"; $a = /^exit$/',
'cmp' => '$_ = "exit\n"; chomp; $a = $_ eq "exit"',
'cmp2' => '$_ = "exit\n"; $a = $_ eq "exit\n"',
'index' => '$_ = "exit\n"; $a = (index $_, "exit" == 0)',
'substr' => '$_ = "exit\n"; $a = (substr($_, 0, 4) eq "exit")',
});
timethese(100000, {
'regex' => '$_ = "xexit\n"; $a = /^exit$/',
'cmp' => '$_ = "xexit\n"; chomp; $a = $_ eq "exit"',
'cmp2' => '$_ = "xexit\n"; $a = $_ eq "exit\n"',
'index' => '$_ = "xexit\n"; $a = (index $_, "exit" == 0)',
'substr' => '$_ = "xexit\n"; $a = (substr($_, 0, 4) eq "exit")',
});
crypt % perl t0
Benchmark: timing 100000 iterations of cmp, cmp2, index, regex, substr...
cmp: 4 secs ( 3.69 usr 0.00 sys = 3.69 cpu)
cmp2: 2 secs ( 2.73 usr 0.00 sys = 2.73 cpu)
index: 4 secs ( 2.75 usr 0.00 sys = 2.75 cpu)
regex: 8 secs ( 7.50 usr 0.00 sys = 7.50 cpu)
substr: 3 secs ( 3.65 usr 0.00 sys = 3.65 cpu)
Benchmark: timing 100000 iterations of cmp, cmp2, index, regex, substr...
cmp: 4 secs ( 3.55 usr 0.00 sys = 3.55 cpu)
cmp2: 3 secs ( 2.48 usr 0.00 sys = 2.48 cpu)
index: 5 secs ( 3.03 usr 0.00 sys = 3.03 cpu)
regex: 4 secs ( 2.73 usr 0.00 sys = 2.73 cpu)
substr: 4 secs ( 3.74 usr 0.00 sys = 3.74 cpu)
crypt %
Hugo van der Sanden
------------------------------
Date: Mon, 17 Feb 1997 10:53:09 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: Pig Latin
Message-Id: <adelton.856176789@aisa.fi.muni.cz>
> Hi!
> I've just finished writing a very useful PERL program. It takes
> whatever the user types in and converts it to Pig Latin. I've tried
> setting it up so that if someone types in exit, then the program will
> quit. Unfortunately, all it does is print exitay. What's wrong? Here's
> the code I used.
> #!perl
> LOOP: while (<>) {
> s/\b([^aeiouy]*)(\S+)\s?/$2$1ay /gi;
> print "$_ \n" ;
> goto LOOP;
> }
> if (<> =="exit") {
> die
> }
I am not sure what you want the program to do but better version would be
> #!perl
> LOOP: while (<>) {
> last if ($_ eq "exit\n");
> s/\b([^aeiouy]*)(\S+)\s?/$2$1ay /gi;
> print "$_ \n" ;
> }
This at least finishes at "exit".
Hope this helps.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: 16 Feb 1997 23:12:41 -0800
From: Russ Allbery <rra@cs.stanford.edu>
Subject: Re: Regexp to do minimal email validation
Message-Id: <qumn2t3dhxy.fsf@cyclone.stanford.edu>
Tom Christiansen <tchrist@mox.perl.com> writes:
> Really? This was the best I (with jfriedl help) could come up with :-)
> #!/usr/bin/perl
> #
> # addrcheck - mail address checker
> # by tchrist@perl.com
> # Copyright 1997 Tom Christiansen
> # version 1.001 Fri Feb 14 15:20:02 MST 1997
Tom knows this, I'm sure, but this script will reject valid addresses.
For example, "Russ Allbery"@eyrie.org is a perfectly valid address which
ends up in my mailbox.
--
Russ Allbery (rra@cs.stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Jan 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.
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 V7 Issue 962
*************************************