[22311] in Perl-Users-Digest
Perl-Users Digest, Issue: 4532 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 10 18:16:51 2003
Date: Mon, 10 Feb 2003 15:16:27 -0800 (PST)
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, 10 Feb 2003 Volume: 10 Number: 4532
Today's topics:
Carriage Returns (ARG!) <oli@NOSPAMoliwoods.co.uk>
Re: Carriage Returns (ARG!) <mr@sandman.net>
Re: Carriage Returns (ARG!) <nobull@mail.com>
Re: Carriage Returns (ARG!) (Tad McClellan)
Re: Carriage Returns (ARG!) (David Efflandt)
Re: Carriage Returns (ARG!) <mgjv@tradingpost.com.au>
Re: Carriage Returns (ARG!) (David Efflandt)
Caution---Newbie FormMail Question <nobody@xyz.com>
Re: Caution---Newbie FormMail Question <mothra@nowhereatall.com>
Class Objects (P D Denize)
Re: Class Objects <steven.smolinski@sympatico.ca>
Re: Class Objects <mgjv@tradingpost.com.au>
Re: Controlling order of precedence <racsw@frontiernet.net>
Re: Crossposting (was: Fetchrow Question) <tassilo.parseval@post.rwth-aachen.de>
Re: Crossposting (was: Fetchrow Question) <mgarrish@rogers.com>
Data access with perl (Jack Cane)
Re: Data access with perl <s.patterson@freeuk.com>
DB2 Connect and DBD::DB2 (Wonderinguy)
Re: Decoding Newsgroup Messages with Attachments <control153@NOSPAMyahoo.com>
Re: Decoding Newsgroup Messages with Attachments <deke@shillelagh.org>
Re: different autoreply after submitting form <vanlare@zeelandnet.nl>
Re: different autoreply after submitting form (Jay Tilton)
do 'functions.pl': problems with cron jobs (Francesco Moi)
Re: do 'functions.pl': problems with cron jobs <abigail@abigail.nl>
Re: do 'functions.pl': problems with cron jobs (Tad McClellan)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 8 Feb 2003 11:23:45 +0000 (UTC)
From: "Oli" <oli@NOSPAMoliwoods.co.uk>
Subject: Carriage Returns (ARG!)
Message-Id: <b22pc0$2r5$1@sparta.btinternet.com>
Hi
Hope someone can help.
What I have is a textbox where a user enters data (their mailing address).
I need any "carriage returns" (i.e. the enter key) to be ignored and changed
to commas, anyone know how to do this?
Many thanks
Oli
------------------------------
Date: Sat, 08 Feb 2003 13:05:44 +0100
From: Sandman <mr@sandman.net>
Subject: Re: Carriage Returns (ARG!)
Message-Id: <mr-F9AA68.13054408022003@news.fu-berlin.de>
In article <b22pc0$2r5$1@sparta.btinternet.com>,
"Oli" <oli@NOSPAMoliwoods.co.uk> wrote:
> Hi
>
> Hope someone can help.
>
> What I have is a textbox where a user enters data (their mailing address).
> I need any "carriage returns" (i.e. the enter key) to be ignored and changed
> to commas, anyone know how to do this?
$input=~s/[\n\r]/,/gm;
--
Sandman[.net]
------------------------------
Date: 08 Feb 2003 12:12:32 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Carriage Returns (ARG!)
Message-Id: <u97kcbynrj.fsf@wcl-l.bham.ac.uk>
"Oli" <oli@NOSPAMoliwoods.co.uk> writes:
> What I have is a textbox where a user enters data (their mailing address).
> I need any "carriage returns" (i.e. the enter key) to be ignored and changed
> to commas, anyone know how to do this?
The Perl operators for searching and replacing bits of strings are
tr/// and s///.
They usually crop up fairly early in any tutorial on Perl.
I suspect that the source from which you are attempting to learn Perl
is not a very good one.
See FAQ or website for recommendations.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Sat, 8 Feb 2003 06:26:06 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Carriage Returns (ARG!)
Message-Id: <slrnb49tqu.jqs.tadmc@magna.augustmail.com>
Oli <oli@NOSPAMoliwoods.co.uk> wrote:
> I need any "carriage returns" (i.e. the enter key) to be ignored and changed
> to commas
$str =~ tr/\r/,/;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 8 Feb 2003 20:42:34 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Carriage Returns (ARG!)
Message-Id: <slrnb4aqtp.hla.efflandt@typhoon.xnet.com>
On Sat, 08 Feb 2003 13:05:44 +0100, Sandman <mr@sandman.net> wrote:
> In article <b22pc0$2r5$1@sparta.btinternet.com>,
> "Oli" <oli@NOSPAMoliwoods.co.uk> wrote:
>
>> Hi
>>
>> Hope someone can help.
>>
>> What I have is a textbox where a user enters data (their mailing address).
>> I need any "carriage returns" (i.e. the enter key) to be ignored and changed
>> to commas, anyone know how to do this?
>
> $input=~s/[\n\r]/,/gm;
That might be OS specific (\n or \r can vary). While the enter key (or
hard wrap) in a text area is typically carriage return, linefeed pair
(regardless of browser OS) it may be best to be on the safe side:
$input =~ s/(\015\012?|\012)/,/gm;
--
David Efflandt - All spam ignored http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
------------------------------
Date: Sun, 9 Feb 2003 08:48:44 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Carriage Returns (ARG!)
Message-Id: <slrnb4aups.hgu.mgjv@martien.heliotrope.home>
On Sat, 8 Feb 2003 20:42:34 +0000 (UTC),
David Efflandt <efflandt@xnet.com> wrote:
> On Sat, 08 Feb 2003 13:05:44 +0100, Sandman <mr@sandman.net> wrote:
>> In article <b22pc0$2r5$1@sparta.btinternet.com>,
>> "Oli" <oli@NOSPAMoliwoods.co.uk> wrote:
>>
>>> Hi
>>>
>>> Hope someone can help.
>>>
>>> What I have is a textbox where a user enters data (their mailing address).
>>> I need any "carriage returns" (i.e. the enter key) to be ignored and changed
>>> to commas, anyone know how to do this?
>>
>> $input=~s/[\n\r]/,/gm;
>
> That might be OS specific (\n or \r can vary). While the enter key (or
> hard wrap) in a text area is typically carriage return, linefeed pair
> (regardless of browser OS) it may be best to be on the safe side:
>
> $input =~ s/(\015\012?|\012)/,/gm;
Are you sure about that? Note that nobody has even suggested that this
has anything to do with CGI or HTML text boxes. It could be a text box
in a Tk application, or a Curses-related application, or any other GUI
or TUI widget set. If any of those is true, then the enter key most
likely translates to either "\n" or "\r", depending on which set is in
use. It most likely does not translate to CRLF.
The OP really should provide sufficient information next time they post
a question. You are probably right in your assumption that it's
browser/HTTP/CGI related, but do state explicitly that you're making it.
Martien
--
|
Martien Verbruggen | Never hire a poor lawyer. Never buy from a
| rich salesperson.
|
------------------------------
Date: Sun, 9 Feb 2003 14:54:58 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Carriage Returns (ARG!)
Message-Id: <slrnb4cqu1.ag1.efflandt@typhoon.xnet.com>
On Sun, 9 Feb 2003, Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
> On Sat, 8 Feb 2003 20:42:34 +0000 (UTC),
> David Efflandt <efflandt@xnet.com> wrote:
>> On Sat, 08 Feb 2003 13:05:44 +0100, Sandman <mr@sandman.net> wrote:
>>> In article <b22pc0$2r5$1@sparta.btinternet.com>,
>>> "Oli" <oli@NOSPAMoliwoods.co.uk> wrote:
>>>
>>>> Hi
>>>>
>>>> Hope someone can help.
>>>>
>>>> What I have is a textbox where a user enters data (their mailing address).
>>>> I need any "carriage returns" (i.e. the enter key) to be ignored and changed
>>>> to commas, anyone know how to do this?
>>>
>>> $input=~s/[\n\r]/,/gm;
>>
>> That might be OS specific (\n or \r can vary). While the enter key (or
>> hard wrap) in a text area is typically carriage return, linefeed pair
>> (regardless of browser OS) it may be best to be on the safe side:
>>
>> $input =~ s/(\015\012?|\012)/,/gm;
>
> Are you sure about that? Note that nobody has even suggested that this
> has anything to do with CGI or HTML text boxes. It could be a text box
> in a Tk application, or a Curses-related application, or any other GUI
> or TUI widget set. If any of those is true, then the enter key most
> likely translates to either "\n" or "\r", depending on which set is in
> use. It most likely does not translate to CRLF.
>
> The OP really should provide sufficient information next time they post
> a question. You are probably right in your assumption that it's
> browser/HTTP/CGI related, but do state explicitly that you're making it.
Well I should have stated that my followup was in regards to textarea in a
web form, but also that my regex is on the safe side, so it should convert
any line ending CR, CR-LF, or LF (\015\012?|\012). However, the original
poster my also want to test the resulting end of text block to make sure
that there is a comma at the end (or not).
--
David Efflandt - All spam ignored http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
------------------------------
Date: Fri, 07 Feb 2003 21:02:54 GMT
From: "Len Stephan" <nobody@xyz.com>
Subject: Caution---Newbie FormMail Question
Message-Id: <2aV0a.21096$2H6.830@sccrnsc04>
Greetings,
Sorry if this is not the correct group to ask this question.
I am using the formmail.pl program on the server hosting my website. I have
not been able to use the multiple recipient feature. Only the first address
of two gets the form info. Is this a known issue with multiple recipients?
I am using the specified arrangement i.e. "name@xyz.com , name@abc.com"
Thanks,
Len Stephan
------------------------------
Date: Fri, 7 Feb 2003 13:48:48 -0800
From: "Mothra" <mothra@nowhereatall.com>
Subject: Re: Caution---Newbie FormMail Question
Message-Id: <3e442833$1@usenet.ugs.com>
"Len Stephan" <nobody@xyz.com> wrote in message
news:2aV0a.21096$2H6.830@sccrnsc04...
> Greetings,
>
> Sorry if this is not the correct group to ask this question.
>
> I am using the formmail.pl program on the server hosting my website
Don't use Matt's scripts
go here for a replacement
http://nms-cgi.sourceforge.net/
Mothra
------------------------------
Date: 9 Feb 2003 19:39:03 -0800
From: paul@buyonline.co.nz (P D Denize)
Subject: Class Objects
Message-Id: <e888d0c1.0302091939.b9d51fe@posting.google.com>
Below is a very basic version of a class.
Where I have difficulty is trying to write the objects out.
------
package Coord;
use Class::Struct qw(struct);
struct('Coord' => [ map { $_ => '$' } qw{ x y z }]);
sub coordinate {
return unless @_;
my $thing = Coord->new();
@$thing = @_;
return $thing;
}
$location = coordinate(2,3);
print "$location->x()\n"; # outputs "Coord=ARRAY(0x15d5404)->x()"
$x=$location->x();
print "$x\n"; # outputs "2" - works fine, but just looks ugly
------
I tried wrapping sections in {} but that just got me more confused.
Can anyone tell me how this should be done. *IS* there an elegant way?
Paul Denize
------------------------------
Date: Mon, 10 Feb 2003 04:34:37 GMT
From: Steven Smolinski <steven.smolinski@sympatico.ca>
Subject: Re: Class Objects
Message-Id: <xZF1a.29393$ns3.182377@news20.bellglobal.com>
P D Denize <paul@buyonline.co.nz> wrote:
> print "$location->x()\n"; # outputs "Coord=ARRAY(0x15d5404)->x()"
>
> $x=$location->x();
> print "$x\n"; # outputs "2" - works fine, but just looks ugly
>
> Can anyone tell me how this should be done. *IS* there an elegant way?
Double-quotes do not interpolate method calls. See the perlop manpage
for 5.8, under Quotes and Quote-like Operators:
For constructs that do interpolate, variables beginning with "$" or
"@" are interpolated. Subscripted variables such as $a[3] or
$href->{key}[0] are also interpolated, as are array and hash slices.
But method calls such as $obj->meth are not.
You know print() takes a list:
print $location->x(), "\n"; # no need for interpolation at all.
HTH.
Steve
--
Steven Smolinski => http://arbiter.ca/
GnuPG Public Key => http://arbiter.ca/steves_public_key.txt
=> or email me with 'auto-key' in the subject.
Key Fingerprint => 08C8 6481 3A7B 2A1C 7C26 A5FC 1A1B 66AB F637 495D
------------------------------
Date: Mon, 10 Feb 2003 04:39:34 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Class Objects
Message-Id: <slrnb4eb87.se5.mgjv@verbruggen.comdyn.com.au>
On 9 Feb 2003 19:39:03 -0800,
P D Denize <paul@buyonline.co.nz> wrote:
> Below is a very basic version of a class.
>
> Where I have difficulty is trying to write the objects out.
> package Coord;
> use Class::Struct qw(struct);
> struct('Coord' => [ map { $_ => '$' } qw{ x y z }]);
[snip code that instantiates $location as a Coord object]
> print "$location->x()\n"; # outputs "Coord=ARRAY(0x15d5404)->x()"
>
> $x=$location->x();
> print "$x\n"; # outputs "2" - works fine, but just looks ugly
> I tried wrapping sections in {} but that just got me more confused.
>
> Can anyone tell me how this should be done. *IS* there an elegant way?
Nope. Method/subroutine interpolation in strings is not handled
elegantly at the moment (I do believe that Perl 6 will be a bit better
at this). You can use:
print $location->x(), "\n";
print "Some other text: ", $location->x(), "\n";
or if you need scalar context:
print scalar $location->x(), "\n";
print "Some other text: ", scalar $location->x(), "\n";
or, using concatenation, which also forces scalar context:
print $location->x() . "\n";
print "Some other text: " . $location->x(), "\n";
or, with printf():
printf "%d\n", $location->x();
printf "Some other text: %d\n", $location->x();
or, (and now it gets uglier)
print "@{[ $location->x() ]}\n";
or other constructions with those blocks (described in the perlref
documentation).
Generally using the concatenation operator (.) or a list of arguments
to print (maybe with a scalar() here or there), or printf are the most
elegant ones. I tend to favour the printf solution, because it seems a
bit clearer to me, but that may simply be because of my C background.
The concatenation and printf (use sprintf instead) solutions also
allow you to easily put the result in a string instead of printing it.
Martien
--
|
Martien Verbruggen |
Trading Post Australia | Curiouser and curiouser, said Alice.
|
------------------------------
Date: Mon, 10 Feb 2003 09:17:29 -0500
From: Robert Krueger <racsw@frontiernet.net>
Subject: Re: Controlling order of precedence
Message-Id: <v4fd3r19pbrn0d@corp.supernews.com>
Martien Verbruggen wrote:
> On 6 Feb 2003 19:06:18 -0800,
> Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> wrote:
>> Robert Krueger (racsw@frontiernet.net) wrote:
>>: Hi,
>>: In C++, you can control the order of evaluation in calculations by
>>: enclosing particular calculations in (). Everything is then calculated
>>: from the innermost () to the outermost () so any question of the order
>>: of precedence can be eliminated.
>>
>>
>> $result = ($a+$b) + ($c+$d) ;
>>
>> Is $a+$b calculated before $c+$d ? Are you sure?
>
> I don't think the OP claimed it would be. They only mentioned the
> order for enclosing parens, and they only claimed it for C++, not for
> Perl.
>
> The OP claimed that in the above the two expressions in brackets would
> be calculated before the addition of the results of those two
> expressions [1].
>
> What perl currently does is:
>
> $ perl -MO=Terse,exec -e '$result = ($a+$b) + ($c+$d)'
> OP (0x80fc088) enter
> COP (0x8103018) nextstate
> SVOP (0x80f9308) gvsv GV (0x80ffeb4) *a
> SVOP (0x80f9328) gvsv GV (0x80ffe9c) *b
> BINOP (0x8102d50) add [1]
> SVOP (0x8102498) gvsv GV (0x80fff08) *c
> SVOP (0x8172c08) gvsv GV (0x80ffecc) *d
> BINOP (0x8102cb8) add [2]
> BINOP (0x80f9378) add [3]
> SVOP (0x8102d78) gvsv GV (0x80fff14) *result
> BINOP (0x80f92e0) sassign
> LISTOP (0x80fc038) leave [1]
> -e syntax OK
>
>
> So, yes, $a + $b (add [1]) is calculated before $c + $d (add[2]).
>
> If we ever get other implementations of Perl, I suspect that the
> language definition would have to be written to specify whether this
> is mandatory or optional behaviour. Until then, perl is the
> specification and is correct by default. :)
>
The reason for my qustion in the first place was because I received an
error when I tried to do this. Obviously, I typed something incorrectly,
as all of you are confirming that parens() work the same in perl as in C++.
Your explanation, Martien, was interesting, even though I didn't understand
the assembly-type code you included. I'm not sure whether the parens
controls the order somewhat or not, but out of technical nit-picking, would
this example force the execution of c&d before a&b?:
((a+b) + ((c+d)))
Actually, I think that's identical to: a+b + (c+d)
Thanks for you input, all.
Robert
------------------------------
Date: 7 Feb 2003 16:45:53 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: Crossposting (was: Fetchrow Question)
Message-Id: <b20ns1$1ll$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Helgi Briem:
> On Fri, 07 Feb 2003 15:26:50 GMT, "mgarrish"
><mgarrish@rogers.com> wrote:
[ imbecilities ]
> Go away now, Matt. This is getting very tedious.
This one is the persistent kind of troll that trolls more severely the
more he is fed. He wont go unless we start ignoring him.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Fri, 07 Feb 2003 23:34:25 GMT
From: "mgarrish" <mgarrish@rogers.com>
Subject: Re: Crossposting (was: Fetchrow Question)
Message-Id: <5oX0a.594629$F2h1.262989@news01.bloor.is.net.cable.rogers.com>
"Helgi Briem" <helgi@decode.is> wrote in message
news:3e43de04.16493806@news.cis.dfn.de...
> On Fri, 07 Feb 2003 15:26:50 GMT, "mgarrish"
>
> Go away now, Matt. This is getting very tedious.
>
Learn to qualify your statements. What is getting tedious for you? Being
reminded that you have nothing to say? Struggling to think of something to
post that isn't a cliche? If it is so tedious for you, you wouldn't be
reading at this point, would you? I could really care less for this thread,
but since you are so intent on trying to finish up with these moronic
postings, I'll just have to keep calling a spade a spade.
Matt
------------------------------
Date: 8 Feb 2003 10:23:59 -0800
From: jwcane@enw-ltd.com (Jack Cane)
Subject: Data access with perl
Message-Id: <3f29ccb2.0302081023.49fb6332@posting.google.com>
I have inherited some code that I am using to perform ODBC data
access. The following code gives me all fields in the select query. I
would like a snippet that shows me how I can access specific fields of
the database. I hope this extract is sufficient.
==========================
if ($Data->Sql($querystring))
{
print "SQL failed.\n";
print "Error: " . $Data->Error() . "\n";
$Data->Close();
exit;
}
while($Data->FetchRow())
{
%Data = $Data->DataHash();
@key_entries = keys(%Data);
print "<TR>";
foreach $key( keys( %Data ) )
{
# print "<TD BGCOLOR = #9999CC>$Data{$key}</TD>";
print "<TD>$Data{$key}</TD>";
}
print "</TR>";
$counter++;
}
------------------------------
Date: 8 Feb 2003 22:19:03 GMT
From: Stephen Patterson <s.patterson@freeuk.com>
Subject: Re: Data access with perl
Message-Id: <slrnb4b0im.42s.s.patterson@seagoon.localdomain>
On 8 Feb 2003 10:23:59 -0800, Jack Cane wrote:
> I have inherited some code that I am using to perform ODBC data
> access. The following code gives me all fields in the select query. I
> would like a snippet that shows me how I can access specific fields of
> the database. I hope this extract is sufficient.
I guess you're not using DBI then :(
> if ($Data->Sql($querystring))
Assuming $querystring contains the text of the SQL query, just adjust
the field list of the query.
--
Stephen Patterson http://www.lexx.uklinux.net http://patter.mine.nu
steve@SPAM.lexx.uklinux.net remove SPAM to reply
Linux Counter No: 142831 GPG Public key: 252B8B37
Last one down the pub's an MCSE
------------------------------
Date: 10 Feb 2003 13:33:45 -0800
From: wonderinguy@hotmail.com (Wonderinguy)
Subject: DB2 Connect and DBD::DB2
Message-Id: <6950e82.0302101333.6668881d@posting.google.com>
I have a db2 connect server (windows) installed which is used to
connect to db2 on OS/390.
I have db2 connect personal edition on a Redhat 8.0
A perl script using DBD::DB2 use the datasource in the redhat computer
to query db2 on os/390.
When I go directly from linux computer(installed with db2 connect PE)
it works, but when I route it thru the DB2 Connect EE on a windows
server, it gives me segmentation fault.
How ever if I do db2 connect to db2 OS/390 via the db2 connect EE it
works. Just the perl DBD:DB2 application gives segmentaion fault.
Any ideas...
Thanks
------------------------------
Date: Fri, 07 Feb 2003 17:16:01 GMT
From: ocd <control153@NOSPAMyahoo.com>
Subject: Re: Decoding Newsgroup Messages with Attachments
Message-Id: <Xns931B7D4E39B8Econtrol153NOSPAMyaho@167.206.3.3>
go to www.cpan.org and look for the module:
Convert::yEnc
it is very helpful .... email me if you have any questions ..
------------------------------
Date: Sat, 08 Feb 2003 03:25:04 GMT
From: "Deke" <deke@shillelagh.org>
Subject: Re: Decoding Newsgroup Messages with Attachments
Message-Id: <kM_0a.32092$yb.1737968@twister.austin.rr.com>
Thanks for the input. It basically confirms my impression thus far.
"Bernie Cosell" <bernie@fantasyfarm.com> wrote in message
news:119EA6F9099BDA09.2C68F1CA50BD26A8.CF48EA0AEB893A06@lp.airnews.net...
> "Deke" <deke@shillelagh.org> wrote:
>
> } The problem I'm running into is decoding messages with attachments.
I've
> } never really played much with newgroups (beyond simple posting), but
> } apparently files can either be attached using MIME format or by
uuencoding.
>
> Note that there is a third format that is becoming pretty popular:
> yenc'oding.
>
> } Questions:
> } 1) Any suggestions on how I can recognize messages with files attached
>
> MIME is relatively easy [at the least you can look for the 'boundary'
> header on the message]. For the other two, the ONLY key, AFAIK, is to
look
> at the first line of the message. If it is "begin ....." then the message
> is uuencoded anbd if the first line of the message is 'ybegn ..." then the
> message is yencoded.
>
> } 2) How do I decode these messages
>
> That's going to be a VERY hard problem and I recommend you not bother.
The
> problem is that for all three, files can be, and generally are, sent out
in
> multiple parts and the various parts need to be located and concatenated
> before you do any decoding. Doing this requires some heavy mojo-magic on
> the subject line, trying to guess whether some part of the subject line is
> a "part n out of M" cue, and if so you need to find *all* the other parts
> [and if even one is missing you can't decode the message]. Then you need
to
> download *all* the pieces, concatenate their bodies and THEN decode.
>
> simple answer: don't bother..:o)
>
> /Bernie\
>
> --
> Bernie Cosell Fantasy Farm Fibers
> bernie@fantasyfarm.com Pearisburg, VA
> --> Too many people, too few sheep <--
------------------------------
Date: Sat, 8 Feb 2003 23:32:17 +0100
From: "Marchal van Lare" <vanlare@zeelandnet.nl>
Subject: Re: different autoreply after submitting form
Message-Id: <3e458571$0$30068$fb624cd1@news1.zeelandnet.nl>
> [ Please do NOT send stealth Cc's.
>
I WON'T
> Please do not top-post and full-quote.
>
I will NOT do this EVER again!
> Please DO see the Posting Guidelines that are posted here frequently.
> ]
I have seen THEM
>
> Marchal van Lare <vanlare@zeelandnet.nl> wrote:
>
> > When someone submits a form, I want the output to be e-mailed to me,
> > while the submitter receives an automatic reply (with confirmation of
the
> > information being submitted, also by e-mail).
> >
> > Is it possible to let the CGI program send out a reply, depending
> > on what the submitter has chosen in the form?
>
>
> Yes.
Yes, you're right, it works, I have found the solution.
THANKS for your friendly reply. It has helped ALOT (NOT)
>
> --
> Tad McClellan SGML consulting
> tadmc@augustmail.com Perl programming
> Fort Worth, Texas
------------------------------
Date: Sun, 09 Feb 2003 00:22:54 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: different autoreply after submitting form
Message-Id: <3e459eab.237577083@news.erols.com>
"Marchal van Lare" <vanlare@zeelandnet.nl> wrote:
[snipped attribution restored:]
> tadmc@augustmail.com (Tad McClellan) wrote:
: > Please DO see the Posting Guidelines that are posted here frequently.
:
: I have seen THEM
But did you read them?
[...]
: >
: > --
: > Tad McClellan SGML consulting
: > tadmc@augustmail.com Perl programming
: > Fort Worth, Texas
Nicely quoted sig. My question is answered.
------------------------------
Date: 9 Feb 2003 10:07:43 -0800
From: francescomoi@europe.com (Francesco Moi)
Subject: do 'functions.pl': problems with cron jobs
Message-Id: <5b829932.0302091007.68a07276@posting.google.com>
Hello.
I'm working with RedHat Linux, and I set a cron job in order to be
executed each an hour:
0 * * * * /home/foo/www/cgi-bin/mycode.pl
'mycode.pl' creates a file by using some functions, so 'mycode.pl'
includes:
----
do 'functions.pl';
-----
I set execution permissions for both files and 'mycode.pl' works OK
when I execute it from my Internet browser's URL.
But after the time of the cron job (each hour o'clock) I don't find
any created file. 'mycode.pl' was executed, but not 'functions.pl'.
Am I doing something wrong?
Thank you very much in advance, and regards.
------------------------------
Date: 09 Feb 2003 18:44:41 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: do 'functions.pl': problems with cron jobs
Message-Id: <slrnb4d8cp.2c1.abigail@alexandra.abigail.nl>
Francesco Moi (francescomoi@europe.com) wrote on MMMCDXLIX September
MCMXCIII in <URL:news:5b829932.0302091007.68a07276@posting.google.com>:
~~ Hello.
~~
~~ I'm working with RedHat Linux, and I set a cron job in order to be
~~ executed each an hour:
~~
~~ 0 * * * * /home/foo/www/cgi-bin/mycode.pl
~~
~~ 'mycode.pl' creates a file by using some functions, so 'mycode.pl'
~~ includes:
~~
~~ ----
~~ do 'functions.pl';
~~ -----
~~
~~ I set execution permissions for both files and 'mycode.pl' works OK
~~ when I execute it from my Internet browser's URL.
~~
~~ But after the time of the cron job (each hour o'clock) I don't find
~~ any created file. 'mycode.pl' was executed, but not 'functions.pl'.
~~
~~ Am I doing something wrong?
Yes. For instance, you didn't check the return value of 'do', nor
did you inspect $! or $@. That, in combination with the manual page
about 'do' is likely to pinpoint what went wrong.
You should also realize that programs run from cron typically do not
have the same environment as programs run from the command line.
There's no shell involved that sets up a user defined environment.
Also, the working directory of a program run from cron is likely to
be different than when run from the command line.
Abigail
--
my $qr = qr/^.+?(;).+?\1|;Just another Perl Hacker;|;.+$/;
$qr =~ s/$qr//g;
print $qr, "\n";
------------------------------
Date: Sun, 9 Feb 2003 14:10:29 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: do 'functions.pl': problems with cron jobs
Message-Id: <slrnb4dddl.fm.tadmc@magna.augustmail.com>
Francesco Moi <francescomoi@europe.com> wrote:
>
> I'm working with RedHat Linux, and I set a cron job in order to be
> executed each an hour:
>
> 0 * * * * /home/foo/www/cgi-bin/mycode.pl
>
> 'mycode.pl' creates a file by using some functions, so 'mycode.pl'
> includes:
>
> ----
> do 'functions.pl';
> -----
>
> I set execution permissions for both files and 'mycode.pl' works OK
> when I execute it from my Internet browser's URL.
So your web server is probably setup so that mycode.pl's current
working directory (cwd) is /home/foo/www/cgi-bin/
(your browser does not matter. Browsers do not run CGI programs.
Web servers run CGI programs.
)
> But after the time of the cron job (each hour o'clock) I don't find
> any created file. 'mycode.pl' was executed,
How can you tell?
That is, what did you observe that leads you to conclude that
mycode.pl was executed?
> but not 'functions.pl'.
>
> Am I doing something wrong?
You must have, else it would be "working". :-)
You don't really have a Perl problem.
The environment for cron jobs on your system is likely the cause
of your problem. What cwd do your cron jobs get?
If you want the same program to work in multiple environments,
then you should not rely on any particular cwd being setup for you.
Set the cwd yourself within mycode.pl:
perldoc -f chdir
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 V10 Issue 4532
***************************************