[25310] in Perl-Users-Digest
Perl-Users Digest, Issue: 7555 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 22 18:05:39 2004
Date: Wed, 22 Dec 2004 15:05:09 -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 Wed, 22 Dec 2004 Volume: 10 Number: 7555
Today's topics:
Re: [OT] ASCIIgram for square root (John Savard)
Re: Basic CGI.pm question <emschwar@pobox.com>
Re: Basic CGI.pm question <Juha.Laiho@iki.fi>
Re: Basic CGI.pm question <1usa@llenroc.ude.invalid>
Re: Change file creation date? <matternc@comcast.net>
Re: Change file creation date? <nobull@mail.com>
Re: Change file creation date? <matternc@comcast.net>
Re: copy mysql database with perl <kkeller-usenet@wombat.san-francisco.ca.us>
Re: input <>; not working? <nobull@mail.com>
Re: input <>; not working? <jgibson@mail.arc.nasa.gov>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 22 Dec 2004 19:10:39 GMT
From: jsavard@excxn.aNOSPAMb.cdn.invalid (John Savard)
Subject: Re: [OT] ASCIIgram for square root
Message-Id: <41c9c3f8.1687850@news.ecn.ab.ca>
On Wed, 22 Dec 2004 11:18:24 +0100, David Kastrup <dak@gnu.org> wrote,
in part:
>Ed Murphy <emurphy42@socal.rr.com> writes:
>> On Wed, 22 Dec 2004 01:56:47 +0000, Nicholas O. Lindan wrote:
>>
>>> Slightly OT,
>>
>> Only slightly?
>>
>>> is there an accepted ASCII-gram for square root?
>>
>> _______
>> _ /(x+y)*z
>> v2 would be my suggestion, or / ------- for more complex expressions.
>> v a+2
>>
>> sqrt(2) or 2^.5 is generally more manageable, though.
>
>Well Emacs Calc suggests
>
> ___________
> | (x + y) z
> | ---------
>\| a + 2
>
>and there is something to be said for your Usenet reader to be able to
>manipulate simple formulas graphically.
I like the first form visually, but I do feel that it can be confusing
to use letters anywhere in a built-up portion of a formula, so my choice
is:
_____________
/ (x + y) z
/ -----------
\/ a + 2
I found that one easy enough; where I had to think a bit was to find a
good substitute for the integral sign:
_
/ p 2
| x + 4x + 3
| ------------ , dx
| x + 1
_/ 0
That, I think, would scale well to larger sizes. Thus, we can have
_
/ theta / psi pi \ / psi pi \
| sin | ----- + --- | + cos | ----- + --- |
| \ 2 4 / \ 2 4 /
| ------------------------------------------------- , d psi
| ____________________________
| / 2 / psi pi \
| / 1 + tan | ----- - --- |
_/ 0 \/ \ 2 4 /
John Savard
http://home.ecn.ab.ca/~jsavard/index.html
------------------------------
Date: Wed, 22 Dec 2004 12:09:38 -0700
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: Basic CGI.pm question
Message-Id: <etoacs6w3nx.fsf@wilson.emschwar>
"Will Hartung" <willh@msoft.com> writes:
> Yea, I saw that reference. I just didn't know what that meant. Well, I
> should say I DO know what it means, I just don't know how to use it. The
> "-debug pragma" is obivously some kind of switch that's thrown someplace and
> associated with CGI, but the detail on how to do that is missing (I should
> say missing in me).
The first hit for '-debug' in 'perldoc CGI' is:
For example, the following use statement imports the standard set
of functions and enables debugging mode (pragma -debug):
use CGI qw/:standard -debug/;
You'll pardon us, I hope, for not being terribly sympathetic to your
inability to find it.
> It's one of those assumed undercurrents thats rocketing me deeper
> into the depths of Perl than where I am,
It's not only not assumed, it's stated blatantly. Just *read the
documentation*. For any module you use, if you don't know exactly
what it does and why, *read the documentation*. The greatest strength
of Perl, IMO, is not its DWIM, its built-in regexes, or even
necessarily CPAN. It's the fact that every single module you install
will have documentation, accessible via perldoc.
If you don't use it, you are doing yourself (and, unfortunately, the
rest of clpm) a great disservice.
> but it's still dark and my flashlight is on the blink.
You're on the top of the mountain, and it's high noon, nary a cloud in
the sky, but you refuse to take off the blindfold you put on yourself.
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Wed, 22 Dec 2004 19:28:21 +0000 (UTC)
From: Juha Laiho <Juha.Laiho@iki.fi>
Subject: Re: Basic CGI.pm question
Message-Id: <cqchsl$ps5$1@ichaos.ichaos-int>
"Will Hartung" <willh@msoft.com> said:
>I was trying to write a simple CGI script last night and ran in to some
>issues.
...
>use CGI;
>
>my $query = new CGI;
>my $vars = $query->Vars;
...
>Later, I discovered that it the CGI.pm version it had installed didn't
>support the $query->Vars routine.
>
>So, I upgraded to 5.8 using www.blastwave.com.
...
>Now, CGI no longer prompts me for the name=value pairs. I read some
>documentation that said that it should, or that I could add pairs by doing
>"x.pl abc=123" on the command line. But that isn't working either.
...
>Can someone perhaps nudge me in the right direction on what I'm doing wrong?
>Apparently the documenation I've been using is wrong or out of date.
As for documentation, see the documentation that comes with your
installation. THat way you'll get documentation that corresponds
with your installed versions.
Then, is this doing what you're looking for:
=====
#! /usr/bin/perl -T
use strict;
use warnings;
use CGI qw/-debug/;
my $q=new CGI();
my $varref=$q->Vars();
foreach (keys %{$varref}) {
print join('=',$_,$varref->{$_}),"\n";
}
=====
So, the qw/-debug/ will give you back the prompt to enter name/value
pairs on stdin. You can also dige name/value pairs on the command
line. Also, the use of Vars seems to work for me (perl 5.8.0, CGI.pm
2.89).
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
------------------------------
Date: 22 Dec 2004 20:13:53 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Basic CGI.pm question
Message-Id: <Xns95C79AF2F9977asu1cornelledu@132.236.56.8>
"Will Hartung" <willh@msoft.com> wrote in
news:32tqeqF3r491uU1@individual.net:
> I was trying to write a simple CGI script last night and ran in to
> some issues.
You know your script has issues, right?
> use CGI;
>
> my $query = new CGI;
> my $vars = $query->Vars;
> my $elements;
Here you declare $elements as a scalar.
> my $combined;
>
> $elements{abc} = "123";
> $elements{xyz} = "qed";
Here you are accessing the elements of an undeclared hash.
> %combined = (%elements, %vars);
>
> print %combined;
C:\Home> perl -c t4.pl
Global symbol "%elements" requires explicit package name at t4.pl line
11.
Global symbol "%elements" requires explicit package name at t4.pl line
12.
Global symbol "%combined" requires explicit package name at t4.pl line
14.
Global symbol "%elements" requires explicit package name at t4.pl line
14.
Global symbol "%vars" requires explicit package name at t4.pl line 14.
Global symbol "%combined" requires explicit package name at t4.pl line
16.
t4.pl had compilation errors.
use warnings;
use strict;
use CGI(-debug);
my $cgi = CGI->new;
use Data::Dumper;
print Dumper($cgi->Vars);
C:\Home> perl t4.pl
(offline mode: enter name=value pairs on standard input; press ^D or ^Z
when done)
5
^Z
keywords
$VAR2 = 5
--
A. Sinan Unur
1usa@llenroc.ude.invalid
(remove '.invalid' and reverse each component for email address)
------------------------------
Date: Wed, 22 Dec 2004 15:10:04 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: Change file creation date?
Message-Id: <K7qdnUZLH8gBSVTcRVn-qg@comcast.com>
jbl wrote:
> I want to modify the file creation time to syncronize my local dates
> with the dates on a server.
You can't. There's no such thing as "file creation time", at least not
on a Windows or UNIX computer. The filesystem does not track such a
statistic.
--
Christopher Mattern
"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
------------------------------
Date: Wed, 22 Dec 2004 21:16:31 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Change file creation date?
Message-Id: <cqcnu0$rp6$2@sun3.bham.ac.uk>
Chris Mattern wrote:
> jbl wrote:
>
>>I want to modify the file creation time to syncronize my local dates
>>with the dates on a server.
>
> You can't. There's no such thing as "file creation time", at least not
> on a Windows or UNIX computer. The filesystem does not track such a
> statistic.
Er, NTFS5 does. (I think earlier NTFS did too).
------------------------------
Date: Wed, 22 Dec 2004 17:06:20 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: Change file creation date?
Message-Id: <4fudnafIO7hBclTcRVn-qA@comcast.com>
Brian McCauley wrote:
>
>
> Chris Mattern wrote:
>
>> jbl wrote:
>>
>>>I want to modify the file creation time to syncronize my local dates
>>>with the dates on a server.
>>
>> You can't. There's no such thing as "file creation time", at least not
>> on a Windows or UNIX computer. The filesystem does not track such a
>> statistic.
>
> Er, NTFS5 does. (I think earlier NTFS did too).
Ah, well, my Windows knowledge is is weaker than my UNIX knowledge.
So noted.
--
Christopher Mattern
"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
------------------------------
Date: Wed, 22 Dec 2004 11:31:01 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: copy mysql database with perl
Message-Id: <lkuo92xhsu.ln2@goaway.wombat.san-francisco.ca.us>
On 2004-12-22, Wang Penghui <wangpenghui@realss.com> wrote:
>
> Could perl copy mysql database just like mysqlhotcopy do?
Presumably, since mysqlhotcopy *is* written in Perl. :)
http://dev.mysql.com/doc/mysql/en/mysqlhotcopy.html
--keith
--
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
------------------------------
Date: Wed, 22 Dec 2004 21:28:00 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: input <>; not working?
Message-Id: <cqcoji$sao$1@sun3.bham.ac.uk>
Billy wrote:
> "ajs@ajs.com" <AaronJSherman@gmail.com> wrote in message
> news:1103733713.510922.174670@f14g2000cwb.googlegroups.com...
>
>>Questions:
>>
>>2. What's your input when you run this? Are you running it from the
>>command line, or are you trying to run it from inside something else
>>(like a Web server, which will not work)?
>
>
> running it from the url line of internet explorer or netscape...
> i.e. domainname.com/cgi-bin/test.pl
Then it looks like this ia a CGI script. It is meaningless to use <> in
this context. Don't do it. What it is you were trying to achieve?
------------------------------
Date: Wed, 22 Dec 2004 13:43:33 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: input <>; not working?
Message-Id: <221220041343330229%jgibson@mail.arc.nasa.gov>
In article <Yijyd.618575$D%.589101@attbi_s51>, Billy
<bustanut2020@yahoo.com> wrote:
> "ajs@ajs.com" <AaronJSherman@gmail.com> wrote in message
> news:1103733713.510922.174670@f14g2000cwb.googlegroups.com...
> > Questions:
> >
> > 1. How do you run this? You're using <>, which will read from files you
> > provide on the command-line or default to STDIN. <STDIN> might be what
> > you meant.
>
> Tried it both ways...I thought they were equivelent...
>
> > 2. What's your input when you run this? Are you running it from the
> > command line, or are you trying to run it from inside something else
> > (like a Web server, which will not work)?
>
> running it from the url line of internet explorer or netscape...
> i.e. domainname.com/cgi-bin/test.pl
>
> > 3. You can re-write your code to tell you a bit more:
> >
> > warn "STDIN is not a terminal; may not work\n" unless -t STDIN;
> > print "Enter a number: ";
> > chomp($number = <STDIN>);
> > printf "The number is '%s' length %d.\n", $number, length($number);
> > Hope that helps.
>
> The code above didn't give anymore then before... This has me stumped....
You cannot read keyboard input from a CGI program launched by a web
server in response to a request for a web page from a browser. Usually,
the keyboard is not even attached to the computer running the web
server.
Standard input for a CGI program might contain a POST request, or
perhaps an uploaded file.
Try running your perl program from a command line prompt.
What are you trying to accomplish? If you are trying to get keyboard
input to your CGI program, use an HTML form with a text field. Let us
know what you are actually trying to do and someone may be able to help
you.
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------
http://www.newsfeed.com The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----
------------------------------
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 7555
***************************************