Help for this page

Select Code to Download


  1. or download this
        my @a = qw[a simple list];
        Internals::SvREADONLY(@a,    1);
    ...
        splice(@a, 1, 1, 'spliced');
        warn join ' ', @a;               
        warn '$a[1] is ' . (Internals::SvREADONLY($a[1]) ? '' : 'not ') . 
    +'read-only';
    
  2. or download this
        my @b = qw[another simple list];
        Internals::SvREADONLY(@b, 1);# Matters here
    ...
        warn join ' ', @b;           # "another simple list"
        splice(@b, 1, 1);            # Zot!
        warn join ' ', @b;           # "another list"