Oriel Jutty :hhHHHAAAH:<p><span class="h-card" translate="no"><a href="https://bitbang.social/@profoundlynerdy" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>profoundlynerdy</span></a></span> That's a purely syntactic issue. You want <code>(...)</code> to be parsed as the <code>(...)[...]</code> list slice operator, but here <code>say</code> gobbles it up for the <code>say(...)</code> function call syntax. Two solutions:</p><ol><li><code>say((split " ", "Foo Bar")[0])</code></li><li><code>say +(split " ", "Foo Bar")[0]</code></li></ol><p>(I changed <code>split / /</code> (which splits on single spaces) to <code>split " "</code> (which splits on any kind of (possibly repeated) whitespace) because that's usually what people want. If you need <code>" Foo Bar"</code> to become <code>("", "Foo", "", "Bar")</code>, use <code>split / /</code>.)</p><p>Solution #1 simply nests the syntactic structures: You have a list slice <code>(...)[...]</code> inside a function call <code>say(...)</code>. Solution #2 (ab)uses the unary <code>+</code> operator, which is a no-op, but syntactically separates <code>say</code> from <code>(</code>, thus preventing <code>(</code> from being parsed as the start of an argument list.</p><p>But if you only want to extract the first "word" (chunk of non-whitespace) from a string, you could also use <code>say "Foo Bar" =~ /(\S+)/</code>.</p><p><a href="https://infosec.exchange/tags/perl" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>perl</span></a></p>