in reply to Skip lines until you find a delimiter >>
Guessing...
#!/usr/bin/perl # http://perlmonks.org/?node_id=1210866 use strict; use warnings; $/ = '>>'; <DATA>; $/ = '"'; chomp( my $variable = <DATA> ); print "variable = '$variable'\n"; __DATA__ <"Session Date:Mar 13/2017 ":>>test", 1,2,3,4 ":>>test1", 5,6,7,8 end>
Outputs:
variable = 'test'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Skip lines until you find a delimiter >>
by RohanGuddad (Initiate) on Mar 14, 2018 at 08:14 UTC | |
by marto (Cardinal) on Mar 14, 2018 at 08:23 UTC | |
|
Re^2: Skip lines until you find a delimiter >>
by RohanGuddad (Initiate) on Mar 14, 2018 at 14:41 UTC | |
by Marshall (Canon) on Mar 14, 2018 at 21:36 UTC | |
by RohanGuddad (Initiate) on Mar 15, 2018 at 13:56 UTC | |
by marto (Cardinal) on Mar 15, 2018 at 14:17 UTC | |
by karlgoethebier (Abbot) on Mar 15, 2018 at 16:45 UTC | |
by Marshall (Canon) on Mar 15, 2018 at 18:30 UTC |