in reply to Removing line from a string
This one puts the lines in an array and removes the first array element - this is probably not the best method, but would be interesting to see how it compares with the regex methods above.
or use the range operator:my @lines = split /^/, $records; shift @lines; # remove first line print @lines; # print the rest
my @lines = split /^/, $records; print @lines[1..$#lines]; # print line 1 onwards removing line 0
A Monk aims to give answers to those who have none, and to learn from those who know more.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Alternative method (aka TIMTOWTDI)
by Lotus1 (Vicar) on Jan 09, 2013 at 20:01 UTC |
In Section
Seekers of Perl Wisdom