in reply to Re^4: Bugfixing Old Code
in thread Bugfixing Old Code

Also note that $_=~ can be shortened to . Moreover, you don't need a capture if you capture the whole pattern.
my @temp_and_starts = /\S+/g;
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^6: Bugfixing Old Code
by NetWallah (Canon) on Jul 23, 2021 at 18:21 UTC
    You are correct - the capturing parens are not necessary,
    In that case, the originally posted code is correct:
    # Split on multiple spaces using regex captured matches my @temp_and_starts = $_ =~ /[^\s +]+/g; my @last_AT_fracs = <$in> =~ /[^\s +]+/g; my @twenty_SFs = (<$in> . <$in> . <$in> . <$in>) =~ /[^\s +]+/g;
    and my test below shows that it works:
    $ perl -E '$_="This and that and other";@x= $_=~ /[^\s]+/g;; say for +@x' This and that and other

                    "The difficult we do today; the impossible takes a little longer."