I have a data in scalar variable and I want to divide the data into 2 parts based on certain condition. Data is:
50This is my test data;and this line is for testing.
I want this to be stored in 2 separate variables and result should be:
$first = 50
$second = This is my test data;and this line is for testing.
This is what I have tried, but in single expression how to achieve this?
my $first = $1 if ($line =~ /(\d+)This/);
my $second = $2 if ($line =~ /(\d+)(\w+)/)
my $x = .. if ..stackoverflow.com/a/11275324/223226