[12838] in Perl-Users-Digest
Perl-Users Digest, Issue: 248 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 25 02:07:21 1999
Date: Sat, 24 Jul 1999 23:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 24 Jul 1999 Volume: 9 Number: 248
Today's topics:
Re: Accessing a MS Access Database (Ying-Gu Yang)
Re: another mail question <NOSPAMebin111@yahoo.com>
Re: command line input (Michael Rubenstein)
Re: command line input (Jon Bell)
Re: command line input <bwalton@rochester.rr.com>
Re: FAQ 9.19: How do I send mail? <tchrist@mox.perl.com>
Finding duplicate elements in an array? (Anno Siegel)
Re: Finding duplicate elements in an array? (Larry Rosler)
Re: Geekspeak Programming Contest (Martin Gleeson)
Re: LWP won't compile into freestanding exe <bwalton@rochester.rr.com>
Outputting text as entered by user (Arul Singam)
Re: Outputting text as entered by user (Arul Singam)
Perl in webpages <webmaster@source.findhere.com>
Re: program runtime problem.. (Anno Siegel)
Re: Realsysytem and perl (Larry Rosler)
Re: Regex-ing (Anno Siegel)
Re: Regex-ing (Michael Rubenstein)
Replacing and Stripping HTML inlandpac@my-deja.com
Re: Scalar to Array Question <JFedor@datacom-css.com>
Search Perl Script <dspivey@electro-net.com>
streaming media/mime type <gilmore@speakeasyx.org>
template <nada818s@powerup.com.au>
Re: Waiting for system ?? (Anno Siegel)
Re: Where all of the quotes come from (was Re: Perl Co <tchrist@mox.perl.com>
Re: Which group is appropriate? (Abigail)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 25 Jul 1999 05:33:53 GMT
From: yyang1@mail.earthlink.net (Ying-Gu Yang)
Subject: Re: Accessing a MS Access Database
Message-Id: <379b9fb4.4110640@news.earthlink.net>
On Mon, 19 Jul 1999 04:02:02 GMT, Carfield Yim
<c8133594@comp.polyu.edu.hk> wrote:
>I am a newbie of using perl to control database,
>I wonder, can I control a access database (*.mdb) in unix?
>I don't need to use the *.mdb at unix, I can download to windows to use.
>But I hope that the user can change the content of a database at unix server.
>Using access in because the one will access database is only know access.
>Can any one help me?
>
>In article <37912699.18E915D3@ccrs.nrcanDOTgc.ca>,
> Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca> wrote:
>> How can access a .mdb from Perl?
>>
>> Thanks
>>
>> ..Tom
>>
>> -----------------------------------------------------------------------------------------
>> Tom Kralidis Geo-Spatial Technologist
>> Canada Centre for Remote Sensing Tel: (613) 947-1828
>> 588 Booth Street , Room 241 Fax: (613) 947-1408
>> Ottawa , Ontario K1A 0Y7
>> http://www.ccrs.nrcan.gc.ca
>> -----------------------------------------------------------------------------------------
>>
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Hi!
I have same problem. I hope to put Access database (.mdb) file on
Linux server and share the file with other users via SAMBA. My
question is how I can read/write Access database (.mdb) file on Linux
server. Please advise me. Thanks in advance!
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/ Ying-Gu Yang
_/ yyang1@mail.earthlink.net
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
------------------------------
Date: Sat, 24 Jul 1999 19:16:49 -0700
From: "e-bin" <NOSPAMebin111@yahoo.com>
Subject: Re: another mail question
Message-Id: <Zxum3.382$Iy.26119@typhoon-sf.snfc21.pbi.net>
Nevermind, I got the module I was looking for "Mail::Sendmail".
George
e-bin <NOSPAMebin111@yahoo.com> wrote in message
news:J_sm3.341$Iy.21635@typhoon-sf.snfc21.pbi.net...
> Thank you once again for the previous help regarding this question, now I
am
> stuck on the Mail::Mailer module. I have downloaded and followed the
> directions to install Mailtools 13 as stated in the directions. (Something
> like "perl makefile.pl dmake, dmake test, and then dmake install").
After
> that I went ahead and tried to test a sample script stated here:
>
> ---------------------------------------------------------------------
> use Mail::Mailer;
>
>
> $from_address="bob\@concentric.net";
> $to_address="jkuhnert\@pacbell.net";
> $subject="Just a TEST!!!";
>
> $mailer=Mail::Mailer->new();
> $mailer->open({ From => $from_address,
> To => $to_address,
> Subject => $subject,
> })
> or die "Can't open: $!\n";
> print $mailer $body;
> $mailer->close();
> ---------------------------------------------------------------------
>
> And at the DOS prompt I am getting the message: "No mailer type specified
> (and no default available)., thus cannot find executable program at
mail.pl
> line 8.
>
> The documentation specified that this might be a good alternative to using
> "sendmail", but from what the error status said, it almost sounds like it
> still wants some type of mail server.. Am I missing something here?
>
> Note: This is my first time installing, running, anything with modules as
of
> yet..
>
> George
>
>
------------------------------
Date: Sun, 25 Jul 1999 04:13:13 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: command line input
Message-Id: <379c8c2d.32075512@nntp.ix.netcom.com>
On Sat, 24 Jul 1999 22:51:21 -0400, "Ed Doyle"
<doyleed@sprynet.com> wrote:
>Hi,
>In DOS, I can write a batch file to take arguments on the command line and
>process them inside the batch file. For example I might have a file called
>hello.bat and it might have a line like type %1 and if I call this file from
>a dos window like this
>hello Ed
>I would expect it to type Ed
>
>Can I do a similar thing with Perl.
>
>More speciffically, from the command line I want to pass in the names of
>some input files and have them assigned to variables inside the perl
>program.
Look at the @ARGV array in perlvar.
You might do well to get a good perl tutorial. Learning Perl has
a good reputation (I have the first edition and it is good, but I
haven't used the second edition). There's also Learning Perl on
Win32 Systems which, I assume, will be better if you're learning
on Windows 95 (I've no experience with this book). Both are
published by O'Reilly.
------------------------------
Date: Sun, 25 Jul 1999 04:08:50 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: command line input
Message-Id: <FFErIq.2M2@presby.edu>
Ed Doyle <doyleed@sprynet.com> wrote:
>In DOS, I can write a batch file to take arguments on the command line and
>process them inside the batch file. For example I might have a file called
>hello.bat and it might have a line like type %1 and if I call this file from
>a dos window like this
>hello Ed
>I would expect it to type Ed
>
>Can I do a similar thing with Perl.
Yes. Command-line arguments are contained in the array @ARGV. Your
favorite Perl book or online reference should have more information about
this.
--
Jon Bell <jtbell@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA
------------------------------
Date: Sun, 25 Jul 1999 00:30:19 -0400
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: command line input
Message-Id: <379A92DB.DF5B6277@rochester.rr.com>
Ed Doyle wrote:
...
> More speciffically, from the command line I want to pass in the names of
> some input files and have them assigned to variables inside the perl
> program.
...
Ed, the arguments will appear in array @ARGV in the MAIN package of your Perl
program. See perlvar for documentation. Here is one way you can print them:
print "$_\n" for @ARGV;
------------------------------
Date: 24 Jul 1999 21:33:10 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: FAQ 9.19: How do I send mail?
Message-Id: <379a8576@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
mwang@tech.cicg.ml.com (Michael Wang) writes:
:If I want to send mail to more than one address, what is the
:"best" way? Use "Final Destination1 <you1\@otherhost>, Final
:Destination2 <you2\@otherhost>" or fork sendmail multiple times?
Depends on what effect you're seeking. Do you want the users
to know others received the mail? Do you want it only on the
sendmail invocation line, not internally? Do you want to bundle
duplicate destinations hosts? Do you just want to queue it, not
try to deliver it immediately?
--tom
--
The typewriting machine, when played with expression, is no more
annoying than the piano when played by a sister or near relation.
--Oscar Wilde
------------------------------
Date: 25 Jul 1999 04:51:19 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Finding duplicate elements in an array?
Message-Id: <7ne547$4np$1@lublin.zrz.tu-berlin.de>
Pfash1 <pfash1@aol.com> wrote in comp.lang.perl.misc:
>I have been struggling with a Perl issue that you might have some insight on:
>How do I check an array of undetermined size to see if there are duplicate
>elements contained in it? In other words:
>
>@arrayone = ('one', 'two', three', 'one')
>
>Let's say this array is initiated by a database search so I don't know the
>number of elements in the array or their location.
>I want to march thru this array and compare each element to every other one to
>find out if there are any duplicates (as is the case with element "one" in the
>example above).
Hmmm... If you want to do that, what's stopping you?
my @duplicates;
for ( my $i = 0; $i < @arrayone; $i++ ) {
my $element = $arrayone[ $i];
for ( my $k = 0; $k < $i; $k++ ) {
push @duplicates, $element if $element eq $arrayone[ $k];
}
}
Oh, you want the unique elements. Well, I'll leave that as an exercise.
Anno
PS: There may be more than one way to do it.
------------------------------
Date: Sat, 24 Jul 1999 22:21:38 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Finding duplicate elements in an array?
Message-Id: <MPG.12043eb7a9e9ce00989d44@nntp.hpl.hp.com>
In article <7ne547$4np$1@lublin.zrz.tu-berlin.de> on 25 Jul 1999
04:51:19 -0000, Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> says...
...
> my @duplicates;
> for ( my $i = 0; $i < @arrayone; $i++ ) {
> my $element = $arrayone[ $i];
> for ( my $k = 0; $k < $i; $k++ ) {
> push @duplicates, $element if $element eq $arrayone[ $k];
> }
> }
>
> Oh, you want the unique elements. Well, I'll leave that as an exercise.
>
> Anno
>
> PS: There may be more than one way to do it.
Yes, indeed there are. The FAQ shows several ways. They are all O(N).
Yours is O(N ** 2). Even the O(N * logN) solution posted today is
better.
Using nested linear searches to determine set membership is evil.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sun, 25 Jul 1999 14:21:56 +1000
From: gleeson@unimelb.edu.au (Martin Gleeson)
Subject: Re: Geekspeak Programming Contest
Message-Id: <gleeson-ya02408000R2507991421560001@news.unimelb.edu.au>
In article <379a31eb@cs.colorado.edu>, tchrist@mox.perl.com (Tom
Christiansen) wrote:
>A post I just read reminded me that I forgot to list
>
> separated = delimited
But don't forget:
separated = seperated
Cheers,
Marty.
--
Martin Gleeson
** Personal opinion only **
Imagine, if you will, a world without hypothetical situations...
------------------------------
Date: Sun, 25 Jul 1999 00:39:22 -0400
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: LWP won't compile into freestanding exe
Message-Id: <379A94FA.A2ADC86D@rochester.rr.com>
David Greer wrote:
> When I compile a script using ActiveCorp's PDK PerlApp script into a
> freestanding exe it compiles fine, but when run gives the following
> error:
>
> Can't locate LWP in @INC (@INC contains: . C:\TEMP\crunch) at (eval 1)
> line 109, <FILECHUNK> chunk 1.
>
> crunch is the name of the script and FILECHUNK is a file handle used
> within the script. LWP is used in the script. Anybody run into any
> thing of this sort?
...
David, offhand, it looks like @INC does not include the directory where
your LWP resides. You might try adding that directory to @INC and see if
it works them. Something like:
push @INC,'c:/full/path/to/directory/where/LWP/is/stored';
As to why your @INC isn't set right when compiled, I don't know.
------------------------------
Date: 25 Jul 1999 03:44:03 GMT
From: ansingam@chat.carleton.ca (Arul Singam)
Subject: Outputting text as entered by user
Message-Id: <7ne163$k5j$1@bertrand.ccs.carleton.ca>
I would like to output the text entered by a user in a form as entered
(as opposed to a single line). i.e i want the formatting to remain the
same as entered by the user, when i output it back to the user. But i
dont want to use <BR> after each line since it breaks html code. Please help.
Should i use a special seperator??
Thanks
Arul
------------------------------
Date: 25 Jul 1999 03:44:45 GMT
From: ansingam@chat.carleton.ca (Arul Singam)
Subject: Re: Outputting text as entered by user
Message-Id: <7ne17d$k5j$2@bertrand.ccs.carleton.ca>
Please email or post to newsgroup.
Arul Singam (ansingam@chat.carleton.ca) wrote:
> I would like to output the text entered by a user in a form as entered
> (as opposed to a single line). i.e i want the formatting to remain the
> same as entered by the user, when i output it back to the user. But i
> dont want to use <BR> after each line since it breaks html code. Please help.
> Should i use a special seperator??
> Thanks
> Arul
------------------------------
Date: Sun, 25 Jul 1999 01:46:35 -0400
From: Kevin Pickens <webmaster@source.findhere.com>
Subject: Perl in webpages
Message-Id: <379AA4BB.2796A81D@source.findhere.com>
I have a webpage that is generated by a perl script
(http://start.cgirealm.com/foundandlost/button.pl). The output from the
script is a full bore html document including a content header.
It includes an HTTP-EQUIV refresh going to the same script.
The problem comes when the script is activated by anything other than
the location bar (i.e. from a frameset -
http://members.xoom.com/thesourcerpg/ads.htm left side frame, or when it
refreshes). In that case, I get a message box saying:
You have started to download a file of type
application/x-perl
from Netscape.
Is there any way to get it to work properly (i.e. refresh or load in the
frame without the download message)?
Thanks in advance,
Kevin Pickens - webmaster@source.findhere.com
The Source - http://source.findhere.com
------------------------------
Date: 25 Jul 1999 05:12:13 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: program runtime problem..
Message-Id: <7ne6bd$4pv$1@lublin.zrz.tu-berlin.de>
cho man fai <mfcho7@ie.cuhk.edu.hk> wrote in comp.lang.perl.misc:
>Dear all,
>
>I recently write a program to tail -f the sendmail log file. I assume
>the program can be started and run forever to find out any spammer if
>they send emails with a number of mails within a period of time. The
>program, however, works only for around the first day only but not
>afterwards.
I doubt that's a good way to detect spammers. They're very good
at "elegant variation" of their purported From-addresses. But
that's beside the point.
>I suspect it is owing to the associative arrays growing and excced the
>limit (memory? or what?) to hold the sender and relay address. Is there
>any limit for that in perl? The array grows in the program and it is
>unavoidable. I did try to clear the array periodically, say every hour,
>but failed. May you tell me the way to clear the assiciative array or
>any workarounds you may think of?
Generally speaking, you'd undef %assoc_array. Since you don't show
any code it's hard to say if that would free the memory or not.
But wouldn't that defeat your purpose anyway? You may want to
tie() the array to one of the available databases. That way
you will ultimately run out of disk space, which will take a little
longer.
Anno
------------------------------
Date: Sat, 24 Jul 1999 20:05:49 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Realsysytem and perl
Message-Id: <MPG.12041ee57a7283dc989d43@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <379A7A34.AEA258C2@bon.net> on Sat, 24 Jul 1999 22:45:10 -
0400, Joe Frey <jfrey@bon.net> says...
> Guys and Gals, I'm running a realserver on an NT machine. Hence, I want
> to use perl on the NT machine to poll a directory for a file's creation
> date down to the second. If the creation date has changed, I want to run
> an application with this file. Is this possible? TIA. Joe Frey.
Yes. You're welcome. Now try coding something.
PS: The creation date changes only if the file is deleted and
recreated. Is that what you mean, or do you mean the modification date?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 25 Jul 1999 04:21:09 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Regex-ing
Message-Id: <7ne3bl$4ll$1@lublin.zrz.tu-berlin.de>
Larry Rosler <lr@hpl.hp.com> wrote in comp.lang.perl.misc:
>In article <3799e195.90571765@nntp.ix.netcom.com> on Sat, 24 Jul 1999
>15:56:24 GMT, Michael Rubenstein <miker3@ix.netcom.com> says...
>> return print reverse sort num values %array;
>> return print(reverse(sort num (values(%array))));
>
>Yuck. Yes, I know that this is an unattributed quote from Holy Writ,
>but that doesn't require me to buy into it. The unparenthesized
>statement is totally clear and unambiguous (though why one would choose
>to return 1 is debatable :-).
Because the select()ed filehandle might be closed?
Anno
------------------------------
Date: Sun, 25 Jul 1999 04:59:23 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: Regex-ing
Message-Id: <379e9841.35167307@nntp.ix.netcom.com>
On Sat, 24 Jul 1999 09:57:22 -0700, lr@hpl.hp.com (Larry Rosler)
wrote:
>In article <3799e195.90571765@nntp.ix.netcom.com> on Sat, 24 Jul 1999
>15:56:24 GMT, Michael Rubenstein <miker3@ix.netcom.com> says...
>> On Fri, 23 Jul 1999 15:01:46 -0700, lr@hpl.hp.com (Larry Rosler)
>> wrote:
>> >In article <379bbe40.15991274@nntp.ix.netcom.com> on Fri, 23 Jul 1999
>> >19:20:56 GMT, Michael Rubenstein <miker3@ix.netcom.com> says...
>> >...
>> >> $news =~ s/(?:\r\n?)|(?:\n\r?)/delimiter/g;
>> > ^^^ ^ ^^^ ^
>> >
>> >I posted this earlier without all that noise. Alternation ('|') has the
>> >lowest precedence in a regex.
>>
>> Along the same lines, just because you CAN omit
>> parentheses in many places doesn't mean that you ought
>> to:
>>
>> return print reverse sort num values %array;
>> return print(reverse(sort num (values(%array))));
>
>Yuck. Yes, I know that this is an unattributed quote from Holy Writ,
>but that doesn't require me to buy into it. The unparenthesized
>statement is totally clear and unambiguous (though why one would choose
>to return 1 is debatable :-).
>
>> When in doubt, parenthesize. At the very least it will
>> let some poor schmuck bounce on the % key in vi.
>
>It is a question of relative fluency. Extra punctuation should convey
>extra semantics, not doubt.
>
>All of us grew up with elementary algebra, so someone who writes
>
> $x = (3 * $y) + $z;
>
>might rightly be viewed with some suspicion. But when the operators are
>more obscure -- such as '<<' '>>' '&' '|' -- the relative precedences
>are daunting. Parenthetization is desirable, even if not required.
>Doubt is acceptable, perhaps is even a social good.
>
>The very low precedence of '|' in a regex is not obscure.
>Parenthesizing around it conveys lack of fluency (i.e., doubt), not
>extra semantics.
I don't expect you to buy it just because of the source;
certainly don't agree with every piece of advice in the Perl
documentation. I cited it as a good statement of my view, not as
an authority.
I don't really care to argue this point. I recognize your
opinion on this as reasonable -- I just don't share it.
What I do object to is the assumption in your respone that the
parentheses are "noise." Others do have different views of what
is noise. You already posted your solution -- what is the point
in objecting to mine? There IS more than one way to do it.
------------------------------
Date: Sun, 25 Jul 1999 05:23:07 GMT
From: inlandpac@my-deja.com
Subject: Replacing and Stripping HTML
Message-Id: <7ne6vn$978$1@nnrp1.deja.com>
Here is what I am trying to do:
1. Open a file (which I know how to do)
2. Replace every occurance of </FONT> in that file with |
3. Strip remaining HTML from the file
4. Replace contents of file with new results.
Can anyone please help?
Everything I try does not work.
Thanks,
Chad.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Sun, 25 Jul 1999 00:40:09 -0400
From: "Jody Fedor" <JFedor@datacom-css.com>
Subject: Re: Scalar to Array Question
Message-Id: <7ne2gr$ah4$1@plonk.apk.net>
Abigail wrote in message ...
>Jody Fedor (JFedor@datacom-css.com) wrote on MMCLIII September MCMXCIII
>in <URL:news:7nd9vl$qd4$1@plonk.apk.net>:
>!! Don't know where to look for information:
>!!
>!! I have a Scalar variable called $items.
>!!
>!! $items contains:
>!!
>!! 1090:2.5" 1.2GB Hard Drive:1:129.00 \n <--- Carriage return or newline
>!! 1250:blah blah:5:5.50 \n
>!!
>!! I'd like to turn this into an array so I can process the file using
foreach.
>
>
>Turn into an array... There are gazillions of ways to make an array.
>
>Some ways:
>
> @array = ($item);
> @array = split // => $item;
> @array = $item =~ /(\S+)/gs;
Thanks Abigail, I like them all. To be saved for future ref! :-)
Jody
------------------------------
Date: Sat, 24 Jul 1999 23:13:38 -0400
From: "DS" <dspivey@electro-net.com>
Subject: Search Perl Script
Message-Id: <379a8087.0@news.hcs.net>
I have searched for days to find a Perl script that will do searches
throughout my website. I am running on a NT Platform and every script I
find is UNIX only and no one seems to know where to find one at. This is
the last ditch effort, so any help would be GREATLY appreciated.
Thanks,
David Spivey
dspivey@rossbyweather.com
------------------------------
Date: Sat, 24 Jul 1999 20:04:22 -0700
From: g gilmore <gilmore@speakeasyx.org>
Subject: streaming media/mime type
Message-Id: <Pine.WNT.4.05.9907241956590.-162021@kingkong>
Hi,
I'm working with RealAudio files. I can write a script that generates
a ram file easy enough and the RA files stream but how do I tell the
player to download a file first and then play it locally?
--
remove x for reply
http://www.speakeasy.org/~gilmore
http://www.firstworldmusic.com
------------------------------
Date: Sun, 25 Jul 1999 13:33:25 +1000
From: "pringles" <nada818s@powerup.com.au>
Subject: template
Message-Id: <379a85ed@grissom>
Periodical
Publication with a distinctive title intended to appear in successive
numbers or parts at stated or regular intervals for an indefinite time.
==============================================================
Please take a look at www.jumbomall.com/kevin and click on template buttom.
This is my problem:
How do I get it display on my site:
I have problem with template:
This is the code in test0.pl under the cgi-bin directiory
sub template{
my ($filename, $fillings) = @_;
my $text;
local $/; #slup mode(undef)
local *F; #create local filehandle
open(F, "< ./filename.txt")||return;
$text = <F>; #read whole file
close(F); #ignore retval
#replace quoted words with value in %$fillings hash
$text =~s{%%(.*?)%%}
{exists($fillings->{$1})
?$fillings->{$1}
:""
}gsex;
return $text;
}
I have the filename.txt in the same directory
the is what I have inside
<!--simple.template for internal template() function -->
<HTML><HEAD><TITLE>Report for %%username%%</TITLE></HEAD>
<BODY><H1>report for %%username%%</H1>
%%username%% logged in %%count%% times, for a total of %%total%% minutes.
I complie the test0.pl with no error. How do I call this test0.pl from the
webpage?
this line in html <FORM action = "http://...gi-bin/kevin/test0.pl"> doesn't
work,
I don't want to do it in a html FORM method because my second webpage is
just for display.
How can I call the test0.pl form it?
nada818s
------------------------------
Date: 25 Jul 1999 04:07:47 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Waiting for system ??
Message-Id: <7ne2ij$4ko$1@lublin.zrz.tu-berlin.de>
Marco Ender <info@servicepool.de> wrote in comp.lang.perl.misc:
>Hy ,
>
>i have a small problem with a script, how can i force the script to wait
>until a system proggy has done his work commpletly.
Run-on sentence. Missing question mark. And you have a *big* problem
with your script.
system() does wait for the process. What makes you think it doesn't?
If the reason is that the output file doesn't seem to be there, see below.
Come to think of it, see below anyway.
>for (@filename){
> system wget $_ -0 filenamelocal.txt
This should be
system "wget $_ -0 filenamelocal.txt";
Don't use barewords. If you'd switched warnings on as recommended,
you'd have spotted this. If you'd used strict, it wouldn't even
have compiled, a good thing in this case. Well, actually your code
didn't compile anyway because you're missing a ";" at the end of
of the line. Are you're not showing us the code you actually use?
How do you suppose us to spot your errors?
Anyway, the file name the system command sees is "filenamelocaltxt",
not "filenamelocal.txt" as you probably believe. Look up the dot
operator to see why.
> ----------> here i need WAIT ontil wget is finished.
No, you don't.
> open (FILE, filelocal.txt)
The open isn't going to work because you have written to
"filenamelocaltxt" but try to read from "filelocaltxt". But
you'll never know because you are not checking open() for success.
Well, it doesn't compile either, because another ";" is missing. Use
open( FILE, "filenamelocal.txt") or
die "Can't read filenamelocal.txt: $!\n";
Better yet, put your filename in a variable to use whenever you
need the filename. That way you wouldn't be trying to read from
a file you didn't create in the first place.
> .....
> .....
> ....
> close (FILE)
Another ";" missing. You don't need to close a filehandle if you're
going to re-open it next thing. A single close() after the loop would
have been enough. But that may be a matter of style.
>system remove filelocal.txt;
More barewords. And why do you want to delete the file if you're
going to overwrite it anyway the next time through the loop? Again,
it would have been enough to remove it once after the loop, of course
using Perl's very own unlink() for the purpose, not a system call.
Also, why don't you indent that line like the others inside the loop?
>}
>
>
>Thx Marco
For nothing.
For those who have read the very recommendable
http://www.plover.com/~mjd/perl/Questions.html
this is an example of another type of badly posed question. The guy
*thinks* he knows what's going on and limits the answers to the
nonsensical "How can I make system() wait for the process to end?"
He goes on to post code that is so bug-ridden, you want latex gloves
to touch it. He hadn't got an answer on my feed and really doesn't
deserve one. If I hadn't just come back from reading the above
article about stupid questions, I'd have ignored it as well. However,
I thought I'd try to give a thorough answer and see how it goes.
Result:
It took ridiculously long, and the time is almost certainly wasted.
The poster's level of programming expertise is just too low to appreciate
it, judging from what he posted. Actually the use of $_ after
"for (@filename)" is about the only indication he at least partially
knows what he's doing. And I'm sure there are more bugs than I've
spotted.
Oh, and I pointed out the run-on sentence in the beginning for a
reason. These are a good indicator that what's following is likely
to be garbage, as are questions followed by a period. It's the
linguistic equivalent of missing semicolons in perl code, as it were.
Anno
------------------------------
Date: 24 Jul 1999 21:20:07 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Where all of the quotes come from (was Re: Perl Cookbook 2nd Ed. ?)
Message-Id: <379a8267@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
mwang@tech.cicg.ml.com (Michael Wang) writes:
:Where do all the quotes come from? Do not seem to come from BSD fortune.
Secret personal stash.
--tom
--
If at first you don't succeed, try reading the fucking manpage.
------------------------------
Date: 24 Jul 1999 22:46:16 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Which group is appropriate?
Message-Id: <slrn7pl230.465.abigail@alexandra.delanet.com>
Kevin Kinnell (kejoki@netdoor.com) wrote on MMCLIV September MCMXCIII in
<URL:news:379A7B23.237A5761@netdoor.com>:
** My server gets the following (english) Perl groups:
**
** alt.perl.sockets
** comp.lang.perl
** comp.lang.perl.announce
** comp.lang.perl.misc
** comp.lang.perl.modules
** comp.lang.perl.tk
** perl.porters-gw
**
** Out of these, only c.l.p and c.l.p.misc aren't specific.
**
** Recent posts make it seem that c.l.p will be a defunct group
** soon.
Soon? Soon? Would you call "about 4 years ago" soon?
** Is there a group where Perl novices--who don't have all of
** the faqs memorized and are just exploring how to get things
** done--should be posting so that they may figure things out
** together instead of pestering the experts and exposing them-
** selves to the inevitable ridicule that attends learning how
** to fit into a new culture?
No, there isn't. This is Usenet. Usenet is not the place to ask the same
questions over and over again. There's *why* the faqs have been written.
And think about it. Perl can be pretty complex at some times. You really
think that figuring out stuff with a bunch of newbies will give you
better or faster answers than reading the FAQ?
Noone in this group will ridicule you if you do your homework and ask
questions. They might ridicule you for not doing what you should have
been doing since highschool though.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 248
*************************************