I've noticed that the mark_raw function makes a copy of the data you pass it. Sometimes if you have a large bit of text, you don't want to make a copy of it, since you'll just wind up throwing away the original data anyway.
So we've found we can do this (in the application, not the mark_raw method available in templates, although I don't know if they are one and the same):
sub mark_raw_in_place { return bless \$_[0], 'Text::Xslate::Type::Raw' }
I don't see any problem with this, it seems to work fine. Of course you've got to realize that if pass in a variable $x, and then later change it, you've changed the raw variable also, since it is just a blessed scalar ref.
But before we start using this more widely, I thought I'd ask... are there any potential problems with this approach?
Rob