[Catalyst] newbie - syntax error

2008-02-22 Thread Dermot
Hi,

I hope my first question isn't too dumb.

In the routine below I want to test if the method is being called with an
additional parameters. So if the uri is ~/list/2
return only the files with user=id. If no parameter is called (~/list)
return all files. The functions works as it is but obviously I can not
recall all files.

Without the comments the list function returns a syntax error. In fact I can
also get the same error is I do:

my $files;
 $files : Stashed = $c-model('ImagesDB::Files')-search({user = $id});


use base 'Catalyst::Controller::BindLex'
...
sub list : Local {
 my ($self, $c, $id) = @_;
 #my $files;
 #if (defined($id)) {
my $files : Stashed = $c-model('ImagesDB::Files')-search({user =
$id});
 #}
 #else {
 #  my $files : Stashed = $c-model('ImagesDB::Files');
 #}
 $c-stash-{template} = 'files/list.tt2';
}


Can anyone give me a pointer? Thanx.
Dp.
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] newbie - syntax error

2008-02-22 Thread Ash Berlin


On 22 Feb 2008, at 14:47, Dermot wrote:


Hi,

I hope my first question isn't too dumb.

In the routine below I want to test if the method is being called  
with an additional parameters. So if the uri is ~/list/2
return only the files with user=id. If no parameter is called (~/ 
list) return all files. The functions works as it is but obviously I  
can not recall all files.


Without the comments the list function returns a syntax error. In  
fact I can also get the same error is I do:


my $files;
 $files : Stashed = $c-model('ImagesDB::Files')-search({user =  
$id});



use base 'Catalyst::Controller::BindLex'
...
sub list : Local {
 my ($self, $c, $id) = @_;
 #my $files;
 #if (defined($id)) {
my $files : Stashed = $c-model('ImagesDB::Files')- 
search({user = $id});

 #}
 #else {
 #  my $files : Stashed = $c-model('ImagesDB::Files');
 #}
 $c-stash-{template} = 'files/list.tt2';
}


Can anyone give me a pointer? Thanx.
Dp.



my $files : Stashed;

if (...) {
  $files = ...
} else {
  $files = 
}

BindLex cant cope when you declare the same variable ($files) multiple  
times in different scopes. ___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: YUI uploader example

2008-02-22 Thread Wade . Stuart
Lance A. Brown [EMAIL PROTECTED] wrote on 02/21/2008 10:02:32 PM:

 This is *really* cool.  Thanks

 --[Lance]

Yes, very cool.  I am still testing it, but it looks like there may need to
be some tests added to the code to limit file size.  I was hoping that the
flash uploader would work with large files (greater than 2g) unlike http
uploads.  It does not seem to be the case though.  I will post diffs once I
work out the best place to test and the actual limits in the example.

-Wade


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/