Explorar el Código

Added new operator handler

Alois Mahdal hace 11 años
padre
commit
ce94e72d7d
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6
    0
      lib/SugarTrail/Template/Condition.pm

+ 6
- 0
lib/SugarTrail/Template/Condition.pm Ver fichero

19
     return $a =~ m/$b/;
19
     return $a =~ m/$b/;
20
 }
20
 }
21
 
21
 
22
+sub _in {
23
+    my $a = shift;
24
+    my %b = map { $_ => 1 } @_;
25
+    return exists $b{$a};
26
+}
27
+
22
 sub new {
28
 sub new {
23
     my $class   = shift;
29
     my $class   = shift;
24
     my $self    = {};
30
     my $self    = {};