[25379] in Perl-Users-Digest
Perl-Users Digest, Issue: 7624 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 9 18:05:34 2005
Date: Sun, 9 Jan 2005 15:05:15 -0800 (PST)
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, 9 Jan 2005 Volume: 10 Number: 7624
Today's topics:
CGI::upload() fails to return valid handle <zen13097@zen.co.uk>
Re: CGI::upload() fails to return valid handle <noreply@gunnar.cc>
Re: CGI::upload() fails to return valid handle <zen13097@zen.co.uk>
Re: CGI::upload() fails to return valid handle <noreply@gunnar.cc>
Re: complex numbers <jurgenex@hotmail.com>
DOM newbie problem, please help! <jet.jetpac@gmail.com>
Re: Extarcting And Storing a String <joe@inwap.com>
Re: Extarcting And Storing a String <hx_101@hotmail.com>
Re: Extarcting And Storing a String <hx_101@hotmail.com>
Re: Extarcting And Storing a String charley@pulsenet.com
Re: Extarcting And Storing a String charley@pulsenet.com
Re: FAQ 1.3 Which version of Perl should I use? <tintin@invalid.invalid>
Re: FAQ 1.3 Which version of Perl should I use? <vilain@spamcop.net>
Re: FAQ 4.30: How do I capitalize all the words on one <news@chaos-net.de>
Re: FAQ 4.30: How do I capitalize all the words on one <matthew.garrish@sympatico.ca>
HELP needed for a small script (David)
Re: HELP needed for a small script <noreply@gunnar.cc>
Re: HELP needed for a small script ioneabu@yahoo.com
Re: Is zero even or odd? <a.newmane.remove@eastcoastcz.com>
Re: Is zero even or odd? <earle.jones@comcast.net>
pack and unpack ? (Steve)
Re: pack and unpack ? (Michael Fuhr)
Re: Some question?! <bik.mido@tiscalinet.it>
Re: Some question?! <bik.mido@tiscalinet.it>
Re: Some question?! <matthew.garrish@sympatico.ca>
Re: Some question?! <nobull@mail.com>
Re: trying to connect to a mysql database, to input a f <ewitkop90@hotmail.com>
Re: trying to connect to a mysql database, to input a f <ewitkop90@hotmail.com>
Re: unicode support <jurgenex@hotmail.com>
Re: unicode support <matthew.garrish@sympatico.ca>
Re: unicode support <cwilbur@mithril.chromatico.net>
XML::Smart, how to print out tree <bart@NOSPAM.tvreclames.nl>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 09 Jan 2005 19:12:08 GMT
From: Dave Weaver <zen13097@zen.co.uk>
Subject: CGI::upload() fails to return valid handle
Message-Id: <41e18208$0$14267$db0fefd9@news.zen.co.uk>
I'm having trouble with a CGI program I wrote to allow uploads to my
web server.
CGI::upload() always seems to return undef, but I expect it, given
the name of a field of the appropriate type, to return a valid file
handle. I have read and re-read the CGI.pm docs, and can't see what
I'm doing wrong (but I presume it's something silly!). This appears to
be a relevant line:
"When called with the name of an upload field, upload() returns a
filehandle, or undef if the parameter is not a valid filehandle."
The parameter I pass to upload() is the name of a filefield param
(and NOT a valid filehandle - I *want* a valid filehandle, which is
why I'm calling upload() in the first place! Seems like some bad
wording in the docs), which appears to be exactly the same as the
samples in the docs. What am I doing wrong, or what have I
misunderstood?
Here is a small-ish sample program that exhibits the problem
(CGI v3.05, perl v5.8.5) :
#!/usr/bin/perl -T
use strict;
use warnings;
use CGI qw(:standard);
use File::Basename;
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
unless ( param( 'uploaded_file' ) ) {
print header,
start_html,
h1( 'File Upload ' ),
start_form,
filefield( -name => 'uploaded_file', -size => 80 ),
br() x 2,
submit( -name => 'Upload' ),
end_form,
end_html;
exit;
}
print header, start_html;
my $filename = param ( 'uploaded_file' );
my $fh = upload( 'uploaded_file' ) or do {
print h1( "Failed to get upload filehandle for '$filename' : ("
. cgi_error() . ")" ), end_html;
exit;
};
my $outname = basename $filename;
open my $f, '>', "/var/www/localhost/htdocs/downloads/uploads/$outname" or do {
print h1( "Failed to upload $outname : $!" ), end_html;
exit;
};
binmode $f;
while ( my $bytes = read $fh, my $data, 10240 ) {
print $f $data;
}
close $f;
print "$outname has been successfully uploaded. Thank you!", end_html;
__END__
------------------------------
Date: Sun, 09 Jan 2005 20:33:57 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: CGI::upload() fails to return valid handle
Message-Id: <34df68F47i5m5U1@individual.net>
Dave Weaver wrote:
> I'm having trouble with a CGI program I wrote to allow uploads to my
> web server.
>
> CGI::upload() always seems to return undef, but I expect it, given
> the name of a field of the appropriate type, to return a valid file
> handle.
What does the form look like?
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 09 Jan 2005 21:22:20 GMT
From: Dave Weaver <zen13097@zen.co.uk>
Subject: Re: CGI::upload() fails to return valid handle
Message-Id: <41e1a08c$0$14269$db0fefd9@news.zen.co.uk>
On Sun, 09 Jan 2005 20:33:57 +0100,
Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
>
> What does the form look like?
>
All the codem, including that to produce the form, was in my original
post.
------------------------------
Date: Sun, 09 Jan 2005 23:27:51 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: CGI::upload() fails to return valid handle
Message-Id: <34dpcoF46m83eU1@individual.net>
Dave Weaver wrote:
> On Sun, 09 Jan 2005 20:33:57 +0100,
> Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
>>
>> What does the form look like?
>
> All the codem, including that to produce the form, was in my original
> post.
Aha, sorry about that.
Anyway, as I suspected the problem is in the form. Try
start_form(-enctype => 'multipart/form-data')
and you are done.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Sun, 09 Jan 2005 08:58:13 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: complex numbers
Message-Id: <Fm6Ed.3556$u47.321@trnddc09>
xah@xahlee.org wrote:
> #python supports complex numbers.
[...]
So?
> # Perl doesn't support complex numbers. But there are packages that
> supports it.
The Math::Complex module is part of the standard installation already, no
need for any "packages" (whatever that might be).
Did you check "perldoc Math::Complex"
NAME
Math::Complex - complex numbers and associated mathematical functions
[...]
jue
------------------------------
Date: 9 Jan 2005 09:48:48 -0800
From: "jet.jetpac@gmail.com" <jet.jetpac@gmail.com>
Subject: DOM newbie problem, please help!
Message-Id: <1105292928.262505.23530@c13g2000cwb.googlegroups.com>
I've tried to write an application using XML::DOM in perl. I'm not able
to getNoddeValue at text node.
XML FILE:
---
<sample param="some param">
<text_node> Test data. </text_node>
</sample>
---
My perl portion:
---
#!/usr/bin/perl
use strict;
use warnings;
use XML::DOM;
my $parser = XML::DOM::Parser->new;
my $document = $parser->parsefile("test.xml");
my $value=$document->getDocumentElement->getFirstChild->getNodeValue;
print "$value\n";
----
The problem is, that $value is not set, getNodeValue returns null,
getNodeName returns '#text'. Can anybody PLEASE tell me, what am I
doing wrong? I'm almost ill of the testing...
Thanks for any help,
Peter
------------------------------
Date: Sat, 08 Jan 2005 23:17:53 -0800
From: Joe Smith <joe@inwap.com>
Subject: Re: Extarcting And Storing a String
Message-Id: <osidnfhaZLY-R33cRVn-vQ@comcast.com>
Digger wrote:
> So how do I go about opening the logfile and running your while loop
> on it????
You don't have to do anything. Just specify the log file name(s)
on the command line.
perl logchecker.pl file1.log file2.log file3.log
Now that you know it is possible, go and study how while(<>){} works.
-Joe
------------------------------
Date: Sun, 09 Jan 2005 12:45:22 -0500
From: Digger <hx_101@hotmail.com>
Subject: Re: Extarcting And Storing a String
Message-Id: <scr2u0lv8n56ljre08pvc3309tcmvfmc10@4ax.com>
On Sat, 08 Jan 2005 23:17:53 -0800, Joe Smith <joe@inwap.com> wrote:
>Digger wrote:
>
>> So how do I go about opening the logfile and running your while loop
>> on it????
>
>You don't have to do anything. Just specify the log file name(s)
>on the command line.
>
> perl logchecker.pl file1.log file2.log file3.log
>
>Now that you know it is possible, go and study how while(<>){} works.
> -Joe
lol...... I had a typo in the syntax I was using.......
------------------------------
Date: Sun, 09 Jan 2005 14:01:41 -0500
From: Digger <hx_101@hotmail.com>
Subject: Re: Extarcting And Storing a String
Message-Id: <5iv2u01lbaenj4upa6qhoe3lsr77i8voi6@4ax.com>
On Sun, 09 Jan 2005 12:45:22 -0500, Digger <hx_101@hotmail.com>
wrote:
>On Sat, 08 Jan 2005 23:17:53 -0800, Joe Smith <joe@inwap.com> wrote:
>
>>Digger wrote:
>>
>>> So how do I go about opening the logfile and running your while loop
>>> on it????
>>
>>You don't have to do anything. Just specify the log file name(s)
>>on the command line.
>>
>> perl logchecker.pl file1.log file2.log file3.log
>>
>>Now that you know it is possible, go and study how while(<>){} works.
>> -Joe
>lol...... I had a typo in the syntax I was using.......
Ok here is what's happening...
script:
#!/usr/bin/perl -w
#
$ARGV[0] = 'url2.log';
my %status;
while (<>) {
/ (FAILED|SUCCESS) (.*)/ and $status{$2} = $1;
}
print "URLs whose last status was SUCCESS:\n";
$status{$_} eq 'SUCCESS' and print " $_\n" for sort keys %status;
print "\nURLs whose last status was FAILED:\n";
$status{$_} eq 'FAILED' and print " $_\n" for sort keys %status;
Log File:
root@digger > more url2.log
[2005-01-04 09:17:59] FAILURE RESPONSE: Exceeded retry count (1) from
http://192.168.6.7:2888/
[2005-01-04 09:17:59] FAILURE RESPONSE: Exceeded retry count (1) from
http://192.9.6.7:2888/
[2005-01-04 09:18:57] SUCCESS RESPONSE from http://192.168.6.7:2888/
[2005-01-04 09:26:57] FAILURE RESPONSE from http://192.55.6.7:2888/
Output:
root@digger > ./test2.pl
URLs whose last status was SUCCESS:
RESPONSE from http://192.168.6.7:2888/
URLs whose last status was FAILED:
As we can see it did pick up the first URL that initially FAILED then
a few minutes later had a SUCCESS. But it didn't pickup
http://192.9.6.7:2888/
http://192.55.6.7:2888/
that both had a FAILURE status, which is what I am concerned
about.....
------------------------------
Date: 9 Jan 2005 12:30:31 -0800
From: charley@pulsenet.com
Subject: Re: Extarcting And Storing a String
Message-Id: <1105302631.290587.28030@c13g2000cwb.googlegroups.com>
Digger wrote:
> #!/usr/bin/perl -w
> #
> $ARGV[0] = 'url2.log';
> my %status;
> while (<>) {
> / (FAILED|SUCCESS) (.*)/ and $status{$2} = $1;
> }
Line above s/b
/ (FAILURE|SUCCESS).+?from (.+)/ and $status{$2} = $1;
> print "URLs whose last status was SUCCESS:\n";
> $status{$_} eq 'SUCCESS' and print " $_\n" for sort keys %status;
>
> print "\nURLs whose last status was FAILED:\n";
> $status{$_} eq 'FAILED' and print " $_\n" for sort keys %status;
In the line above, 'FAILED' s/b 'FAILURE'
$status{$_} eq 'FAILURE' and print " $_\n" for sort keys %status;
> Output:
>
> root@digger > ./test2.pl
> URLs whose last status was SUCCESS:
> RESPONSE from http://192.168.6.7:2888/
>
> URLs whose last status was FAILED:
>
>
>
> As we can see it did pick up the first URL that initially FAILED then
> a few minutes later had a SUCCESS. But it didn't pickup
> http://192.9.6.7:2888/
> http://192.55.6.7:2888/
Output with my changes to the code:
URLs whose last status was SUCCESS:
http://192.168.6.7:2888/
URLs whose last status was FAILED:
http://192.55.6.7:2888/
http://192.9.6.7:2888/
I think these changes should give you the desired results.
Chris
------------------------------
Date: 9 Jan 2005 12:41:12 -0800
From: charley@pulsenet.com
Subject: Re: Extarcting And Storing a String
Message-Id: <1105303272.874149.70530@c13g2000cwb.googlegroups.com>
Wow, there is a piece missing in the first change;
/ (FAILURE|SUCCESS).+?from (.+)/ (** wrong)
/ (FAILURE|SUCCESS).+?from (.+)/ and $status{$2} = $1; (** right)
------------------------------
Date: Sun, 9 Jan 2005 19:50:38 +1300
From: "Tintin" <tintin@invalid.invalid>
Subject: Re: FAQ 1.3 Which version of Perl should I use?
Message-Id: <34c2ekF48sp3gU1@individual.net>
"PerlFAQ Server" <comdog@panix.com> wrote in message
news:crp3o5$9if$1@reader1.panix.com...
>
> 1.3: Which version of Perl should I use?
>
> You should definitely use version 5. Version 4 is old, limited, and no
> longer maintained; its last patch (4.036) was in 1992, long ago and far
> away. Sure, it's stable, but so is anything that's dead; in fact, perl4
> had been called a dead, flea-bitten camel carcass. The most recent
> production release is 5.8.2 (although 5.005_03 and 5.6.2 are still
> supported).
> The most cutting-edge development release is 5.9. Further
> references to the Perl language in this document refer to the
> production
> release unless otherwise specified. There may be one or more official
> bug fixes by the time you read this, and also perhaps some experimental
> versions on the way to the next release. All releases prior to 5.004
> were subject to buffer overruns, a grave security issue.
Does this FAQ need to be so specific about version numbers, given that the
latest version is 5.8.6 and 5.9.1?
Perhaps just mention which older versions are still supported and the
difference between the production and development version numbers.
------------------------------
Date: Sun, 09 Jan 2005 13:30:34 -0800
From: Michael Vilain <vilain@spamcop.net>
Subject: Re: FAQ 1.3 Which version of Perl should I use?
Message-Id: <vilain-664A47.13303409012005@news.giganews.com>
In article <090120050156263397%comdog@panix.com>,
brian d foy <comdog@panix.com> wrote:
> In article <34c2ekF48sp3gU1@individual.net>, Tintin
> <tintin@invalid.invalid> wrote:
>
> > Does this FAQ need to be so specific about version numbers, given that the
> > latest version is 5.8.6 and 5.9.1?
>
> I get this question a lot in training classes. A lot of organizations
> don't upgrade until they absolutely need to.
Same with ISP's. They're running a very old version of MySQL because
they don't want customer's applications to break.
--
DeeDee, don't press that button! DeeDee! NO! Dee...
------------------------------
Date: 9 Jan 2005 12:13:38 GMT
From: Martin Kissner <news@chaos-net.de>
Subject: Re: FAQ 4.30: How do I capitalize all the words on one line?
Message-Id: <slrncu27vh.2hj.news@maki.homeunix.net>
Jürgen Exner wrote :
> kerb@kerb.eu.org wrote:
>> $text =~ tr/a-a/A-Z/;
>
> $text =~ tr/a-z/A-Z/;
>
> This prints
> JüRGEN
> while the correctly uppercased text would have been
> JÜRGEN
How about:
$text =~ tr/a-zäöü/A-ZÄÖÜ/;
This does the Job.
HTH
--
Epur Si Muove (Gallileo Gallilei)
------------------------------
Date: Sun, 9 Jan 2005 13:58:26 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: FAQ 4.30: How do I capitalize all the words on one line?
Message-Id: <f9fEd.1104$b64.68190@news20.bellglobal.com>
"Martin Kissner" <news@chaos-net.de> wrote in message
news:slrncu27vh.2hj.news@maki.homeunix.net...
> Jürgen Exner wrote :
>> kerb@kerb.eu.org wrote:
>>> $text =~ tr/a-a/A-Z/;
>>
>> $text =~ tr/a-z/A-Z/;
>>
>> This prints
>> JüRGEN
>> while the correctly uppercased text would have been
>> JÜRGEN
>
> How about:
> $text =~ tr/a-zäöü/A-ZÄÖÜ/;
> This does the Job.
>
But what about àáâãçèé, etc.?
That's why the solution posted is so very, very wrong. Please read the faq.
Matt
------------------------------
Date: 9 Jan 2005 14:32:38 -0800
From: david@prosl.com (David)
Subject: HELP needed for a small script
Message-Id: <dd02b68d.0501091432.213f51c4@posting.google.com>
First off all, my apologies if this message has no direct concern with
this group
I'm actually looking for help with a script for my website I couldn't
find on the web
In order for my customers to track their orders, the script would open
a txt file looking like:
00001;we are preparing your order
00002;we are preparing your order
00003;your order has been shipped
00004;we are preparing your order
00005;we are waiting for your payment
00006......
The customer gives his order reference (field 1) in a "search" text
box, the script checks out the txt file and the page then returns
order status (field 2)- If order reference does not exist, page
returns for exemple "Order does not exist"
As I'm a newbie (sorrrry ;-), how do I place this script in my html
page ? Do I have to create a .cgi file ? Cut & Paste in my page ???
What about CHMOD ???
I'm not asking for a complete course but I would be so grateful for
your help regarding this matter !
Thanks in advance guys ;-)
David
------------------------------
Date: Sun, 09 Jan 2005 23:43:17 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: HELP needed for a small script
Message-Id: <34dq9oF4am7nvU1@individual.net>
David wrote:
> I'm actually looking for help with a script for my website I couldn't
> find on the web
<job specification snipped>
If you are looking for somebody who writes it for you, try:
http://jobs.perl.org/
If you want to give it a try yourself, these links might be useful:
About Perl:
http://learn.perl.org/
About CGI scripts:
http://cgi.resourceindex.com/Documentation/CGI_Tutorials/
Then, if you encounter difficulties to make it work, you are welcome to
ask for help. Ask here if the problem is about Perl itself, or else
comp.infosystems.www.authoring.cgi is a more appropriate newsgroup.
Good luck!
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 9 Jan 2005 14:55:15 -0800
From: ioneabu@yahoo.com
Subject: Re: HELP needed for a small script
Message-Id: <1105311315.249380.292690@c13g2000cwb.googlegroups.com>
David wrote:
> First off all, my apologies if this message has no direct concern
with
> this group
> I'm actually looking for help with a script for my website I couldn't
> find on the web
>
> In order for my customers to track their orders, the script would
open
> a txt file looking like:
>
>
> 00001;we are preparing your order
> 00002;we are preparing your order
> 00003;your order has been shipped
> 00004;we are preparing your order
> 00005;we are waiting for your payment
> 00006......
>
> The customer gives his order reference (field 1) in a "search" text
> box, the script checks out the txt file and the page then returns
> order status (field 2)- If order reference does not exist, page
> returns for exemple "Order does not exist"
>
> As I'm a newbie (sorrrry ;-), how do I place this script in my html
> page ? Do I have to create a .cgi file ? Cut & Paste in my page ???
> What about CHMOD ???
>
> I'm not asking for a complete course but I would be so grateful for
> your help regarding this matter !
>
> Thanks in advance guys ;-)
>
> David
I am going sky diving tomorrow and I was wondering if anyone can give
me some tips on how to make my own parachute...
Just kidding!
seriously, from one newbie to another, try these books:
Learning Perl, Third Edition
by Randal L. Schwartz, Tom Phoenix
Official Guide to Programming with CGI.pm
by Lincoln Stein
MySQL and Perl for the Web
by Paul DuBois
wana
------------------------------
Date: Sun, 9 Jan 2005 08:21:01 -0800
From: "Alfred Z. Newmane" <a.newmane.remove@eastcoastcz.com>
Subject: Re: Is zero even or odd?
Message-Id: <34d3vdF47dpkeU1@individual.net>
vonroach wrote:
> On Fri, 31 Dec 2004 09:11:43 -0800, "Alfred Z. Newmane"
> <a.newmane.remove@eastcoastcz.com> wrote:
>
>> What in the sam-hell are you on? Thats what I've /BEEN/ saying, ya
>> trollimous maximus;
>>
>> I've been saying it's undefined.
>
> Then there was the trifle of your ambiguous apple question or should I
> say troll.
I never asked the apple question, that was someone else. No wonder
you're so mixed up, you can't even put a statement with the correct
name!
------------------------------
Date: Sun, 09 Jan 2005 12:25:16 -0800
From: Earle Jones <earle.jones@comcast.net>
Subject: Re: Is zero even or odd?
Message-Id: <earle.jones-DD4092.12251609012005@comcast.dca.giganews.com>
In article <34d3vdF47dpkeU1@individual.net>,
"Alfred Z. Newmane" <a.newmane.remove@eastcoastcz.com> wrote:
> vonroach wrote:
> > On Fri, 31 Dec 2004 09:11:43 -0800, "Alfred Z. Newmane"
> > <a.newmane.remove@eastcoastcz.com> wrote:
> >
> >> What in the sam-hell are you on? Thats what I've /BEEN/ saying, ya
> >> trollimous maximus;
> >>
> >> I've been saying it's undefined.
> >
> > Then there was the trifle of your ambiguous apple question or should I
> > say troll.
>
> I never asked the apple question, that was someone else. No wonder
> you're so mixed up, you can't even put a statement with the correct
> name!
*
Zero is even.
1. It is divisible by two without a remainder.
2. It occurs between two odd integers.
earle
*
------------------------------
Date: 9 Jan 2005 10:37:17 -0800
From: ineverlookatthis@yahoo.com (Steve)
Subject: pack and unpack ?
Message-Id: <f0d57f86.0501091037.4ccc11e8@posting.google.com>
Sorry to be thick, but I have googled this and ended-up more confused
than ever. So I hope you don't mind if I come back on this question.
I am reading a series of bytes from a com port. Having looked at the
data and the way it changes, I *believe* that some or all of the bytes
123 101 60 117
represent a signed floating-point with the value of approximately +24
(+/- 1)
Could someone kindly explain how I get to the value from the raw
bytes?
Thanks
------------------------------
Date: 9 Jan 2005 12:28:16 -0700
From: mfuhr@fuhr.org (Michael Fuhr)
Subject: Re: pack and unpack ?
Message-Id: <41e185d0_3@omega.dimensional.com>
ineverlookatthis@yahoo.com (Steve) writes:
> I am reading a series of bytes from a com port. Having looked at the
> data and the way it changes, I *believe* that some or all of the bytes
>
> 123 101 60 117
>
> represent a signed floating-point with the value of approximately +24
> (+/- 1)
Why do you believe that? What evidence leads you to that conclusion?
> Could someone kindly explain how I get to the value from the raw
> bytes?
Find out for certain what kind of data is represented, how it's
represented, and that you're looking at the right portion of the
data. Beware of looking for a solution before you fully understand
the problem.
Here's one way to create a string of those four bytes and then
unpack that string as a floating-point number:
my $s = pack("C*", 123, 101, 60, 117); # assumes the numbers are decimal
my $f = unpack("f", $s);
On my i386 machine this yields 2.38821e+32; on my sparc it yields
1.19026e+36 (differences due to endianness). If the bytes do indeed
represent a floating-point number around 24 then this method of
unpacking is wrong.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/
------------------------------
Date: Sun, 09 Jan 2005 14:57:30 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Some question?!
Message-Id: <hfv1u098j5ud2busq8gd7jqh8fsrmmgh9i@4ax.com>
On Fri, 7 Jan 2005 22:10:41 +0100, "Tanja" <tanja@verso.co.izbaciovo>
wrote:
>Subject: Some question?!
You'd better choose a relevant Subject line.
>3.) Where to find free version of Cron for Windows?
OT, but I think there should be some available. However are you sure
you want to use cron instead of Windows' native scheduler?
>4.) Can you compare speed of program written in perl, and program written in
>C or Pascal?
> In seconds of execution identical program written in different
>language.
By definition you can't have 'identical programs' written in different
languages (well, with a few witty exceptions, I guess - and depending
on the actual languages). You can have (hopefully!) _equivalent_
programs.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sun, 09 Jan 2005 14:57:33 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Some question?!
Message-Id: <vpv1u0l60ab9j1tti42eue4bek25pb1006@4ax.com>
On Fri, 07 Jan 2005 13:41:26 -0800, Jim Gibson
<jgibson@mail.arc.nasa.gov> wrote:
>> 1.) Is it possible to run IE and fill web form, with perl program?
>
>It is possible to write a stand-alone Perl program that will submit a
>form request to a web server without using IE.
I agree that indeed this is the kind of answer the OP's question
deserves, but FWIW I _think_ that there should be some Win32* trickery
available to perform the task she described, literally.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sun, 9 Jan 2005 13:06:28 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Some question?!
Message-Id: <xoeEd.1021$b64.59247@news20.bellglobal.com>
"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message
news:vpv1u0l60ab9j1tti42eue4bek25pb1006@4ax.com...
> On Fri, 07 Jan 2005 13:41:26 -0800, Jim Gibson
> <jgibson@mail.arc.nasa.gov> wrote:
>
>>> 1.) Is it possible to run IE and fill web form, with perl program?
>>
>>It is possible to write a stand-alone Perl program that will submit a
>>form request to a web server without using IE.
>
> I agree that indeed this is the kind of answer the OP's question
> deserves, but FWIW I _think_ that there should be some Win32* trickery
> available to perform the task she described, literally.
>
If the IE part of the equation is not important, there's always
Win32::Internet (but you're always better off using the LWP modules, IMO).
Using Perl (or any other language) to fill out a form in a running instance
of internet explorer is just a needless waste of time.
Matt
------------------------------
Date: Sun, 09 Jan 2005 19:30:42 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Some question?!
Message-Id: <crs0fb$mtq$1@sun3.bham.ac.uk>
Tad McClellan wrote:
> Tanja <tanja@verso.co.izbaciovo> wrote:
>
>>1.) Is it possible to run IE and fill web form, with perl program?
>
>
>
> No.
Er yes, Win32::IE::Mechanize.
> You do not need IE at all.
Indeed you do _not_ need IE but that doesn't mean that you can't do it
that way.
------------------------------
Date: 9 Jan 2005 05:46:14 -0800
From: "erik" <ewitkop90@hotmail.com>
Subject: Re: trying to connect to a mysql database, to input a file
Message-Id: <1105278374.737166.40360@c13g2000cwb.googlegroups.com>
Peter Wyzl wrote:
> <ewitkop90@hotmail.com> wrote in message
> news:1105221468.209116.13100@c13g2000cwb.googlegroups.com...
> : This is my code:
>
> This would be the 'previous line missing the semicolon'
>
> : $dbh = DBI->connect('DBI:mysql;firewall:localhost:3306','xxxx',
> : 'xxxxxxx',
> : {RaiseError => 1, AutoCommit => 1 })
>
>
> This would be the syntax error telling you how to fix it...
>
> : (Missing semicolon on previous line?)
> : syntax error at ./mysql-fwlog-input line 9, near ")
>
> Missing a semicolon on the previous line....?
>
> P
> --
> http://cgi.ebay.com.au/ws/eBayISAPI.dll?ViewItem&rd=1&item=4516341671
> print "Just another Perl Hacker";
I did trying different syntaxes before posting to the group. What ever
I changed, was not working. Give me a little credit. :-)
Thanks all.
------------------------------
Date: 9 Jan 2005 05:46:23 -0800
From: "erik" <ewitkop90@hotmail.com>
Subject: Re: trying to connect to a mysql database, to input a file
Message-Id: <1105278383.938619.40830@c13g2000cwb.googlegroups.com>
Peter Wyzl wrote:
> <ewitkop90@hotmail.com> wrote in message
> news:1105221468.209116.13100@c13g2000cwb.googlegroups.com...
> : This is my code:
>
> This would be the 'previous line missing the semicolon'
>
> : $dbh = DBI->connect('DBI:mysql;firewall:localhost:3306','xxxx',
> : 'xxxxxxx',
> : {RaiseError => 1, AutoCommit => 1 })
>
>
> This would be the syntax error telling you how to fix it...
>
> : (Missing semicolon on previous line?)
> : syntax error at ./mysql-fwlog-input line 9, near ")
>
> Missing a semicolon on the previous line....?
>
> P
> --
> http://cgi.ebay.com.au/ws/eBayISAPI.dll?ViewItem&rd=1&item=4516341671
> print "Just another Perl Hacker";
I did try different syntaxes before posting to the group. What ever I
changed, was not working. Give me a little credit. :-)
Thanks all.
------------------------------
Date: Sun, 09 Jan 2005 09:01:07 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: unicode support
Message-Id: <np6Ed.3557$u47.3380@trnddc09>
xah@xahlee.org wrote:
> # -*- coding: utf-8 -*-
> # python supports unicode in source code by putting a coding
> declaration
> # as the first line.
So?
> In perl, support of unicode is very flaky. The language does not
> support it, but packages that changes behaviors of string handling (in
> its regex, for instance.)
Really? You may want to check your sources. They seem to be a little bit
outdated, like several years old?
jue
------------------------------
Date: Sun, 9 Jan 2005 13:19:19 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: unicode support
Message-Id: <AAeEd.1071$b64.61602@news20.bellglobal.com>
<xah@xahlee.org> wrote in message
news:1105259315.471816.291600@c13g2000cwb.googlegroups.com...
# -*- coding: utf-8 -*-
# python supports unicode in source code by putting a coding
declaration
# as the first line.
print "look chinese chars: ?????"
# Note, however, identifiers cannot use unicode chars.
# e.g. you cannot define a function with unicode char.
So why are you posting to a Perl newsgroup? You can "use utf8" if you want
to write your Perl programs in utf-8 (though you should upgrade to 5.8 as
well). Or is this your lame attempt at trolling at python group?
Matt
------------------------------
Date: Sun, 09 Jan 2005 19:39:29 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Re: unicode support
Message-Id: <87r7ku5riu.fsf@mithril.chromatico.net>
>>>>> "xah" == xah <xah@xahlee.org> writes:
xah> python supports unicode in source
xah> code by putting a coding declaration as the first line.
[...]
xah> In perl, support of unicode is very flaky. The language does
xah> not support it, [...]
All:
Xah Lee is trolling. (Whether he's *only* a troll, or a reasonable
person who occasionally trolls to amuse himself, is a matter of
perspective.) Please note the inaccuracy of his comment on Perl and
the two newsgroups to which this message was posted before replying;
this is a clear case of "lets you and him fight."
Charlton
--
cwilbur at chromatico dot net
cwilbur at mac dot com
------------------------------
Date: Sun, 9 Jan 2005 17:42:56 +0100
From: "Bart van den Burg" <bart@NOSPAM.tvreclames.nl>
Subject: XML::Smart, how to print out tree
Message-Id: <crrnu1$ktv$1@reader08.wxs.nl>
Hi,
I wish to use XML::Smart to make a website with (rather than XML::Simple,
which is really slow), but there's one thing I just cannot figure out: how
do I print out the whole tree?
Thanks,
Bart
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 7624
***************************************