On Dec 10, 2003, at 1:39 AM, Mark Weisman wrote:

I've got a multiline text box that will feed the ^M at the end of each
line. I want to capture it into a single line (which is done), but how
do I get it back? Not knowing how many lines there may be with the ^M
between them. Currently, I use the old standby:

foreach my $rec (@post) {
        chomp($rec)
        (Unknown here) = split(/\^M/,$rec);
        print "whatever I need printed\n";
};

I'm not sure as to how to declare it, or if there is another way?

my @lines = split /\^m/, $rec;


Is that what you mean? The split just returns a list of the lines, so we can stick that in an array.

James


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to