in reply to Finding a line in a scalar, and copying it to a new scalar?

Update: I just re-read the OP and realised that you'd asked for a regex solution. In which case you could replace the split line below with:
my ($a, $b, $c) = $temp =~ m/(\w+)\n/g;

(The same comment still applies re assigning to a list).

This is pretty trivial, just split on \n. eg:

#!/usr/bin/perl -w use strict; my $temp = "DATA\nFile\nHello\n"; my ($a, $b, $c) = split(/\n/, $temp); print "$a:$b:$c\n";

Although, if you have an unknown number of "lines", then you are probably better off spliting them into a list, like so:

my @list = split(/\n/, $temp);

Cheers,
Darren :)