App-Rad

 view release on metacpan or  search on metacpan

lib/App/Rad/Include.pm  view on Meta::CPAN

    $c->register('include', \&include, 'include one-liner as a command');
}

# translates one-liner into
# a complete, readable code
sub _get_oneliner_code {
    return _sanitize( _deparse($_[0]) );
}


#TODO: option to do it saving a backup file
# (behavior probably set via 'setup')
# inserts the string received
# (hopefully code) inside the
# user's program file as a 'sub'
sub _insert_code_in_file {
    my ($command_name, $code_text) = @_;

    my $sub =<<"EOSUB";
sub $command_name {
$code_text



( run in 1.148 second using v1.01-cache-2.11-cpan-49f99fa48dc )