http://www.perlmonks.org?node_id=989197

cheekuperl has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks,
Are there any rules for bareword to string conversion? I am perplexed to see different behaviors as below:
$ perl -e 'print cat' # Doesn't print anything. But 1 bareword is OK $ perl -e 'print cat dog' #Doesnt like two barewords Can't locate object method "cat" via package "dog" at -e line 1. $ perl -e 'print reverse cat' #Prints cat. OK with one again. cat$ perl -e 'print reverse cat dog' # Still hates two Can't locate object method "cat" via package "dog" at -e line 1.
This is perl, version 5.004_04