I thought I could do below but does not work.
does split( )[ ] illegal pattern as below?
I thought I could pass two argument to below sub.
First argument is something like 1:3:33:2:33:5 and wanted to only store 2nd and 3rd into the array and push the second argument into it and join them by - and return the variable.
Did I make program or syntax mistake or is this just not possible using below?
73 sub extract {
74 $_ = shift;
75 my @extract_i = split(/:/)[1,2];
76 push @extract_i, $_[1];
77 my $i_pstn = join('-', @extract_i);
78 }