Both work fine for me when used like this:
Code:
sub EVENT_SAY
{
my $cookieid = quest::varlink(19732);
quest::say("Yum, [$cookieid]");
quest::itemlink(19732);
}
Hard to say why it might be crashing for you. You'll probably need to debug it to see where it crashes for anyone to help you.