Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: taking white space out between closing and opening tags

by Mr. Muskrat (Canon)
on Aug 21, 2002 at 20:51 UTC ( #191868=note: print w/replies, xml ) Need Help??

in reply to taking white space out between closing and opening tags

I'll help with the regex requirements.
#/usr/bin/perl -w use strict; my $text = "<tag>\n\tThe purpose of the applicant rating session is fo +r you,\nthe applicant, to provide a sample of your\t\neffective teach +ing skills.</tag>"; $text =~ s/\s+/ /g; # convert white space to a single space print $text;
The print statement is just there to show what's taken place.
edited to match the given example...
Of course, this still leaves a space between the tag and the text... dpuu and Ovid both give better ways of doing it... but I wasn't paying attention.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://191868]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2023-06-05 00:02 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (22 votes). Check out past polls.