Re: Problem with my code for passing block

2022-01-11 Thread demerphq
On Tue, 11 Jan 2022 at 11:35, Jan Kasprzak wrote: > demerphq wrote: > : On Tue, 11 Jan 2022 at 10:18, Yamadaえりな wrote: > : > : > So, I would like to ask another question: > : > Is it safe to pass function reference to the caller (mostly it's the > : > method instantized from a class) in mod_perl

Re: Problem with my code for passing block

2022-01-11 Thread Jan Kasprzak
demerphq wrote: : On Tue, 11 Jan 2022 at 10:18, Yamadaえりな wrote: : : > So, I would like to ask another question: : > Is it safe to pass function reference to the caller (mostly it's the : > method instantized from a class) in mod_perl development env? : > Or should I avoid using this style? : > :

Re: Problem with my code for passing block

2022-01-11 Thread demerphq
On Tue, 11 Jan 2022 at 10:18, Yamadaえりな wrote: > So, I would like to ask another question: > Is it safe to pass function reference to the caller (mostly it's the > method instantized from a class) in mod_perl development env? > Or should I avoid using this style? > Nothing wrong with passing cod

Re: Problem with my code for passing block

2022-01-11 Thread Yamadaえりな
So, I would like to ask another question: Is it safe to pass function reference to the caller (mostly it's the method instantized from a class) in mod_perl development env? Or should I avoid using this style? Thanks.

Re: Problem with my code for passing block

2022-01-11 Thread Yamadaえりな
Thanks for all your help. Yes I have made the mistake to think {} is a code reference in perl. 私はすでに理解していますありがとう On Tue, Jan 11, 2022 at 5:10 PM Jacques Deguest wrote: > Yamada-san, > > The value you pass to 'run' is not a code reference, but an hash > reference, i.e. '{}' > > A code reference

Re: Problem with my code for passing block

2022-01-11 Thread Jacques Deguest
Yamada-san, The value you pass to 'run' is not a code reference, but an hash reference, i.e. '{}' A code reference would be: 'sub{}', so do '$obj->run( sub{ "hello world"} );' instead. Jacques On 2022/01/11 17:51, Yamadaえりな wrote: Good afternoon, Can you help check my problem with this?

Re: Problem with my code for passing block

2022-01-11 Thread demerphq
On Tue, 11 Jan 2022, 16:53 Yamadaえりな, wrote: > Good afternoon, > > Can you help check my problem with this? > > $ cat t1.pl > use strict; > > package Myclass; > > sub new { > my $self = shift; > bless {},$self; > } > > sub run { >my $self = shift; >my $block = shift; >&{$block}; >

Problem with my code for passing block

2022-01-11 Thread Yamadaえりな
Good afternoon, Can you help check my problem with this? $ cat t1.pl use strict; package Myclass; sub new { my $self = shift; bless {},$self; } sub run { my $self = shift; my $block = shift; &{$block}; } 1; package main; my $obj = Myclass->new; $obj->run( { "hello world"} ); $

Re: mod_dav question

2022-01-11 Thread Yamadaえりな
かしこまりました Thank you Jan and Jack I will try to implement that. Regards Yamada On Tue, Jan 11, 2022 at 4:10 PM Jacques Deguest wrote: > Yamada-san, > > You would need to set up a perl response handler like: > > SetHandler modperl > PerlSetupEnv On > PerlResponseHandler +Your::WebDav

Re: mod_dav question

2022-01-11 Thread Jacques Deguest
Yamada-san, You would need to set up a perl response handler like:     SetHandler modperl     PerlSetupEnv On     PerlResponseHandler +Your::WebDav::Module and in your module Your::WebDav::Module you would write something like: BEGIN {     use strict;     use warnings;     use Apache2::Reques

Re: mod_dav question

2022-01-11 Thread Jan Kasprzak
Yamada-san, Yamadaえりな wrote: : We are using mod_dav with apache2.4 to manage files via webdav protocol. : We want to limit file uploading based on the user's total storage. : For instance, if a user has his storage size reached to the max limit, he : can't upload files anymore. : Do you ha