[13280] in Perl-Users-Digest
Perl-Users Digest, Issue: 690 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 31 20:07:22 1999
Date: Tue, 31 Aug 1999 17:05:10 -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 Tue, 31 Aug 1999 Volume: 9 Number: 690
Today's topics:
11/1 date problem - timelocal / localtime <lsantoso@baynetworks.com>
Re: 11/1 date problem - timelocal / localtime (Larry Rosler)
Re: a simple POST request vengence7140@my-deja.com
Re: Auto actions on popup_menu's <gellyfish@gellyfish.com>
Re: Beginner question <gellyfish@gellyfish.com>
EMPLOYMENT OPPORTUNITY:Perl/Web Developer hrdept@tucows.com
Re: EMPLOYMENT OPPORTUNITY:Perl/Web Developer <jeff@vpservices.com>
EMPLOYMENT: Perl/Web Developer hrdept@my-deja.com
EMPLOYMENT: Perl/Web Developer hrdept@my-deja.com
Re: essentially; making a long file name into a 8.3 fil <kin@0011.com>
Re: File listing (Sam Holden)
Re: help using CGI.pm for file upload ??? (Larry Rosler)
Re: Help! Redirection problem <gellyfish@gellyfish.com>
Re: how to make sort() case insensitive? <gellyfish@gellyfish.com>
Re: How to rewind DATA filehandle? <gellyfish@gellyfish.com>
Re: Interrupts and Graphics in Win32 <streaking_pyro@my-deja.com>
Re: LWP::Simple GET ??? (Charles DeRykus)
Re: Mail including HTML tag... <gellyfish@gellyfish.com>
Maybe too academic: How to build a (binary) tree (struc <ulf.rimkus@okay.net>
Re: Perl On NT <gellyfish@gellyfish.com>
print bold (David Beckley)
Re: Queries <ascot@aquafind.com>
R: Octal Codes <nando@tetecma.com>
R: Time as per IST?? <nando@tetecma.com>
Simulating Carriage Returns <paulm@dirigo.com>
subtraction error <i_tel@my-deja.com>
Re: subtraction error <bmetcalf@nortelnetworks.com>
Re: subtraction error <laurensmith@sprynet.com>
Re: Using PGP encryption within your perl program? <carvdawg@patriot.net>
variable help <magicrat@agevision.com>
Re: Why doesn't my undef an array? <iansmith@pepper.ncinter.net>
Re: Win32::EventLog Issue <tom_lichti@interactivemedia.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 31 Aug 1999 14:38:43 -0700
From: Linda Santoso <lsantoso@baynetworks.com>
Subject: 11/1 date problem - timelocal / localtime
Message-Id: <37CC4B63.30DE44CB@baynetworks.com>
Hi,
Can someone help me debug the following script? I converted 11/1/1999 to
scalar using timelocal and tried to get it back using localtime, but it
keeps returning 10/31/1999. Same happens with any date after
11/1/1999. It decrements the date by one when I tried to convert it
back using localtime. Am I missing something?
Thanks,
-Linda
#!/usr/bin/perl
require 'Timelocal.pm';
$start = &Timelocal'timelocal(0,0,0,1,10,99);
$end = start + (24*60*60*6);
($a,$b,$c,$d,$e,$f,$g,$h,$i) = localtime($start);
print "\n\n$a, $b, $c, $d, $e, $f, $g, $h, $i\n\n";
------------------------------
Date: Tue, 31 Aug 1999 15:25:10 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: 11/1 date problem - timelocal / localtime
Message-Id: <MPG.1235f6236ee54976989ef5@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <37CC4B63.30DE44CB@baynetworks.com> on Tue, 31 Aug 1999
14:38:43 -0700, Linda Santoso <lsantoso@baynetworks.com> says...
> Can someone help me debug the following script? I converted 11/1/1999 to
> scalar using timelocal and tried to get it back using localtime, but it
> keeps returning 10/31/1999. Same happens with any date after
> 11/1/1999. It decrements the date by one when I tried to convert it
> back using localtime. Am I missing something?
You seem to be missing Perl 5.
> #!/usr/bin/perl
> require 'Timelocal.pm';
> $start = &Timelocal'timelocal(0,0,0,1,10,99);
> $end = start + (24*60*60*6);
^ bareword! $end isn't used anyhow.
> ($a,$b,$c,$d,$e,$f,$g,$h,$i) = localtime($start);
> print "\n\n$a, $b, $c, $d, $e, $f, $g, $h, $i\n\n";
#!/usr/bin/perl-w
use strict;
use Time::Local;
my $start = timelocal(0, 0, 0, 1, 10, 99);
my @a = localtime($start);
print "\n\n@a\n\n";
__END__
0 0 0 1 10 99 1 304 0
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 31 Aug 1999 21:01:54 GMT
From: vengence7140@my-deja.com
Subject: Re: a simple POST request
Message-Id: <7qhfrr$8o2$1@nnrp1.deja.com>
Sorry, I am not passing forms back and forth between client
and server. I don't want my body of text to be processed by
browser.
the incoming message would be:
HTTP header ....
My body of text ....
I want to call a function to get My body of text.
Hope this clears the confusion.
Jimmy
In article <37CC1217.33F41B25@cisco.com>,
Makarand Kulkarni <makkulka@cisco.com> wrote:
> [ vengence7140@my-deja.com wrote:
>
> > ..send a post request to a server, followed by
> > a body of text. What I want to do on server
> > side is to get the body of text and process it.
>
> Your question is not clear. Your body of text ( for example
> this could be some amount of text from a textarea element
> inside a HTML form ) has to be sent as a value in a name/value
> pair. On the server side you get the value (which is the body)
> of text then do whatever you like. For example using CGI.pm
> you will do something like this --
>
> $long_text_element = $CGIObject->param ('name');
> where 'name' is the name of the textarea element in the HTML form.
> --
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 31 Aug 1999 21:19:48 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Auto actions on popup_menu's
Message-Id: <7qhgtk$6ff$1@gellyfish.btinternet.com>
On Tue, 31 Aug 1999 23:08:40 +1200 Aaron Lister wrote:
> How do I have an action run automatically when an item is selected from a
> popup_menu in a per/cgi script without using JavaScript?
>
You cant have a popup_menu in a Perl program.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 31 Aug 1999 20:54:27 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Beginner question
Message-Id: <7qhfe3$6f3$1@gellyfish.btinternet.com>
On Tue, 31 Aug 1999 08:01:48 +0200 Koopa One wrote:
> Im new to Perl and CGI, so here's a question for you professionals:
>
> My ISP doe not allow CGI or PERL Scripts on the Server. He told me to use
> the program perl2exe, it compiles Scripts to executeable files.
>
If your ISP does not allow CGI then whatever you do to your program is
hopeless and anyhow a 'Script' is by necessity an executable file anyhow.
I'd either give up or get another ISP.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Tue, 31 Aug 1999 21:18:27 GMT
From: hrdept@tucows.com
Subject: EMPLOYMENT OPPORTUNITY:Perl/Web Developer
Message-Id: <7qhgqo$9ap$1@nnrp1.deja.com>
#!/usr/bin/perl
use Employee qw(:WebProgrammer);
use CGI;
use DBI;
$You = new Employee;
$in = new CGI;
$use_mod_perl = ((exists $ENV{'GATEWAY_INTERFACE'}
and $ENV{'GATEWAY_INTERFACE'} =~ /CGI-Perl/)
or exists $ENV{'MOD_PERL'} );
$os = $in->param('os') || 'Linux' || 'Solaris' || 'BSD';
$knowledge = "/usr/local/lib/required";
open(REQUIRED, "$knowledge");
while (<REQUIRED>) {
next if (/Do not understand this message/);
($apache, $SQL, $HTML, $Javascript) = split;
}
close(REQUIRED)
$knowledge = "/usr/local/lib/helpful";
open(BENEFICIAL, "$knowledge");
$nice_to_have = <BENEFICIAL>;
$nice_to_have =~ m/(sendmail)(MySQL)(Oracle)(DNS\/BIND)(Java)/;
close(BENEFICIAL);
$dbh = DBI->connect('dbi:mysql:TUCOWS','you','hired') || die "can't
connect";
$query = "SELECT the_best FROM applicants WHERE experience like 'at
least 1-2 year%';
$sth = $dbh->prepare("$query");
$sth->execute;
$sth->finish;
$dbh->disconnect;
if ($interested) {
$email = 'hrdept@tucows.com';
$fax = "416-239-8409";
$phone !~ /good/;
}
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 31 Aug 1999 23:05:00 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: EMPLOYMENT OPPORTUNITY:Perl/Web Developer
Message-Id: <37CC5EA1.C83AF6DF@vpservices.com>
hrdept@tucows.com wrote:
>
> #!/usr/bin/perl
> use Employee qw(:WebProgrammer);
> [snip]
if( is_job_stuff_in_non_job_newsgroup($message) ) {
$annoying++;
}
if( is_posted_multiple_times($message) ) {
$annoying++;
}
if( is_pretty_dang_amusing($message) ) {
$annoying-=2;
}
So, I guess you come out even, which is better than average on clpm.
--
Jeff
------------------------------
Date: Tue, 31 Aug 1999 21:12:06 GMT
From: hrdept@my-deja.com
Subject: EMPLOYMENT: Perl/Web Developer
Message-Id: <7qhges$96g$1@nnrp1.deja.com>
#!/usr/bin/perl
use Employee qw(:WebProgrammer);
use CGI;
use DBI;
$You = new Employee;
$in = new CGI;
$use_mod_perl = ((exists $ENV{'GATEWAY_INTERFACE'}
and $ENV{'GATEWAY_INTERFACE'} =~
/CGI-Perl/)
or exists $ENV{'MOD_PERL'} );
$os = $in->param('os') || 'Linux' || 'Solaris' ||
'BSD';
$knowledge = "/usr/local/lib/required";
open(REQUIRED, "$knowledge");
while (<REQUIRED>) {
next if (/Do not understand this message/);
($apache, $SQL, $HTML, $Javascript) = split;
}
close(REQUIRED)
$knowledge = "/usr/local/lib/helpful";
open(BENEFICIAL, "$knowledge");
$nice_to_have = <BENEFICIAL>;
$nice_to_have =~
m/(sendmail)(MySQL)(Oracle)(DNS\/BIND)(Java)/;
close(BENEFICIAL);
$dbh =
DBI->connect('dbi:mysql:TUCOWS','you','hired') ||
die "can't connect";
$query = "SELECT the_best FROM applicants WHERE
experience like 'at least 1-2 year%';
$sth = $dbh->prepare("$query");
$sth->execute;
$sth->finish;
$dbh->disconnect;
if ($interested) {
$email = 'hrdept@tucows.com';
$fax = "416-239-8409";
$phone !~ /good/;
}
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 31 Aug 1999 21:12:05 GMT
From: hrdept@my-deja.com
Subject: EMPLOYMENT: Perl/Web Developer
Message-Id: <7qhgeq$96e$1@nnrp1.deja.com>
#!/usr/bin/perl
use Employee qw(:WebProgrammer);
use CGI;
use DBI;
$You = new Employee;
$in = new CGI;
$use_mod_perl = ((exists $ENV{'GATEWAY_INTERFACE'}
and $ENV{'GATEWAY_INTERFACE'} =~
/CGI-Perl/)
or exists $ENV{'MOD_PERL'} );
$os = $in->param('os') || 'Linux' || 'Solaris' ||
'BSD';
$knowledge = "/usr/local/lib/required";
open(REQUIRED, "$knowledge");
while (<REQUIRED>) {
next if (/Do not understand this message/);
($apache, $SQL, $HTML, $Javascript) = split;
}
close(REQUIRED)
$knowledge = "/usr/local/lib/helpful";
open(BENEFICIAL, "$knowledge");
$nice_to_have = <BENEFICIAL>;
$nice_to_have =~
m/(sendmail)(MySQL)(Oracle)(DNS\/BIND)(Java)/;
close(BENEFICIAL);
$dbh =
DBI->connect('dbi:mysql:TUCOWS','you','hired') ||
die "can't connect";
$query = "SELECT the_best FROM applicants WHERE
experience like 'at least 1-2 year%';
$sth = $dbh->prepare("$query");
$sth->execute;
$sth->finish;
$dbh->disconnect;
if ($interested) {
$email = 'hrdept@tucows.com';
$fax = "416-239-8409";
$phone !~ /good/;
}
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 31 Aug 1999 15:59:28 -0700
From: Kin Lum <kin@0011.com>
Subject: Re: essentially; making a long file name into a 8.3 filename..
Message-Id: <37CC5E50.5203B937@0011.com>
Wyzelli wrote:
> Well if you think it would be a good practice to parse a directory which
> contained several different versions of a file, and rename them all to the
> same thing, well that is your lookout, but how do you know which version is
> the one you have left?
Of course it is not a good practice. But that's not what
the original question asked for. If it is good practice,
maybe it is not a good practice to rename them to 8.3
but to upgrade the old computer.
------------------------------
Date: 31 Aug 1999 23:51:18 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: File listing
Message-Id: <slrn7soql1.503.sholden@pgrad.cs.usyd.edu.au>
On 31 Aug 1999 07:07:34 -0400, meow <meowing@banet.net> wrote:
>Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
>
>>> There's definitely not consensus on whether dot-files should be left
>>> out by default. It doesn't even hold across Unix versions, let alone
>>> the other stuff out there.
>
>> Which version of sh included dot-files in a * wild-card expansion?
>
>Any system with bash has it. shopt -s dotglob
>Some V7, everything older.
>Macs don't care 'bout no dots.
>VMS? well, just don't try to delete one, especially if you've got
>FOO.BAR and .BAR in the same dorectory :P
>DOS/Win don't care.
Are any of those sh?
>> It is to most unix users, who would be amazed to find the dozens of
>> files they have gathered in their home directory over the years without
>> realising it...
>
>That would be a good thing. Seeing what's lurking under
>$HOME/.netscape would prevent some of those puzzled looks over quotas.
Only if the admin people don't know how to set up netscape correctly.
Of course users not having a clue and just doing 'rm -rf .netscape' to free
some space would be good? You think? Oops all the years of collecting bookmarks
gone in a flash...
>And of course, just adding a ^[^.].* to that regexp would get rid of the
>darned things if they really frighten people.
They don't frighten me, all I argue is there is a consensus that dot-files
are 'hidden' on unix, under Windows there is an attribute for hidden, so
no such consensus exists. I get annoyed when programs display them since they
clutter up my home directory. Since I also sometimes want to look at them,
I also get annoyed when programs don't have an option to display them. But
I don't want it t be the default. I the programmer couldn't be bothered adding
an option, then I would prefer them not displayed (I can ln a new name if I
really need to get at them).
All I can do is rant my opinion and appeal to authority :
...the filename-matching characters do not look at filenames beginning
with a dot, to avoid problems with the names '.' and '..' that are in
every directory. The rule is: the filename-matching characters only match
filenames beginning with a period if the period is explicitly supplied in
the pattern.
--THE UNIX PROGRAMMING ENVIRONMENT
Kernighan and Pike
I would be quite annoyed if all of the following showed up every time I
tried to list the files in my home directory...
. .mh_profile
.. .mh_profile.old
.Mail.for.mrmph .mime.types
.RealNetworks_RealMediaSDK_60 .mine
.RealNetworks_RealPlayer_60 .mpdt22
.RealNetworks_RealShared_00 .ncftp
.Xauthority .netscape
.Xdefaults .news_time
.Xresources .newsrc
.acrorc .newsrc-news
.addressbook .newsrc.bak
.addressbook.lu .newssignature
.bash_history .nn
.bash_profile .oldnewsrc
.bochsrc .paradise-metaserver
.cpan .pgp
.cvspass .plan
.cvsroot .postie
.desksetdefaults .postitnotes
.desktop-redgate.vislab.usyd.edu.au .profile
.displayrc .profile.old
.displays .project
.doomrc .purify.Xdefaults
.dt .random_images
.dtprofile .red-prefs
.esrc .rhosts
.esrc2 .rnlast
.exmh-defaults .rnsoft
.fetchhost .sh_history
.fetchhostalison .shosts
.fetchhostcsu .signature
.fetchhostgeo .sigrandpid
.fetchold .sigs
.forward .slrn.sl
.fullcircle .slrnrc
.geekcode .soundconf
.gimp .ssh
.gimprc .streak
.glimpse_filenames .timex
.glimpse_filenames_index .trash
.glimpse_index .vicerc
.glimpse_messages .vtwmrc
.glimpse_partitions .weblink
.glimpse_statistics .wilybak
.history .wilyguide
.hotjava .wilytools
.ispell_english .win95
.jnewsrc .xblast
.jnewsrc-lock .xblast-setups
.jnewsrc.time .xboing-scores
.jnewsrc~ .xfm
.junk .xftpcache
.lyx .xftprc
.mail .xgalscores
.mail_order .xmsg_hosts
.mailcap .xpcs-g61-27.cs.usyd.edu.au:0.oldkeys
.maildelivery .xrncache-news.cs.usyd.edu.au
.maildelivery.dir .xsession
.maildelivery.pag .xsession-errors
.mapeditrc .xsession-errors-old
.mh_alias .ytalkrc
--
Sam
You can write Perl programs that resemble sed, or awk, or C, or Lisp, or
Python. This is Officially Okay in Perl culture.
--Larry Wall
------------------------------
Date: Tue, 31 Aug 1999 15:03:21 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: help using CGI.pm for file upload ???
Message-Id: <MPG.1235f102770e37da989ef4@nntp.hpl.hp.com>
In article <37C6D0F4.4CB1D0B4@busprod.com> on Fri, 27 Aug 1999 12:55:00
-0500, Dan Baker <dtbaker_@busprod.com> says...
...
> - the perl cgi on the server doesnt seem to use the limit I set for
> maximum POST file size. I was hoping there was a way to catch illegal
> file types and sizes before they user server time and space to upload. I
> have the following line in my script, but it still allows large files to
> be posted:
> $CGI::POST_MAX=1024 * 100 ; # limit to 100kB
Put that line immediately after the 'use CGI' statement in order for it
to be effective.
This is documented in `perldoc CGI` under 'Avoiding Denial of Service
Attacks'.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 31 Aug 1999 21:00:18 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help! Redirection problem
Message-Id: <7qhfp2$6f8$1@gellyfish.btinternet.com>
In comp.lang.perl.misc Daphne Lim <webmaster_info@infobankasia.com.sg> wrote:
> Hi, i have a perl script that captures data from an html page (a form),
> after which i need to post the collected data to another perl script,
> myperl.perl. myperl.perl uses:
>
> read(STDIN,$inputs,$ENV{'CONTENT_LENGTH'});
>
Then quite simply your script is broken.
> and the limitation for me is
> that i can't change myperl.perl to get $ENV{'QUERY_STRING'} instead.
>
Why ? I can see no possible reasosn that you shouldnt use correct form
parsing code or perhaps even a well documented and supported module
such as CGI.pm.
I would recommend asking this question in the newsgroup:
comp.infosystems.www.authoring.cgi
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 31 Aug 1999 21:14:14 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: how to make sort() case insensitive?
Message-Id: <7qhgj6$6fc$1@gellyfish.btinternet.com>
On Tue, 31 Aug 1999 16:17:33 GMT [L] Vicious! wrote:
[ In classic jeopardy style which I have fixed ]
> Larry Rosler <lr@hpl.hp.com> wrote in message
>>
>> However, many of us believe that it is better to give away fishing rods
>> than to give away fish.
>>
>
> Actually I agree, but the could you do me a favour. I run Win98, and when I
> run 'perldoc -f sort' there is no way to actually read the stuff. |more
> doesn't work either and I coulnd find any page switches, neither can I write
> the results to a file using >sort.txt. Suggestions? Thnx for helping, by the
> way! (o:
>
Uh huh. If you are using an Activestate Perl of build >500 then the
documentation will be installed as HTML that has a shortcut in your
Start Menu - you will want to look at the perlfunc document.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 31 Aug 1999 21:58:36 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: How to rewind DATA filehandle?
Message-Id: <7qhj6c$6gp$1@gellyfish.btinternet.com>
On Tue, 31 Aug 1999 12:49:51 -0500 Steve Schwartz wrote:
>
> My hack is to use seek(DATA,0,0) and then read DATA until the __END__ token.
>
You can use something like:
#!/usr/bin/perl -w
$datapos = tell DATA;
print while(<DATA>);
seek DATA,$datapos,0;
print while(<DATA>);
__END__
this
is
a
test
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Tue, 31 Aug 1999 22:39:34 GMT
From: R.Joseph <streaking_pyro@my-deja.com>
Subject: Re: Interrupts and Graphics in Win32
Message-Id: <7qhlj5$ct5$1@nnrp1.deja.com>
Actaully, I meant DOS, sorry. I know this can be done in DOS, because
I have done it in Turbo C++...but I was wondering if it could be done
in Perl? Is there a way to use Perl to do DirectX??
> It's not possible to do this in any language under Win32. Your best
bet
> is probably to write some xsubs that use DirectX to do your screen
> access. The int13 code is meaningless in a Win32 context; I doubt
it's
> even mapped into memory.
>
>
--
R.Joseph
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 31 Aug 1999 20:34:52 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: LWP::Simple GET ???
Message-Id: <FHCJu4.1Bn@news.boeing.com>
In article <37CBE579.C76283CB@eis.noaa.gov>,
Bob Freedman <bob.freedman@eis.noaa.gov> wrote:
>
>When using LWP::Simple GET is there a way to time-out the retrevial of
>the html document?
>
>I' trying to eliminate waiting for the slowest HTML doc to return before
>processing all the others and would like to kiil the get command after a
>certain time.
>
I don't believe so; even wrapping a block eval timeout around
the GET can be problematic. There's contention with LWP's own
timeouts. Alternatively, LWP::UserAgent has a timeout method.
HTH,
--
Charles DeRykus
------------------------------
Date: 31 Aug 1999 21:49:36 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Mail including HTML tag...
Message-Id: <7qhilg$6g9$1@gellyfish.btinternet.com>
On Wed, 1 Sep 1999 01:55:54 +0900 W cube Desichnology wrote:
> I want your help...
> I wanna know how to mail with sendmail including HTML tag in perl.
> May I need some special module?
>
Yup.
MIME::Lite
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Tue, 31 Aug 1999 21:29:32 +0100
From: "Ulf Rimkus" <ulf.rimkus@okay.net>
Subject: Maybe too academic: How to build a (binary) tree (structure)
Message-Id: <7qhi2v$2u57$1@news.okay.net>
Hallo!
When I was just looking through my computer language books like them for C
and PASCAL everyone takes a huge amount of paper to explain all about trees,
pre-order, in-order search and stuff like that. Now I was trying to find out
how to do that in Perl, but donīt have even an idea how to implement such a
data structure in Perl.
Maybe someone out there likes to give me a hint (well, Iīd like to programme
it by myself, but itīs just the lack of an idea, or sort of wrong way of
thinking while poisend by C and Pascal ;-) ).
Greetings, Ulf
------------------------------
Date: 31 Aug 1999 21:53:23 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl On NT
Message-Id: <7qhisj$6gc$1@gellyfish.btinternet.com>
On Tue, 31 Aug 1999 10:29:59 -0700 Bill Tucker wrote:
> Question, does anyone know what needs to be done to have perl execute on a
> NT 4.0 system running Netscape Enterprise 3.5? I have perl in the path but
> obviously you can't use the same HTML syntax as you do within Unix (<form
> method="post" action="/cgi-bin/send_wba.pl">) to have pl file execute.
>
You will need to consult the Win32 specific FAQ that is distributed
with the Activestate Perl - there is an entire section that documents
how to configure various HTTP servers to work with Perl. If this
document isnt sufficient then you will be better put asking in the
group : comp.infosystems.www.servers.ms-windows.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Tue, 31 Aug 1999 21:10:26 GMT
From: david@bgraphx.com (David Beckley)
Subject: print bold
Message-Id: <37cc4366.26086209@news.swcp.com>
Need to generate a version of ascii text SGML output from a perl
program in which the stuff which is tagged is in BOLD print, to make
proofreading easier. Have been doing this with a WordPerfect macro,
but trying to find an easier way. Output comes from NT Workstation 4.0
and goes to an HP Laserjet 4m which is a network node. The laser
understands the PCL codes, but I can't figure out how to make the
printer recognize them as such. I've looked at printing using the pod
codes, but have the same problem.
TIA!
David
------------------------------
Date: Tue, 31 Aug 1999 17:20:20 -0700
From: James Hensinger <ascot@aquafind.com>
Subject: Re: Queries
Message-Id: <37CC7144.90CC61AD@aquafind.com>
elephant wrote:
> James Hensinger writes ..
> >I have Linux Red Hat running MySQL and a database with multiple tables.
> >Is there a command I can use to stop when each page is full like in dos
> >the /p stopped when each screen page was full. Or where on the net can
> >I find the different commands?
>
> did you even look at the newsgroup that you were posting to ? .. or are
> you just really good at hiding your Perl question ?
>
> --
> jason - elephant@squirrelgroup.com -
Thank you gentlemen for your answers. I am not a programmer and am a new
user to Linux and computer languages. I am learning this the hard way so
help would certainly be appreciated. We are not all so skillful in this
area. So, now I know to go to the newsgroup to find the answers using Perl.
Cheers
------------------------------
Date: Wed, 1 Sep 1999 01:12:11 +0200
From: "Nando" <nando@tetecma.com>
Subject: R: Octal Codes
Message-Id: <IhZy3.8498$E4.8544@typhoon.libero.it>
Try the following:
$line =~ s/\032$//;
--
Fernando
webmaster <webmaster@sendyourad.com> wrote in message
37CAEDE6.26D@sendyourad.com...
> I am receiving a text feed from another system that is passing an octal
> code of 32 within the text of the feed. When I run my perl script to
> manipulate some of the data in the text feed it comes to the place where
> the octal 32 code is and moves 100+ plus lines down the feed and then
> continues. I can't see any visual representation of the of the octal
> code nor can I use the chop command to get rid of it even though it
> always appears at the end of a line. Can anyone out there help me?
------------------------------
Date: Wed, 1 Sep 1999 00:42:17 +0200
From: "Nando" <nando@tetecma.com>
Subject: R: Time as per IST??
Message-Id: <IRYy3.8400$E4.13110@typhoon.libero.it>
use Date::Manip;
$date=&DateCalc("today","+ 3hours 12minutes 6 seconds",\$err);
$date=&DateCalc("12 hours ago","12:30 6Jan90",\$err);
Read module documentation.
--
Fernando
Bill Moseley <moseley@best.com> wrote in message
MPG.1228439212edabcf9896ca@nntp1.ba.best.com...
> Sreshth Kumar (skumar@deutech.com) seems to say...
> > Suppose I want to display all times according to IST (GMT + 5:30) the
> > easiest way to do it would be to add 5 hours and 30 minutes to the time
> > returned by gmtime(). How do I do this?
> >
> > Or for that matter how does one increment / decrement time by a given
number
> > of hours/minutes/seconds?
>
> Seems like addition and subtractions is what you want. Read perldoc -f
> gmtime again and see what it says to use as input.
>
> --
> Bill Moseley mailto:moseley@best.com
> pls note the one line sig, not counting this one.
------------------------------
Date: Tue, 31 Aug 1999 21:08:46 GMT
From: Stone Cold <paulm@dirigo.com>
Subject: Simulating Carriage Returns
Message-Id: <7qhg8m$8sj$1@nnrp1.deja.com>
Is there a way to simulate a carriage return in perl when calling an
external DOS command. For example, I'm pulling the system date from my
machine by doing the following:
$now=`date`;
($junk1,$junk2,$junk3,$junk4,$current) = split(/\s+/,$now);
print $current;
exit 0;
This will run the date shell command and give me back the current
date. Because it gives other info as well, I'm splitting on the other
stuff to not see it.
What happens is that when I run the script externally
(C:/Perl/.../...test.pl), it just hangs there. I think it has
something to do with there NOT being a carriage return after the `date`
command because if I print $now, it doesn't even give me the date.
Does anyone know what I can do to correct this?
--
Paul R. Mesker
System Engineer
Dirigo Inc.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 31 Aug 1999 22:53:40 GMT
From: hojo <i_tel@my-deja.com>
Subject: subtraction error
Message-Id: <7qhmdf$dkj$1@nnrp1.deja.com>
While running a simple subtraction, we get a floating point error where
a value of -1.77635683940025e-15 shows up rather than 0. Below is our
output that consistantly fails. Starting with a current balance of 0 we
run transaction amounts. The final transaction amount returns the bogus
data:
Trans Amount $curbal
0
-79.31 -79.31
79.31 0
-77.00 -77
77.00 0
-127.87 -127.87
127.87 0
-53.43 -53.43
103.44 50.01
-59.75 -9.74
9.74 -1.77635683940025e-15 (should be 0)
I would call this a bug. Has anybody run into/fixed this problem?
Thank You
--
=-=-=-=-=-=-=-=-=-=
David Hajoglou
Sys. Admin., Abbreviator
=-=-=-=-=-=-=-=-=-=
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 31 Aug 1999 16:18:47 -0700
From: Brandon Metcalf <bmetcalf@nortelnetworks.com>
Subject: Re: subtraction error
Message-Id: <37CC62D7.9D2B7684@nortelnetworks.com>
And your Perl question is?
Brandon
hojo wrote:
> While running a simple subtraction, we get a floating point error where
> a value of -1.77635683940025e-15 shows up rather than 0. Below is our
> output that consistantly fails. Starting with a current balance of 0 we
> run transaction amounts. The final transaction amount returns the bogus
> data:
>
> Trans Amount $curbal
> 0
> -79.31 -79.31
> 79.31 0
> -77.00 -77
> 77.00 0
> -127.87 -127.87
> 127.87 0
> -53.43 -53.43
> 103.44 50.01
> -59.75 -9.74
> 9.74 -1.77635683940025e-15 (should be 0)
>
> I would call this a bug. Has anybody run into/fixed this problem?
>
> Thank You
>
> --
> =-=-=-=-=-=-=-=-=-=
> David Hajoglou
> Sys. Admin., Abbreviator
> =-=-=-=-=-=-=-=-=-=
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
------------------------------
Date: Tue, 31 Aug 1999 16:40:03 -0700
From: "Lauren Smith" <laurensmith@sprynet.com>
Subject: Re: subtraction error
Message-Id: <7qhp4j$f3s$1@brokaw.wa.com>
hojo wrote in message <7qhmdf$dkj$1@nnrp1.deja.com>...
>While running a simple subtraction, we get a floating point error where
>a value of -1.77635683940025e-15 shows up rather than 0
perldoc -q decimals
Lauren
------------------------------
Date: Tue, 31 Aug 1999 17:17:09 -0400
From: "Harlan Carvey, CISSP" <carvdawg@patriot.net>
Subject: Re: Using PGP encryption within your perl program?
Message-Id: <37CC4655.9E1297A@patriot.net>
> I am currently working on a project where I have
> to use data encyption within my perl script. I
> know how to open a dos session window using the
> open command with a pipe, but I can't seem to run
> any command once I start the PGP (data encryption)
> process. Anyway, if anyone has performed data
> encrytion from within their perl script can you
> please let me know what encryption tool you used
> and how you did it?
Data encryption is easy using any of the modules that support it.
As you are on NT...here's a link that may help...you can use PGP
or Blowfish...
http://user.intersatx.net/hopwoodg/
Enjoy
------------------------------
Date: Tue, 31 Aug 1999 19:16:52 -0400
From: magicrat <magicrat@agevision.com>
Subject: variable help
Message-Id: <37CC6264.BD13E305@agevision.com>
Hi, new to perl. I have a web form that I am grabbing info from. Now,
let's say I have input boxes for songs 1-10. The name of the input on
the html form is song1, song2, song3...
So, in defining the variables in the perl script, I would do:
my $song1 = $FORM{song1};
my $song2 = $FORM{song2};
my $song3 = $FORM{song3};
etc.
my question is, how to I grab all of these values from the form and
define my perl variables without going through the manual process listed
above.
I know it can be done, i just don't remember how.
Thanks
Andy@agevision.com
------------------------------
Date: Tue, 31 Aug 1999 23:26:37 GMT
From: Ian Smith <iansmith@pepper.ncinter.net>
Subject: Re: Why doesn't my undef an array?
Message-Id: <NwZy3.10647$914.642997@typ11.nn.bcandid.com>
In comp.lang.perl.misc Craig Ciquera <craig@mathworks.com> wrote:
> perldoc -f defined was helpful in this case. You may want to take a
> look.
Ugh. The defined function does ugly things with arrays indeed.
In the modified cod belowe, it generates no error since Perl is
generating a brand new thingy for each call. I would have
assumed that my produced a 100% fresh and unopened varable
each time, but it re-uses some internal things apparently.
#!/usr/local/bin/perl5 -w
use strict;
sub test {
my $yn = shift;
my @array;
@array = ( 'A','B','C','D' ) if $yn;
print "$yn : $array[2]\n" if defined @array;
return \@array;
}
my $x=test(0); my $y=test(1); my $z=test(0);
--
IanSmith@ncinter.net Visit Below!
My HP48/Imagine/ImageMaster/FractalExtreme Page --> www.ian.org
The best baseball simulation on the market! --> www.imonkey.com
------------------------------
Date: Tue, 31 Aug 1999 17:16:57 -0400
From: "Tom Lichti" <tom_lichti@interactivemedia.com>
Subject: Re: Win32::EventLog Issue
Message-Id: <7qhgot$lih$1@demon.uunet.ca>
After much head scratching and trial and error, I discovered the problem: if
the item (either hardware or software) does not exist on the machine you are
monitoring _from_, the message does not get built correctly. I believe it
has to do with some resource files (dll's, I assume) that don't exist on the
monitoring machine, so the formatmessage function fails. I can only assume
this is the problem from what I read in the Win32 API reference documents,
and investigation of the failed messages bears this out.
Thanks again,
Tom
Tom Lichti wrote in message <7q6nib$cbh$1@goblin.uunet.ca>...
>I am using this module to remotely access/monitor a number of NT Server
>event logs, and it seems to work fine except for one thing: the actual
event
>message is not always returned, and I get an "Use of uninitialized value at
>V:\DOCS\DEV\Eventmon.pl line 55" error for every event that does not return
>a message. If I access the log through the REAL event viewer (either
locally
>or remotely) all events and their messages are present.
>
>Does anyone have any experience with this module, and more specifically
this
>problem? Please reply direct as well as to this group.
>
>Thanks in advance.
>Tom Lichti
>
>
>
------------------------------
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
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 690
*************************************