Sample code for 30+ languages & platforms
Perl

Load StringTable from a StringBuilder

Demonstrates how to load a StringTable from the text contained in a Chilkat StringBuilder object.

Chilkat Perl Downloads

Chilkat2 Perl
use strict;
use warnings;
use Chilkat2;

my $success = 0;

my $strTab = Chilkat2::StringTable->new;
my $sb = Chilkat2::StringBuilder->new;

$sb->Append("This is line 1\r\n");
$sb->Append("An empty line follows...\r\n");
$sb->Append("\r\n");
$sb->Append("This is line 4\r\n");

$strTab->AppendFromSb($sb);

my $i = 0;
my $numStrings = $strTab->Count;
while ($i < $numStrings) {
    print $i, ': ', $strTab->StringAt($i), "\n";
    $i = $i + 1;
}