Does the line you which to parse always follow the same format i.e. begins with the string
Experiment: and you always want the 2nd, underscore delimited string ? If it's only the values in this 2nd string that '
...could vary in each file', then...
while (<DATA>) {
next unless /^Experiment:/;
my ($first, $second, undef, undef, undef, $last) = split /[-_]/, (
+split)[1];
warn "$first, $second, $last";
last;
}
__DATA__
Experiment: rs5443-61902_923_922_921_291008 Active filters: FAM (483-5
+33), VIC /HEX / Yellow555 (523-568)
Include Color Pos Name 483-533 523-568 Call Score Status
True 3200768 A1 EPS316120 8.535 17.575 GG 0.90
True 3200768 A2 EPS318077 8.820 17.126 GG 0.95
True 255 A3 EPS316121 17.084 13.650 GA 0.97
True 3200768 A4 EPS318078 8.541 16.653 GG 0.94
True 16744448 A5 EPS316122 18.267 3.880 AA 1.00
True 255 A6 EPS318079 13.130 11.004 GA 0.91>br> True 3200768 A7 EPS316
+123 9.150 16.868 GG 1.00
True 3200768 A8 EPS318080 9.346 17.771 GG 0.97
True 3200768 A9 EPS316124 9.205 17.201 GG 0.98
True 3200768 A10 EPS318081 9.729 17.934 GG 1.00
returns
rs5443, 61902, 291008 at tst.pl line 8, <DATA> line 1.
as required ??
A user level that continues to overstate my experience :-))
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.