LA.pm: Regex

Arkadiy Sudarikov asudarikov at xceed.com
Fri Oct 19 16:41:23 CDT 2001


Call me dumb mofo, but... I still don't get it...

I mean, I have this string in hash ref, accessible as $hashref->{'Foo'}.
That string contains, like, numbers and spaces.

Now, I need to do print join ', ', 'foo', $hashref->{'Foo'}, 'bar'; but I
need to strip spaces from $hashref->{'Foo'}. So, how can I do my s/\s+//g
within this context, on the same line? Something like print join ', ',
'foo', $hashref->{'Foo'}=~ s/\s+//g, 'bar';

Thanks for help,
Private Arkadiy



More information about the Losangeles-pm mailing list