in reply to How does this code work? (from "Perl is Unix")
The for is acting on @_ which in perl is 'the array i'm currently looking at' and in this scope is the list you passed to strip. ugly code though.sub strip { s/\A\s+//, s/\s+\z// for my @r = @_; @r }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How does this code work? (from "Perl is Unix")
by Anonymous Monk on Nov 06, 2009 at 06:21 UTC | |
by rowdog (Curate) on Nov 06, 2009 at 08:10 UTC | |
|
Re^2: How does this code work? (from "Perl is Unix")
by Aristotle (Chancellor) on Nov 07, 2009 at 03:18 UTC | |
by Anonymous Monk on Nov 07, 2009 at 09:03 UTC |