Help for this page

Select Code to Download


  1. or download this
    my $field = '*E2@x*PAP';
    $field =~ /\*PAP\z/;
    
  2. or download this
    my $nl   = "newline\n";
    my $nonl = "newline";
    $nl   =~ /line$/;
    $nonl =~ /line$/;
    
  3. or download this
    use Test::More 'tests' => 3;
    
    ...
    my $nonl = "newline";
    ok( $nl   =~ /line$/, '$ matches newline at end' );
    ok( $nonl =~ /line$/, '$ matches end of string without newline' );