Thread Nicht enthalten in (7 answers)
Opened by Gast at 2007-11-14 10:31

renee
 2007-11-14 17:26
#102416 #102416
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Ja, das geht auch.

Ich wage zu bezweifeln, dass es da einen Geschwindigkeitsunterschied gibt, aber ich weiß nicht, wie "teuer" ein UNOP ist, denn mal das hier gemacht:

Skript:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl

use strict;
use warnings;

my $string = "Hallo Peter";

if( $string !~ /Peter/ ){
    print "test";
}

unless( $string =~ /Peter/ ){
    print "test";
}


Ausgabe von B::Terse:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
LISTOP (0x1941114) leave [1] 
OP (0x1940cf0) enter
COP (0x1941138) nextstate
BINOP (0x1941174) sassign
SVOP (0x1941198) const [2] PV (0x193efd0) "Hallo Peter"
OP (0x19411b8) padsv [1]
COP (0x1940f34) nextstate
UNOP (0x1940f70) null
LOGOP (0x1940f90) and
UNOP (0x1941074) not
PMOP (0x19410b4) match
OP (0x19410f8) padsv [1]
LISTOP (0x1940fb4) scope
OP (0x1940fd8) null [174]
LISTOP (0x1941030) print
OP (0x1941014) pushmark
SVOP (0x1941054) const [3] PV (0x193efac) "test"
COP (0x1940d30) nextstate
UNOP (0x1940d6c) null
LOGOP (0x1940d8c) or
PMOP (0x1940eb0) match
OP (0x1940ef4) padsv [1]
LISTOP (0x1940db0) scope
OP (0x1940dd4) null [174]
LISTOP (0x1940e2c) print
OP (0x1940e10) pushmark
SVOP (0x1940e50) const [4] PV (0x193ef88) "test"


Wichtig sind hier die UNOP-Blöcke nach den COP's
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread Nicht enthalten in