Help for this page

Select Code to Download


  1. or download this
    # skip initial whitespace, if any
    $tag =~ /^\s*/gcxs;
    ...
    
    # check if parsing was successful
    die if pos $tag != length $tag;
    
  2. or download this
    my %quotes;
    $quotes{$_} = qr/ \G ( (?: \\. | [^$_] )* ) $_ /xs for qw(' ");
    
  3. or download this
        if (my $pat = $quotes{$v}) {
            $tag =~ /$pat/gc or last;
            $v = $1;
            $v =~ s/\\(.)/$1/g;
        }