in reply to Quick Syntax check

It will be much faster and more consise to do :
$temp_dcr{$dcr_name}{PromotionName} =~ s/ //g;

Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Replies are listed 'Best First'.
Re: Re: Quick Syntax check
by petdance (Parson) on May 21, 2001 at 19:18 UTC
    Not only is it "faster and more concise", but it's also clear WHAT it is you're doing. In the original example, the next person reading your code thinks "OK, he busts apart the string on spaces, and then rejoins it with nothing. Why is he doing that?"

    With the s/// or tr/// solutions, it's obvious: "Oh, he's deleting all the spaces."

    xoxo,
    Andy

    %_=split/;/,".;;n;u;e;ot;t;her;c; ".   #   Andy Lester
    'Perl ;@; a;a;j;m;er;y;t;p;n;d;s;o;'.  #   http://petdance.com
    "hack";print map delete$_{$_},split//,q<   andy@petdance.com   >