Thread ternary op und Zuweisung: *gnaaaaarl* (7 answers)
Opened by dukeofnukem at 2007-06-22 17:09

dukeofnukem
 2007-06-22 18:17
#77752 #77752
User since
2007-01-15
47 Artikel
BenutzerIn
[default_avatar]
[quote=renee,22.06.2007, 15:21]Also das hier funktioniert wie gewünscht:
Code (perl): (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
28
#!/usr/bin/perl

use strict;
use warnings;

my $index = 0;
my @nsi = (q~<nContractID>13523</nContractID>~);

my %xmlstring = (
    QueryCId => qr/<nC[o]?ntr[a]?ctID[^>]*>\s*(\d+)\s*<\/nC[o]?ntr[a]?ctID>/s,
);
my $cid;

my %xmlstring = (
    QueryCId => qr/<nC[o]?ntr[a]?ctID[^>]*>\s*(\d+)\s*<\/nC[o]?ntr[a]?ctID>/s,
);

print "\nreg: ", $nsi[$index] =~ /$xmlstring{'QueryCId'}/;

$nsi[$index] =~ /$xmlstring{'QueryCId'}/ ?
    print "\nMATCH" :
    print "\nNO MATCH";

$nsi[$index] =~ /$xmlstring{'QueryCId'}/ ?
    $cid = '' :
    $cid = 'I HATE YOU';

print "\nCID should be empty: ", $cid;
[/quote]
Der Code ist Dein Code, hab ja weil ich selbst nicht glauben konnte direkt aus dem Forum in den Editor cut+paste gemacht.


OS ist SLES9 IIRC...
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
28
29
30
31
32
33
34
35
36
37
38
39
Summary of my perl5 (revision 5.0 version 8 subversion 3) configuration:
Platform:
osname=linux, osvers=2.6.5, archname=x86_64-linux-thread-multi
uname='linux mahler 2.6.5 #1 smp thu aug 25 06:20:45 utc 2005 x86_64 x86_64 x86_64 gnulinux '
config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr -Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm -Duseshrplib=true -Doptimize=-O2 -fmessage-length=0 -Wall -Wall -pipe'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=define use64bitall=define uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O2 -fmessage-length=0 -Wall -Wall -pipe',
cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing'
ccversion='', gccversion='3.3.3 (SuSE Linux)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib64'
libpth=/lib64 /usr/lib64 /usr/local/lib64
libs=-lm -ldl -lcrypt -lpthread
perllibs=-lm -ldl -lcrypt -lpthread
libc=/lib64//lib64/libc.so.6, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.3.3'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic -Wl,-rpath,/usr/lib/perl5/5.8.3/x86_64-linux-thread-multi/CORE'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib64'


Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS USE_64_BIT_INT USE_64_BIT_ALL USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Locally applied patches:
SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962
Built under linux
Compiled at Dec 17 2005 03:22:14
%ENV:
[...]
drum&bass is a state of mind

View full thread ternary op und Zuweisung: *gnaaaaarl*