BBS-Perm

 view release on metacpan or  search on metacpan

bin/bbs-perm-config  view on Meta::CPAN

                if ( ref $item eq 'HASH' ) {
                    $item = $item->{$key};
                }
                elsif ( ref $item eq 'ARRAY' ) {
                    $item = $item->[$key];
                }
            }
            else {
                die "$item is not a ref";
            }
        }

        if ( ref $item ) {
            if ( ref $item eq 'HASH' ) {
                $item->{$last_key} = $value;
            }
            elsif ( ref $item eq 'ARRAY' ) {
                $item = $item->[$last_key];
            }
        }
        else {
            die "$item is not a ref";
        }

        BBS::Perm::Config::_DumpFile( $file, $config );
    }
    else {
        my @keys = split /\./, $arg;
        my $item = $config;
        for my $key (@keys) {
            if ( ref $item ) {
                if ( ref $item eq 'HASH' ) {
                    $item = $item->{$key};
                }
                elsif ( ref $item eq 'ARRAY' ) {
                    $item = $item->[$key];
                }
            }
            else {
                die "$item is not a ref";
            }
        }
        require Data::Dumper;
        no warnings 'once';
        local $Data::Dumper::Terse = 1;
        print Data::Dumper::Dumper($item);
    }
}

__DATA__
---
global:  
# Default values for all sites
    title: 'bbs-perm'
    protocol: ssh
    port: 22
    agent: 'bbs-perm-agent'
    font: 'WenQuanYi Micro Hei Mono 20'
    timeout: 60
    background_file: /path/to/picture
    background_transparent: 0
    opacity: 0.8
    mouse_autohide: 0
    default:
        - bash
    color:
        background: black
        foreground: white
    plugins:
        uri:
            default: 'http://www.google.com'
            browser: 'firefox -new-tab'
        ip:
            qqwry: /opt/qqwry.dat
        feed:
            label: Feed
    shortcuts:
        copy: 'M-c'
        paste: 'M-v'
        fullscreen: 'CM-f'
        feed: 'C-f'
        left_tab: 'M-['
        right_tab: 'M-]'
newsmth:
# use Alt+j to connect
    shortcut: 'M-j'
    encoding: gbk
    title: guest@newsmth
    site: newsmth.net
    username: guest
bash:
    shortcut: 'M-l'
    title: bash
    protocol: 'bash'
    agent: 'bash'
    timeout: 0



( run in 1.506 second using v1.01-cache-2.11-cpan-97f6503c9c8 )