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:
Are there any rules for bareword to string conversion? I am perplexed to see different behaviors as below:
This is perl, version 5.004_04$ 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.
Back to
Seekers of Perl Wisdom