[13927] in Perl-Users-Digest
No subject found in mail header
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 10 17:48:09 1999
Date: Mon, 8 Nov 1999 18:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942113111-v9-i1323@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 8 Nov 1999 Volume: 9 Number: 1323
Today's topics:
Re: @ISA (Eric Bohlman)
Binary FTP using Net::FTP package? <joneill@pgicompanies.com>
Debugging CGI under NT... (Matthew Miller)
Re: FAQ 4.55: How do I look up a hash element by value? lee.lindley@bigfoot.com
Re: FAQ 5.5: How can I manipulate fixed-record-length f <cassell@mail.cor.epa.gov>
Help with IF statements <kf4dmb@tds.net>
Re: Help with IF statements <vincent.murphy@cybertrust.gte.com>
Re: How can I set reg. expresion to anchor at the end o (Charles DeRykus)
Re: How do U parse from the end of the line? <cassell@mail.cor.epa.gov>
Re: how to call a CGI script (written in Perl) from HTM <emschwar@rmi.net>
Re: How to get a URL with timeout (Charles DeRykus)
I don't get this very simple regular expression!!! jubby@my-deja.com
Re: I don't get this very simple regular expression!!! <cassell@mail.cor.epa.gov>
Re: I don't get this very simple regular expression!!! <vincent.murphy@cybertrust.gte.com>
Re: I don't get this very simple regular expression!!! <jtolley@bellatlantic.net>
Re: localtime object y2k compliant? <wyzelli@yahoo.com>
Re: Need some tips with ImageMagick... (Martien Verbruggen)
Re: Need some tips with ImageMagick... (Kragen Sitaker)
perl and scroll in web pages. How? <luisdlr@yahoo.com>
Perl/Tk looping question. <joneill@pgicompanies.com>
Running a program in background. <joneill@pgicompanies.com>
Re: Running a program in background. <moseley@best.com>
Re: Running a program in background. <cassell@mail.cor.epa.gov>
Re: running dos command from perl (Kragen Sitaker)
Using Perl to fill in html fields <falong@hiwaay.net>
Re: Using Perl to fill in html fields <flavell@mail.cern.ch>
Re: Win32::Internet rvlong@my-deja.com
Re: Win32::Internet rvlong@my-deja.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 8 Nov 1999 23:29:16 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: @ISA
Message-Id: <807mcc$7ni$2@nntp5.atl.mindspring.net>
Uri Guttman (uri@sysarch.com) wrote:
: and then get and read object oriented perl. all you ever want to know
: about that subject. it has my highest rating on my perl books page.
And by an amazing coincidence, the November issue of Perlmonth
<URL:http://www.perlmonth.com> which just came out today just happens to
have a feature article by Damian covering (tada!) inheritance and
polymorphism in Perl objects.
------------------------------
Date: Tue, 09 Nov 1999 02:02:32 GMT
From: "joneill" <joneill@pgicompanies.com>
Subject: Binary FTP using Net::FTP package?
Message-Id: <YgLV3.6285$L5.69118@c01read02-admin.service.talkway.com>
I'm using the Net::FTP package to transfer files from an FTP site to my
Win32 machine. The line feeds in the original file get changed to
carriage return/line feeds in the downloaded file. It's important the I
don't change the contents of these files at all and I think the answer
is using binary transfer. I tried a couple of different things based on
the sparse documentation, but nothing worked. I think it's there ... I
just need a little guidance to the answer.
Jay O'Neill
PGI Companies
jo'neill@pgicompanies.com
--
Free audio & video emails, greeting cards and forums
Talkway - http://www.talkway.com - Talk more ways (sm)
------------------------------
Date: 9 Nov 1999 01:14:09 GMT
From: namille2@news.vt.edu (Matthew Miller)
Subject: Debugging CGI under NT...
Message-Id: <807sh1$pa7$2@solaris.cc.vt.edu>
Hello,
Me and a friend were debugging a CGI script under NT 4 and noticed some odd
behavior. The first thing is that while debugging the script we entered the
the name=value pairs for the CGI we couldn't get the script to continue. On
my linux box typing cntl-d ends the input of the name-value pairs and the
debugging session continues. We were using Activesite build 519. We couldn't
find any way to continue execution. We found no clues under perldoc CGI.
What is done at this point?
The second problem is it seems that under NT perl doesn't support command
line arguments. Regardless of the number of command line arguments #$ARGV
always equals -1! I wrote a test script and seen it for my self, I wouldn't
have thought it otherwise.
So whats going on? Other than doing this on NT? btw we got the debugging
done by telneting to my machine and doing the work
Thanks, Matthew
reply here, to email edit my address.
--
A prohibitionist is the sort of man one wouldn't care to drink with --
even if he drank. -- H.L. Mencken
------------------------------
Date: 9 Nov 1999 00:47:49 GMT
From: lee.lindley@bigfoot.com
Subject: Re: FAQ 4.55: How do I look up a hash element by value?
Message-Id: <807qvl$eq4$1@rguxd.viasystems.com>
Dan Wilga <dwilgaREMOVE@mtholyoke.edu> wrote:
:>In article <3825f94e@cs.colorado.edu>, perlfaq-suggestions@perl.com (Tom
:>and Gnat) wrote:
:>> How do I look up a hash element by value?
:>>
:>> Create a reverse hash:
:>>
:>> %by_value = reverse %by_key;
-----------------------( big lists created and here)
Unless there is a Perl optimization that I am not aware of, 2
large lists are created here -- one is fed to reverse and another
is returned by reverse for assignment to %by_value.
:>> $key = $by_value{$value};
:>>
:>> That's not particularly efficient. It would be more space-efficient
:>> to use:
:>>
:>> while (($key, $value) = each %by_key) {
:>> $by_value{$value} = $key;
:>> }
:>Why is the second method more space-efficient? Doesn't it require the same
:>amount of space (the original %by_key plus the final %by_value)? Or is it
:>that reverse creates a temporary hash before writing to %by_value? It's
:>not clear from perlfunc if this is the case.
list, not hash.
:>I don't doubt that you're right, I just want to understand why.
:>And would the second version be much slower?
Try it yourself. Try `perldoc Benchmark` for how to measure.
Use different hash sizes and expore it. If you really want to explore
the issue, use a really big hash that exceeds the amount of RAM
on your machine. :-)
But as a general rule of thumb creating large intermediate lists is
neither efficient nor fast, even when it all fits into memory.
--
// Lee.Lindley /// I used to think that being right was everything.
// @bigfoot.com /// Then I matured into the realization that getting
//////////////////// along was more important. Except on usenet.
------------------------------
Date: Mon, 08 Nov 1999 17:07:22 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
To: Tom and Gnat <perlfaq-suggestions@perl.com>
Subject: Re: FAQ 5.5: How can I manipulate fixed-record-length files?
Message-Id: <382773CA.85B9A321@mail.cor.epa.gov>
[emailed to perlfaq-suggestions also]
Tom Christiansen wrote:
[snip]
> How can I manipulate fixed-record-length files?
[snip]
> open(PS, "ps|");
> print scalar <PS>;
> while (<PS>) {
> ($pid, $tt, $stat, $time, $command) = unpack($PS_T, $_);
> for $var (qw!pid tt stat time command!) {
> print "$var: <$$var>\n";
^^^^^
ACK!! ------------------------>
[snip]
> We've used `$$var' in a way that forbidden by `use strict 'refs''.
> That is, we've promoted a string to a scalar variable reference
> using symbolic references. This is ok in small programs, but
> doesn't scale well. It also only works on global variables, not
> lexicals.
Isn't this A Bad Thing (tm) when we tell people that symrefs
are 'okay' in a small program? Aren't the people who will
do malignant things with symrefs writing *only* small programs
[relatively speaking, that is]? Wouldn't it be better to
remove the symref or replace it with less evil code?
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Tue, 09 Nov 1999 01:42:49 GMT
From: "jim and lois flaherty" <kf4dmb@tds.net>
Subject: Help with IF statements
Message-Id: <t_KV3.182$4D5.116994@ratbert.tds.net>
I have a form and the script e-mails the results to the proper person.
Everything works fine execpt
the IF statement I have .
$adpso = $formdata{'adpso'};
$code = $formdata{'dept'};
if($code eq "03") {
$adpso = "schmidt"
}
else
{
}
if($code eq "20") {
$adpso = "MR Lowe"
}
else
{
}
if($code eq "40") {
$adpso = "Paipe"
}
else
{
$adpso = "engelhardt"
}
No matter what the code on the form which is a drop Box . the script always
selects
engelhardt
Help !
thanks in advance
Jim
------------------------------
Date: Tue, 09 Nov 1999 02:01:05 GMT
From: Vincent Murphy <vincent.murphy@cybertrust.gte.com>
Subject: Re: Help with IF statements
Message-Id: <xjg7ljsjue7.fsf@gamora.ndhm.gtegsc.com>
>>>>> "jim" == jim and lois flaherty <kf4dmb@tds.net> writes:
jim> I have a form and the script e-mails the results to the proper person.
jim> Everything works fine execpt
jim> the IF statement I have .
jim> $adpso = $formdata{'adpso'};
jim> $code = $formdata{'dept'};
jim> if($code eq "03") {
jim> $adpso = "schmidt"
jim> }
jim> else
jim> {
jim> }
jim> if($code eq "20") {
jim> $adpso = "MR Lowe"
jim> }
jim> else
jim> {
jim> }
jim> if($code eq "40") {
jim> $adpso = "Paipe"
jim> }
jim> else
jim> {
jim> $adpso = "engelhardt"
jim> }
jim> No matter what the code on the form which is a drop Box . the script always
jim> selects
jim> engelhardt
Bet it gives "Paipe" when code is eq to 40. You're stating if it doesn't
equal 40 - then it has to be engelhardt.
HTH
------------------------------
Date: Mon, 8 Nov 1999 22:40:04 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: How can I set reg. expresion to anchor at the end of a string?
Message-Id: <FKwHMs.C6@news.boeing.com>
In article <slrn827a1v.dk.abigail@alexandra.delanet.com>,
Abigail <abigail@delanet.com> wrote:
>
>Well, had you used 'use strict', you would have noticed that /$regex/
>isn't quite working if you build the regex in $re....
>
Many pardons for the on-the-fly mangle. Also, I neglected
to use '/s' although this didn't appear to have a signficant
effect.
Probably a fairer benchmark would also include strings that
weren't multiples of 4 as Lee mentioned. Correcting these
oversights, I still consistently got better results for
the mono_re on both Solaris and HP-UX but only for silly size
strings.
Probably not worth more bandwidth but was an interesting
result.
--
Charles DeRykus
------------------------------
Date: Mon, 08 Nov 1999 17:11:14 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How do U parse from the end of the line?
Message-Id: <382774B2.D648A7B5@mail.cor.epa.gov>
mirranda@my-deja.com wrote:
[snip]
> My problem is this:
> On NT, I get this config file which I get with the whole path
> then I need to modify the extension and copy it to another directory.
I would suggest that you look at the File::Basename module,
which will do the parsing for you. And it is OS-independent
too. You can get the docs on it by typing at a command prompt:
perldoc File::Basename
The fileparse() function should do everything you need.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 08 Nov 1999 16:26:02 -0700
From: Eric The Read <emschwar@rmi.net>
Subject: Re: how to call a CGI script (written in Perl) from HTML code?
Message-Id: <xkf66zcefat.fsf@valdemar.col.hp.com>
"cuteman" <cuteman@sensewave.com> writes:
> Hmm... this might not be a Perl question, rather a CGI, but perhaps someone
> is willing to help? =)
>
>
> How do I call a CGI script (written in Perl) from HTML code?
Actually, it's not even that-- it's an HTML question. Why didn't you ask
in an HTML newsgroup? Go find one and ask there. Hint: the name will
contain the string '.html.', not '.perl.'.
-=Eric, maximizing punctuation for fun 'n' profit
--
"Cutting the space budget really restores my faith in humanity. It
eliminates dreams, goals, and ideals and lets us get straight to the
business of hate, debauchery, and self-annihilation."
-- Johnny Hart
------------------------------
Date: Mon, 8 Nov 1999 22:58:18 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: How to get a URL with timeout
Message-Id: <FKwIH6.1CJ@news.boeing.com>
In article <941966363.565104@ham.ihug.co.nz>,
Marcel Dinger <marcel@ihug.co.nz> wrote:
>I'm trying to get pages (complete text), and search for particular details from
> .....
>my $ua = new LWP::UserAgent;
>$ua->timeout(10);
>
Here's a snippet from Gisle that may help:
> seconds (on win32) or about 25 seconds (on Linux).
> Setting the timeout value for the UserAgent doesn't seem
> to affect it.
Gisle> Timeout of the socket connect(2) call is broken for older
Gisle> IO::Socket modules on some systems. Make sure you have IO
Gisle> version 1.20. On Linux, try to run your script with "use
Gisle> LWP::Debug '+'" and under strace(1) to figure out where it
Gisle> hangs. About Win32 I have no clue.
--
Charles DeRykus
------------------------------
Date: Tue, 09 Nov 1999 00:11:40 GMT
From: jubby@my-deja.com
Subject: I don't get this very simple regular expression!!!
Message-Id: <807orq$r5j$1@nnrp1.deja.com>
Here's a simple regular expression:
([^ ]*).* ([^ ]*[^ IVX][^ ]*)
With this you can match the first and last name from a string like
"William H. Gates III".
How does the second grouping work???
The expression works perfectly well on a string like "David G. Ivan"!
Enquiring minds would like to know...
Thanks.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 08 Nov 1999 17:33:48 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: I don't get this very simple regular expression!!!
Message-Id: <382779FC.4AB2B9B3@mail.cor.epa.gov>
jubby@my-deja.com wrote:
>
> Here's a simple regular expression:
>
> ([^ ]*).* ([^ ]*[^ IVX][^ ]*)
>
> With this you can match the first and last name from a string like
> "William H. Gates III".
Or just about anything else. This is a very bad regex.
It will probably take much longer to run than a well-written
regex, and it will probably match all kinds of things you
didn't want to match.
> How does the second grouping work???
> The expression works perfectly well on a string like "David G. Ivan"!
The second 'part' says:
match 0 or more non-space characters,
then 1 character which is none of the set space, I, V, or X,
then 0 or more non-space characters.
But that's almost *anything*. It doesn't match 'III', but it
will match a ton of other things. Look at this bit of code:
#!/usr/bin/perl -w
use strict;
my @array = ("William H. Gates III",
"David G. Ivan",
"(541) 555-4444",
"a b c",
"# #",
" @",
" L");
m/([^ ]*).* ([^ ]*[^ IVX][^ ]*)/ && print "$1,$2\n" foreach (@array);
This will print out the two pieces that match, separated by a
comma, for each of the 5 elements of the array.. if there is
a match for both pieces. Want to guess how many of the 5 will
match?
Okay, here's the output:
William,Gates
David,Ivan
(541),555-4444
a,c
#,#
,@
,L
Yes! EVERYTHING matches! .* or [^ ]* will match if there
is *nothing* there. This regex will match anything that
contains a space followed by something other than [ IVX].
Surely that is not what you wanted.
I suggest you read up more on regexes, and do not use
someone else's bad regex in your code. Try this website:
http://www.netcat.co.uk/rob/perl/win32perltut.html
Good luck,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Tue, 09 Nov 1999 01:43:36 GMT
From: Vincent Murphy <vincent.murphy@cybertrust.gte.com>
Subject: Re: I don't get this very simple regular expression!!!
Message-Id: <xjghfiwjv7b.fsf@gamora.ndhm.gtegsc.com>
>>>>> "jubby" == jubby <jubby@my-deja.com> writes:
jubby> Here's a simple regular expression:
jubby> ([^ ]*).* ([^ ]*[^ IVX][^ ]*)
jubby> With this you can match the first and last name from a string like
jubby> "William H. Gates III".
jubby> How does the second grouping work???
jubby> The expression works perfectly well on a string like "David G. Ivan"!
the second group says "If I'm not zero or more spaces and not space, I, V
or X and zero or more spaces then grab me."
unfortunately in this case $str=qq(William H. Gates X X X V I X I I I X );
would also give William Gates.
jubby> Enquiring minds would like to know...
perldoc perlre for the "really enquiring minds" :-)
jubby> Thanks.
HTH
------------------------------
Date: Tue, 09 Nov 1999 02:00:34 GMT
From: James Tolley <jtolley@bellatlantic.net>
Subject: Re: I don't get this very simple regular expression!!!
Message-Id: <38277FBB.93A2CA10@bellatlantic.net>
jubby@my-deja.com wrote:
>
> Here's a simple regular expression:
>
> ([^ ]*).* ([^ ]*[^ IVX][^ ]*)
>
> With this you can match the first and last name from a string like
> "William H. Gates III".
>
> How does the second grouping work???
> The expression works perfectly well on a string like "David G. Ivan"!
In the second grouping, you're asking for the last group of non-space
chars
which contains at least one char anywhere within iteslf that is not
[IVX].
The .* gobbles everything up, and then you start back-tracking to
satisfy the
other 2 requirements: the space after .* and [^ IVX].
You'd get what you want from this as well:
James H. M. S. IVIXIVIXaIVXIVIX IX
^
the [^ IVX] matches here.
But you're not prepared for this:
John Smith, Jr.
hth,
James
------------------------------
Date: Tue, 9 Nov 1999 10:58:42 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: localtime object y2k compliant?
Message-Id: <dNKV3.10$kK3.2397@vic.nntp.telstra.net>
Jocelyn Amon <finsol@ts.co.nz> wrote in message
news:7vv80o$26v$1@nnrp1.deja.com...
> In article <01bf2714$c32e8be0$3527e1ce@bill.jump.net>,
> "William" <bivey@teamdev.com> wrote:
> <SNIP>
> >
> >
> It is not uncommon for programmers to learn from looking at existing
> code - correct? So, why would they need to query localtime usage when
> they see it already used in code and they can see quite clearly how the
> year value is extracted? Why would they have any reason to think they
> would need to refer to the manual? Maybe programmers 'should' learn
> from the manual but my guess is that the vast majority learn by example
> - not by referring to the manual every time they need to code something
> just slightly unfamiliar. That is the real world of programming. Where
> do you work - in an ivory tower?
Absolutely, and I learnt to drive by watching other drivers. Only the best
too. F1GP drivers. Trouble is all the other drivers who keep getting in my
way reckon it's my fault for not learning how to drive properly! So I
watched some ordinary drivers for a while. In a country where they are car
mad, so they must know how to drive. So now when I drive on the right hand
side of the road in NZ I keep having silly fools yelling at me "Learn to
Drive".
What could I be doing wrong?
Road Rules? Manual? What? Just learn by copying!
>
> Jocelyn Amon
> --
Wyzelli
------------------------------
Date: Mon, 08 Nov 1999 23:27:27 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Need some tips with ImageMagick...
Message-Id: <z%IV3.158$RV5.4266@nsw.nnrp.telstra.net>
On Mon, 08 Nov 1999 22:39:30 GMT,
Markus Svilans <bh447@freenet.carleton.ca> wrote:
> Hi everyone,
>
> I just need some pointers of the usage of some components from the
> ImageMagick image processing package.
>
> Specifically, I need to know how to resize images with the mogrify
> program. I know how to do this:
>
> mogrify -size 30 30 filename.jpg
(that is not how the documentation for mogrify tells you to scale
things)
If you're using ImageMagick, you should really use the perl Module
Image::magick. If that's not what you're interested in, the question
doesn't belong here.
So, here goes
use Image::Magick;
my $im = Image::Magick->new();
my $x = $im->Read($image_name);
die $x if $x;
# The following will make sure the image is 90 x 90 after the scale
$x = $im->Scale( width => 90, height => 90 );
# The next one would preserve the current aspect ratio
# $x = $im->Scale( geometry => '90x90' );
# But you can get around that with
# $x = $im->Scale( geometry => '90x90!' );
warn $x if $x;
$x = $im->Write($outputfile);
die $x if $x;
If you want to insist on using the command line tools, I suggest you
type
# man mogrify
and check how the example there rescales cockatoo.miff
Martien
--
Martien Verbruggen |
Interactive Media Division | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd. | enough features yet.
NSW, Australia |
------------------------------
Date: Mon, 08 Nov 1999 23:28:17 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Need some tips with ImageMagick...
Message-Id: <l0JV3.58535$23.2213611@typ11.nn.bcandid.com>
In article <382750a9.6483217@news.ncf.carleton.ca>,
Markus Svilans <toastman@mindless.com> wrote:
>I just need some pointers of the usage of some components from the
>ImageMagick image processing package.
>
>Specifically, I need to know how to resize images with the mogrify
>program. I know how to do this:
>
> mogrify -size 30 30 filename.jpg
>
>But I never get images that are 30x30 pixels. Can someone help me out
>here?
I believe comp.lang.perl.misc is the wrong newsgroup to ask how to run
a C program from the Unix shell. comp.unix.questions or
comp.os.linux.misc come to mind. The documentation for ImageMagick may
also be helpful.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Tue, 09 Nov 1999 01:29:07 GMT
From: luisdlr <luisdlr@yahoo.com>
Subject: perl and scroll in web pages. How?
Message-Id: <807td0$ugp$1@nnrp1.deja.com>
helllooosss everybody.
I need to do a web page with perl, this web page calls a database
(postgresql). The database has a table like this:
--------------------------
| NAME | ADDRESS | PHONE |
--------------------------
| x | y | z | 1
| a | b | c | 2
| i | j | k | 3
--------------------------
OK. You can see a table in a web page, the table has N tuples, but the
web page has only 3 tuples to see.
The users must move the cursor (up and down) and they should see the
others tuples (scrolling).
I do not know how to do the scrolling in my web page using perl.
please somebody help me.
LuisDLR.......
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 09 Nov 1999 00:00:23 GMT
From: "joneill" <joneill@pgicompanies.com>
Subject: Perl/Tk looping question.
Message-Id: <ruJV3.6223$L5.68611@c01read02-admin.service.talkway.com>
In Perl/Tk how can I get access to objects(pressing Cancel buttons,
redrawing progress bars, etc.) while my program is in a loop (reading a
file, generating a table, etc.) without totally compromising my
program's performance?
Jay O'Neill
PGI Companies
jo'neill@pgicompanies.com
--
Free audio & video emails, greeting cards and forums
Talkway - http://www.talkway.com - Talk more ways (sm)
------------------------------
Date: Mon, 08 Nov 1999 23:52:38 GMT
From: "joneill" <joneill@pgicompanies.com>
Subject: Running a program in background.
Message-Id: <anJV3.6218$L5.68519@c01read02-admin.service.talkway.com>
There is an FTP site that I want to check periodically for new files.
What is the best way for a program to run efficiently/effectively in
the background -- becoming active only to check for files, performing
certain jobs when new files are present, then going back into
hibernation?
Jay O'Neill
PGI Companies
jo'neill@pgicompanies.com
--
Free audio & video emails, greeting cards and forums
Talkway - http://www.talkway.com - Talk more ways (sm)
------------------------------
Date: Mon, 8 Nov 1999 16:19:54 -0800
From: Bill Moseley <moseley@best.com>
Subject: Re: Running a program in background.
Message-Id: <MPG.12910888a60fae0398985d@nntp1.ba.best.com>
joneill (joneill@pgicompanies.com) seems to say...
> There is an FTP site that I want to check periodically for new files.
> What is the best way for a program to run efficiently/effectively in
> the background -- becoming active only to check for files, performing
> certain jobs when new files are present, then going back into
> hibernation?
cron on Unix?
at on NT?
Doesn't seem like you need to keep the program running inbetween checks.
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Mon, 08 Nov 1999 17:14:28 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Running a program in background.
Message-Id: <38277574.4618C89D@mail.cor.epa.gov>
joneill wrote:
>
> There is an FTP site that I want to check periodically for new files.
> What is the best way for a program to run efficiently/effectively in
> the background -- becoming active only to check for files, performing
> certain jobs when new files are present, then going back into
> hibernation?
Sounds like a job for cron .. assuming you're on a unix-ish
platform. Otherwise, you'll have to try AT (NT's stripped-
down version of cron which may not have everything you want)
or an NT version of cron. For more on the NT side of things,
read the Win32 [ActivePerl] FAQ under the section "Windows
95/NT" and look for this question:
"How do I schedule jobs on Win32 platforms?"
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Mon, 08 Nov 1999 23:29:31 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: running dos command from perl
Message-Id: <v1JV3.58538$23.2213536@typ11.nn.bcandid.com>
In article <807jvu$nja$1@nnrp1.deja.com>, <gqc2017@my-deja.com> wrote:
>Hi, how do I execute the following dos command from perl
>
>postmail -t -Hcarbonmedia.net adam\@carbonmedia.com < myfile.txt
perldoc -f system
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08. Hurrah!
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Mon, 8 Nov 1999 18:56:17 -0800
From: "Allen Long" <falong@hiwaay.net>
Subject: Using Perl to fill in html fields
Message-Id: <wcKV3.58702$23.2230362@typ11.nn.bcandid.com>
I am new to perl and need to know how to use a Perl program to fill in a cgi
field in a web browser such as netscape or ie. I also need to know if there
is a way to simulate mouseclicks.
Thanks
------------------------------
Date: Tue, 9 Nov 1999 02:25:23 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Using Perl to fill in html fields
Message-Id: <Pine.HPP.3.95a.991109022306.24192D-100000@hpplus01.cern.ch>
On Mon, 8 Nov 1999, Allen Long wrote:
> I am new to perl and need to know how to use a Perl program to fill in a cgi
> field in a web browser such as netscape or ie.
CGI.pm
> I also need to know if there
> is a way to simulate mouseclicks.
I'd say you need to study how the WWW works, so as to be in a position
to ask a coherent question. You're not going to find enlightenment of
that kind on clpm, for all its other attractions. You might for example
want to start at http://www.htmlhelp.org
god luck
------------------------------
Date: Mon, 08 Nov 1999 23:16:53 GMT
From: rvlong@my-deja.com
Subject: Re: Win32::Internet
Message-Id: <807ll2$osk$1@nnrp1.deja.com>
I got it to work as follows:
> > $INET = new Win32::Internet();
> > $INET->FTP($FTP, "ftp.mysite.com", $username,
$password) || die
> > "Can't connect: $!";
> > $FTP->Cd("logfiles") || die "Can't change
directories: $!";
> > $FTP->Get($remote_file, $local_file) || die
"Can't get file: $!";
In article <pc7904ou8c6.fsf@panix6.panix.com>,
Lewis Perin <perin@panix.com> wrote:
> "No One" <nothing@nowhere.com> writes:
>
> > I'm trying to create a script to download
logfiles and I keep getting
> > errors while using the Win32::Internet in
ActiveState Perl build 521.
> > Here's the script:
> >
> > - ----------snip----------
> > $INET = new Win32::Internet();
> > $INET->FTP($FTP, "ftp.mysite.com", $username,
$password) || die
> > "Can't connect: $!";
> > $INET->Cd("logfiles") || die "Can't change
directories: $!";
> > $INET->Get($remote_file, $local_file) || die
"Can't get file: $!";
> > - ----------snip----------
> >
> > The program "dies" at the "Cd" command every
time with no other
> > message other than the one I have written in
the "die" routine. Does
> > anyone have any pointers?
>
> First, are you sure there's a logfiles directory
*immediately below*
> the directory FTP puts you into at login? You
can probably figure out
> the commands for diagnosing this.
>
> Second, and I have to admit I've never used
Win32::Internet, but is
> there a reason you chose not to use the portable
Net::FTP? It works
> just fine for me under Win32.
>
> /Lew
> --
> Lew Perin / perin@mail.med.cornell.edu /
perin@acm.org
> www.panix.com/~perin/
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 08 Nov 1999 23:16:52 GMT
From: rvlong@my-deja.com
Subject: Re: Win32::Internet
Message-Id: <807ll0$osj$1@nnrp1.deja.com>
I got it to work with the following corrections...
Try this:
$INET = new Win32::Internet();
$INET->FTP($FTP, "ftp.mysite.com", $username,
$password) || die "Can't connect: $!";
$FTP->Cd("logfiles") || die "Can't change
directories: $!";
$FTP->Get($remote_file, $local_file) || die "Can't
get file: $!";
In article <s1cnb8m9r0880@corp.supernews.com>,
"No One" <nothing@nowhere.com> wrote:
>
> Hash: SHA1
>
> I'm trying to create a script to download
logfiles and I keep getting
> errors while using the Win32::Internet in
ActiveState Perl build 521.
> Here's the script:
>
> - ----------snip----------
> $INET = new Win32::Internet();
> $INET->FTP($FTP, "ftp.mysite.com", $username,
$password) || die
> "Can't connect: $!";
> $INET->Cd("logfiles") || die "Can't change
directories: $!";
> $INET->Get($remote_file, $local_file) || die
"Can't get file: $!";
> - ----------snip----------
>
> The program "dies" at the "Cd" command every
time with no other
> message other than the one I have written in the
"die" routine. Does
> anyone have any pointers?
>
> Thanks,
> Chris Muller
>
>
> Version: PGPfreeware 6.0.2 for non-commercial
use <http://www.pgp.com>
>
>
iQA/AwUBOBZdUCNkOAwUeW8yEQLifgCg334eya4gze/W1m3HQm
4UBDq1U+8AoMQA
> S4CBtXnG+iAvPmcRZCo0q1p8
> =86SQ
> -----END PGP SIGNATURE-----
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 1323
**************************************