$ perl -we'$[ = 3; $_ = "abc"; my $x = substr($_,2,1)' Use of assignment to $[ is deprecated at -e line 1. substr outside of string at -e line 1.