Help with the Perl programming language?

I have a value called $flip and it equals <flip>no</flip>.
How can I print out just the no and not the <flip></flip>?
Ok so
$flip =~ s/<flip>//;
$flip =~ s/</flip>//;
I was able to get the first line to run by it had difficulty with the / in the </flip>
How would you get around that?
 
This looks like it might be part of a program that deals with XML data. If so, tou might want to look at some of the free xml libraries for perl. I only mention that in case you will need to process some other values in this type of format. Even if you do not use the xml libraries you can gain a lot by studying the source code.

The very simplest approach is to do a string compare. If $flip is "<flip>no</flip>" you print "no".
 
Back
Top