in reply to Off by one key... or yet another example of why strict and warnings are always a good idea (even for "one-liners")

Setting up an alias in your shell's rc file helps - for bash:

alias sperl='env PERL5OPT="-Mstrict -Mwarnings" perl'

You keep running your oneliners without strictures; but if something blows or feels fishy, you just interrupt and type

prompt$ s!!

to run your latest command under strict and warnings.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
  • Comment on Re: Off by one key... or yet another example of why strict and warnings are always a good idea (even for "one-liners")
  • Select or Download Code