<?xml version="1.0" encoding="windows-1252"?>
<node id="1010807" title="Re: Palindrome array" created="2012-12-29 04:47:32" updated="2012-12-29 04:47:32">
<type id="11">
note</type>
<author id="281137">
davido</author>
<data>
<field name="doctext">
&lt;p&gt;There are a number of good ways to approach this.  Here's one way that uses a CPAN module:&lt;/p&gt;
&lt;c&gt;
use String::Palindrome qw( is_palindrome );

my @array = qw( x a m a x );

print "@array ",
      is_palindrome( @array ) ? "is" : "isn't ",
      "palindromic.\n";
&lt;/c&gt;
&lt;p&gt;The above solution works just as well if you pass it a string rather than an array, but in either case it does the job.&lt;/p&gt;

&lt;div class="pmsig"&gt;&lt;div class="pmsig-281137"&gt;
&lt;br /&gt;&lt;p&gt;Dave&lt;/p&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1010790</field>
<field name="parent_node">
1010790</field>
</data>
</node>
