Home : General : Perl Programming :

General: Perl Programming: Re: [LoisC] Help with small script - finding related records: Edit Log

Here is the list of edits for this post
Re: [LoisC] Help with small script - finding related records
You may as well just use:

Code:
$rec{'Title'} =~ s/&/&/g;
$rec{'Title'} =~ s/"/"/g;

print &other_title_link("$rec{'Title'}", "6");

If it matches those strings it will replace them, otherwise it won't. There's not much point going to the extra effort of using an "if" block to check whether there's a match or not as the substitution basically does the same thing anyway.

Also note you don't need all the backslashes in the regexes. Only METACHARACTERS need to be escaped, eg. *, $, +, (, ), [, ]

Last edited by:

Wychwood: Jul 22, 2008, 2:35 AM

Edit Log: