[27792] in Perl-Users-Digest
Perl-Users Digest, Issue: 9156 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 14 14:05:46 2006
Date: Fri, 14 Apr 2006 11:05:05 -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 Fri, 14 Apr 2006 Volume: 10 Number: 9156
Today's topics:
Re: existence and size of client file <no@thanks.com>
Re: existence and size of client file <noreply@gunnar.cc>
Re: existence and size of client file <no@thanks.com>
Re: existence and size of client file <jurgenex@hotmail.com>
Re: existence and size of client file <no@thanks.com>
Re: existence and size of client file <1usa@llenroc.ude.invalid>
Re: existence and size of client file <jurgenex@hotmail.com>
Re: existence and size of client file <noreply@gunnar.cc>
Re: existence and size of client file <no@thanks.com>
Re: existence and size of client file <no@thanks.com>
Re: existence and size of client file <no@thanks.com>
Re: existence and size of client file xhoster@gmail.com
Other XS progamming questions <bol@adv.magwien.gv.at>
Re: POP3 Mail Client in PERL using IO::Socket module on <ttk@remove_this_and_all_after_org.ciar.org.esper.com>
Problem with DBD::DB2 and UTF8. <shah@typhoon.xnet.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 14 Apr 2006 15:50:46 +0200
From: Asterbing <no@thanks.com>
Subject: Re: existence and size of client file
Message-Id: <MPG.1ea9c71f700b090e9897e7@news.tiscali.fr>
In article <KhM%f.20266$wH1.3677@trnddc03>, jurgenex@hotmail.com says...
> Asterbing wrote:
> > Is there a way to test the existence and size of a client file ?
>
> Depending on what kind of client you are talking about, maybe. Like for
> mirroring systems that's a key functionality.
>
Oh no, in framework of a CGI.
> But what does that have to do with Perl?
Because I'm talking about CGI written in Perl for which I've to
incorporate a feature which will allow users to upload a file. So, my
question was implicitely about Perl, but could be explicitely
reformulated as this : "Is there a way to test the existence and size of
a client file in a CGI written in Perl ? -e and -s are server-side only,
unless mistake.
------------------------------
Date: Fri, 14 Apr 2006 16:06:06 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: existence and size of client file
Message-Id: <4a9oigFs7lqnU1@individual.net>
Asterbing wrote:
> Is there a way to test the existence and size of a client file ? This to
> avoid any unuseful traffic (upload, serveur file test, unlink if too
> big)
Maybe you want to check the $ENV{CONTENT_LENGTH} variable before upload.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Fri, 14 Apr 2006 16:29:58 +0200
From: Asterbing <no@thanks.com>
Subject: Re: existence and size of client file
Message-Id: <MPG.1ea9d05032f9adc99897e8@news.tiscali.fr>
In article <4a9oigFs7lqnU1@individual.net>, noreply@gunnar.cc says...
> Asterbing wrote:
> > Is there a way to test the existence and size of a client file ? This to
> > avoid any unuseful traffic (upload, serveur file test, unlink if too
> > big)
>
> Maybe you want to check the $ENV{CONTENT_LENGTH} variable before upload.
>
>
Well, but the form will only POST the path to file for uploading, not
the length of the file data itself.
------------------------------
Date: Fri, 14 Apr 2006 14:40:05 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: existence and size of client file
Message-Id: <9vO%f.9$7w6.2@trnddc02>
Asterbing wrote:
> In article <KhM%f.20266$wH1.3677@trnddc03>, jurgenex@hotmail.com
> says...
>> Asterbing wrote:
>>> Is there a way to test the existence and size of a client file ?
>>
>> Depending on what kind of client you are talking about, maybe. Like
>> for mirroring systems that's a key functionality.
>
> Oh no, in framework of a CGI.
I suppose you mean HTTP because for the Commone Gateway Interface there
isn't really a client unless you call the CGI program the client because the
other end of the communication line is a web server.
And no, the HTT-Protocol does not provide any means for such inquiries by
the server to the client.
If you think about it it would be quite a security hole if there was such a
method, wouldn't it?
>> But what does that have to do with Perl?
>
> Because I'm talking about CGI written in Perl
Which still doesn't make it a question about Perl because your question and
the answer would be exactly the same even if your CGI program would be
written in C or LOGO or Pascal or Prolog.
First of all you have a question about HTTP, then maybe about CGI.
jue
------------------------------
Date: Fri, 14 Apr 2006 17:01:05 +0200
From: Asterbing <no@thanks.com>
Subject: Re: existence and size of client file
Message-Id: <MPG.1ea9d7a087f43d3c9897ea@news.tiscali.fr>
In article <9vO%f.9$7w6.2@trnddc02>, jurgenex@hotmail.com says...
> First of all you have a question about HTTP, then maybe about CGI.
>
Seen this way, yes, but I could reformulate indefinitively and a day or
another find the angle you wish... For example : does -e, -s or open
authorized to reach client-side files ?
------------------------------
Date: Fri, 14 Apr 2006 15:18:37 +0000 (UTC)
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: existence and size of client file
Message-Id: <Xns97A5730EC30D4asu1cornelledu@132.236.56.8>
Asterbing <no@thanks.com> wrote in
news:MPG.1ea9d7a087f43d3c9897ea@news.tiscali.fr:
> In article <9vO%f.9$7w6.2@trnddc02>, jurgenex@hotmail.com says...
>> First of all you have a question about HTTP, then maybe about CGI.
>>
>
> Seen this way, yes, but I could reformulate indefinitively and a day or
> another find the angle you wish...
As someone else mentioned in a different thread recently, I know what the
words mean but the sentence above makes no sense.
> For example : does -e, -s or open authorized to reach client-side files ?
What client? NFS, SSH etc?
Your question has been answered already: A CGI script running on a web
server has no way of inspecting the file system on the HTTP client that is
making the request to the web server.
The question has nothing whatsoever to do with Perl, and your attempt to
get cute is not appreciate it.
Bye.
Sinan
------------------------------
Date: Fri, 14 Apr 2006 15:36:39 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: existence and size of client file
Message-Id: <bkP%f.28$yQ.0@trnddc07>
Asterbing wrote:
> In article <9vO%f.9$7w6.2@trnddc02>, jurgenex@hotmail.com says...
>> First of all you have a question about HTTP, then maybe about CGI.
>>
>
> Seen this way, yes, but I could reformulate indefinitively and a day
> or another find the angle you wish... For example : does -e, -s or
> open authorized to reach client-side files ?
Answer:
Yes, if you are talking about e.g. an NFS client or if files are shared
between computers.
No, if you are talking about e.g. an HTTP client.
Again, which part of "this has nothing to do with Perl but only with your
application domain" don't you understand?
jue
------------------------------
Date: Fri, 14 Apr 2006 18:44:36 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: existence and size of client file
Message-Id: <4aa1rmFrl4k8U1@individual.net>
Asterbing wrote:
> In article <4a9oigFs7lqnU1@individual.net>, noreply@gunnar.cc says...
>>Asterbing wrote:
>>>Is there a way to test the existence and size of a client file ? This to
>>>avoid any unuseful traffic (upload, serveur file test, unlink if too
>>>big)
>>
>>Maybe you want to check the $ENV{CONTENT_LENGTH} variable before upload.
>
> Well, but the form will only POST the path to file for uploading, not
> the length of the file data itself.
True, but $ENV{CONTENT_LENGTH} will hold the length of the whole
request, and if it exceeds a certain value, it may not be desirable to
even parse the request.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Fri, 14 Apr 2006 19:12:31 +0200
From: Asterbing <no@thanks.com>
Subject: Re: existence and size of client file
Message-Id: <MPG.1ea9f6695e01464e9897eb@news.tiscali.fr>
In article <Xns97A5730EC30D4asu1cornelledu@132.236.56.8>,
1usa@llenroc.ude.invalid says...
> What client? NFS, SSH etc?
>
Any web current browsers.
> Your question has been answered already: A CGI script running on a web
> server has no way of inspecting the file system on the HTTP client that is
> making the request to the web server.
>
Well, so, here is my problem, more accurately. I have to provide a way
for people to upload files which will be limited to, say 100MB. What I
would like is that user be warned as soon as possible if his file is too
big.
Thus, for example, I would like that John submit a 101MB file and be
warn some minutes later, after unuseful 100MB uploading.
Is there a way to solve this case using the builtin functions available
in Perl ?
------------------------------
Date: Fri, 14 Apr 2006 19:15:01 +0200
From: Asterbing <no@thanks.com>
Subject: Re: existence and size of client file
Message-Id: <MPG.1ea9f704eec23a4a9897ec@news.tiscali.fr>
In article <bkP%f.28$yQ.0@trnddc07>, jurgenex@hotmail.com says...
> Again, which part of "this has nothing to do with Perl but only with your
> application domain" don't you understand?
>
Because, I'm searching if Perl built-in fcts allow to solve my problem.
Just replied to A.Sinan before to read your post.
------------------------------
Date: Fri, 14 Apr 2006 19:16:42 +0200
From: Asterbing <no@thanks.com>
Subject: Re: existence and size of client file
Message-Id: <MPG.1ea9f763ed0a0d439897ed@news.tiscali.fr>
In article <4aa1rmFrl4k8U1@individual.net>, noreply@gunnar.cc says...
> > Well, but the form will only POST the path to file for uploading, not
> > the length of the file data itself.
>
> True, but $ENV{CONTENT_LENGTH} will hold the length of the whole
> request, and if it exceeds a certain value, it may not be desirable to
> even parse the request.
>
OK, but how does this may help me to figure-out if the submitted file is
too big (say, >100MB) ?
------------------------------
Date: 14 Apr 2006 17:44:55 GMT
From: xhoster@gmail.com
Subject: Re: existence and size of client file
Message-Id: <20060414135714.617$hO@newsreader.com>
Asterbing <no@thanks.com> wrote:
> In article <4a9oigFs7lqnU1@individual.net>, noreply@gunnar.cc says...
> > Asterbing wrote:
> > > Is there a way to test the existence and size of a client file ? This
> > > to avoid any unuseful traffic (upload, serveur file test, unlink if
> > > too big)
> >
> > Maybe you want to check the $ENV{CONTENT_LENGTH} variable before
> > upload.
> >
> >
>
> Well, but the form will only POST the path to file for uploading, not
> the length of the file data itself.
If you are correct and the CGI submission only includes a file path and not
the actual file data, then the file data must be accessed through the some
other method; other than CGI. So your question has nothing to do with CGI.
Since you haven't told us what that other method is...
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Fri, 14 Apr 2006 16:33:20 +0200
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Other XS progamming questions
Message-Id: <1145025200.681793@proxy.dienste.wien.at>
Hi folks,
Because the inital "XS progamming question" thread is very long already,
and there's a lot of questions therein meanwhile, I decided to start a new
track with the following ones.
1) I understand that in object creation, two scalar values are involved:
SV *sv1 = newSViv(7);
SV *sv2 = newSVrv(sv1,"myclass");
sv1 is a reference to the object in sv2, right? And sv2 is just a magical
SV with its "stash" pointing to pv "class".
But what I can't understand is the actual purpose of sv1. Why I need
the reference for blessing? Or in other words, why do I need the
reference when upgrading a SV to SVMG?
Similar in Perl:
$myobj = bless (\$sv1, "class");
OK, $myobj is now an object blessed into "class". So writing
$myobj->test(1);
is just another form for
class::test($myobj,1);
But what's the purpose of $sv1 here? It is never used again.
To the XS example above, I can made a sv_dump(sv2) to see the
magical SV. Can I access directly this SV from Perl as well? Or do I have
always to use a reference? I can't see the concept in this implementation.
2) The docs (perlguts) say "If you mortalize a variable twice, the reference
count will later be decremented twice". Is this correct?
I understand that "mortalizing" a SV means to set the "TEMP" bit in its
flag field and that FREETMPS checks for SVs with this flag set and if so,
decremens their ref count and if it becomes 0, discards the SVs. But where
is stored a SV's "mortalization count"? And what happens if this count goes
beyond zero?
MTIA for your patience and for all answers,
kind greetings from Vienna, and glad Eastern,
Ferry
--
Ing. Ferry Bolhar
Municipality of Vienna, Department 14
A-1010 Vienna / AUSTRIA
E-mail: bol@adv.magwien.gv.at
------------------------------
Date: 14 Apr 2006 15:12:37 GMT
From: TTK Ciar <ttk@remove_this_and_all_after_org.ciar.org.esper.com>
Subject: Re: POP3 Mail Client in PERL using IO::Socket module only and regular expressions
Message-Id: <e1oe550216t@news2.newsguy.com>
Hello!
One of my first perl projects happens to have been a POP3 client.
So the code is kind of messy, but it works. The source is here:
http://aux.ciar.org/ttk/public/popper
It uses the Socket module rather than IO::Socket, but reading the
context of your situation I'm not sure if that would matter. Even
if it does, it should be readily convertible. Just hoping it helps.
Good luck!
-- TTK
------------------------------
Date: Fri, 14 Apr 2006 15:31:56 +0000 (UTC)
From: Hemant Shah <shah@typhoon.xnet.com>
Subject: Problem with DBD::DB2 and UTF8.
Message-Id: <e1of9c$98k$1@new7.xnet.com>
Folks,
Here is my setup:
DB2 V8.2 ESE running on Linux with utf-8 code set.
Database territory = us
Database code page = 1208
Database code set = utf-8
Database country/region code = 1
The tables in this database contain English, Spanish and Japanese text.
I have DB2 V8.2 ESE setup on AIX (5.1, 5.2, 5.3), the database on
AIX is setup as remote database:
System Database Directory
Number of entries in the directory = 1
Database 1 entry:
Database alias = GBLCODE
Database name = GBLCODE
Node name = GBLNODE
Database release level = a.00
Comment =
Directory entry type = Remote
Authentication = CLIENT
Catalog database partition number = -1
I have perl scripts using DBD:DB2 V 0.78 and DBI V1.45. The scripts were
running fine under AIX 5.1 and 5.2. Recently I upgraded one of the systems
from AIX 5.1 to AIX 5.3. Now my scripts do not work on AIX 5.3. When it
fetches/inserts any column that contains UTF-8 characters it
messes up the characters, and in many (not all) cases it thinks that the
data is bigger than the column during insert.
If I run the same script from AIX 5.2 system with everything else the same,
it works fine.
I ran command to update the instance and re-built DBI and DBD, but it did
not fix the error. I checked locale filesets between AIX 5.2 and AIX 5.3
and I cannot find anything missing.
I wrote a simple perl script that reads Japanese (utf-8) text from a file
and writes it out to another file, this seems to work so I think the problem
is in DB2/DBD interface.
I need to fix this problem because I need to upgrade the other system from
AIX 5.2 to AIX 5.3.
Thanks.
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: NoJunkMailshah@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
------------------------------
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 9156
***************************************