Re: I'll try once more..

2000-08-25 Thread Peter Scott

At 11:55 PM 8/25/00 +, Ed Mills wrote:
>Having just coded some more perl resplendent with this syntax:
>
>  $in{pmonth}=$usr{paidon};
>  $in{pmonth}=~s/^.+([A-Za-z]{3,3}).+$/$1/;
>
>once again I'll suggest (then I quit)
>
>$in{pmonth}=~s/^.+([A-Za-z]{3,3}).+$/$1/,$in{paidon};
>
>
>is a LOT nicer, and more Perlish (see split) way of doing this. I'm tired 
>of using two expressions for what should clearly be one.

What's wrong with doing it en passant:

($in{pmonth}=$usr{paidon}) =~s/^.+([A-Za-z]{3,3}).+$/$1/;

I do that all the time.  Makes the copying easier to spot since it's up 
front and you don't have to scan to the end to discover it.
--
Peter Scott
Pacific Systems Design Technologies




Re: I'll try once more..

2000-08-25 Thread Nathan Wiger

Ed Mills wrote:
> 
> Having just coded some more perl resplendent with this syntax:
> 
>   $in{pmonth}=$usr{paidon};
>   $in{pmonth}=~s/^.+([A-Za-z]{3,3}).+$/$1/;
> 
> once again I'll suggest (then I quit)
> 
> $in{pmonth}=~s/^.+([A-Za-z]{3,3}).+$/$1/,$in{paidon};
> 
> is a LOT nicer, and more Perlish (see split) way of doing this. I'm tired of
> using two expressions for what should clearly be one.

 ($in{pmonth} = $usr{paidon}) =~ s/^.+([A-Za-z]{3,3}).+$/$1/;

Works in Perl 5. Maybe someone mentioned this already, maybe not.

-Nate



I'll try once more..

2000-08-25 Thread Ed Mills

Having just coded some more perl resplendent with this syntax:

  $in{pmonth}=$usr{paidon};
  $in{pmonth}=~s/^.+([A-Za-z]{3,3}).+$/$1/;

once again I'll suggest (then I quit)

$in{pmonth}=~s/^.+([A-Za-z]{3,3}).+$/$1/,$in{paidon};


is a LOT nicer, and more Perlish (see split) way of doing this. I'm tired of 
using two expressions for what should clearly be one.


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com