in reply to text parsing question

Here's one way that is quite simple and conveniently groups the column endings for each line in an array:
#!/usr/bin/perl use warnings; use strict; while (<DATA>) { my @columns = do { my $s; map $s += length, /(\s*-+)/mg } ; print "@columns\n"; } # Output: # # 13 40 50 56 83 90 96 109 122 # 14 22 __DATA__ ---------- ------------------------- -------- ---- -------- +----------------- ----- ---- ----------- ----------- ----------- ------

Cheers,
Tom