On Fri, 7 Mar 2003, Johnstone, Colin wrote:

> Gidday All,
>  
> please help with my subroutine
>  
> sub cleanText{
>  my $cleanedText = @_;

This is the problem, assigning an array to a scalar stores the number of 
elements in the array (in this case the number of args to cleanText) in
the scalar ($cleanedText). Change this to either
my $cleanedText = $_[0];
or
my $cleanedText = shift;

>  
>  $cleanedText =~ s{<p>}{<p class='bodytext'>}g;
>  $cleanedText =~ s{<b>}{<span class='bodybold'>}g;
>  $cleanedText =~ s{<\/b>}{<\/span>}g; 
>  $cleanedText =~ s{<a href}{<a class='bodytext' href}g;
>  
>  return $cleanedText;
> }
>  
> This subroutine is used in our cms the idea is to take the editors content and add 
> the appropriate styles etc
>  
> when I pass it a value it returns 1;

It is returning the number of args passed to it :-)


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

Reply via email to