in reply to Preventing Blank Lines Between Printed Array Elements

This small modification makes your code work:
foreach my $line (split /^/, $text) { print $line; my $separator_printed = 0; foreach ($line =~ m/\[.*?\]\[(.*?)\]/g) { my $link_number = $_; $separator_printed++ or print "\n"; print grep(/(\[$link_number\]\:.*)/, @url_list); print "\n"; } }

        What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
              -Larry Wall, 1992

Replies are listed 'Best First'.
Re^2: Preventing Blank Lines Between Printed Array Elements
by immamanatee (Initiate) on May 05, 2014 at 16:49 UTC
    Thanks NetWallah, that works perfectly.