Thread Suche in bestimmten Zeilen nach bestimmtem Wort (28 answers)
Opened by kabazza at 2007-01-04 19:25

renee
 2007-01-18 16:46
#72903 #72903
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Wenn die Variable $text einen "unwahren" Wert (0,"0","",undef) enthält, wird ihr " " zugewiesen:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl

use strict;
use warnings;

my $var = undef;
$var ||= 2;
# $var -> 2

$var ||= "test";
# $var -> test

$var = 0;
$var ||= 'hallo';
# $var -> hallo

$var = "";
$var ||= 'perl-community.de';
# $var -> perl-community.de
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 Suche in bestimmten Zeilen nach bestimmtem Wort