[18537] in Perl-Users-Digest
Perl-Users Digest, Issue: 705 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 18 18:16:33 2001
Date: Wed, 18 Apr 2001 15:15:31 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <987632130-v10-i705@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 18 Apr 2001 Volume: 10 Number: 705
Today's topics:
Re: $& <dan@nospam_dtbakerprojects.com>
Re: $1, $2, $3 can be lvalues <bart.lateur@skynet.be>
Re: 'Use'ing shared objects <jeff_nokes@yahoo.com>
basic regex (J.C.Posey)
Re: basic regex (J.C.Posey)
Re: basic regex <wyzelli@yahoo.com>
Re: basic TRUE / FALSE (Andre Malo)
Re: basic TRUE / FALSE <ren@tivoli.com>
Re: Beta Testers/Perl Hackers <ebneter@ix.netcom.com>
Re: Blocking socket I/O nobull@mail.com
Can't open file, dies (Jim Kroger)
Re: Can't open file, dies <uri@sysarch.com>
Re: CGI Timing Question <flavell@mail.cern.ch>
CGI/Perl/Apache <sredon@home.com>
Re: CGI/Perl/Apache <flavell@mail.cern.ch>
Re: complaint about moderation of this group (Harri Haataja)
Cookie/Hash help needed <bcoon@sequenom.com>
Document Format [not explicitly perl related] <grichards@endertechnology.com>
Re: Document Format [not explicitly perl related] <ronald.fischer.gp@icn.siemens.de>
Re: Document Format [not explicitly perl related] <ron@savage.net.au>
Re: Document Format [not explicitly perl related] <bart.lateur@skynet.be>
Re: Duplicate Emails <bart.lateur@skynet.be>
errors <todd@designsouth.net>
Re: Exec format error (Christian Kruse)
expected result with locking issue? <dan@nospam_dtbakerprojects.com>
Re: expected result with locking issue? (Abigail)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 18 Apr 2001 04:17:37 GMT
From: Dan Baker <dan@nospam_dtbakerprojects.com>
Subject: Re: $&
Message-Id: <3ADD141D.847F91FA@nospam_dtbakerprojects.com>
Brian Leung wrote:
>
> Hi,
> What is the meaning of $& in perl script?
-------------
try looking in the core docs in the perlvar section of your
documentation. There are a bunch of "special" variables that are
documented there.
D
------------------------------
Date: Wed, 18 Apr 2001 09:41:19 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: $1, $2, $3 can be lvalues
Message-Id: <93oqdt449tgqcf7bolfho4edk7b6idosvl@4ax.com>
John Lin wrote:
>Seeing this in document perlvar:
>
>$1 is the same as substr($var, $-[1], $+[1] - $-[1])
>$2 is the same as substr($var, $-[2], $+[2] - $-[2])
>$3 is the same as substr($var, $-[3], $+[3] - $-[3])
>
>The first thing that came into my mind was,
>why won't Perl break the limit that $1 $2 $3 must be read-only?
>
>substr can be lvalue, so can $1 $2 $3 be lvalues, IMHO.
Part of the problem is that as soon as you change the length of part of
the string, the offsets for the other values are no longer correct.
$\ = "\n";
$_ = "good";
print substr($_, 1, 3);
substr($_,0,1) = 'GGG';
print substr($_, 1, 3);
Or: if you change the length of $1, there's no garantee that the values
of $2 etc. would still be what one wants them to be.
If you must modify $1, then feel free to use the substr() mechanism, but
then, the responsibility is all yours.
I doubt if you can still continue as if nothing happened in a m//g loop.
--
Bart.
------------------------------
Date: Wed, 18 Apr 2001 11:26:37 -0700
From: "Jeffry A. Nokes" <jeff_nokes@yahoo.com>
Subject: Re: 'Use'ing shared objects
Message-Id: <3ADDDC5D.C4E0C8D@yahoo.com>
Malte Ubl wrote:
>
> Robert Jones schrieb:
> >
> > I'm trying to make use of the perlcc 'compiler' to create shared
> > objects and the 'use' them in wrapper scripts in order to cut down on
> > interpretation time but I can't get it to work and the FAQs don't
> > help.
> >
> > Does anyone know how to use a shared object file within a script?
> > Which module(s) do I need to read them in?
>
> As I read the FAQ you wont't neccessarily get improved performance from this.
> I suggest you use XS or Inline to use external C libraries if you want speed.
>
> ->malte
Actually,
I was going to post a similar question just now. I'm not as concerned
with performance as I am with design. I know how to create shared
object libraries in a Windows environment (.DLL) and call functions from
them via Perl. I also know that using perlcc on *.pm files can create
shared object (.so) libraries in a UNIX environment.
My question is how do I call a function from a .so file in UNIX via a
Perl script?
I've read all the FAQs and PerlDocs and I can't figure it out either.
Thanks in advance for any help.
- Jeff
------------------------------
Date: 18 Apr 2001 11:48:55 +0100
From: jcp@myrtle.ukc.ac.uk (J.C.Posey)
Subject: basic regex
Message-Id: <jkoeluqbi08.fsf@myrtle.ukc.ac.uk>
I'm sure this is trivial, but regex wreck my head...
I simply want to match an hour from a field in a log file. The match should
be between 09 - 16. Obviously, time is in 24 hours.
I thought it would be as simple as:
$hour =~ /[0,1][0-6,9]/ #but still matches out of bounds, i.e. hour 19, 01
Any help on this would be appreciated.
Jake
------------------------------
Date: 18 Apr 2001 12:04:01 +0100
From: jcp@myrtle.ukc.ac.uk (J.C.Posey)
Subject: Re: basic regex
Message-Id: <jkobspubhb2.fsf@myrtle.ukc.ac.uk>
jcp@myrtle.ukc.ac.uk (J.C.Posey) writes:
> I'm sure this is trivial, but regex wreck my head...
>
> I thought it would be as simple as:
>
> $hour =~ /[0,1][0-6,9]/ #but still matches out of bounds, i.e. hour 19, 01
>
Never follow up your own post! :) I ignored the obvious:
$hour =~/09|10|11|12|13|14|15|16/
Obviously this works, but would be interested in "better" more interesting
regex answers.
Cheers,
Jake
------------------------------
Date: Wed, 18 Apr 2001 23:23:51 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: basic regex
Message-Id: <eYgD6.4$mg4.1528@vic.nntp.telstra.net>
"J.C.Posey" <jcp@myrtle.ukc.ac.uk> wrote in message
news:jkoeluqbi08.fsf@myrtle.ukc.ac.uk...
> I'm sure this is trivial, but regex wreck my head...
>
> I simply want to match an hour from a field in a log file. The match
should
> be between 09 - 16. Obviously, time is in 24 hours.
>
> I thought it would be as simple as:
>
> $hour =~ /[0,1][0-6,9]/ #but still matches out of bounds, i.e. hour 19, 01
>
$hour =~ /^09|1[0-6]$/;
Bill in the mail....
Wyzelli
--
#Modified from the original by Jim Menard
for(reverse(1..100)){$s=($_==1)? '':'s';print"$_ bottle$s of beer on the
wall,\n";
print"$_ bottle$s of beer,\nTake one down, pass it around,\n";
$_--;$s=($_==1)?'':'s';print"$_ bottle$s of beer on the
wall\n\n";}print'*burp*';
------------------------------
Date: 16 Apr 2001 20:12:57 GMT
From: ndparker@gmx.net (Andre Malo)
Subject: Re: basic TRUE / FALSE
Message-Id: <Xns9085E21DACFC1ndparker@news.o3media.de>
* Randal L. Schwartz wrote in <m1wv8kll84.fsf@halfdome.holdit.com>:
>Gah! What if subroutine_returning_boolean isn't playing your game,
>and simply returns 42 to indicate true, [...]
hehehe
sub do_you_know_the_answer () {ord q
[* It's just 42! *]
}
n.d.p.
--
die (eval q-qq[Just Another Perl Hacker
]
;-)
# n.d. parker, http://www.o3media.de/ #
------------------------------
Date: 16 Apr 2001 14:04:14 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: basic TRUE / FALSE
Message-Id: <m3d7ac6501.fsf@dhcp9-172.support.tivoli.com>
On Mon, 16 Apr 2001, rutterba@cisco.com wrote:
> Bareword "FALSE" not allowed while "strict subs" in use at
> /users/rutterba/bin/fn line 19.
> Bareword "TRUE" not allowed while "strict subs" in use at
> /users/rutterba/bin/fn line 20.
TRUE and FALSE are not special in Perl. There is Boolean context,
which is really just a special kind of scalar context. Here's a
relevant sections of perldata(1):
A scalar value is interpreted as TRUE in the Boolean sense
if it is not the null string or the number 0 (or its
string equivalent, "0"). The Boolean context is just a
special kind of scalar context where no conversion to a
string or a number is ever performed.
So, you can use 0 (or "0" or undef) for FALSE and 1 (or just about
anything else) for TRUE.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Tue, 17 Apr 2001 03:15:14 -0700
From: Kate Ebneter <ebneter@ix.netcom.com>
Subject: Re: Beta Testers/Perl Hackers
Message-Id: <3ADC17B2.A171A56F@ix.netcom.com>
Philip Newton wrote:
>
> On 14 Apr 2001 07:02:36 GMT, anotherway83@aol.com (The Mosquito
> ScriptKiddiot) wrote:
>
> > ms/mrs abigail <insert lastname here>
>
> Abigail has no lastname.
Abigail is one of my favorite posters here; I wrote a poem for her,
in fact:
Abigail, Abigail, my kind of girl,
You write the most intricate, elegant Perl.
Your JAPHs are of legend, your wit is divine:
Oh, Abigail, Abigail, won't you be mine?
I don't think it compiles under perl 5.6.0, though...
Kate Ebneter
Not yet a real Perl hacker
------------------------------
Date: 18 Apr 2001 18:08:36 +0100
From: nobull@mail.com
Subject: Re: Blocking socket I/O
Message-Id: <u9n19egmp7.fsf@wcl-l.bham.ac.uk>
Robert Fonda <rlf@proimages.net> writes:
> Ok, I'm trying to use read() from a socket. If there is no data on the
> socket the read completes with 0 bytes. I need the read to block.
Blocking is the default mode for sockets.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 18 Apr 2001 15:33:37 -0400
From: minorseventhSPAMBLOCK@earthlink.net (Jim Kroger)
Subject: Can't open file, dies
Message-Id: <minorseventhSPAMBLOCK-1804011533370001@tritone.csbmb.princeton.edu>
Hi, I have the following script that doesn't work unless I make the change
below:
#!/usr/sbin/perl
unlink("logfile");
open(LOG, ">>logfile") || die "can not create \n";
close(LOG);
open(LOG) || die "can not open \n"; <<<<<<<<<<<<<<<<<
print LOG "test\n";
close(LOG) || die "can not close \n";
When I run this file (called test), I get the following effor msg:
can not open
so I assume the problem is in opening the file at <<<<<<<<<<<<<<<.
However, if I change the command there to
open(LOG, ">>logfile") || can not open \n"; <<<<<<<<<<<<<<<< CHANGE
the script works as intended. So my question is, what is the use of a
handle if you have to assign it to a file each time? I'm using Learning
Perl, and I don't see a reference to or example of REopening a file which
has previously had a handle assigned. It seems logically like my script
above should work, but obviously I'm wrong. Must I always include the
actual filename along with the handle whenever I try to open a previously
defined output file?
Thanks in advance for any guidance,
Jim
------------------------------
Date: Wed, 18 Apr 2001 19:59:11 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Can't open file, dies
Message-Id: <x7u23mj7xs.fsf@home.sysarch.com>
>>>>> "JK" == Jim Kroger <minorseventhSPAMBLOCK@earthlink.net> writes:
JK> unlink("logfile");
unless you really don't care, always check unlink for failure
JK> open(LOG, ">>logfile") || die "can not create \n";
put in $! so you can see why it failed
JK> open(LOG) || die "can not open \n";
hmm, what FILE are you trying to open there?
read
perldoc -f open
perldoc opentut
and see.
also if you have put $! in the die message it might have clude you in too.
JK> open(LOG, ">>logfile") || can not open \n";
hmm, what is different about this open and the one that fails. i see a
major one, do you?
JK> the script works as intended. So my question is, what is the use of a
JK> handle if you have to assign it to a file each time? I'm using Learning
JK> Perl, and I don't see a reference to or example of REopening a file which
JK> has previously had a handle assigned. It seems logically like my script
JK> above should work, but obviously I'm wrong. Must I always include the
JK> actual filename along with the handle whenever I try to open a previously
JK> defined output file?
ahh, i see your problem, you don't understand file handles. they are not
associated with files unless they are opened. when you close it it loses
that association. and it never keeps track of the path to the file
because that information is suspect (on unix it can be moved, one of
several hard links, deleted, etc all AFTER the open occurs).
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info: http://www.sysarch.com/perl/OOP_class.html
------------------------------
Date: Mon, 16 Apr 2001 21:46:19 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: CGI Timing Question
Message-Id: <Pine.LNX.4.30.0104162109500.14756-100000@lxplus003.cern.ch>
On Mon, 16 Apr 2001, Rodion Serebryakov supplied more evidence
against upside-down full-quoters by blurting out:
> Look into "no parse header" scripts, which generate their own HTTP headers.
I'd say keep that possibility up your sleeve, only as a last resort.
But if you're using Apache (1.3.*), for example, then it won't do you
any good.
> It's very simple.
You seem to think so, but there are several issues on which your
answers are misleading and incomplete. OK, so it serves the original
poster right, for asking off-topic questions, but one still had
certain standards of accuracy. For Apache, this part of the issue is
also an FAQ:
http://httpd.apache.org/docs/misc/FAQ.html#nph-scripts
> Your script will generate a stream of HTML documents that will replace one
> another in the browser window,
No, it won't, not on the basis of what you've posted.
If you expected that to happen, you'd need to show the O.P how you
planned to achieve it (though preferably on the CGI authoring group,
where it can be reviewed by appropriate specialists).
However, the original poster mentioned databases, without mentioning
anything about the details. I can't help wondering whether a
significant part of their delay is spent in connecting to the database
server, for which there are recognised solutions.
------------------------------
Date: Wed, 18 Apr 2001 19:13:14 GMT
From: Steve <sredon@home.com>
Subject: CGI/Perl/Apache
Message-Id: <3ADE1001.E2B48C8B@home.com>
Greetings :
I'm new to perl and Apache, and I just finished setting up Apache
on an RH linux 6.1 box. For serving simple web pages, it works
fine. It also successfully runs both of the sample CGI scripts that
come with the installation, 'printenv' and 'test-cgi'. The Perl script,
if run from a terminal window, displays the following :
Content-type: text/html
<html>
Hello
</html>
If I run httpd -l, the list includes mod_cgi.c.
( I've read that there is a module called mod_perl, but I got the
impression that perl would work with Apache without this...
am I wrong ? )
When I try to run the Perl CGI script from a browser on a
remote machine, I get the following message :
-------- Begin Message -------------
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, root@develop.localdomain and
inform them of the time the error occurred, and
anything you might have done that may have caused the error.
More information about this error may be available in the server error
log.
Apache/1.3.9 Server at localhost.localdomain Port 80
-------- Begin Message -------------
Any assistance would be appreciated.
Cheers
Steve
------------------------------
Date: Wed, 18 Apr 2001 22:47:12 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: CGI/Perl/Apache
Message-Id: <Pine.LNX.4.30.0104182242400.4437-100000@lxplus003.cern.ch>
On Wed, 18 Apr 2001, Steve wrote:
> More information about this error may be available in the server error
> log.
...
> Any assistance would be appreciated.
You seem to have just supplied it!
What's more, the fact that you could ask the question with a straight
face rather suggests that you failed to read the FAQ. Usenet tends
to consider that as a discourtesy.
___
/
perldoc -q server error
=head1 Found in /usr/local/lib/perl5/5.00503/pod/perlfaq9.pod
=head2 My CGI script runs from the command line but not the browser.
(500 Server Error)
If you can demonstrate that you've read the following FAQs and that
your problem isn't something simple that can be easily answered,
you'll probably receive a courteous and useful reply to your question
if you post it on comp.infosystems.www.authoring.cgi
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[...]
\___
Good luck.
------------------------------
Date: Wed, 18 Apr 2001 11:32:30 GMT
From: harri@tolppa.kotisivupalvelu.fi (Harri Haataja)
Subject: Re: complaint about moderation of this group
Message-Id: <slrn9dquhk.v0a.harri@tolppa.kotisivupalvelu.fi>
Jonathan Stowe wrote:
>David J. Ritchie <ritchie@fnal.gov> wrote:
>>
>> Newbie's need to learn that it's not a help desk (as another
>> poster pointed out). It's not a place where they or someone
>> pays money so that they can get their question answered.
>
>But the majority of people who answer questions here *do pay* - for their
>internet account, their phone bills whatever ...
Not to mention the potential value of their time.
Be it ten seconds or few hours spent.
--
md5 sum: 07394dd242eb331be403826f2df92bbf
------------------------------
Date: Wed, 18 Apr 2001 11:30:38 -0700
From: Bryan Coon <bcoon@sequenom.com>
Subject: Cookie/Hash help needed
Message-Id: <3ADDDD4E.D6E280E5@sequenom.com>
I am having some trouble getting the proper values from CGI::Cookie by
hash...
I am setting the cookie like this:
$c = new CGI::Cookie(-name=>"cookiename", -value=>{-logname=>"login",
-pass=>"password"});
Which I am not sure is correct. My goal is simply to set a cookie with
the user login and password at login, and to get the values for logname
and pass from the cookie for verification later. I think this is very
very simple and commonly done, but I could not find anything in the
docs, usenet or faq that helped.
I can access the values by:
%cookie = fetch CGI::Cookie;
$cookie{cookiename}{value}[0];
But this also seems a bit strange, as the script tells me that my -value
is an array, rather than a hash. I can only access the elements by
number, and they are reversed (i.e. ...{value}[0] is password,
...{value}[1] is pass, etc.
Any ideas or suggestions?
Thanks,
Bryan
------------------------------
Date: Wed, 18 Apr 2001 09:47:37 GMT
From: "Gabriel Richards" <grichards@endertechnology.com>
Subject: Document Format [not explicitly perl related]
Message-Id: <ZodD6.173741$LO3.27723395@typhoon.we.rr.com>
Hi, please forgive the off topic post, but I find this community very
knowledgable and I don't know where to look for my answers.
I want to create a web based service that takes data users enter, feeds it
into a database, then creates for them a document formatted much like a
spreadsheet by merging this data into a template. The document has to be in
a popular format like PDF or xls or doc that can be easily printed. From the
little research I've done, it seems I would have to (using perl of course!)
create a PostScript file and merge the database data into that, then use
something like Adobe Distiller Server to create a PDF and then send that
back to the user. The problems are, I don't know PostScript (can be solved)
and Distiller Server's license says no Internet use!
Do you understand what I'm trying to do? Is there another way? Another
technology?
Gabe
--
Ender Technology
Website and Database Development for Small Business
http://www.endertechnology.com
310-835-8234
------------------------------
Date: Wed, 18 Apr 2001 12:10:40 +0200
From: Ronald Fischer <ronald.fischer.gp@icn.siemens.de>
Subject: Re: Document Format [not explicitly perl related]
Message-Id: <3ADD6820.5582A2D1@icn.siemens.de>
Gabriel Richards wrote:
> I want to create a web based service that takes data users enter, feeds it
> into a database, then creates for them a document formatted much like a
> spreadsheet by merging this data into a template. The document has to be in
> a popular format like PDF or xls or doc that can be easily printed. From the
> little research I've done, it seems I would have to (using perl of course!)
> create a PostScript file and merge the database data into that, then use
> something like Adobe Distiller Server to create a PDF and then send that
> back to the user. The problems are, I don't know PostScript (can be solved)
> and Distiller Server's license says no Internet use!
I wouldn't call XLS and DOC (which DOC) as "popular format", as it
requires special (non-free) software to view it and runs only on some
platforms.
Wouldn't it make sense to use HTML as document format? In this case, you
can find several Perl modules which help you doing what you want.
Ronald
--
Ronald Otto Valentin Fischer < rovf @ earthling . net >
http://profiles.yahoo.com/ronny_fischer/
http://fusshuhn.ourfamily.com/cppincomp.html
This is Unix land. In quiet nights you can hear Windows machines reboot.
------------------------------
Date: Wed, 18 Apr 2001 21:17:11 +1000
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: Document Format [not explicitly perl related]
Message-Id: <GSdD6.3958$EQ3.131714@ozemail.com.au>
Consider using the Perl-based answer to PDF. It's called SDF - Simple Document Format. Unfortunately I just checked it's home page,
and it's moved. Email them at http://www.mincom.com/index.asp and ask.
--
Cheers
Ron Savage
ron@savage.net.au
http://savage.net.au/index.html
------------------------------
Date: Wed, 18 Apr 2001 12:12:44 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Document Format [not explicitly perl related]
Message-Id: <of0rdtooisai5dd5g9o5ifa667d2fprhma@4ax.com>
Gabriel Richards wrote:
>I want to create a web based service that takes data users enter, feeds it
>into a database, then creates for them a document formatted much like a
>spreadsheet by merging this data into a template. The document has to be in
>a popular format like PDF or xls or doc that can be easily printed. From the
>little research I've done, it seems I would have to (using perl of course!)
>create a PostScript file and merge the database data into that, then use
>something like Adobe Distiller Server to create a PDF and then send that
>back to the user. The problems are, I don't know PostScript (can be solved)
>and Distiller Server's license says no Internet use!
There are other options.
A) Create PDF directly. There are some Perl modules that are supposed
to be very good at it, in particular Text::PDF::API. See CPAN
(<http://search.cpan.org>).
B) Create XLS directly, using Spreadsheet::WriteExcel (see CPAN)
C) Create RTF
D) HTML tables? Perhaps a bit crude. But with CSS, you can format a
HTML document rather finely.
--
Bart.
------------------------------
Date: Wed, 18 Apr 2001 10:06:51 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Duplicate Emails
Message-Id: <nloqdt0actjvkf6m56rmf3bq7du2k9465i@4ax.com>
Darnell Kelly wrote:
>is the FAQ at perl.com?
If you have Perl installed, it is on your harddisk, in 9 parts, called
perlfaq1 .. perlfaq9. If you have a Win32 perl, it is there both in
HTML and in pod format. The latter is good for use with the command line
utility perldoc, which can then best be used from within a text editor
that can capture a program's output into a window.
This will locate this particular entry:
perldoc -q duplicate
-->
Found in pod\perlfaq4.pod
How can I remove duplicate elements from a list or array?
Indeed, those FAQ's are (slightly outdated?) also on <www.perl.com>, at:
<http://www.perl.com/pub/v/faqs>. Perlfaq4 is under "data manipulation".
The header is slightly different there, too:
How can I extract just the unique elements of an array?
>what i have is a form with
>multiple checkboxes, right? basically, a person clicks any or all boxes,
>writes a text message, maybe cc: someone, press submit and the emails go
>forward. the @all_emails array you have can be substituted for @to which is
>my argument from
>
>my($to, $cc, $from, $subject, $message) = @ARGV; ,
>
>correct? or is this wrong...
Eh... no. That is not the standard way of getting data back from a form.
You should use a CGI library which can properly get the parameters, like
CGI, CGI::Query, CGI::Minimal, CGI::Lite, or even cgi-lib.pl. Look at
<http://search.cpan.org/search?mode=module&query=CGI> for an overview
for all things CGI: you can both look at the docs, and get modules if
you don't already have them. Personally, I like the old style idea of
loading a hash with the parameters, instead of the "param" method
commonly used with CGI.pm.
I can't even garantee that what you propose won't work. Often, @ARGV
will not be empty in a CGI script. But it most definitely isn't the
latest idea of passing parameters to CGI, so it's most definitely not a
*safe* way of doing it.
--
Bart.
------------------------------
Date: Wed, 18 Apr 2001 20:37:29 GMT
From: "Todd Smith" <todd@designsouth.net>
Subject: errors
Message-Id: <dWmD6.17865$ep.5244651@news1.rdc1.tn.home.com>
Where can I get the list of common Perl errors that's in the back of the
Blue Camel online?
------------------------------
Date: 18 Apr 2001 07:03:31 GMT
From: CK1@wwwtech.de (Christian Kruse)
Subject: Re: Exec format error
Message-Id: <Xns90875CB6DD4BCCK1wwwtechde@130.133.1.4>
Hi,
http://learn.to/quote
Lars <eaglelw@gmx.de> wrote in <9bhu94$is$5@surz18.uni-marburg.de>:
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: print: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>./mein.pl: =: command not found
>
>
>und das passiert, wenn ich das script direkt aufrufe.
>
>
>./mein.pl: line 46: syntax error near unexpected token `chop($datum)'
>./mein.pl: line 46: `$datum = `$date_pfad +"%A, %B %d, %Y at %T
>(%Z)"`; chop($datum);'
>
>fehlermeldug ist zwar etwas unklar, aber nicht das eigentliche problem!
Noe. Die Fehlermeldung ist klar. Du hast keine shebang-zeile angegeben.
#!/path/to/perl -w
in die _erste_ Zeile setzen...
Gruss,
Christian
------------------------------
Date: Wed, 18 Apr 2001 04:09:44 GMT
From: Dan Baker <dan@nospam_dtbakerprojects.com>
Subject: expected result with locking issue?
Message-Id: <3ADD1245.371147AB@nospam_dtbakerprojects.com>
I have a script which could *potentially* be fired up by more than one
user at once. The process takes about a second to run, and opens and
appends to a debug file during execution... just a simple trace in most
cases.
What I am wondering is what would be the EXPECTED result if a second
user fires up an instance on the process while another is executing?
would it crash the process, or just return an error from the open()? I'm
having trouble trying to figure out a way to actually test this
condition opening the same file in append mode from two different
processes.
The debug file is opened in append mode.
thanx,
Dan
------------------------------
Date: Wed, 18 Apr 2001 12:12:53 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: expected result with locking issue?
Message-Id: <slrn9dr165.6ee.abigail@tsathoggua.rlyeh.net>
David Efflandt (see-sig@from.invalid) wrote on MMDCCLXXXVII September
MCMXCIII in <URL:news:slrn9dq6fi.jc6.see-sig@typhoon.xnet.com>:
[] On Wed, 18 Apr 2001, Dan Baker <dan@nospam_dtbakerprojects.com> wrote:
[] > I have a script which could *potentially* be fired up by more than one
[] > user at once. The process takes about a second to run, and opens and
[] > appends to a debug file during execution... just a simple trace in most
[] > cases.
[] >
[] > What I am wondering is what would be the EXPECTED result if a second
[] > user fires up an instance on the process while another is executing?
[] > would it crash the process, or just return an error from the open()? I'm
[] > having trouble trying to figure out a way to actually test this
[] > condition opening the same file in append mode from two different
[] > processes.
[] >
[] > The debug file is opened in append mode.
[]
[] After the open, you would want to flock the filehandle (which should wait
[] for the first process to finish) then seek the end of the file before
[] writing, like the example in: perldoc -f flock
Not on most systems. It's a feature of opening in append mode.
See open(2).
Abigail
--
tie $" => A; $, = " "; $\ = "\n"; @a = ("") x 2; print map {"@a"} 1 .. 4;
sub A::TIESCALAR {bless \my $A => A} # Yet Another silly JAPH by Abigail
sub A::FETCH {@q = qw /Just Another Perl Hacker/ unless @q; shift @q}
------------------------------
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 705
**************************************