Is this a way of using a one-liner to assign an array value to a variable using the split function.
I have the following code. This works.
my @Fields = split(',',@_[0]);
my $Unit = @Fields[2];
Wondering if it could be written in one like the following, they are returning syntax errors.
my $Unit = split(',',@_[0])[2];
my $Unit = @(split(',',@_[0]))[2];