Help for this page

Select Code to Download


  1. or download this
    @a=('a', 'b', 'c');
    $a = sort(@a);
    print $a;
    Use of uninitialized value at - line 3.
    
  2. or download this
    There is no equivalent operator to force an expression to
    be interpolated in list context because it's in practice never
    needed.  If you really wanted to do so, however, you could use
    the construction @{[ (some expression) ]}, but usually a simple
    (some expression) suffices.
    
  3. or download this
    @a=('a', 'b', 'c');
    $a = @{[sort(@a)]};
    print $a;