Rich Busse wrote:
> 
> I have a string that looks like
> 
> Operator Overview#PGM#Report about all configured
> operators#/opt/OV/bin/OpC/call_sqlplus.sh all_oper#
> 
> I want to replace the last "#" with a newline. I've come up with a few ideas
> like
> 
> substr ($_, rindex ($_, "#"), 1) = "\n" ;
> or
> substr ($_, length ($_) - 1, 1) = "\n" ;
> or
> chop ; $_ .= "\n" ;
> 
> Are there any better ways, maybe using s/// or tr/// ? TIA...


One way to do it:

$_ = reverse;
s/#/\n/;
$_ = reverse;



John
-- 
use Perl;
program
fulfillment

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

Reply via email to