Loading ...
Sorry, an error occurred while loading the content.

Re: PS Re: [PBML] Push equivalent

Expand Messages
  • Jonathan Dunn
    This seems to work: ( @array ) = pushUnique( @array, $element ) ; print join n , @array ; sub pushUnique { my( $element, @array ) = reverse @_ ; push(
    Message 1 of 8 , Jun 4, 2003
    • 0 Attachment
      This seems to work:

      ( @array ) = pushUnique( @array, $element ) ;

      print join "\n", @array ;

      sub pushUnique {
      my( $element, @array ) = reverse @_ ;
      push( @array, $element ) unless grep { /^$element$/ } @array ;
      return @array ;
      }
    Your message has been successfully submitted and would be delivered to recipients shortly.