#!/usr/bin/perl -w ############################################################################## print "Content-type: text/html\n\n"; $Count_Link = 14; @line = ('12(2345678901234)'); for($Link_Count=0;$Link_Count(.*?))(.*?<)/$1$Build_Text$2/; $Build_Text = ""; next; } $Width2 = $Count_Link-1; $Order = substr($Text,0,$Count_Link); if($Order !~ /\(/) { $Build_Text .= $Order . '
'; $line[$Link_Count] =~s /(href.+?>)\Q$Order\E/$1/; $Link_Count--; if (substr ($Text,$Count_Link,1) ne ' ') { if (!$Links_Count) { chomp($ORIGINAL_DOC = "$OriginalLinks[$OL_count]"); $Links_Count .= " $ORIGINAL_DOC:\n"; } $Links_Count .= "$Order"; next; } } for($Break_Count = $Width2;$Break_Count>-1;$Break_Count--) { $character = substr($Order,$Break_Count,1); $c2 = ')'; if ($character eq '[') { $c2 = ']'; } ################################### ### "test 1" gets printed. if (!$Break_Count){ print "
test 1"; } ################################### if ((!$Break_Count)&& ($Build_Text =~ /.*?(?!
.*
)(.*)(
)/)&& (length $1 < $Count_Link)&& ($line[$Link_Count] =~ /href.+?>$Order($c2|.$c2)/)) { ###################################################### ### If the above condition were true, "test 2" would be printed. Since it's not printed, this block is skipped. if (!$Break_Count){ print "
test 2"; } ###################################################### $New_Line = substr($Order,1); $line[$Link_Count] =~s /(href.+?>).{$Count_Link}(.)/$1/; $Build_Text =~s /
$/$character
$New_Line$2
/; $Link_Count--; last; } elsif (!$Break_Count) { ################################### ### Nothing changed since "test 1" ### was printed, so why isn't ### "test 3" printed? if (!$Break_Count){ print "
test 3"; } ################################### $Build_Text .= $Order . '
'; $line[$Link_Count] =~s /(href.+?>)\Q$Order\E/$1/; $Link_Count--; last; } elsif ($character eq '(') { $New_Line = substr($Order,0,$Break_Count); $Build_Text .= $New_Line.'
'; $line[$Link_Count] =~s /(href.+?>)\Q$New_Line\E/$1/is; $Link_Count--; last; } } }