apt_get has asked for the wisdom of the Perl Monks concerning the following question:
The output is like:#!/usr/bin/perl use warnings; use strict; my @names=("Sam Adams","Bud weiser","Ice House"); my ($name, $temp); foreach $name (@names){ $temp=$name; $temp=~s/(\w)(\s)(\w)/$1 . "+" . $2 . "+" . $3/eig; print "$temp\n"; $name=~s/(\w)(\s)(\w)/$1/eig; print "$name\n"; } print "\n"; __END__
Why is it not likeSam+ +Adams Samdams Bud+ +weiser Budeiser Ice+ +House Iceouse
Any ideas? Thanks in advanceSam+ +Adams Sam Bud+ +weiser Bud Ice+ +House Ice
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: $1 $2 Weirdness?
by graff (Chancellor) on Jun 27, 2005 at 00:11 UTC | |
by apt_get (Acolyte) on Jun 27, 2005 at 00:16 UTC | |
|
Re: $1 $2 Weirdness?
by sk (Curate) on Jun 27, 2005 at 00:11 UTC | |
|
Re: $1 $2 Weirdness?
by GrandFather (Saint) on Jun 27, 2005 at 00:11 UTC | |
by bart (Canon) on Jun 27, 2005 at 08:40 UTC | |
by GrandFather (Saint) on Jun 27, 2005 at 20:33 UTC | |
by apt_get (Acolyte) on Jun 27, 2005 at 00:18 UTC |