[23235] in Perl-Users-Digest
Perl-Users Digest, Issue: 5456 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 7 18:10:38 2003
Date: Sun, 7 Sep 2003 15:10:14 -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 Sun, 7 Sep 2003 Volume: 10 Number: 5456
Today's topics:
multiple processes running contemporarily! <member32241@dbforums.com>
Re: multiple processes running contemporarily! <kevin@vaildc.net>
Re: multiple processes running contemporarily! (Tad McClellan)
Re: multiple processes running contemporarily! <member32241@dbforums.com>
Newby Question: Displaying Excel from within my CGI <kbass@midsouth.rr.com>
Re: Newby Question: Displaying Excel from within my CGI <noreply@gunnar.cc>
Re: Order of evaluation of expressions <nospam-abuse@ilyaz.org>
Re: PHP vs Perl <newsfeed@boog.co.uk>
Re: PHP vs Perl <REMOVEsdnCAPS@comcast.net>
Possible bug?; keywords for sub idenifier? <tcurrey@no.no.no.i.said.no>
Re: Possible bug?; keywords for sub idenifier? <tcurrey@no.no.no.i.said.no>
Re: problems with charsets <pilsl_usenet@goldfisch.at>
Re: read VB file with Perl <david-del@del-nonspiritual.com>
Re: read VB file with Perl <postmaster@castleamber.com>
Re: read VB file with Perl <david-del@del-nonspiritual.com>
Re: read VB file with Perl <postmaster@castleamber.com>
Re: Repost Search (Jimmy)
Re: <bwalton@rochester.rr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 07 Sep 2003 11:59:02 -0400
From: dominant <member32241@dbforums.com>
Subject: multiple processes running contemporarily!
Message-Id: <3340442.1062950342@dbforums.com>
How could i achive that?
--
Posted via http://dbforums.com
------------------------------
Date: Sun, 07 Sep 2003 13:38:26 -0400
From: Kevin Michael Vail <kevin@vaildc.net>
Subject: Re: multiple processes running contemporarily!
Message-Id: <kevin-9BBBCD.13382607092003@news101.his.com>
In article <3340442.1062950342@dbforums.com>,
dominant <member32241@dbforums.com> wrote:
> How could i achive that?
1. "Contemporarily" isn't a word. Do you mean "contemporaneously"?
2. What is your Perl question?
--
Kevin Michael Vail | Dogbert: That's circular reasoning.
kevin@vaildc.net | Dilbert: I prefer to think of it as no loose ends.
http://www.vaildc.net/kevin/
------------------------------
Date: Sun, 7 Sep 2003 12:42:55 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: multiple processes running contemporarily!
Message-Id: <slrnblmrgv.ghj.tadmc@magna.augustmail.com>
dominant <member32241@dbforums.com> wrote:
>
> How could i achive that?
perldoc -f fork
perldoc -f exec
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 07 Sep 2003 15:15:33 -0400
From: dominant <member32241@dbforums.com>
Subject: Re: multiple processes running contemporarily!
Message-Id: <3340765.1062962133@dbforums.com>
:) simultaneously!
I solved my problem by putting the start word before the command (within
the system())
--
Posted via http://dbforums.com
------------------------------
Date: Sun, 07 Sep 2003 21:08:47 GMT
From: <kbass@midsouth.rr.com>
Subject: Newby Question: Displaying Excel from within my CGI
Message-Id: <z7N6b.3543$WW5.3385@clmboh1-nws5.columbus.rr.com>
I have created a table from my CGI program with data coming from Postgres
and I want to now display this table as an Excel file. How can this be done?
Thanks!
Kevin
------------------------------
Date: Sun, 07 Sep 2003 23:28:20 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Newby Question: Displaying Excel from within my CGI
Message-Id: <bjg81h$irnuu$1@ID-184292.news.uni-berlin.de>
kbass@midsouth.rr.com wrote:
> I have created a table from my CGI program with data coming from
> Postgres and I want to now display this table as an Excel file. How
> can this be done?
CGI ... Postgres ... Excel ...
Do you have a Perl question?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sun, 7 Sep 2003 18:45:01 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Order of evaluation of expressions
Message-Id: <bjfubd$acc$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Eric J. Roode
<REMOVEsdnCAPS@comcast.net>], who wrote in article <Xns93DCE1251F9F8sdn.comcast@206.127.4.25>:
> Parentheses don't control order of evaluation. Associativity is more
> related to precedence than to order of evaluation.
IIRC, C compiler would not rearrage floating point expressions using
associativity/distributivity. However, it may rearrange integer
expressions (since for integer types the associativity/distributivity
hold); or rearrange things due to commutativity.
Perl lacking any optimization lieves it out of question completely...
Hope this helps,
Ilya
------------------------------
Date: Sun, 7 Sep 2003 14:19:06 +0100
From: "Peter Cooper" <newsfeed@boog.co.uk>
Subject: Re: PHP vs Perl
Message-Id: <bjfbai$if621$1@ID-194358.news.uni-berlin.de>
"Eric J. Roode" <REMOVEsdnCAPS@comcast.net> wrote:
> Almost exactly the same:
>
> use Time::Format;
Very cool, never knew about this module before (there's always new ones
hiding around the corner, I find!). I'll have to check this one out.
Pete
------------------------------
Date: Sun, 07 Sep 2003 12:48:49 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: PHP vs Perl
Message-Id: <Xns93EF8CA86C30Csdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
"Peter Cooper" <newsfeed@boog.co.uk> wrote in news:bjfbai$if621$1@ID-
194358.news.uni-berlin.de:
> "Eric J. Roode" <REMOVEsdnCAPS@comcast.net> wrote:
>> Almost exactly the same:
>>
>> use Time::Format;
>
> Very cool, never knew about this module before (there's always new ones
> hiding around the corner, I find!). I'll have to check this one out.
Well, I think it's cool -- but I'm biased; I wrote it. :-)
Thanks for your kind words, Peter.
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBP1tvrGPeouIeTNHoEQIupwCg9wvIhFb8N+2y7QVEBIw4OrOdc7sAn2h9
df2wE++VyKBuGL6ZhsaAeotJ
=r65E
-----END PGP SIGNATURE-----
------------------------------
Date: Sun, 7 Sep 2003 13:24:27 -0700
From: "Trent Curry" <tcurrey@no.no.no.i.said.no>
Subject: Possible bug?; keywords for sub idenifier?
Message-Id: <bjg4a1$c6j$1@news.astound.net>
I just wondering, why does Perl allow you to use supposedly reserved words
for a sub (function) identifier?
An example that illustrates this is as follows:
test.pl
----------
#!/usr/bin/perl
package test;
use strict;
$test::Config = new Test_Config;
print $test::Config->my;
print "\n";
----------
Test_Config.pm
----------
package RMS_Config;
use strict;
sub new {
my $this = shift;
my $obj = {
'TEST1' => 1,
'TEST2' => 2
};
bless $obj, $this;
return $obj;
}
sub my {
my $this = shift;
return "test123";
}
1;
----------
Output
----------
[SR@SRLNX test]$ perl -W test.cgi
test123
[SR@SRLNX test]$
----------
Why on earth does it allow reserved names to be used as identifiers? I also
works if tried like this:
test_2.pl
----------
#!/usr/bin/perl
package test;
use strict;
sub my {
print "f o o\n";
}
----------
I get no errors nor warning.
Thanks for any info.
------------------------------
Date: Sun, 7 Sep 2003 14:02:25 -0700
From: "Trent Curry" <tcurrey@no.no.no.i.said.no>
Subject: Re: Possible bug?; keywords for sub idenifier?
Message-Id: <bjg6h7$crj$1@news.astound.net>
"Trent Curry" <tcurrey@no.no.no.i.said.no> wrote in message
news:bjg4a1$c6j$1@news.astound.net...
> I just wondering, why does Perl allow you to use supposedly reserved words
> for a sub (function) identifier?
>
> An example that illustrates this is as follows:
>
[Snipped example code]
Just FYI, I'm using Perl 5.6.1 (i386)
------------------------------
Date: Sun, 7 Sep 2003 21:47:30 +0200
From: peter pilsl <pilsl_usenet@goldfisch.at>
Subject: Re: problems with charsets
Message-Id: <3f5b8bd5$1@e-post.inode.at>
Alan J. Flavell wrote:
>
> Now go to the Perl encoding pages to find out how to define the
> encoding layer (5.8.0+) or the explicit en/de/coding calls to handle
> it. After that it's a doddle (=Spaziergang, Kleinigkeit, or
> whatever).
>
> see also: http://www.perldoc.com/perl5.8.0/lib/Encode.html
> http://www.perldoc.com/perl5.8.0/lib/Encode/Supported.html
>
You are one of the good ghosts in this group. Like many times before you
helped me a lot with accurate information.
Thnx a lot, (tausend dank und so)
peter
--
peter pilsl
pilsl_usenet@goldfisch.at
http://www.goldfisch.at
------------------------------
Date: Sun, 07 Sep 2003 09:59:54 -0500
From: David McDivitt <david-del@del-nonspiritual.com>
Subject: Re: read VB file with Perl
Message-Id: <tbhmlv8aa90br3mrmqb73b0vmlrdnpfndk@4ax.com>
On the VB side I obtained the seconds different between Microsoft base
time and Perl base time using:
DateDiff("s", "12/30/1899", "01/01/1970")
This was then used as a constant in the Perl program.
my $MicrosoftTimeDiff = 2209161600;
print "LastScanTime = ", timestring($LastScanTime), "\n";
sub timestring {
my $perltime = (shift() * 86400) - $MicrosoftTimeDiff;
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
gmtime($perltime);
return sprintf '%02s-%02s-%02s %02s:%02s:%02s',
$mon+1, $mday, $year%100, $hour, $min, $sec;
}
>From: "John W. Krahn" <krahnj@acm.org>
>Date: Sun, 07 Sep 2003 02:49:04 GMT
>Lines: 17
>
>David McDivitt wrote:
>>
>> Thanks to Vlad Tepes for getting me going on this. My Perl program is
>> below. Neat thing is Perl unpacks double floating point values straight
>> out of the input buffer. The date data type in VB is a double with days
>> to the left of the decimal and time to the right. Anyone know how to
>> convert double values to a date string?
>
>Multiply the date by the number of seconds in a day and use localtime to
>convert that to a date string.
------------------------------
Date: Sun, 07 Sep 2003 18:15:11 +0200
From: John Bokma <postmaster@castleamber.com>
Subject: Re: read VB file with Perl
Message-Id: <1062951416.157449@halkan.kabelfoon.nl>
Some small remarks (besides don't top post and do cut parts away that
are no longer relevant).
> open DESCRIPFILE, "<0001.desc";
you *should check this*: open( ...) or die "Can't open '0001.desc': $!";
> read DESCRIPFILE, $buf, $headerlength;
check this too.
[snip]
> for ($j=$stringcount; $j<@pointers; $j++) {
> $template .= "A".$pointers[$j];
> $stringtotal += $pointers[$j];
> }
foreach my $pointer (@pointers) {
$template .= "A$pointer";
$stringtotal += $pointer;
}
notice the string interpolation ("A$pointer"; )
> read DESCRIPFILE, $buf, $stringtotal;
check this
> @strings = unpack $template, $buf;
> close DESCRIPFILE;
check this
> print "LastScanTime = ", $LastScanTime, "\n";
> print "NextExecuteTime = ", $NextExecuteTime, "\n";
You format those lines, why not the samen in the output? Also use HERE
document here:
print <<"REPORT";
LastScanTime = $LastScanTime
NextExecuteTime = $NextExectuteTime
:
:
REPORT
Notice: string interpolation takes place (due to "" around REPORT)
Everything until REPORT (not included) is printed as is (after
interpolation).
There should be *no* spaces (or other stuff) after REPORT
> for ($j=0; $j<$stringcount; $j++) {print "$strings[$j]\n"}
print join("\n", @strings), "\n";
join glues the strings together with a "\n" (hence the additional "\n"
to terminate the last line)
--
Kind regards, feel free to mail: mail(at)johnbokma.com (or reply)
virtual home: http://johnbokma.com/ ICQ: 218175426
John web site hints: http://johnbokma.com/websitedesign/
------------------------------
Date: Sun, 07 Sep 2003 12:17:51 -0500
From: David McDivitt <david-del@del-nonspiritual.com>
Subject: Re: read VB file with Perl
Message-Id: <8bpmlvosdjsap99oo16togks0mtorath7e@4ax.com>
Thanks. I'm almost halfway through Deital's "Perl, How to Program". I
took two Java classes and marvel at how anything so convoluted can
become so widely accepted; classes within classes with classes. Not only
can you not write simple code, but it's slow, and so much crap must be
installed to do development. You should see the VAJava workstations at
work. I have it all too but never used it. I am really excited about
Perl and am already making applications after two weeks.
>From: John Bokma <postmaster@castleamber.com>
>Date: Sun, 07 Sep 2003 18:15:11 +0200
>Lines: 67
<snip>
>There should be *no* spaces (or other stuff) after REPORT
>
>> for ($j=0; $j<$stringcount; $j++) {print "$strings[$j]\n"}
>
>print join("\n", @strings), "\n";
>
>join glues the strings together with a "\n" (hence the additional "\n"
>to terminate the last line)
------------------------------
Date: Sun, 07 Sep 2003 23:44:22 +0200
From: John Bokma <postmaster@castleamber.com>
Subject: Re: read VB file with Perl
Message-Id: <1062971166.542387@halkan.kabelfoon.nl>
David McDivitt wrote:
> Thanks. I'm almost halfway through Deital's "Perl, How to Program". I
> took two Java classes and marvel at how anything so convoluted can
> become so widely accepted; classes within classes with classes.
inner classes can be quite useful. It prevents cluttering. As with every
thing it can be abused etc.
> Not only can you not write simple code,
That is not true :-)
> but it's slow,
Not really true.
> and so much crap must be installed to do development.
The JDSK is sufficient IMHO and a decent editor :-)
> You should see the VAJava workstations at work. I have it all too but
> never used it. I am really excited about Perl and am already making
> applications after two weeks.
:-). I use Java, Perl and some other languages. I always look at the
problem thinking "which language should I use for this, which one suits
the problem". Sometimes it is Perl, sometimes it is Java and sometimes a
totaly different language.
--
Kind regards, feel free to mail: mail(at)johnbokma.com (or reply)
virtual home: http://johnbokma.com/ ICQ: 218175426
John web site hints: http://johnbokma.com/websitedesign/
------------------------------
Date: 7 Sep 2003 07:31:48 -0700
From: jimmy_armand@hotmail.com (Jimmy)
Subject: Re: Repost Search
Message-Id: <72ea1877.0309070631.76930620@posting.google.com>
thank you john. This is just what i needed!
"John W. Krahn" <krahnj@acm.org> wrote in message news:<3F5959CC.417A1932@acm.org>...
> Jimmy wrote:
> >
> > while( <FILEHANDLE> or <FILEHANDLETWO>)
> > {
> > $mesAlertes = <FILEHANDLE>;
> > $mesAlertesDeux = <FILEHANDLETWO>;
> > $final = ($mesAlertes, $mesAlertesDeux);
> >
> > print $final;
> > }
> >
> > Want to make a search in two files, and print data on screen. But if
> > the files have the same data, the data will be display once. My code
> > don't work. why?
> >
> > BTW, i'm a newbie, so thanks to be patient :)
>
> Well, the simple answer is:
>
> @ARGV = ( 'file1', 'file2' );
> my %seen;
> while ( <> ) {
> print unless $seen{ $_ }++;
> }
>
>
> John
------------------------------
Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re:
Message-Id: <3F18A600.3040306@rochester.rr.com>
Ron wrote:
> Tried this code get a server 500 error.
>
> Anyone know what's wrong with it?
>
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {
(---^
> dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
...
> Ron
...
--
Bob Walton
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 5456
***************************************