Reputation: 10362
How to do chomp the array without using a foreach?
@array = ( " adfasdas
", "asdas " , "23232
",
"ads as" ;
chomp (@array);
Upvotes: 2
Views: 19151
Reputation: 3123
Exactly like that.
chomp @list;
'perldoc -f chomp' for more info.
Upvotes: 29
Reputation: 24070
Exactly how you're doing it.
chomp( @array );
Will chomp every element in the array.
Upvotes: 9