[25607] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 7851 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 3 18:10:37 2005

Date: Thu, 3 Mar 2005 15:10:29 -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           Thu, 3 Mar 2005     Volume: 10 Number: 7851

Today's topics:
        Iterated mega file upload - invented wheel wanted john_ramsden@sagitta-ps.com
    Re: Iterated mega file upload - invented wheel wanted <1usa@llenroc.ude.invalid>
    Re: Iterated mega file upload - invented wheel wanted john_ramsden@sagitta-ps.com
    Re: Iterated mega file upload - invented wheel wanted (Anno Siegel)
    Re: Iterated mega file upload - invented wheel wanted <colin.deletethis@andthis.mms3.com>
    Re: Iterated mega file upload - invented wheel wanted <richard@zync.co.uk>
    Re: Iterated mega file upload - invented wheel wanted <mrwilson@625elmstreet.info>
    Re: Iterated mega file upload - invented wheel wanted <csaba@z6.com>
        make install in anderes Directory <spam-collector@pense-online.de>
    Re: make install in anderes Directory <spam-collector@pense-online.de>
    Re: minor re, problelm (Anno Siegel)
        mod_perl hosting <none@zerofiveone.com>
    Re: mod_perl hosting ny10scn@yahoo.com
    Re: Net::Telnet, Terminal Programs, Prompts <zentara@highstream.net>
    Re: Net::Telnet, Terminal Programs, Prompts <jmw_misc@hotmail.com>
    Re: PERL WEB PROGRESS BAR <zentara@highstream.net>
        persistant db connection <alexj@floor.ch>
        special variables (julia)
    Re: special variables <spamtrap@dot-app.org>
    Re: special variables <jgibson@mail.arc.nasa.gov>
        UltraEdit? <Ronvgraham@yahoo.com>
    Re: UltraEdit? <none@zerofiveone.com>
    Re: UltraEdit? <postmaster@castleamber.com>
    Re: UltraEdit? <andy@andyh.co.uk>
    Re: UltraEdit? <thepoet_nospam@arcor.de>
        WikiConverter <sun_tong@users.sourceforge.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 3 Mar 2005 07:08:00 -0800
From: john_ramsden@sagitta-ps.com
Subject: Iterated mega file upload - invented wheel wanted
Message-Id: <1109862480.383312.250480@z14g2000cwz.googlegroups.com>


I have to prepare an Apache/PHP based (or perl if easier) web
page that allows a user to upload very large files, possibly
over 10 Gbytes and maybe up to 100 Gbytes.

I'm aware that file upload limits can be increased by config
changes; but I'd rather minimize the need for changes like
this, both for admin reasons and to avoid possible (?) memory problems
or even bugs.

In principle there's a simple solution whereby the user runs
an initial page, in which they input the file name, and the
Submit button then runs JavaScript in the page.

The JavaScript opens the file, positions at a start offset
(initially zero), and reads and uploads up to a fixed length
of the contents, along with a continuation offset (or zero
to indicate the end reached), and the server code re-runs
the script in a loop while this returned offset is non-zero.
Subsequent runs of the script would bypass the data input
and execute the JavaScript directly.

Anyway, the question I have is whether anyone has written
anything similar, ideally with a progress bar?

The only problem I anticipate is possible delays, and even
timeouts, while the code (client or server) positions to
the next offset to read or write (respectively) the next
chunk of a very large, e.g. 50 GByte, file.

Any suggestions gratefully received.

(It's a shame Apache doesn't seem to have an embedded FTP
server in some way. I guess FTP would be the obvious choice,
but the client doesn't wish to have a separate FTP server
running.)


Cheers

John R Ramsden (jramsden at glassouse.com)



------------------------------

Date: Thu, 03 Mar 2005 15:15:18 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Iterated mega file upload - invented wheel wanted
Message-Id: <Xns960E6851CB6CFasu1cornelledu@127.0.0.1>

john_ramsden@sagitta-ps.com wrote in news:1109862480.383312.250480
@z14g2000cwz.googlegroups.com:

> The JavaScript opens the file, positions at a start offset
> (initially zero), and reads and uploads up to a fixed length
> of the contents, along with a continuation offset (or zero
> to indicate the end reached), and the server code re-runs
> the script in a loop while this returned offset is non-zero.
> Subsequent runs of the script would bypass the data input
> and execute the JavaScript directly.

Do you have a Perl question?

Sinan


------------------------------

Date: 3 Mar 2005 07:21:19 -0800
From: john_ramsden@sagitta-ps.com
Subject: Re: Iterated mega file upload - invented wheel wanted
Message-Id: <1109863279.466706.303800@f14g2000cwb.googlegroups.com>


A. Sinan Unur wrote:
>
> john_ramsden@sagitta-ps.com wrote in news:1109862480.383312.250480
> @z14g2000cwz.googlegroups.com:
> >
> > I have to prepare an Apache/PHP based (or perl if easier)
> >  [...]
> >
> > The JavaScript opens the file, positions at a start offset
> > (initially zero), and reads and uploads up to a fixed length
> > of the contents, along with a continuation offset (or zero
> > to indicate the end reached), and the server code re-runs
> > the script in a loop while this returned offset is non-zero.
> > Subsequent runs of the script would bypass the data input
> > and execute the JavaScript directly.
>
> Do you have a Perl question?

Read the first line, numbnuts: "(or perl if easier)"



------------------------------

Date: 3 Mar 2005 15:47:16 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Iterated mega file upload - invented wheel wanted
Message-Id: <d07bi4$4ge$1@mamenchi.zrz.TU-Berlin.DE>

 <john_ramsden@sagitta-ps.com> wrote in comp.lang.perl.misc:
> 
> A. Sinan Unur wrote:
> >
> > john_ramsden@sagitta-ps.com wrote in news:1109862480.383312.250480
> > @z14g2000cwz.googlegroups.com:

> > Do you have a Perl question?
> 
> Read the first line, numbnuts: "(or perl if easier)"

So long then.

Anno


------------------------------

Date: Thu, 03 Mar 2005 17:15:53 +0000
From: Colin McKinnon <colin.deletethis@andthis.mms3.com>
Subject: Re: Iterated mega file upload - invented wheel wanted
Message-Id: <d07gme$4hf$1$8302bc10@news.demon.co.uk>

Please don't cross post.

john_ramsden@sagitta-ps.com wrote:

> 
> I have to prepare an Apache/PHP based (or perl if easier) web
> page that allows a user to upload very large files, possibly
> over 10 Gbytes and maybe up to 100 Gbytes.
> 

Sounds like a recipe for disaster. HTTP wasn't designed with this kind of
thing in mind. You're going to get all sorts of problems. You might be able
to get to work with webDAV, but you'll need to learn a lot more about how
it works.

> 
> In principle there's a simple solution whereby the user runs
<snip>
> The JavaScript opens the file, positions at a start offset
> (initially zero), and reads and uploads up to a fixed length
> of the contents, along with a continuation offset (or zero
> to indicate the end reached), and the server code re-runs
> the script in a loop while this returned offset is non-zero.

 ...right, but Javascript doesn't do this. (well, some implementations will,
but you have to jump through hoops to get it to work). If you must run it
over HTTP (and you'll have to split it up), you'll need something other
than a browser at the client end.

> (It's a shame Apache doesn't seem to have an embedded FTP
> server in some way. I guess FTP would be the obvious choice,
> but the client doesn't wish to have a separate FTP server
> running.)
>

NO NO NO.

FTP is an archaic and insecure protocol which is a %^&* to run across NAT
and has a history of broken implementations. I would have thought that the
'Global Leader in Independent Storage Services' (www.glasshouse.com) would
have a bit more nous about network protocols.

C.



------------------------------

Date: Thu, 03 Mar 2005 17:19:01 +0000
From: Richard Gration <richard@zync.co.uk>
Subject: Re: Iterated mega file upload - invented wheel wanted
Message-Id: <pan.2005.03.03.17.19.00.687399@zync.co.uk>

On Thu, 03 Mar 2005 07:08:00 -0800, john_ramsden wrote:

> (It's a shame Apache doesn't seem to have an embedded FTP server in some
> way. 

Apache 2.x does, I think. At least the MPM architecture allows for it, I
don't know if one has been written. As has been pointed out, FTP
belongs to the age of a nicer internet, but httpd2 will let you do it if
you really want to ...

R


------------------------------

Date: Thu, 03 Mar 2005 12:08:51 -0600
From: "Mr. Wilson" <mrwilson@625elmstreet.info>
Subject: Re: Iterated mega file upload - invented wheel wanted
Message-Id: <d07j3v$oq2$1@unlnews.unl.edu>

> john_ramsden@sagitta-ps.com wrote:
> 
>> ...that allows a user to **upload** very large files...

[idiotic non-answer snipped]

Didn't watch enough Sesame Street to learn the difference between up and 
down, eh?

Heh, what a maroon.

--Mr. Wilson


------------------------------

Date: Thu, 03 Mar 2005 18:41:53 GMT
From: "Csaba2000" <csaba@z6.com>
Subject: Re: Iterated mega file upload - invented wheel wanted
Message-Id: <RTIVd.99666$2e4.80774@news.chello.at>

This is an interesting question, but I must be missing something:
If I understand you right, you're trying to get a large file from
the client (browser) side to your (the server) side.  And you
want the user's browser (possibly with the aid of code you
provide) to cooperate in this endeavor so you can get past
the usual (including timeout) limitations.

But javascript (really the only thing available generically) on
the client side does not have access to the user's disk.  So
I am curious to know what I am not understanding here.
If browsers are not involved, then I would turn to cURL
within command line PHP (on the client side) or a similar
variant and have the PHP on the Apache end reassemble
the file.  Haven't done it, but it seems straightforward.
Probably would try with a command line version of cURL.

As for progress bar, on the client side, you can use COM
methods on  recent Windows systems to put up an IE and
keep changing the IE page as you progress along (see the
php.net/com area for starter examples).

Csaba Gabor from Vienna

<john_ramsden@sagitta-ps.com> wrote in message 
news:1109862480.383312.250480@z14g2000cwz.googlegroups.com...
>
> I have to prepare an Apache/PHP based (or perl if easier) web
> page that allows a user to upload very large files, possibly
> over 10 Gbytes and maybe up to 100 Gbytes.
>
> I'm aware that file upload limits can be increased by config
> changes; but I'd rather minimize the need for changes like
> this, both for admin reasons and to avoid possible (?) memory problems
> or even bugs.
>
> In principle there's a simple solution whereby the user runs
> an initial page, in which they input the file name, and the
> Submit button then runs JavaScript in the page.
>
> The JavaScript opens the file, positions at a start offset
> (initially zero), and reads and uploads up to a fixed length
> of the contents, along with a continuation offset (or zero
> to indicate the end reached), and the server code re-runs
> the script in a loop while this returned offset is non-zero.
> Subsequent runs of the script would bypass the data input
> and execute the JavaScript directly.
>
> Anyway, the question I have is whether anyone has written
> anything similar, ideally with a progress bar?
>
> The only problem I anticipate is possible delays, and even
> timeouts, while the code (client or server) positions to
> the next offset to read or write (respectively) the next
> chunk of a very large, e.g. 50 GByte, file.
>
> Any suggestions gratefully received.
>
> (It's a shame Apache doesn't seem to have an embedded FTP
> server in some way. I guess FTP would be the obvious choice,
> but the client doesn't wish to have a separate FTP server
> running.)
>
>
> Cheers
>
> John R Ramsden (jramsden at glassouse.com)
> 




------------------------------

Date: Thu, 03 Mar 2005 20:53:33 +0100
From: Joachim Pense <spam-collector@pense-online.de>
Subject: make install in anderes Directory
Message-Id: <d07q06$gdr$05$1@news.t-online.com>

Vermutlich habe ich eine FAQ verpasst, aber wenn ich einen CPAN-Modul unter
UNIX installieren will, finde ich keine Möglichkeit, ihm zu sagen, wohin er
den Modul installieren soll. Ich muss also entweder Root-Rechte haben, um
in die Perl-Standardlibs hineinzuschreiben, oder aber die Dateien manuell
in mein privates Library-Directory schieben. Gibt es doch eine Möglichkeit,
das zu automatisieren?

Joachim


------------------------------

Date: Thu, 03 Mar 2005 20:54:55 +0100
From: Joachim Pense <spam-collector@pense-online.de>
Subject: Re: make install in anderes Directory
Message-Id: <d07q2o$gdr$05$2@news.t-online.com>

sorry, wrong Newsgroup, this should have gone to de.comp.lang.perl.misc

Joachim Pense:

> Vermutlich habe ich eine FAQ verpasst, aber wenn ich einen CPAN-Modul
> unter UNIX installieren will, finde ich keine Möglichkeit, ihm zu sagen,
> wohin er den Modul installieren soll. Ich muss also entweder Root-Rechte
> haben, um in die Perl-Standardlibs hineinzuschreiben, oder aber die
> Dateien manuell in mein privates Library-Directory schieben. Gibt es doch
> eine Möglichkeit, das zu automatisieren?
> 
> Joachim




------------------------------

Date: 3 Mar 2005 14:20:55 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: minor re, problelm
Message-Id: <d076g7$1j2$1@mamenchi.zrz.TU-Berlin.DE>

George <georgekinley@hotmail.com> wrote in comp.lang.perl.misc:
> I have 
> ($pI,$vI)=($input=~/(\d+),(\d+)/) || ($input=~/(.*),(.*)/);
> print "($pI,$vI)";
> which work fine if $input="24,qwerr" but returns (1,) if $input="38,29"
> why is that
> why this "or" is not working, and how can I use ?: in this case

Do you have strict and warnings on?  It doesn't look like it.  You
should.

Precedence, context, and a peculiar behavior of "||" work together to
bring about this result.  First off, "||" has higher precedence than
"=", so the expression is evaluated as

    ($pI,$vI)= ( ($input=~/(\d+),(\d+)/) || ($input=~/(.*),(.*)/) );

Now, in perldoc perlop we find

       Binary "||" performs a short-circuit logical OR operation.
       That is, if the left operand is true, the right operand is
       not even evaluated.  Scalar or list context propagates
       down to the right operand if it is evaluated.

The peculiarity is in the last sentence.

The left operand is evaluated in boolean context, so the first regex
will return true or false, but not the list of captures.  If the first
regex matches, that's it, so $pI is set to 1 and $vI remains undefined.
If it doesn't match, the second regex is evaluated in list context and
returns the two captures.

To make it work right, rewrite it as

    ($pI, $vI) = ( $input =~ /(\d+),(\d+)/) or
    ($pI, $vI) = ( $input =~ /(.*),(.*)/);


Note the use of the low-precedence "or" instead of "||".

Anno


------------------------------

Date: Thu, 03 Mar 2005 17:45:52 +0000
From: Tom <none@zerofiveone.com>
Subject: mod_perl hosting
Message-Id: <d7je21d0ibgin0ttv2ep4ctedeu92ohk9v@4ax.com>

I am looking for decent mod_perl hosting.  I am based in the UK but
dont mind if the hosting is elsewhere.

MySQL would also be nice, what Im looking for is a hosting company
that has sane charging policies for DNS entries etc.

Any recommendations or resource links would be good.

Cheers,
Tom


------------------------------

Date: 3 Mar 2005 11:14:55 -0800
From: ny10scn@yahoo.com
Subject: Re: mod_perl hosting
Message-Id: <1109877295.102184.304220@z14g2000cwz.googlegroups.com>

Tom wrote:
> I am looking for decent mod_perl hosting.  I am based in the UK but
> dont mind if the hosting is elsewhere.
>
> MySQL would also be nice, what Im looking for is a hosting company
> that has sane charging policies for DNS entries etc.
>
> Any recommendations or resource links would be good.

I use telana.com.  I've set up WebGUI with mod_perl on their servers.
They offer unlimited subdomains, and a reasonable amount of bandwidth
and storage, for $8 (US)/month.

HTH



------------------------------

Date: Thu, 03 Mar 2005 11:25:37 -0500
From: zentara <zentara@highstream.net>
Subject: Re: Net::Telnet, Terminal Programs, Prompts
Message-Id: <mode215aklmrbljqc7g26b3kub3euc33dp@4ax.com>

On 2 Mar 2005 06:50:06 -0800, "Mike" <jmw_misc@hotmail.com> wrote:

>Hi, I have been trying to create a Tk::Text that reads and writes to a
>Net::Telnet object. It works fairly well, but doesnt handle terminal
>types of programs like vi.
>
>Just looking for any ideas from the experts. I dont know to much about
>termianl emulations, etc.
>
>Also, i get two prompts. Anyone know why i might be getting that from
>Net::Telnet; I have prompt set to anything and timeout at 0, so i dont
>match on prompt or block. I just poll every 1/4 sec. But what i read
>with get, comes with two prompts. Any ideas on a better method let me
>know. I was trying to keep from using prompt, allowing it to work no
>matter what you logged into.
>
>This script is an example of its use followed by the module itself
>Note the ip is hardcoded so change to fit your system.
>
>Thanks
>Mike

I tried you program, and I couldn't quite figure out how it works. :-)

You don't have a login anywhere, and my test of it just shows a loop
where it can't login, and keeps giving a bad login message.

If I were doing this, I would try and use Expect or IPC::Open3 to run
the telnet session, and print the output to the textbox. Have a separate
textbox for inputting data.

So have 2 textboxes one on top for receive, and one below for sending.
Then you can run your telnet session thru IPC::Open3.  Read the OUT from
the session and print it to the top textbox,  and do some regexes on the
output, to determine when to enable the input textbox  below.

What you seem to be trying is substituing the textbox for an interactive
shell. Maybe it can be done?  But you are not very close.

Why don't you do a "groups.google.com" search for "Tk telnet" and see
how others have approached it.





-- 
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html


------------------------------

Date: 3 Mar 2005 12:03:29 -0800
From: "Mike" <jmw_misc@hotmail.com>
Subject: Re: Net::Telnet, Terminal Programs, Prompts
Message-Id: <1109880209.592853.17040@o13g2000cwo.googlegroups.com>

Thanks for taking a look.

If you change the ip address and place the module where you can load
it, you should get a text box display with a connect button. Once i
press the button, i get whatever the host telnet echos out. Mine shows
a login prompt. Which i then can enter into the text box username and
password. I then see the command prompt and can type commands in.

Do you get anything after pressing the connect? If so make sure you
select the Text box in order to enter commands. I have added a focus in
the module now, but it is missing in what i posted.

I am now trying to use Term::VT120 along with Net::Telnet
The Term allows somewhat of the terminal buffering i need which i poll
for the current screen and update the Text Box. It works fairly well
also. But i currently dont sedn anything to the Telnet obj until i hit
return. But with programs like more for example, i need space to
immediately be sent. Or if an editor like vi, i need esc to be sent
right away.

If you can think of anything or have any ideas, please post.

Thanks
Mike


Mike wrote:
> Hi, I have been trying to create a Tk::Text that reads and writes to
a
> Net::Telnet object. It works fairly well, but doesnt handle terminal
> types of programs like vi.
>
> Just looking for any ideas from the experts. I dont know to much
about
> termianl emulations, etc.
>
> Also, i get two prompts. Anyone know why i might be getting that from
> Net::Telnet; I have prompt set to anything and timeout at 0, so i
dont
> match on prompt or block. I just poll every 1/4 sec. But what i read
> with get, comes with two prompts. Any ideas on a better method let me
> know. I was trying to keep from using prompt, allowing it to work no
> matter what you logged into.
>
> This script is an example of its use followed by the module itself
> Note the ip is hardcoded so change to fit your system.
>
> Thanks
> Mike
>
> ############################################################
>
> use strict;
> use Tk;
> use lib 'lib';
> use Tk::ECC::Telnet;
>
> my $mw = new MainWindow();
> my $tn = $mw->Telnet->pack(-side => 'top', -expand => '1', -fill =>
> 'both');
> my $bt = $mw->Button(-text => 'Connect', -command => [\&connect,
> $tn])->pack(-expand => '1', -fill => 'x');
> MainLoop;
>
> sub connect {
>   my $tn = shift;
>   print "Connecting to $tn\n";
>   $tn->conn('10.1.24.226');
>   }
>
> ##############################################################
>
> Here is the Module Tk::ECC::Telnet
>
> # -------------------------------------------------------------------
> # Tk Widget based on Standard Tk::Text and Net::Telnet
> # -------------------------------------------------------------------
>
> package Tk::ECC::Telnet;
>
> use Net::Telnet;
> use base qw(Tk::Derived Tk::Text);
> Construct Tk::Widget 'Telnet';
>
> sub ClassInit {
>   my ($class, $mw) = @_;
>   $class->SUPER::ClassInit($mw);
>   $mw->bind($class,'<Return>', \&Return)
>   #$mw->bind($class, '<KeyPress>', \&keypress);
> }
>
> sub Populate {
>   my ($self, $args) = @_;
>   my $ip = '192.168.2.10';
>   $self->SUPER::Populate($args);
>   $self->{END} = 0.0;
>   $self->{KEY} = 0;
>   $self->{TELNET} = new Net::Telnet( Timeout => 0, Prompt => '//',);
>   $self->{TELNET}->errmode("return");
> }
>
> sub conn {
>   my ($self, $ip) = @_;
>   $self->{TELNET}->open($ip);
>   $self->repeat('250', [\&read_telnet, $self])
> }
>
> sub disconn {
>   print "Disccc\n";
>   my ($self,) = shift;
>   $self->{TELNET}->print("exit");
>   #$self->cancel('250', [\&read_telnet, $self])
> }
>
> sub insert {
>   #print "insert [@_]\n";
>   my ($self) = shift;
>   $self->SUPER::insert(@_);
>   return if ($self->{KEY});
>   print "Setting End\n";
>   $self->{END} = $self->index('insert');
> }
>
> sub Return {
>   #print "Return [@_]\n";
>   my $self = shift;
>   return unless ($self->compare($self->index('insert'), '>=',
> $self->{END}));
>   my $cmd = $self->get($self->{END}, 'end');
>   $self->SUPER::Insert("\n");
>   $self->{TELNET}->print($cmd);
>   $self->{TELNET}->timeout(1);
>   $self->{TELNET}->getline();
>   $self->{TELNET}->getline();
>   $self->{TELNET}->timeout(0);
> }
>
> sub Backspace {
>   #print "BackSpace [@_]\n";
>   my $self = shift;
>   print $self->index('insert') . ">" . $self->{END} . "\n";
>   return unless ($self->compare($self->index('insert'), '>',
> $self->{END}));
>   $self->SUPER::Backspace;
> }
>
> sub InsertKeypress {
>   #print "InsertKeypress [@_]\n";
>   my ($self, $key) = @_;
>   return unless ($self->compare($self->index('insert'), '>=',
> $self->{END}));
>   $self->{KEY} = 1;
>   $self->SUPER::InsertKeypress($key);
>   $self->{KEY} = 0;
>   #print "END is currently " . $self->{END} . "\n";
> }
>
> sub read_telnet {
>   my ($self) = shift;
>   while (my $data = $self->{TELNET}->get()) {
>     print "Data [$data]\n";
>     $self->insert('end', $data);
>     $self->see('end');
>     $self->markSet('insert', 'end');
>     }
>   }
> 
> 1;



------------------------------

Date: Thu, 03 Mar 2005 13:16:41 -0500
From: zentara <zentara@highstream.net>
Subject: Re: PERL WEB PROGRESS BAR
Message-Id: <q1le21p98qvq9u3c5flahq362kb8euseq4@4ax.com>

On 2 Mar 2005 08:15:51 -0800, 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?
>- 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.

You can setup a javascript indicator for your upload

Check out this:
http://zentara.net/jsupload.html

I hacked a Perl version of a PHP uploader script.
I havn't messed with them in awhile, so YMMV.
I have a 100k limit on the script, so it may finish before
it can report percentages. You can download it, and
experiment for yourself.

You really waste upload bandwidth when you use these
(except for the pure javascript version). Because you need to setup
a feedback cgi, which shares the bandwidth with the upload.
The javascript one is just an indicator, so it consumes no bandwidth.

One written in Tk or Gtk , is your best bet, unless you are forced
to use a browser.  You can feed the output from LWP, or libCurl
to a Progressbar.



-- 
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html


------------------------------

Date: Thu, 03 Mar 2005 15:26:19 +0100
From: Alexandre Jaquet <alexj@floor.ch>
Subject: persistant db connection
Message-Id: <d076qa$s0n$1@news.hispeed.ch>

I'm a bit confused where I should place persistant connection and I want 
my scripts useds as compiled registry scripts.

I've added in my httpd.conf

PerlModule Apache::DB;

<Location /perl-status>
        SetHandler perl-script
        PerlResponseHandler Apache::Status
</Location>
<Location /script>
         SetHandler perl-script
         PerlHandler ModPerl::Registry
         Options ExecCGI
         PerlSendHeader On
         Order allow,deny
         Allow from all
</Location>




I add on my startup.pl script :

use strict;
use ModPerl::Registry ();
use Apache2 ();
use Apache::DBI;
use Image::Magick;
use DBI;
use Mail::Sender;
use Digest::MD5 qw(md5_hex);
use Data::Dumper;
use POSIX;
use CGI ();
CGI->compile(':all');

  Apache::DBI->connect_on_init
   ("DBI:mysql:test:localhost",
    "username",
    "passwd",
    {
     PrintError => 1, # warn() on errors
     RaiseError => 0, # don't die on error
     AutoCommit => 1, # commit executes immediately
    }
   );
return 1;

but now how can I use it in my scripts who needs to use this connection 
  ? for exemple I consider $dbh as the connection reference

$dbh->do($sql) ...


------------------------------

Date: 3 Mar 2005 11:18:16 -0800
From: julia_2683@hotmail.com (julia)
Subject: special variables
Message-Id: <65a243bc.0503031118.774b0cd3@posting.google.com>

Hi, all. I have been looking for some documentation that discusses the
@$ (@$newRules) variables but I can't find the right information so I
decrypt the subroutine.


sub buildRulesSens {
  my ($sens, $exceptFile, $lang) = @_;

  @RULES_FILES = ();
  my $rulesPath = "$lang/rules/sens$sens";
  find \&lsRuleFiles, "$rulesPath";
  my $out = "$lang/rules_sens$sens.txt";

  my $conf = readConfFile($exceptFile);

  open (OUT, ">$out") or error("Cant open '$out'");
  foreach my $ruleF (@RULES_FILES) {
    printc "Processing rules file: $ruleF\n";
    print OUT "#<FILE>$ruleF<BODY>\n";
    my $newRules = buildRules($ruleF, $conf);
    foreach my $r (@$newRules) {
      print OUT "$r\n";
    }
    #trc('_rules', $_rules); die;
  }
  close OUT;
}


------------------------------

Date: Thu, 03 Mar 2005 14:31:02 -0500
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: special variables
Message-Id: <Y5ednfl2sLFr-LrfRVn-pw@adelphia.com>

julia wrote:

> Hi, all. I have been looking for some documentation that discusses the
> @$ (@$newRules) variables but I can't find the right information so I
> decrypt the subroutine.

$newRules is a reference to an array. Using "foreach (@$newRules)" will loop
over the elements in the array that $newRules refers to.

For more about references, have a look at:
    perldoc perlreftut
    perldoc perldsc
    perldoc perllol

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


------------------------------

Date: Thu, 03 Mar 2005 11:31:53 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: special variables
Message-Id: <030320051131535075%jgibson@mail.arc.nasa.gov>

In article <65a243bc.0503031118.774b0cd3@posting.google.com>, julia
<julia_2683@hotmail.com> wrote:

> Hi, all. I have been looking for some documentation that discusses the
> @$ (@$newRules) variables but I can't find the right information so I
> decrypt the subroutine.

A variable that starts with @$ is the act of dereferencing an array
reference. @$newRules is shorthand for @{$newRules}, where $newRules
contains a reference to an array. @$newRules or @{$newRules} is then
that array. 

In the code below, buildRules(...) must be returning a reference to an
array. The subsequent foreach statement is iterating over the elements
of that array, aliasing each one to $r.

> 
> 
> sub buildRulesSens {
>   my ($sens, $exceptFile, $lang) = @_;
> 
>   @RULES_FILES = ();
>   my $rulesPath = "$lang/rules/sens$sens";
>   find \&lsRuleFiles, "$rulesPath";
>   my $out = "$lang/rules_sens$sens.txt";
> 
>   my $conf = readConfFile($exceptFile);
> 
>   open (OUT, ">$out") or error("Cant open '$out'");
>   foreach my $ruleF (@RULES_FILES) {
>     printc "Processing rules file: $ruleF\n";
>     print OUT "#<FILE>$ruleF<BODY>\n";
>     my $newRules = buildRules($ruleF, $conf);
>     foreach my $r (@$newRules) {
>       print OUT "$r\n";
>     }
>     #trc('_rules', $_rules); die;
>   }
>   close OUT;
> }

See the Perl documentation on references:

perldoc perlreftut
perldoc perlref


----== 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 =---


------------------------------

Date: Thu, 03 Mar 2005 18:31:46 GMT
From: Ron Graham <Ronvgraham@yahoo.com>
Subject: UltraEdit?
Message-Id: <Xns960E75491F949Ronvgrahamyahoocom@151.164.30.44>

Has anybody used UltraEdit for their perl scripting?  Is this the best 
editor or is their a better one for general networking and perl/vbscript 
scripting?  Any advice would be greatly appreciated.


------------------------------

Date: Thu, 03 Mar 2005 19:34:11 +0000
From: Tom <none@zerofiveone.com>
Subject: Re: UltraEdit?
Message-Id: <sjpe21dmo9klupe5iv4ep6ci62v48e5pae@4ax.com>

I like Active State Komodo, but thats geared to open source languages,
for VB Im not so sure what you should use.

Cheers,
Tom


On Thu, 03 Mar 2005 18:31:46 GMT, Ron Graham <Ronvgraham@yahoo.com>
wrote:

>Has anybody used UltraEdit for their perl scripting?  Is this the best 
>editor or is their a better one for general networking and perl/vbscript 
>scripting?  Any advice would be greatly appreciated.



------------------------------

Date: 3 Mar 2005 19:50:15 GMT
From: John Bokma <postmaster@castleamber.com>
Subject: Re: UltraEdit?
Message-Id: <Xns960E8CC34E358castleamber@130.133.1.4>

Ron Graham wrote:

> Has anybody used UltraEdit for their perl scripting?  Is this the best 
> editor or is their a better one for general networking and perl/vbscript 
> scripting?  Any advice would be greatly appreciated.

I use Textpad. Never liked the crowded UI of UltraEdit. Had a peek at 
Eclipse but that is to me unusable for perl editing.

I hope that Textpad gets folding soon, since that's one option I miss.

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


------------------------------

Date: Thu, 03 Mar 2005 21:45:35 +0000
From: Andy Hassall <andy@andyh.co.uk>
Subject: Re: UltraEdit?
Message-Id: <da1f211v4t2n06c49d8kcgdp00l31n0l13@4ax.com>

On Thu, 03 Mar 2005 18:31:46 GMT, Ron Graham <Ronvgraham@yahoo.com> wrote:

>Has anybody used UltraEdit for their perl scripting?  Is this the best 
>editor or is their a better one for general networking and perl/vbscript 
>scripting?  Any advice would be greatly appreciated.

 When I'm on Windows, I use UltraEdit for everything _except_ Perl, where I use
Emacs with cperl-mode - IMHO it can't be beat for Perl editing.

-- 
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool


------------------------------

Date: Thu, 03 Mar 2005 23:29:41 +0100
From: Christian Winter <thepoet_nospam@arcor.de>
Subject: Re: UltraEdit?
Message-Id: <42278fce$0$24926$9b4e6d93@newsread2.arcor-online.net>

Ron Graham wrote:
> Has anybody used UltraEdit for their perl scripting?  Is this the best 
> editor or is their a better one for general networking and perl/vbscript 
> scripting?  Any advice would be greatly appreciated.

I use UltraEdit most of the time when coding on windows, on
*nix systems I prefer vim as most of our penguins don't have
a graphical desktop installed. Another one you might want to
look at for perl coding is PCE[1] which is written in perl
and configured with xml files. It's similar to UltraEdit
(menu structure, syntax highlighting, tabbed windows),
but GPLed. It's still in development and nowhere "feature
complete", but IMHO worth a look.

-Chris


[1] http://proton-ce.sourceforge.net


------------------------------

Date: Thu, 03 Mar 2005 16:30:14 -0500
From: * Tong * <sun_tong@users.sourceforge.net>
Subject: WikiConverter
Message-Id: <pan.2005.03.03.21.30.11.486426@users.sourceforge.net>

Hi, 

Can anybody make any WikiConverter works?

I tried to use DokuWiki (a dialect for HTML::WikiConverter), but it
failed. So I tried HTML::WikiConverter instead. But I just can't get it
going. Here is what I've tried:

$wc = new HTML::WikiConverter(html => 'http://www.citlink.net/~messengertj/htmlhelp.htm');
print $wc->output, "\n";


$wc = new HTML::WikiConverter(html => 'http://www.citlink.net/~messengertj/htmlhelp.htm', dialect => 'MediaWiki', pretty_tables => 1);
print $wc->output, "\n";

$wc = new HTML::WikiConverter(base_url => 'http://www.citlink.net/~messengertj/', file => 'htmlhelp.htm');
print $wc->output;

 ... Nothing works. Anybody can? Please help.


-- 
Tong (remove underscore(s) to reply)
  *niX Power Tools Project: http://xpt.sourceforge.net/
  - All free contribution & collection


------------------------------

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 7851
***************************************


home help back first fref pref prev next nref lref last post