Charles DeRykus writes:
> You could also simplify the closure since @tasks is in the closure's
> lexical scope, eg,
>
> my $report_static = sub { print $tasks[$iter++]; ... };
>
> foreach $task (@tasks) {
> if (...)
> $report_statics->();
> else
> $report_dynami
> ...
>
> I'm not sure why you don't just pass $task as an argument to the
> report_xxx subs...?
>
> A closure (perldoc -q closure) would be the long way around unless
> I've missed something:
>
> my $task;
> my $iter;
> my $report_static = sub { my $ref = shift;
>
Hi Martin,
thanks for your kind words.
On Sat, 28 Feb 2015 09:01:26 -0600
"Martin G. McCormick" wrote:
> Shlomi Fish writes:
> http://perl-begin.org/tutorials/bad-elements/#declaring_all_vars_at_top
> >
> > (Note: perl-begin.org is a domain I originated and maintain).
>
> Shlomi Fish, Uri and
Shlomi Fish writes:
http://perl-begin.org/tutorials/bad-elements/#declaring_all_vars_at_top
>
> (Note: perl-begin.org is a domain I originated and maintain).
Shlomi Fish, Uri and Brock,
I certainly wish I had known about a resource like this
earlier in my relatively short perl career.
Hi Martin,
here are some comments on your code in addition to what Uri said.
On Fri, 27 Feb 2015 22:24:52 -0600
"Martin G. McCormick" wrote:
> Brock Wilcox writes:
> > I'm afraid a bit more context is needed to identify the problem. Could you
> > post your entire bit of code into a gist or past
On Fri, Feb 27, 2015 at 8:24 PM, Martin G. McCormick
wrote:
> Brock Wilcox writes:
>> I'm afraid a bit more context is needed to identify the problem. Could you
>> post your entire bit of code into a gist or pastebin or something for us
>> to
>> see?
>
> I'll do better than that. This is a
On 02/27/2015 11:24 PM, Martin G. McCormick wrote:
Brock Wilcox writes:
I'm afraid a bit more context is needed to identify the problem. Could you
post your entire bit of code into a gist or pastebin or something for us
to
see?
I'll do better than that. This is a script which is
strippe
Brock Wilcox writes:
> I'm afraid a bit more context is needed to identify the problem. Could you
> post your entire bit of code into a gist or pastebin or something for us
> to
> see?
I'll do better than that. This is a script which is
stripped of everything but the problem code. It is 2
I'm afraid a bit more context is needed to identify the problem. Could you
post your entire bit of code into a gist or pastebin or something for us to
see?
On Feb 27, 2015 9:52 PM, "Martin G. McCormick" <
mar...@server1.shellworld.net> wrote:
> I put together an anonymous subroutine which
I put together an anonymous subroutine which partly
works. There is an array called @tasks which is defined as a
local variable in the main routine and when I call the anonymous
subroutine, one can still read all the elements in @tasks.
There is also a single scaler called $task, a
10 matches
Mail list logo