[25603] in Perl-Users-Digest
Perl-Users Digest, Issue: 7847 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 2 18:05:44 2005
Date: Wed, 2 Mar 2005 15:05:23 -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, 2 Mar 2005 Volume: 10 Number: 7847
Today's topics:
Re: Class::Date <jamiethacker@gmail.com>
How to tell if the filesystem is RO? <cocke@catherders.com>
Re: How to tell if the filesystem is RO? <phaylon@dunkelheit.at>
Re: How to tell if the filesystem is RO? <noreply@gunnar.cc>
Re: How to tell if the filesystem is RO? <kkeller-usenet@wombat.san-francisco.ca.us>
Re: How to tell if the filesystem is RO? <No_4@dsl.pipex.com>
Re: How to tell if the filesystem is RO? <cocke@catherders.com>
installing architecture dependent modules <bmetcalf@nortelnetworks.com>
Re: IO::Scalar insanity <flavell@ph.gla.ac.uk>
Re: IO::Scalar insanity <please_post@nomail.edu>
Re: IO::Scalar insanity <socyl@987jk.com.invalid>
Need to download 20000 pdf files <hkurande@yahoo.com>
Re: Need to download 20000 pdf files <tadmc@augustmail.com>
Re: Need to download 20000 pdf files <wyzelli@yahoo.com>
Re: odd socket behavior with ZoneAlarm <clarke@n_o_s_p_a_m_hyperformix.com>
perl commands (Gabriella)
Re: perl commands <kim@schulz.dk>
Re: perl commands <jkeen_via_google@yahoo.com>
Re: perl commands <eighner@io.com>
Re: perl commands <matternc@comcast.net>
Re: perl commands <matternc@comcast.net>
Re: perl problem with select and non-blocking sysread f (john)
PERL WEB PROGRESS BAR (Sebastien)
Re: PERL WEB PROGRESS BAR <botfood@yahoo.com>
Re: PERL WEB PROGRESS BAR <jgibson@mail.arc.nasa.gov>
Re: PERL WEB PROGRESS BAR <lawrence.tierney@bipcontracts.com>
Re: PERL WEB PROGRESS BAR xhoster@gmail.com
Re: Pure Perl OpenSSL Library <No_4@dsl.pipex.com>
Re: Pure Perl OpenSSL Library <dkm@kataplop.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 2 Mar 2005 08:40:07 -0800
From: "jamie@nospam.com" <jamiethacker@gmail.com>
Subject: Re: Class::Date
Message-Id: <1109781607.745199.23490@z14g2000cwz.googlegroups.com>
>i didn't find something usefull with HiRes :(
Perhaps I am misunderstanding what you are trying to accomplish. If,
for example, you needed to time how long something takes...in
milliseconds...you could:
#!/usr/bin/perl
use strict;
use warnings;
use Time::HiRes qw(gettimeofday);
$t0 = gettimeofday();
#Do something here
$t1 = gettimeofday();
$elapsed = $t1 - $t0;
<disclaimer> Stolen from "The Cookbook"</disclaimer>
--
Jamie
------------------------------
Date: Wed, 02 Mar 2005 11:40:21 -0500
From: Michael W Cocke <cocke@catherders.com>
Subject: How to tell if the filesystem is RO?
Message-Id: <3vqb21d4di8in0tihd3n6qrlue5ogccai8@4ax.com>
I know I can brute force something like writing a file and catching
the error, but is there a better way to tell if the filesystem is R/O?
(For the curious, my error-behaviour in tune2 is set to remount-ro,
and I want to automagically force a reboot when it goes blooey)
Mike-
--
Mornings: Evolution in action. Only the grumpy will survive.
--
Please note - Due to the intense volume of spam, we have installed site-wide spam
filters at catherders.com. If email from you bounces, try non-HTML, non-encoded,
non-attachments.
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
------------------------------
Date: Wed, 02 Mar 2005 18:08:12 +0100
From: phaylon <phaylon@dunkelheit.at>
Subject: Re: How to tell if the filesystem is RO?
Message-Id: <pan.2005.03.02.17.08.11.278480@dunkelheit.at>
Michael W Cocke wrote:
> I know I can brute force something like writing a file and catching the
> error, but is there a better way to tell if the filesystem is R/O?
You could parse the output of "mount" or use one of the -X filetests to
see if the file is writable. There's also a Linux::Mounts on CPAN, but it
doesn't look like what you're searching.
hth,phay
--
http://www.dunkelheit.at/
Thru the darkness of futures past, the magician longs to see.
One chants out between two worlds: Fire, walk with me.
-- Twin Peaks, »Bob«
------------------------------
Date: Wed, 02 Mar 2005 18:12:10 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: How to tell if the filesystem is RO?
Message-Id: <38maf3F5nussiU1@individual.net>
Michael W Cocke wrote:
> I know I can brute force something like writing a file and catching
> the error, but is there a better way to tell if the filesystem is R/O?
perldoc -f -X
(the -r operator)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 2 Mar 2005 10:59:52 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: How to tell if the filesystem is RO?
Message-Id: <82fhf2xrpb.ln2@goaway.wombat.san-francisco.ca.us>
On 2005-03-02, Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
> Michael W Cocke wrote:
>> I know I can brute force something like writing a file and catching
>> the error, but is there a better way to tell if the filesystem is R/O?
>
> perldoc -f -X
>
> (the -r operator)
That will only give the permissions on the file itself, not on the
entire filesystem. Also, -r only looks at the actual permissions on the
file, and won't look for other reasons it couldn't write a file (in
fact, perldoc -f -X specifically states it doesn't look at whether the
filesystem is mounted ro).
Short of parsing the output of mount or /etc/mtab (if your box has
mtab), I can't think of a good way to determine if the filesystem is ro.
There is a Sys::Filesystem module in CPAN, but I haven't tried it.
--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
see X- headers for PGP signature information
------------------------------
Date: Wed, 02 Mar 2005 19:50:36 +0000
From: Big and Blue <No_4@dsl.pipex.com>
Subject: Re: How to tell if the filesystem is RO?
Message-Id: <ftudnd85vrGVhLvfRVnyhQ@pipex.net>
Michael W Cocke wrote:
>
> I know I can brute force something like writing a file and catching
> the error, but is there a better way to tell if the filesystem is R/O?
In the general case, no, as it is perfectly possible to mount an NFS
file-system for writing when it is only exported read-only from the server
(so any local test you did would say it is writable, but it isn't).
> (For the curious, my error-behaviour in tune2 is set to remount-ro,
> and I want to automagically force a reboot when it goes blooey)
However, that is a *very* specific case. Iff the remount-ro is
reflected in /proc/mounts then just parse that file (which I leave as an
exercise to you).
--
Just because I've written it doesn't mean that
either you or I have to believe it.
------------------------------
Date: Wed, 02 Mar 2005 14:55:39 -0500
From: Michael W Cocke <cocke@catherders.com>
Subject: Re: How to tell if the filesystem is RO?
Message-Id: <m76c21pn785akk6djle0jja0kamqkgpgne@4ax.com>
On Wed, 02 Mar 2005 18:12:10 +0100, Gunnar Hjalmarsson
<noreply@gunnar.cc> wrote:
>Michael W Cocke wrote:
>> I know I can brute force something like writing a file and catching
>> the error, but is there a better way to tell if the filesystem is R/O?
>
> perldoc -f -X
>
>(the -r operator)
I thought of that, but I'm not sure if things like that or stat calls
will accurately reflect if the whole filesystem has been forced r/o by
a fault... Guess I'd better do some testing.
Mike-
--
Mornings: Evolution in action. Only the grumpy will survive.
--
Please note - Due to the intense volume of spam, we have installed site-wide spam
filters at catherders.com. If email from you bounces, try non-HTML, non-encoded,
non-attachments.
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
------------------------------
Date: Wed, 2 Mar 2005 19:17:04 +0000 (UTC)
From: Brandon Metcalf <bmetcalf@nortelnetworks.com>
Subject: installing architecture dependent modules
Message-Id: <slrnd2c139.acp.bmetcalf@cash.rhiamet.com>
I'm reposting this since the same post I made on 2/24 didn't seem to
make it out to the world.
I'm currently compiling several modules under different versions of Perl
and on different architectures. It looks like more recent versions of
Perl (as of 5.6.0 ?) I can simply drop these modules in
/path/to/perllibs/$Config{version}/$Config{archname} and then in scripts
simply say
use lib '/path/to/perlibs';
and Perl will modify @INC appropriately.
Of course, this will require compiling the modules (which probably needs
to be done anyway since some of them include binaries) for all the
different combinations of $Config{version} and $Config{archname} that I
might use.
Is this the best approach? Obviously, this keeps the modifying of @INC
very simple, but is there something better?
Thanks.
--
Brandon
------------------------------
Date: Wed, 2 Mar 2005 16:16:27 +0000
From: "Alan J. Flavell" <flavell@ph.gla.ac.uk>
Subject: Re: IO::Scalar insanity
Message-Id: <Pine.LNX.4.61.0503021614590.17689@ppepc56.ph.gla.ac.uk>
On Wed, 2 Mar 2005, kj wrote, quoting me:
> >Anyone who's expert enough to produce a safe and reliable
> >implementation that doesn't use CGI.pm will have no difficulty in
> >solving that problem without any help from us.
>
> The OP didn't specify whether he was debugging his own code, or
> that what he was debugging was a "safe and reliable" anything.
And what conclusion would you draw from that? (I've already drawn
mine, by the way.)
------------------------------
Date: Wed, 2 Mar 2005 17:00:40 +0000 (UTC)
From: bill <please_post@nomail.edu>
Subject: Re: IO::Scalar insanity
Message-Id: <d04rfo$lam$1@reader2.panix.com>
Thanks for all the help.
BTW, the code I'm debugging is indeed something I wrote, but it
uses SOAP::Lite, whose documentation I find pretty unhelpful and
whose code I find absolutely impenetrable. I have no idea whether
SOAP::Lite uses CGI.pm for its "CGI-based" servers.
I am surprised to learn that one can't make a string/buffer look
like STDIN in a Perl script. I could *swear* I saw this done
somewhere.
bill
------------------------------
Date: Wed, 2 Mar 2005 17:21:00 +0000 (UTC)
From: kj <socyl@987jk.com.invalid>
Subject: Re: IO::Scalar insanity
Message-Id: <d04sls$1l1$1@reader2.panix.com>
In <Pine.LNX.4.61.0503021614590.17689@ppepc56.ph.gla.ac.uk> "Alan J. Flavell" <flavell@ph.gla.ac.uk> writes:
>On Wed, 2 Mar 2005, kj wrote, quoting me:
>> >Anyone who's expert enough to produce a safe and reliable
>> >implementation that doesn't use CGI.pm will have no difficulty in
>> >solving that problem without any help from us.
>>
>> The OP didn't specify whether he was debugging his own code, or
>> that what he was debugging was a "safe and reliable" anything.
>And what conclusion would you draw from that?
See my previous posts on this thread.
>(I've already drawn
>mine, by the way.)
Oh, goodie!
kj
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
------------------------------
Date: 2 Mar 2005 12:22:56 -0800
From: "Hemant" <hkurande@yahoo.com>
Subject: Need to download 20000 pdf files
Message-Id: <1109794976.151573.170000@o13g2000cwo.googlegroups.com>
I am working on a project that requires me to have access to more than
20000 pdf files. Any suggestions on how to go about searching over the
internet and be able to download the files?
------------------------------
Date: Wed, 2 Mar 2005 14:53:09 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Need to download 20000 pdf files
Message-Id: <slrnd2c9tl.96r.tadmc@magna.augustmail.com>
Hemant <hkurande@yahoo.com> wrote:
> be able to download the files?
use LWP::Simple;
my $pdf = get 'http://some.domain/directory/file.pdf';
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 02 Mar 2005 22:22:01 GMT
From: "Peter Wyzl" <wyzelli@yahoo.com>
Subject: Re: Need to download 20000 pdf files
Message-Id: <d0rVd.181582$K7.86822@news-server.bigpond.net.au>
"Hemant" <hkurande@yahoo.com> wrote in message
news:1109794976.151573.170000@o13g2000cwo.googlegroups.com...
:I am working on a project that requires me to have access to more than
: 20000 pdf files. Any suggestions on how to go about searching over the
: internet and be able to download the files?
Here is something I ran to download a bunch of .swf files into the swf
directory on my c: drive
chdir 'c:/swf';
for ('001' .. '340'){
next if (-e "c:/swf/a_0${_}.swf");
system "lwp-download http://www.swfsite.com/a_0${_}.swf";
}
exit;
lwp-download comes with Activeperl
The files I need were all named a_0***.swf where *** represents the numbers
from 001 to 340
Modify it to suit your needs (assuming you have Windows and lwp-download. I
don't know if Activestate's perl for Unix includes lwp-download.
P
--
print "Just another Perl Hacker";
------------------------------
Date: Wed, 2 Mar 2005 15:33:57 -0600
From: "AC" <clarke@n_o_s_p_a_m_hyperformix.com>
Subject: Re: odd socket behavior with ZoneAlarm
Message-Id: <422630f1$0$92312$39cecf19@news.twtelecom.net>
"phaylon" <phaylon@dunkelheit.at> wrote in message
news:pan.2005.03.02.14.59.28.191943@dunkelheit.at...
> D. Marxsen wrote:
>
>> There is a problem in the interaction of Perl with a firewall and Perl
>> does behave differently when trying different approaches.
>
> Sure, if you code different things, perl often feels free to act
> different.
>
>> So it would be very helpful if someone could shed some light on the
>> difference of both attempts. I would like to know it!
>
> What's the problem with looking at perldoc -f recv?
>
>> We have to be careful not to behave like two companies, pushing
>> responsibility to and fro (we all hate that, don't we?). This is
>> frustrating and helps no-one.
>
> Yeah, but it will get kinda unperlish if there would be more perl+Apache,
> perl+Redhat, perl+SuSE, perl... You know what I mean?
>
> Don't understand me wrong, you can write about whatever you want, but I
> just don't think the problem that one firewall (I think there are other's
> where it worked) has so much to do with Perl. I mean, we don't know what
> this firewall actually does, how it relies to the system it is running on,
> how it's configured, how it _can_ be configured. Sure, there are some
> people in here, who know ZA. But there are much more at the ZA forums.
> Where is the problem in writing a little script (which already exists) and
> ask the ZA guys why it works without ZA, but not with an activated (and
> configured, or has anyone "forgotten" to read the docs?) one.
>
> just my 2c.
>
> --
> http://www.dunkelheit.at/
> codito, ergo sum.
>
I try to be really sensitive to off-topic posts and get irritated by others
who do it. So I did not post to this group lightly.
My original question stands. This problem is an odd interaction between Perl
and some third pary product. If I post in the ZoneAlarm forums, folks either
say "I don't know Perl" or "This is a Perl problem". If I post here, some
folks say "this is off topic." I did a search for the newsgroup
*firewallsperl* but couldn't find it. ;-)
------------------------------
Date: 2 Mar 2005 13:35:34 -0800
From: gabriella@istop.com (Gabriella)
Subject: perl commands
Message-Id: <17c19ad9.0503021335.30662d39@posting.google.com>
Could somebody give me the meaning of each line ?
while (<IN>) {
my $line = $_;
chomp($line);
next if ($line =~ /^ *$/m);
next if ($line =~ /^#.*$/m);
next if ($line !~ /^[0-9].*$/m);
#$line =~ s/#.*$//m;
$line =~ s/ +$//m;
$line =~ s/^ +//m;
Thanks
------------------------------
Date: Wed, 2 Mar 2005 22:40:38 +0100
From: Kim Schulz <kim@schulz.dk>
Subject: Re: perl commands
Message-Id: <20050302224038.00136f47@lifesuckz.nork.aau.dk>
On 2 Mar 2005 13:35:34 -0800
gabriella@istop.com (Gabriella) wrote:
> Could somebody give me the meaning of each line ?
>
> while (<IN>) {
While reading input (eg file on commandline)
> my $line = $_;
set $line to be the next(first) line in the file
> chomp($line);
remove newline from the end of the line.
> next if ($line =~ /^ *$/m);
ignore line and goto next line if line only contains spaces or is empty
> next if ($line =~ /^#.*$/m);
ignore line if line starts with # (comment probably)
> next if ($line !~ /^[0-9].*$/m);
ignore line if it does not start with a number
> #$line =~ s/#.*$//m;
a comment (notice the #)
> $line =~ s/ +$//m;
remove all leftover spaces at the ends of line
> $line =~ s/^ +//m;
remove all spaces at the beginning of the line
> Thanks
--
Kim Schulz | Need a Content Management System for your website? Go
Geek by nature | get Fundanemt at : http://www.fundanemt.com New
schulz.dk | version out now!
------------------------------
Date: 2 Mar 2005 13:46:53 -0800
From: "Jim Keenan" <jkeen_via_google@yahoo.com>
Subject: Re: perl commands
Message-Id: <1109800013.751653.163860@l41g2000cwc.googlegroups.com>
Gabriella wrote:
> Could somebody give me the meaning of each line ?
>
> while (<IN>) {
> my $line = $_;
> chomp($line);
> next if ($line =~ /^ *$/m);
> next if ($line =~ /^#.*$/m);
> next if ($line !~ /^[0-9].*$/m);
> #$line =~ s/#.*$//m;
> $line =~ s/ +$//m;
> $line =~ s/^ +//m;
> Thanks
Better than giving you the answers ... we'll show you how to look up
the answers yourself in the Perl documentation. Assuming you have Perl
installed, you call the 'perldoc' command from the command-prompt,
followed by one or more options or arguments. For example:
perldoc -f chomp # Documentation for function 'chomp'
perldoc perlop # Documentation for Perl operators
# Look in sections on "Binding Operators" and
# "Regexp Quote-Like Operators"
perldoc perldoc # How to use the perldoc command
perldoc perltoc # Table of contents for the Perl documentation
And so forth.
------------------------------
Date: Wed, 02 Mar 2005 15:52:14 -0600
From: Lars Eighner <eighner@io.com>
Subject: Re: perl commands
Message-Id: <slrnd2cd39.244.eighner@goodwill.io.com>
In our last episode,
<20050302224038.00136f47@lifesuckz.nork.aau.dk>, the lovely and
talented Kim Schulz broadcast on comp.lang.perl.misc:
> On 2 Mar 2005 13:35:34 -0800
> gabriella@istop.com (Gabriella) wrote:
>> Could somebody give me the meaning of each line ?
>>
>> while (<IN>) {
> While reading input (eg file on commandline)
>> my $line = $_;
> set $line to be the next(first) line in the file
>> chomp($line);
> remove newline from the end of the line.
>> next if ($line =~ /^ *$/m);
> ignore line and goto next line if line only contains spaces or is empty
>> next if ($line =~ /^#.*$/m);
> ignore line if line starts with # (comment probably)
>> next if ($line !~ /^[0-9].*$/m);
> ignore line if it does not start with a number
Which means the previous two lines were useless, as this one
would have excluded blank lines and comments.
>> #$line =~ s/#.*$//m;
> a comment (notice the #)
>> $line =~ s/ +$//m;
> remove all leftover spaces at the ends of line
>> $line =~ s/^ +//m;
> remove all spaces at the beginning of the line
>> Thanks
--
Lars Eighner eighner@io.com http://www.io.com/~eighner/
"Shhh! Be vewwy, vewwy quiet! I'm hunting Muswims!"
- President Elmer Bush
------------------------------
Date: Wed, 02 Mar 2005 17:27:05 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: perl commands
Message-Id: <fNCdnYNyxoImoLvfRVn-sg@comcast.com>
Gabriella wrote:
> Could somebody give me the meaning of each line ?
>
> while (<IN>) {
A while loop; this reads a line from file handle IN into
$_. It stops looping when there's nothing more to read
from IN.
> my $line = $_;
Take the line you just read in $_ and assign it to
$line. my makes it a lexical variable (it only
exists inside the {} block.)
> chomp($line);
Remove the trailing newline from $line
> next if ($line =~ /^ *$/m);
Skip the rest of this loop iteration if $line is only
spaces, or empty. The /m is only meaningful if
$line contains multiple lines, and is pointless here.
> next if ($line =~ /^#.*$/m);
Skip the rest of this loop interation is $line begins
with a #. The '.*$' is pointless, as is the /m.
> next if ($line !~ /^[0-9].*$/m);
Skip the rest of this loop if line does not start with
a digit. Once again, the '.*$' and the /m are pointless.
> #$line =~ s/#.*$//m;
Would delete everything in $line from the first # to the
end of the line, if it weren't commented out. /m is
still pointless.
> $line =~ s/ +$//m;
Deletes any trailing spaces in $line. /m is still pointless.
> $line =~ s/^ +//m;
Deletes any leading spaces in $line. Utterly pointless
as a previous line terminated this iteration unless $line
started with a digit.
> Thanks
--
Christopher Mattern
"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
------------------------------
Date: Wed, 02 Mar 2005 17:27:40 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: perl commands
Message-Id: <fNCdnYJyxoJAoLvfRVn-sg@comcast.com>
Lars Eighner wrote:
> In our last episode,
> <20050302224038.00136f47@lifesuckz.nork.aau.dk>, the lovely and
> talented Kim Schulz broadcast on comp.lang.perl.misc:
>
>> On 2 Mar 2005 13:35:34 -0800
>> gabriella@istop.com (Gabriella) wrote:
>
>>> Could somebody give me the meaning of each line ?
>>>
>>> while (<IN>) {
>
>> While reading input (eg file on commandline)
>
>
>>> my $line = $_;
>> set $line to be the next(first) line in the file
>>> chomp($line);
>> remove newline from the end of the line.
>>> next if ($line =~ /^ *$/m);
>> ignore line and goto next line if line only contains spaces or is empty
>>> next if ($line =~ /^#.*$/m);
>> ignore line if line starts with # (comment probably)
>>> next if ($line !~ /^[0-9].*$/m);
>> ignore line if it does not start with a number
>
> Which means the previous two lines were useless, as this one
> would have excluded blank lines and comments.
Missed that one. Whoever did this isn't very good.
>
>>> #$line =~ s/#.*$//m;
>> a comment (notice the #)
>>> $line =~ s/ +$//m;
>> remove all leftover spaces at the ends of line
>>> $line =~ s/^ +//m;
>> remove all spaces at the beginning of the line
>>> Thanks
>
--
Christopher Mattern
"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
------------------------------
Date: 2 Mar 2005 09:47:08 -0800
From: lqueryvg@yahoo.com (john)
Subject: Re: perl problem with select and non-blocking sysread from multiple pipes
Message-Id: <9c8511e0.0503020947.725d7cc8@posting.google.com>
"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message news:<Xns960CEDCD35614asu1cornelledu@127.0.0.1>...
> lqueryvg@yahoo.com (john) wrote in
> news:9c8511e0.0503011554.381166af@posting.google.com:
>
> >
> > Sorry. More context is below (the last words are mine)...
> >
> >> > > my $eofsFound = 0;
> >> > > my $eofsExpected = 5;
> >> > > my $taskNum = 0;
> >> > >
> >> > > my $readBits = ''; # "bitlist" of parent reader filehandles
> >> > > my($fh) = ('fh0000'); # indirect filehandle names, yuk
> >> >
> >> > Yes, yuk - this is not necessary in 5.6.1 and later - is
> >> > compatability with earlier Perl really needed?
> >>
> >> If there's a better way then I'll do it.
> >> I don't like using the 'no strict refs' all over the place and
> >> the indirect filehandle stuff is just plain confusing.
> >> Can you give me any pointers ?
> >
> > I'm still interested to hear what the "recommended"
> > approach is to avoid the yucky indirect filehandle names.
> > Is it IO::Handle ?
>
> I am not sure :) Sorry, but I have never used 'indirect filehandles' and
> what your reason is for using them. However, what you are after might be
> lexical fiheandles:
>
> E.g.
>
> open my $fh, '<', 'fh0000' or die $!;
>
> Sinan.
The reason was that when I tried using IO::Handle I was doing
something like the following:
$readers{$taskNum} = IO::Handle->new();
my $cw = IO::Handle->new();
new IO::Pipe($readers{$taskNum}, $cw) or die 'pr/cw pipe';
then later I was doing...
open(STDOUT, ">&$cw") or die "STDOUT open: $!";
This was giving me an "Invalid argument" error. I tried to find a
solution but my brain packed up, and I ended up going with the nasty
no strict refs approach. After seeing what you guys wrote I decided to
have another bash and realised that $cw is a file handle, whereas
open() is expecting a file number.
The following works...
my $fd = fileno($cw);
open(STDOUT, ">&$fd") or die "STDOUT open: $!";
I'm fairly new to perl and I'm still learning.
Thanks Brian/Sinan for helping.
------------------------------
Date: 2 Mar 2005 08:15:51 -0800
From: dorey.sebastien@free.fr (Sebastien)
Subject: PERL WEB PROGRESS BAR
Message-Id: <a9cb8dbb.0503020815.910eae7@posting.google.com>
Hello,
I am doing little CGI scripts. Right now I am working on how to upload
files from a computer to a web site.
I think I will finish soon that feature. Here are my questions (I'd
already looked on the web some stuff related to these questions):
- I would like to create a progression bar while uploading my file. Do
you know where I can find some basic scripts that can do that?
- I have already found some text scripts that can do it in my term. Is
there any scripts that can do that for the web (not using Perl GTK for
instance)?
Thanx very much for the answers.
Sebastien
------------------------------
Date: 2 Mar 2005 09:01:24 -0800
From: "botfood" <botfood@yahoo.com>
Subject: Re: PERL WEB PROGRESS BAR
Message-Id: <1109781898.407405.82430@o13g2000cwo.googlegroups.com>
a "low tech" way to do it is to have your script overwrite a
dynamically generated status page periodically, and include a "refresh"
in the header so it refreshes to itself every couple seconds. Then when
your script completes, make the last overwrite your "final" page.
------------------------------
Date: Wed, 02 Mar 2005 09:29:24 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: PERL WEB PROGRESS BAR
Message-Id: <020320050929241943%jgibson@mail.arc.nasa.gov>
In article <a9cb8dbb.0503020815.910eae7@posting.google.com>, Sebastien
<dorey.sebastien@free.fr> wrote:
> Hello,
> I am doing little CGI scripts. Right now I am working on how to upload
> files from a computer to a web site.
> I think I will finish soon that feature. Here are my questions (I'd
> already looked on the web some stuff related to these questions):
> - I would like to create a progression bar while uploading my file. Do
> you know where I can find some basic scripts that can do that?
> - I have already found some text scripts that can do it in my term. Is
> there any scripts that can do that for the web (not using Perl GTK for
> instance)?
Another almost frequently-asked question. See:
http://www.stonehenge.com/merlyn/LinuxMag/col39.html
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
------------------------------
Date: Wed, 02 Mar 2005 17:38:21 GMT
From: "Lord0" <lawrence.tierney@bipcontracts.com>
Subject: Re: PERL WEB PROGRESS BAR
Message-Id: <hSmVd.378$n41.4@newsfe1-gui.ntli.net>
> Another almost frequently-asked question. See:
>
> http://www.stonehenge.com/merlyn/LinuxMag/col39.html
I have successfully used the above solution a few times but I'm wondering
how you would create a "progress bar" that accurately reflects the % of the
file uploaded? Does the CGI object have attributes for the total size of the
post and total data thus far posted *before* the post is complete?
Lord0
------------------------------
Date: 02 Mar 2005 20:14:38 GMT
From: xhoster@gmail.com
Subject: Re: PERL WEB PROGRESS BAR
Message-Id: <20050302151438.082$oz@newsreader.com>
dorey.sebastien@free.fr (Sebastien) wrote:
> Hello,
> I am doing little CGI scripts. Right now I am working on how to upload
> files from a computer to a web site.
> I think I will finish soon that feature. Here are my questions (I'd
> already looked on the web some stuff related to these questions):
> - I would like to create a progression bar while uploading my file. Do
> you know where I can find some basic scripts that can do that?
The upload of files is driven by the web browser the end user is using.
It should be up to that web browser to show the progress.
> - I have already found some text scripts that can do it in my term.
What does that mean? I wouldn't think the whole concept of uploading files
would be applicable to a terminal.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Wed, 02 Mar 2005 19:43:50 +0000
From: Big and Blue <No_4@dsl.pipex.com>
Subject: Re: Pure Perl OpenSSL Library
Message-Id: <M9OdnaQBPpDvirvfRVnyiw@pipex.net>
Marc wrote:
>
> The first problem is still there (but now, maybe you understood what I
> meant). When I'll install thousand of nodes (one cluster), all nodes
> will request their certificates within minutes, so I must avoid as much
> as possible heavy tasks that can be avoided.
So, pre-create a certificate for each node on the server. Then when
the request comes in you just need to return the file. Look upon it as a
cache. When a request comes in you look in there for a file with the
requesting system's name (or address - some distinguishing element). If it
is there return the file, if it isn't *then* create one and put it in the
cache.
Before you turn on the nodes let the server run for a while creating a
thoudand or so certificates.
> I can't avoid the maths behind the crypto, but I can avoid fork when
> they are not needed.
But one way to avoid a fork() now is to have done it earlier, at leisure.
--
Just because I've written it doesn't mean that
either you or I have to believe it.
------------------------------
Date: Wed, 02 Mar 2005 21:05:35 +0100
From: "Marc" <dkm@kataplop.net>
Subject: Re: Pure Perl OpenSSL Library
Message-Id: <42261c7f@epflnews.epfl.ch>
Big and Blue <No_4@dsl.pipex.com> writes:
> Marc wrote:
>> The first problem is still there (but now, maybe you understood what
>> I
>> meant). When I'll install thousand of nodes (one cluster), all nodes
>> will request their certificates within minutes, so I must avoid as much
>> as possible heavy tasks that can be avoided.
>
> So, pre-create a certificate for each node on the server. Then
> when the request comes in you just need to return the file. Look upon
> it as a cache. When a request comes in you look in there for a file
> with the requesting system's name (or address - some distinguishing
> element). If it is there return the file, if it isn't *then* create
> one and put it in the cache.
I thought of this but as a side effect, I can have certificate that are
not used (for example, if one machine is broken...).
Second point, is that if I want to generate certificate _before_ nodes'
installations, server will also need to generate private keys. I don't
want to have a repository with all private keys inside. Your cache
system will make the private keys to be duplicated (one copy on the
central server, one copy (possibly) on a node).
> Before you turn on the nodes let the server run for a while
> creating a thoudand or so certificates.
>
>> I can't avoid the maths behind the crypto, but I can avoid fork when
>> they are not needed.
>
> But one way to avoid a fork() now is to have done it earlier, at leisure.
True, but you it can add complexity to security handling... I am still
in the 'study' part, I'm writing a test system, and I'll be able to see
where the real bottleneck (if one) is ;)
Marc
------------------------------
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 7847
***************************************