
package Text::Wigwam::Stash::Base::Magic::Scalar;

use strict;
use warnings;
no warnings 'uninitialized';

our $VERSION = '0.01';

use base 'Text::Wigwam::Stash::Base::Magic';
use Scalar::Util qw/blessed/;

sub Ucfirst  { ucfirst ${$_[1]} }
sub Lc       { lc ${$_[1]} }
sub Uc       { uc ${$_[1]} }
sub Length   { length ${$_[1]} }
sub Inc      { ++${$_[1]} }
sub Dec      { --${$_[1]} }
sub Ord      { ord ${$_[1]} }
sub Dollars  {
    local( $_ ) = sprintf "%.2f", $_[1];
    1 while s/(\d)(\d\d\d)(?!\d)/$1,$2/;
    return '$'.$_;
}
sub DEFAULT  { $_[1] }

1;
