"Johnstone, Colin" wrote: > Gidday All, > > please help with my subroutine >
Your call to this sub below offers a single string parameter--which happens to be multiline. > > sub cleanText{ > my $cleanedText = @_; #Since there is one element in @_, $cleanedText now has the value 1 or '1' > $cleanedText =~ s{<p>}{<p class='bodytext'>}g; # '1' has no '<p>, so no effect > $cleanedText =~ s{<b>}{<span class='bodybold'>}g; # '1' has no '<b>', so no effect > $cleanedText =~ s{<\/b>}{<\/span>}g; # ... '<Vb>' ... > $cleanedText =~ s{<a href}{<a class='bodytext' href}g; # ... '<a href>' ... > > return $cleanedText; # Returns number of elements in @_, i.e. 1 > } > > 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; > > e.g > > $bodyCopy = cleanText('<p>Fittingly, the first student to arrive on the first day at > Booligal Public's new era was Steven Spiers.</p>... > <p>The Department of Education and Training maintained the premises as an outpost of > the Hay Distance Education Centre, and a teacher visited regularly to work with > local students.</p> > '); > > I don't understand? > > Any help appreciated > > Regards > > Colin Johnstone Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]