What am I missing

The $word* variables aren't getting assigned "an array", they are getting assigned the values from the array.

@collect = split( / /, 'This is a sentence.' );
  1. The array on the LHS means that the assigment is in list context.
  2. Split returns a list of scalars.
  3. In list context, the elements of what's on the LHS get assigned to the values from the list on the RHS, so the @collect array is populated from the values returned by split
( $word1, $word2, $word3, $word4 ) = @collect;
  1. The (...) on the LHS mean that the assignment is in list context
  2. Per List value constructors, the @collect array gets evaluated in list context, which results in the list (on the RHS) consisting of the elements from the @collect array
  3. The assignment then happens in list context, so the leftmost item of the list on the LHS ($word1) gets assigned the value of the leftmost item from the list on the RHS, and so on
print join( q[ ; ], ( $word1, $word2, $word3, $word4 ); => syntax error at parv.pl line 3, near ");"

but with a second ) on that line to allow it to compile:
  1. the words are given list context by the parentheses (unnecessarily, because join already gives list context)
  2. join concatenates the elements of that list, using space-semicolon-space as the separator, into a string
  3. That string is then printed.

(LHS = "Left-hand side", RHS = "Right-hand side": in these cases, relative to the assignment operator =)


In reply to Re: Drowning(Distraction) in(via) nomenclature by pryrt
in thread Seeking Perl docs about how UTF8 flag propagates by raygun

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.