<?xml version="1.0" encoding="windows-1252"?>
<node id="450080" title="Why use strict is good, and barewords are bad" created="2005-04-21 12:14:58" updated="2005-08-13 14:03:01">
<type id="120">
perlmeditation</type>
<author id="9073">
merlyn</author>
<data>
<field name="doctext">
I was answering a question posted to one of the myriad of Perl mailing lists a few moments ago, and was reminded of this interesting point.
&lt;p&gt;
We're all told (or do the telling of) "use strict always!" and "barewords are bad".  But the motivation for why barewords are bad might not be clear.
&lt;p&gt;
Back in the Perl3 days, when barewords were added, I came up with this interesting little puzzle.  See if you can solve it.  Don't post your answers without hiding them somehow (readmore, black-on-black, or some other way).
&lt;h2&gt;The Puzzle&lt;/h2&gt;
Presuming no "use strict" (or the days of Perl3), why does:
&lt;code&gt;
@days = (sun,mon,tue,wed,thu,fri,sat);
&lt;/code&gt;
work OK, but
&lt;code&gt;
@months = (jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec);
&lt;/code&gt;
fail?
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-9073"&gt;
&lt;p&gt;-- [http://www.stonehenge.com/merlyn/|Randal L. Schwartz, Perl hacker]
&lt;br&gt;
Be sure to read [id://205373|my standard disclaimer] if this is a reply.&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</field>
</data>
</node>
