Because despite the name @list
you're in fact assigning it a single element which is precisely the string "'Ashok Hello'"
, that is: without the external double quotes, but with
the internal single ones. That is precisely the difference between q()
: the former returns non interpolated strings, and when used with "'"
(single quotes) as a delimiter "q"
become redundant, while
the latter returns a list of (non interpolated) "words"1
, splitting on whitespace.
Notice the double quotes - I mean that they're not required to match /^\w+$/