Help for this page

Select Code to Download


  1. or download this
    my $var;
    if ($string =~ /$capture_regex/) {
        $var = $1;
    }
    
  2. or download this
    my ($var) = $string =~ /$capture_regex/;
    
  3. or download this
    next unless $string =~ /$capture_regex/;
    my $var = $1;
    
  4. or download this
    my $var;
    if ($string =~ /$capture_regex/) {
    ...
        # ... issue warning, make a log entry, or whatever ...
        next;
    }
    
  5. or download this
    $ grep soft /usr/share/dict/words | wc -l
    30
    $ grep ^soft /usr/share/dict/words | wc -l
    22
    
  6. or download this
    / \b (?: soft | softer | softest ) \b /ix
    
  7. or download this
    #!/usr/bin/env perl
    
    ...
    
        return \%corpus;
    }
    
  8. or download this
    { "2017-09-01" => 4, "2017-09-03" => 6, "2017-09-04" => 12 }
    
  9. or download this
    $count_for_date{$date} ||= 0;
    
  10. or download this
    { "2017-09-01" => 4, "2017-09-02" => 0, "2017-09-03" => 6, "2017-09-04
    +" => 12 }