Hello Folks,
I need to make a substitution in place for each element of an array, and I need
to do this to two arrays. Currently the relevant code fragment (without pragmas) is:
foreach my $element (@cddb_artist)
{
$element =~ s/^.*?([0-9,a-f]{8}):.*$/$1/;
}
foreach my
R (Chandra) Chandrasekhar schreef:
foreach my $element (@cddb_artist)
{
$element =~ s/^.*?([0-9,a-f]{8}):.*$/$1/;
}
foreach my $element (@cddb_track)
{
$element =~ s/^.*?([0-9,a-f]{8}):.*$/$1/;
}
You can write all that as this single
On Sat, Mar 8, 2008 at 9:59 AM, Dr.Ruud [EMAIL PROTECTED] wrote:
snip
2. Can arbitrary regular expressions, including /PATTERN/REPLACEMENT/
versions
for substitutions, be used as subroutine arguments, and if so, how?
Store the parts in variables.
snip
Specifically, use the qr//
R (Chandra) Chandrasekhar wrote:
Hello Folks,
I need to make a substitution in place for each element of an array, and
I need to do this to two arrays. Currently the relevant code fragment
(without pragmas) is:
foreach my $element (@cddb_artist)
{
$element =~