[Fixed Jeopardy quoting]

[EMAIL PROTECTED] (Martin Pfeffer) wrote on 19 Nov 2001:
> FLAHERTY, JIM-CONT wrote:
> 
>> My script dumps file name into a mysql DB on redhat 7.1 linux . The
>> problem I have is sometime windows files has  a single quote  ( ' ) 
>> in the name. I want to replace it with a space . I not strong on
>> pattern matching in perl yet 
>> 
>> 
>> $thestring = "this isn't a good file name";
>
> $thestring =~ s/'/ /g;

If you're simply replacing one set of characters with another, the 
preferred function (actually an operator) is tr///

$thestring =~ tr/'/ /;

If tr/// is a shovel, then s/// is a bulldozer.  

-- 
David Wall
[EMAIL PROTECTED]

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

Reply via email to