The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
## name lvalue
## failures 1
## cut

substr( $foo, 2, 1 ) = 'XYZ';

#-----------------------------------------------------------------------------

## name 4 arg substr
## failures 0
## cut

substr $foo, 2, 1, 'XYZ';

#-----------------------------------------------------------------------------

## name rvalue
## failures 0
## cut

$bar = substr( $foo, 2, 1 );

#-----------------------------------------------------------------------------

## name hash rvalue
## failures 0
## cut

%bar = ( foobar => substr( $foo, 2, 1 ) );

#-----------------------------------------------------------------------------

## name substr as word
## failures 0
## cut

$foo{substr};

#-----------------------------------------------------------------------------

## name low precedence boolean blocks assignment
## failures 0
## cut

'x' eq substr $foo, 0, 1 or $foo = 'x' . $foo;

#-----------------------------------------------------------------------------

## name allow under really old Perl. RT #59112
## failures 0
## cut

use 5.004;

substr( $foo, 0, 0 ) = 'bar';

#-----------------------------------------------------------------------------

##############################################################################
#      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/distributions/Perl-Critic/t/BuiltinFunctions/ProhibitLvalueSubstr.run $
#     $Date: 2011-04-27 09:59:08 -0500 (Wed, 27 Apr 2011) $
#   $Author: wyant $
# $Revision: 4075 $
##############################################################################

# Local Variables:
#   mode: cperl
#   cperl-indent-level: 4
#   fill-column: 78
#   indent-tabs-mode: nil
#   c-indentation-style: bsd
# End:
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :