MichaelORourke has asked for the wisdom of the Perl Monks concerning the following question:
Newer Perls since 5.6.x don't need, nor do they tolerate the comma after the block I can say that I've seen folks try to use 'grep' as it might be in an Unix environ. Not so. And since I didn't use map so much for these maybe that's a way around. Nonetheless, I'll offer something soon if need be. This also goes to the wantarray construct and the man pages for same. I've already written and commented on this but for clarity -- stop moving the data around!my @good = grep(s/../../, readdir(DIR)); or my @better = grep({-f "./$_", readdir(DIR));
Okay, let me know and thanks. morourke@theworld.commy $ar = \@somearray; my @array = @somearray; # from a function my $ar = &fsome(); my @array = &fsome(); sub fsome { my @interesting - qw( one two buckle my shoe ); wantarray? @interesting: \@interesting; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: The way around < 5.6.x grep(... [,]* readdir(DIR)
by kyle (Abbot) on Mar 19, 2008 at 21:13 UTC | |
by tye (Sage) on Mar 19, 2008 at 21:41 UTC | |
|
Re: The way around < 5.6.x grep(... [,]* readdir(DIR)
by parv (Parson) on Mar 20, 2008 at 03:24 UTC |