Re: [Catalyst] Defining ARRAY in Config::General config

2010-10-08 Thread Alexander Hartmaier
If you're referring to Catalyst::Plugin::Email you shouldn't use that
any more as mailing doesn't need to be a plugin but a view.
Try Catalyst::View::Email(::Template)

--
Best regards, Alex


Am Dienstag, den 21.09.2010, 06:29 +0200 schrieb Pavel A. Karoukin:
 Hello,


 I am using Catalyst::Plugin::Mail and want to define email config in
 myapp.conf. But C::P::Mail expects email config variable to be array
 ref. How I can assign array value to config variable in myapp.conf?


 Regards,
 Pavel




***
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
***
Notice: This e-mail contains information that is confidential and may be 
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
***

___
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] Defining ARRAY in Config::General config

2010-10-08 Thread Denny
On Fri, 2010-10-08 at 19:46 +0200, Alexander Hartmaier wrote:
 Am Dienstag, den 21.09.2010, 06:29 +0200 schrieb Pavel A. Karoukin:
  I am using Catalyst::Plugin::Mail and want to define email config in
  myapp.conf. But C::P::Mail expects email config variable to be array
  ref. How I can assign array value to config variable in myapp.conf?
 
 If you're referring to Catalyst::Plugin::Email you shouldn't use that
 any more as mailing doesn't need to be a plugin but a view.
 Try Catalyst::View::Email(::Template)

Following on from that advice (which I was also given, and followed),
here's a sample Catalyst::View::Email(::Template) config I had to work
out earlier this week.  There are a remarkable shortage of sample
Catalyst configs online, and I found it quite frustrating just trying to
find the right syntax to use - even though it's incredibly simple once
you know how.  Hope this helps.

Regards,
Denny


de...@serenity ~/code/shinycms $ cat shinycms.conf 
name   ShinyCMS
author Denny de la Haye 2...@denny.me

default_view HTML

View::Email
stash_key email_data
default
content_type text/plain
charset utf-8
/default
sender
mailer SMTP
mailer_args
Host localhost
/mailer_args
/sender
/View::Email

View::Email::Template
stash_key email_data
template_prefix emails
default
content_type text/html
charset utf-8
view HTML
/default
sender
mailer SMTP
mailer_args
Host localhost
/mailer_args
/sender
/View::Email::Template



signature.asc
Description: This is a digitally signed message part
___
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] Defining ARRAY in Config::General config

2010-09-21 Thread Kamen Naydenov
On Tue, Sep 21, 2010 at 07:29, Pavel A. Karoukin hipp...@gmail.com wrote:
 Hello,
 I am using Catalyst::Plugin::Mail and want to define email config in
 myapp.conf. But C::P::Mail expects email config variable to be array ref.
 How I can assign array value to config variable in myapp.conf?
Multiple rows with same name and different values form array in myapp.conf

For example:
room 7
room 9
room 13

Example is in Config::General syntax

best regards
Kamen

___
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] Defining ARRAY in Config::General config

2010-09-21 Thread Octavian Rasnita
The problem appears when the array should have just a single item, because 
in that case Config::General reports it as a scalar value.


I don't know if there is a better way of defining a single-item array with 
Config::General, but I found a workaround that may work. We can use 
something like:


foo bar
foo

This creates an array with 2 elements and the last one is undef.

--Octavian

- Original Message - 
From: Kamen Naydenov pa...@kamennn.eu

To: The elegant MVC web framework catalyst@lists.scsys.co.uk
Sent: Tuesday, September 21, 2010 9:05 AM
Subject: Re: [Catalyst] Defining ARRAY in Config::General config


On Tue, Sep 21, 2010 at 07:29, Pavel A. Karoukin hipp...@gmail.com 
wrote:

Hello,
I am using Catalyst::Plugin::Mail and want to define email config in
myapp.conf. But C::P::Mail expects email config variable to be array ref.
How I can assign array value to config variable in myapp.conf?

Multiple rows with same name and different values form array in myapp.conf

For example:
room 7
room 9
room 13

Example is in Config::General syntax

best regards
Kamen

___
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/ 



___
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] Defining ARRAY in Config::General config

2010-09-21 Thread Andrew Rodland
On Tuesday, September 21, 2010 02:52:52 am Octavian Rasnita wrote:
 The problem appears when the array should have just a single item, because
 in that case Config::General reports it as a scalar value.
 
 I don't know if there is a better way of defining a single-item array with
 Config::General, but I found a workaround that may work. We can use
 something like:

With Config::General = 2.47 and Config::Any = 0.20, you can use the syntax 
foo [ bar ] or foo = [ bar ] to set the key foo to an arrayref 
containing the single value bar. The latest version of 
Catalyst::Plugin::ConfigLoader will ensure that you're up to date.

Andrew

___
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] Defining ARRAY in Config::General config

2010-09-21 Thread Octavian Rasnita

Hi Andrew,

I tried:

C:\Documents and Settings\Teddy perl -MConfig::General -e print 
$Config::General::VERSION

2.49

#The program:

use Config::General;
use Data::Dumper;

my $conf = Config::General-new('config.conf');
my %conf = $conf-getall;

print Dumper \%conf;

#The configuration file:

array2
foo [ bar ]
/array2

foo [ bar ]

#The result:

$VAR1 = {
 'foo' = '[ bar ]',
 'array2' = {
   'foo' = '[ bar ]'
 }
   };

So it seems it doesn't work as it should because it creates a scalar that 
contains [ bar ].


Am I missing something?

Thanks.

--Octavian

- Original Message - 
From: Andrew Rodland and...@cleverdomain.org

To: The elegant MVC web framework catalyst@lists.scsys.co.uk
Sent: Tuesday, September 21, 2010 11:27 AM
Subject: Re: [Catalyst] Defining ARRAY in Config::General config



On Tuesday, September 21, 2010 02:52:52 am Octavian Rasnita wrote:
The problem appears when the array should have just a single item, 
because

in that case Config::General reports it as a scalar value.

I don't know if there is a better way of defining a single-item array 
with

Config::General, but I found a workaround that may work. We can use
something like:


With Config::General = 2.47 and Config::Any = 0.20, you can use the 
syntax

foo [ bar ] or foo = [ bar ] to set the key foo to an arrayref
containing the single value bar. The latest version of
Catalyst::Plugin::ConfigLoader will ensure that you're up to date.

Andrew

___
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/ 



___
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] Defining ARRAY in Config::General config

2010-09-21 Thread Emanuele Zeppieri
On Tue, Sep 21, 2010 at 2:14 PM, Octavian Rasnita
octavian.rasn...@ssifbroker.ro wrote:

 Hi Andrew,

 I tried:

 C:\Documents and Settings\Teddy perl -MConfig::General -e print
 $Config::General::VERSION
 2.49

 #The program:

 use Config::General;
 use Data::Dumper;

 my $conf = Config::General-new('config.conf');

To obtain single value arrays with the syntax in question, the above
line should be:

my $conf = Config::General-new( -ConfigFile = 'config.conf',
-ForceArray = 1 );

___
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] Defining ARRAY in Config::General config

2010-09-21 Thread Pavel A. Karoukin
On Tue, Sep 21, 2010 at 8:06 AM, Emanuele Zeppieri ema...@gmail.com wrote:

 On Tue, Sep 21, 2010 at 2:14 PM, Octavian Rasnita
 octavian.rasn...@ssifbroker.ro wrote:

  Hi Andrew,
 
  I tried:
 
  C:\Documents and Settings\Teddy perl -MConfig::General -e print
  $Config::General::VERSION
  2.49
 
  #The program:
 
  use Config::General;
  use Data::Dumper;
 
  my $conf = Config::General-new('config.conf');

 To obtain single value arrays with the syntax in question, the above
 line should be:

 my $conf = Config::General-new( -ConfigFile = 'config.conf',
 -ForceArray = 1 );


How I can pass this -ForceArray to Config::General in my catalyst app?

Regards,
Pavel
___
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] Defining ARRAY in Config::General config

2010-09-21 Thread Emanuele Zeppieri
On Tue, Sep 21, 2010 at 3:30 PM, Pavel A. Karoukin pa...@yepcorp.com wrote:

 On Tue, Sep 21, 2010 at 8:06 AM, Emanuele Zeppieri ema...@gmail.com wrote:

 On Tue, Sep 21, 2010 at 2:14 PM, Octavian Rasnita
 octavian.rasn...@ssifbroker.ro wrote:

  Hi Andrew,
 
  I tried:
 
  C:\Documents and Settings\Teddy perl -MConfig::General -e print
  $Config::General::VERSION
  2.49
 
  #The program:
 
  use Config::General;
  use Data::Dumper;
 
  my $conf = Config::General-new('config.conf');

 To obtain single value arrays with the syntax in question, the above
 line should be:

 my $conf = Config::General-new( -ConfigFile = 'config.conf',
 -ForceArray = 1 );


 How I can pass this -ForceArray to Config::General in my catalyst app?

http://search.cpan.org/~bricas/Catalyst-Plugin-ConfigLoader-0.30/lib/Catalyst/Plugin/ConfigLoader.pm#DESCRIPTION

___
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] Defining ARRAY in Config::General config

2010-09-21 Thread Pavel A. Karoukin
On Tue, Sep 21, 2010 at 8:53 AM, Emanuele Zeppieri ema...@gmail.com wrote:

 On Tue, Sep 21, 2010 at 3:30 PM, Pavel A. Karoukin pa...@yepcorp.com
 wrote:

  On Tue, Sep 21, 2010 at 8:06 AM, Emanuele Zeppieri ema...@gmail.com
 wrote:
 
  On Tue, Sep 21, 2010 at 2:14 PM, Octavian Rasnita
  octavian.rasn...@ssifbroker.ro wrote:
 
   Hi Andrew,
  
   I tried:
  
   C:\Documents and Settings\Teddy perl -MConfig::General -e print
   $Config::General::VERSION
   2.49
  
   #The program:
  
   use Config::General;
   use Data::Dumper;
  
   my $conf = Config::General-new('config.conf');
 
  To obtain single value arrays with the syntax in question, the above
  line should be:
 
  my $conf = Config::General-new( -ConfigFile = 'config.conf',
  -ForceArray = 1 );
 
 
  How I can pass this -ForceArray to Config::General in my catalyst app?


 http://search.cpan.org/~bricas/Catalyst-Plugin-ConfigLoader-0.30/lib/Catalyst/Plugin/ConfigLoader.pm#DESCRIPTION



Thank you!
___
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] Defining ARRAY in Config::General config

2010-09-21 Thread Octavian Rasnita
From: Emanuele Zeppieri ema...@gmail.com
 To obtain single value arrays with the syntax in question, the above
 line should be:
 
 my $conf = Config::General-new( -ConfigFile = 'config.conf',
 -ForceArray = 1 );
 


Aa, thanks.

Octavian


___
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] Defining ARRAY in Config::General config

2010-09-21 Thread Andrew Rodland
On Tuesday, September 21, 2010 08:30:43 am Pavel A. Karoukin wrote:
 On Tue, Sep 21, 2010 at 8:06 AM, Emanuele Zeppieri ema...@gmail.com wrote:
  On Tue, Sep 21, 2010 at 2:14 PM, Octavian Rasnita
  my $conf = Config::General-new( -ConfigFile = 'config.conf',
  -ForceArray = 1 );
 
 How I can pass this -ForceArray to Config::General in my catalyst app?
 
By having the current version of Config::Any installed, like I said in the 
first place. :)

Andrew

___
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/


[Catalyst] Defining ARRAY in Config::General config

2010-09-20 Thread Pavel A. Karoukin
Hello,

I am using Catalyst::Plugin::Mail and want to define email config in
myapp.conf. But C::P::Mail expects email config variable to be array ref.
How I can assign array value to config variable in myapp.conf?


Regards,
Pavel
___
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/