Your question is ultimately "why is @backwards in scalar context in line 6", which
begs the question, "how can I determine a term's context?".
Context is determined by "what is around" (i.e. its "context") the term.
How can I determine a term's context? By looking at the operator/function that
is using the term.
What steps could you follow to figure out the context for @backwards yourself if you
didn't have helpful stackoverflow folks around to tell you its context?
Here we have
print @backwards."\n"
so there are two operators/functions. How do we know which one provides context
to @backwards? By consulting precedence. Near the top of perlop.pod we have Perl's
precedence chart (print is a "list operator"):
left terms and list operators (leftward)
...
left + - .
...
nonassoc list operators (rightward)
Oh great, now we need to know whether print is leftward or rightward. By consulting
the "Terms and List Operators (Leftward)" section in perlop (right after the
precedence list) we see that print is rightward here, because we have not enclosed
its arguments in parenthesis.
So concatenation is higher precedence, so concatenation provides context to @backwards.
Next step is to check the docs (perlop again) for concatenation:
Binary "." concatenates two strings.
Strings are scalars, so binary "." concatenates two scalars.
And we finally have it!
@backwards has scalar context because concatenation provides scalar context to
each of its operands.
Woo. That was easy, wasn't it :-)