Help for this page

Select Code to Download


  1. or download this
    perl -E "my $string = 'abc efg hijk lmnop'; if($string !=~ m/defg/) {s
    +ay $string;}"
    abc efg hijk lmnop
    
  2. or download this
    use warnings;<c> added to the one-liner this is evident:</p>
    
    <c>!=~ should be !~ at -e line 1.
    Use of uninitialized value $_ in pattern match (m//) at -e line 1.
    Argument "abc efg hijk lmnop" isn't numeric in numeric ne (!=) at -e l
    +ine 1.
    
  3. or download this
    C:\>perl -E "use warnings; my @strings = ('12345 defg', 'abc efg hijk 
    +lmnop', 'xyz defg abc'); for my $string(@strings) { if($string !~ m/d
    +efg/) {say $string;}}"
    abc efg hijk lmnop