in reply to Re: matching POD footnote
in thread matching POD footnote

substitute this:
N<See U<http://search.cpan.org/perldoc?App::perlbrew> for installation instructions.>.

whit this:

<font class="footnote">See U<http://search.cpan.org/perldoc?App::perlbrew> for installation instructions.</font>.

Replies are listed 'Best First'.
Re^3: matching POD footnote
by Anonymous Monk on Jul 18, 2013 at 08:38 UTC

    Can you explain what  my @file = <DATA>; does?

    Can you explain what  s/$Npod/$N$1$n/s for @file; does?

    At what point does $_ contain multiple lines?

    Basic debugging checklist, $_ never contains more than one line

      my @file = <DATA>; - assigns the text from the file to an array.

      s/$Npod/$N$1$n/s for @file;

      - replaces N<..(some text)..>

      with <font class="footnote">..(some text)..</font>

      and this is the problem... It does not work :(

        I think the anonymous monk was wanting you to think in more detail about what the following does:

        s/$Npod/$N$1$n/s for @file;

        You might write that in longhand as:

        foreach my $line (@file) { $line =~ s/$Npod/$N$1$n/s; }

        In other words, it's acting on one line at a time. The only pod footnote in your example input was split over multiple lines.

        package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name