Jeff 'Japhy' Pinyan wrote:
>
> If you DON'T want that, you'd have to do:
>
> for (@data) {
> (my $copy = $_) =~ s/^ //;
> push @data_, $copy;
> }
>
> Or something to that effect. Here's a one-liner:
>
> @data_ = map { (my $copy = $_) =~ s/^ //; $copy } @data;
>
a bit shorter:
#!/usr/bin/perl -w
use strict;
my @data = (' 123',' 456',' 789');
my @data_ = ();
s/^ // for(@data_ = @data);
print join('',@data),"\n",join('',@data_),"\n";
__END__
prints:
123 456 789
123456789
david
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]