Jerry Preston wrote:
> 
> I want to break down this name, pgrap.C4A2S1R.1.gif, into 4 parts.  I
> can do it with split:
> 
>           ( $a1,$a2,$a3,$a4 ) = split( /\./, $program );
> 
> How do I do it with           s/\b(\.)\b(\.)\b(\.)\b(\.)/?
> 

Don't use substutions when you want to get parts.
It's a job for pattern matching
(if you really don't want to split).

( $a1,$a2,$a3,$a4 ) = $program =~ m/^(.+)\.(.+)\.(.+)\.(.+)$/;

Greetings,
Andrea

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to