in reply to How to findout a sub string from the string
Assuming you want to extract the last line of the string (i.e. everything after the last \n), you could use split and retrieve the last field:
Or use a regular expression:my $substring = (split /\n/, $tmp)[-1];
my ($substring) = $tmp =~ /\n(.*)$/;
|
|---|