I don't understand what you mean. Sure it is possible to modify a list! Just like in C, I can pass a reference to a list to be modified and it will be modified! In the code below, I am modifying the actual list since the sub uses the reference to that list.
#!usr/bin/perl -w
use warnings;
sub modify_list
{
my $listRef = shift;
@$listRef = grep{!/^b/}@$listRef;
#note there is no "return" value here
#the list has been modified!!!!
}
my @list = ("a1", "b23", "c45", "d1", "b43", "b65");
print join (" ",@list),"\n";
#prints: a1 b23 c45 d1 b43 b65
modify_list(\@list);
print join (" ",@list),"\n";
#prints a1 c45 d1
|