[Catalyst] assigning vars to $c-stash

2007-03-12 Thread Octavian Rasnita
Hi, I have a $hash hash reference and I want to add all its elements to the stash. How can I do this? Do I need to use a loop and assign each element one by one? I have seen that it is not possible to use $c-stash = $hash; Can I use something else than foreach(keys %$hash) { $c-stash-{$_}

Re: [Catalyst] assigning vars to $c-stash

2007-03-12 Thread Carl Franks
On 12/03/07, Octavian Rasnita [EMAIL PROTECTED] wrote: I have a $hash hash reference and I want to add all its elements to the stash. How can I do this? Do I need to use a loop and assign each element one by one? I have seen that it is not possible to use $c-stash = $hash; %{ $c-stash } = (

Re: [Catalyst] assigning vars to $c-stash

2007-03-12 Thread Matt Lawrence
Carl Franks wrote: On 12/03/07, Octavian Rasnita [EMAIL PROTECTED] wrote: I have a $hash hash reference and I want to add all its elements to the stash. How can I do this? Do I need to use a loop and assign each element one by one? I have seen that it is not possible to use $c-stash = $hash;

Re: [Catalyst] assigning vars to $c-stash

2007-03-12 Thread Robert 'phaylon' Sedlacek
Octavian Rasnita wrote: I have a $hash hash reference and I want to add all its elements to the stash. How can I do this? Do I need to use a loop and assign each element one by one? I have seen that it is not possible to use $c-stash = $hash; Can I use something else than foreach(keys

Re: [Catalyst] assigning vars to $c-stash

2007-03-12 Thread Eden Cardim
On 3/12/07, Robert 'phaylon' Sedlacek [EMAIL PROTECTED] wrote: $c-stash( %$hash ); $c-stash( $hash ); is a little bit faster... -- Eden Cardim Instituto Baiano de Biotecnologia Núcleo de Biologia Computacional e Gestão de Informações Biotecnológicas Laboratório de Bioinformática -- you

Re: [Catalyst] assigning vars to $c-stash

2007-03-12 Thread Robert 'phaylon' Sedlacek
Eden Cardim wrote: $c-stash( $hash ); is a little bit faster... Correct. -- # Robert 'phaylon' Sedlacek # Perl 5/Catalyst Developer in Hamburg, Germany { EMail = ' [EMAIL PROTECTED] ', Web = ' http://474.at ' } ___ List:

Re: [Catalyst] assigning vars to $c-stash

2007-03-12 Thread Octavian Rasnita
Thank you all for your solutions. I think this is the most simple. Octavian - Original Message - From: Eden Cardim [EMAIL PROTECTED] To: The elegant MVC web framework catalyst@lists.rawmode.org Sent: Monday, March 12, 2007 2:39 PM Subject: Re: [Catalyst] assigning vars to $c-stash

Re: [Catalyst] Detecting if a user aborted a (long) download

2007-03-12 Thread Wade . Stuart
There are various compromises that you can make instead, including checking to see if the whole file at least made it out of your catalyst app (by having your filehandle monitor that for you). You can also give the user a good amount of time to download the file as many times as he

Re: [Catalyst] Performance

2007-03-12 Thread Jason Kohles
On Mar 9, 2007, at 10:04 AM, Robert 'phaylon' Sedlacek wrote: Christopher H. Laco wrote: Sure, it they're that different. The goal still stands, don't use uri_for everywhere. Only use it when you really need it. Jep. But this is not getting easier if you start to have captures in your

Re: [Catalyst] Detecting if a user aborted a (long) download

2007-03-12 Thread Jeff Chimene
Jonathan Rockway wrote: On Sunday 11 March 2007 21:18, Jeff Chimene wrote: Jonathan Rockway wrote: On Sunday 11 March 2007 20:59, Jeff Chimene wrote: How does that differ from something that compares bytes sent to bytes received? Assuming that the OP defines success when bytes

Re: [Catalyst] Detecting if a user aborted a (long) download

2007-03-12 Thread Wade . Stuart
Since we haven't heard from the OP. I have two questions: o Did you investigate sendfile? Sendfile() buys you nothing relevant to the OP's question. o Have you considered implementing a download progress indicator? One of the reasons users give up on downloads is that they don't know

Re: [Catalyst] Detecting if a user aborted a (long) download

2007-03-12 Thread Dave Rolsky
On Mon, 12 Mar 2007, [EMAIL PROTECTED] wrote: 2, where download app continues download even if you leave the page/site that started it This is normal behavior. In Firefox, at least, once you start downloading the file, that's a separate request, unrelated to the page where I started the

Re: [Catalyst] Detecting if a user aborted a (long) download

2007-03-12 Thread Jay K
Hi Thomas, Check out the code associated with the 2006 advent calendar entry entitled 'streaming mp3s with Catalyst' http://www.catalystframework.org/calendar/2006/15 It's a little more involved, in that it handles 'range' requests - but the main portion of the mp3 sending should work for you,

Re: [Catalyst] Detecting if a user aborted a (long) download

2007-03-12 Thread Thomas Klausner
Hi! On Mon, Mar 12, 2007 at 01:21:45PM -0500, [EMAIL PROTECTED] wrote: your webapp does not get you past this problem. A simple, smart and quite frankly the industry standard solution is to allow the user to try again on failure. So I need to figure out if there was I failure. Which I did

Re: [Catalyst] Detecting if a user aborted a (long) download

2007-03-12 Thread Wade . Stuart
[EMAIL PROTECTED] wrote: Since we haven't heard from the OP. I have two questions: o Did you investigate sendfile? Sendfile() buys you nothing relevant to the OP's question. Really? The OP was merely detecting whether or not the session aborted, not whether or not the

Re: [Catalyst] Detecting if a user aborted a (long) download

2007-03-12 Thread Carl Johnstone
Here's a worst-case scenario you send it to IE and somewhere along the line it picks up a Vary header. IE won't store anything in it's cache with a Vary header - not even downloaded files. So it downloads the file then deletes it. You can't save it elsewhere or retrieve it!