I have a requirement to send my variable to an array. I have something like this
var = "abc|xyz|123";
I want to have the above values ββin an array.
$arr[0]="abc";
$arr[1]="xyz";
$arr[2]="123";
I used the following method, but at the same time I do not get the size of the array
$var = "abc|xyz|123";
$var =~ tr/|/\n/;
@a = $var;
print $a[0];
Full converted output is sent only to the variable instead of the individual variables.
Please help me with this.
Regards, Shriharsha Kalluru.
source
share