[gimp-perl] my() on $i etc need to before eval() of expr.
- From: Ed J <edj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp-perl] my() on $i etc need to before eval() of expr.
- Date: Tue, 29 Apr 2014 15:07:39 +0000 (UTC)
commit 8698eb68f16d81e5e454f4788049e7b72dd30862
Author: Ed J <edj src gnome org>
Date: Tue Apr 29 16:03:32 2014 +0100
my() on $i etc need to before eval() of expr.
examples/frame_filter | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/examples/frame_filter b/examples/frame_filter
index 9f62de6..e61fe45 100755
--- a/examples/frame_filter
+++ b/examples/frame_filter
@@ -7,17 +7,18 @@ use strict;
podregister {
my @layers = $image->get_layers;
my $n = @layers or die "At least one layer is required\n";
- my $func = eval "sub{\n#line 0 \"expression\"\n$expr\n}";
+ my ($i, $I, $p, $P, $d); # declare here so seen by eval below
+ my $func = eval "sub{\nno strict;\n#line 0 \"expression\"\n$expr\n}";
die "Syntax error in expression '$expr': $ \n" if $@;
# now apply the expr
eval { $image->undo_group_start };
# 5.004 has problems with overlaying functions
Gimp->progress_init("Applying Expression...",-1);
- for my $i (0..$n-1) {
- my $I = $n-$i-1;
- my $p = @layers > 1 ? $i/$#layers : 0;
- my $P = 1-$p;
- my $d = $layers[$i];
+ for $i (0..$n-1) {
+ $I = $n-$i-1;
+ $p = @layers > 1 ? $i/$#layers : 0;
+ $P = 1-$p;
+ $d = $layers[$i];
eval { &$func };
die "Evaluation error in frame $i: $ \n" if $@;
Gimp->progress_update(($i+1)/$n);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]