in reply to using a string or file in qw

qw( a b c )

is equivalent to

( split(' ', ' a b c ') )

so what you want is

my @words = split(' ', $text);