nicholaspr has asked for the wisdom of the Perl Monks concerning the following question:

hI If you have an array of numbers...is there an easy way to subtract one from each element Thank you

Replies are listed 'Best First'.
Re: array subtract
by almut (Canon) on Mar 02, 2010 at 17:25 UTC
    $_-- for @array;
Re: array subtract
by jdporter (Paladin) on Mar 03, 2010 at 14:18 UTC

    Or:

    @diminished = map { $_ - 1 } @numbers;