Thank you very much!! This solved my problem. I just slurp the text file in a string variable and then apply your regex which I can now fully understand.
#!/usr/bin/env perl use strict; use warnings; use Data::Dumper; my $file = 'textfile.txt'; open my $fh, '<', $file or die; $/ = undef; my $text = <$fh>; close $fh; my %res = $text =~ /BEGIN_TAG_(\d+)(.*?)END_TAG/sg; print Dumper (\%res);
In reply to Re^2: Get text between start and end tag
by Dirk80
in thread Get text between start and end tag
by Dirk80
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |