#!/usr/bin/perl use 5.10.0; use strict; use warnings; my %wanted; while (my $line = <DATA>) { if ( $line =~ /\[start\]/ .. $line =~ /\[end\]/) { next if ($line =~ /\[start\]/ or $line =~ /\[end\]/); chomp $line; $wanted{$line}++; } } say $_ for sort keys %wanted; __DATA__ [start] bbc_arc_001 bbc_arc_002 abc_arc_001 [end] bbc_arc_001 bbc_arc_002 bbc_arc_003 bbc_arc_004
In reply to Re: Extract Tags between Two strings
by fishmonger
in thread Extract Tags between Two strings
by stallion
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |