in reply to discussion: What should split( /PATTERN/, EXPR, 0 ) return better?

It's much more efficient if you just don't split() if you don't want anything from its result. Why make the call at all if you want nothing returned?

  • Comment on Re: discussion: What should split( /PATTERN/, EXPR, 0 ) return better?
  • Download Code

Replies are listed 'Best First'.
Re^2: discussion: What should split( /PATTERN/, EXPR, 0 ) return better?
by rsFalse (Chaplain) on Oct 12, 2017 at 18:51 UTC
    Do I want anything or something depends on a variable (input).
      my @results; if ($condition){ @results = split ' ', $pattern, $max; } else { # do something different, or don't }

      Do I want anything or something depends on a variable (input).

      Don't you mean dynamic variable?

      See I can say silly stuff too.

      What are your opinion?

      m//atch if you want to match, split if you want to split, or mysplit if neither satisfies thats programming