I'm trying to split an HTML document into its head and body:
my @contentsArray = split( /<\/head>/is, $fileContents, 1);
if( scalar @contentsArray == 2 ){
$bodyContents = $dbh->quote(trim($contentsArray[1]));
$headContents = $dbh->quote(trim($contentsArray[0]) . "</head>");
}
is what i have. $fileContents
contains the HTML code. When I run this, it doesn't split. Any one know why?