in reply to Making a variable from a number in front of a string
#!/usr/bin/perl use warnings; use strict; my $printing; my $next_section = q(); while (<DATA>) { if (/^\(([0-9]+)\) .*Significant Accounting Policies/) { $printing = 1; $next_section = 1 + $1; } elsif (/^\($next_section\)\s/) { undef $printing; } print if $printing; } __DATA__ (1) Preface What is this all about. (2) Summary of Significant Accounting Policies Revenue Recognition Revenue is recognized at the time goods are sold and shipped. (3) Long-term Debt
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Making a variable from a number in front of a string
by porsche5k (Novice) on Jul 15, 2016 at 17:40 UTC | |
by Laurent_R (Canon) on Jul 15, 2016 at 17:53 UTC | |
by Marshall (Canon) on Jul 15, 2016 at 18:22 UTC | |
by Marshall (Canon) on Jul 15, 2016 at 18:35 UTC |