亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tiny.pm

?? 一個PERL讀CONFIG的PM程序,大家試試,以前我做項目用過的.
?? PM
字號:
package Config::Tiny;

# If you thought Config::Simple was small...

use 5.004;
use strict;

use vars qw{$VERSION $errstr};
BEGIN {
	$VERSION = '2.02';
	$errstr  = '';
}

# Create an empty object
sub new { bless {}, shift }

# Create an object from a file
sub read {
	my $class = ref $_[0] ? ref shift : shift;

	# Check the file
	my $file = shift or return $class->_error( 'You did not specify a file name' );
	return $class->_error( "File '$file' does not exist" )              unless -e $file;
	return $class->_error( "'$file' is a directory, not a file" )       unless -f _;
	return $class->_error( "Insufficient permissions to read '$file'" ) unless -r _;

	# Slurp in the file
	local $/ = undef;
	open CFG, $file or return $class->_error( "Failed to open file '$file': $!" );
	my $contents = <CFG>;
	close CFG;

	$class->read_string( $contents );
}

# Create an object from a string
sub read_string {
	my $class = ref $_[0] ? ref shift : shift;
	my $self  = bless {}, $class;
	return undef unless defined $_[0];

	# Parse the file
	my $ns      = '_';
	my $counter = 0;
	foreach ( split /(?:\015{1,2}\012|\015|\012)/, shift ) {
		$counter++;

		# Skip comments and empty lines
		next if /^\s*(?:\#|\;|$)/;

		# Handle section headers
		if ( /^\s*\[\s*(.+?)\s*\]\s*$/ ) {
			# Create the sub-hash if it doesn't exist.
			# Without this sections without keys will not
			# appear at all in the completed struct.
			$self->{$ns = $1} ||= {};
			next;
		}

		# Handle properties
		if ( /^\s*([^=]+?)\s*=\s*(.*?)\s*$/ ) {
			$self->{$ns}->{$1} = $2;
			next;
		}

		return $self->_error( "Syntax error at line $counter: '$_'" );
	}

	$self;
}

# Save an object to a file
sub write {
	my $self = shift;
	my $file = shift or return $self->_error(
		'No file name provided'
		);

	# Write it to the file
	open( CFG, '>' . $file ) or return $self->_error(
		"Failed to open file '$file' for writing: $!"
		);
	print CFG $self->write_string;
	close CFG;
}

# Save an object to a string
sub write_string {
	my $self = shift;

	my $contents = '';
	foreach my $section ( sort { (($b eq '_') <=> ($a eq '_')) || ($a cmp $b) } keys %$self ) {
		my $block = $self->{$section};
		$contents .= "\n" if length $contents;
		$contents .= "[$section]\n" unless $section eq '_';
		foreach my $property ( sort keys %$block ) {
			$contents .= "$property=$block->{$property}\n";
		}
	}
	
	$contents;
}

# Error handling
sub errstr { $errstr }
sub _error { $errstr = $_[1]; undef }

1;

__END__

=pod

=head1 NAME

Config::Tiny - Read/Write .ini style files with as little code as possible

=head1 SYNOPSIS

    # In your configuration file
    rootproperty=blah

    [section]
    one=twp
    three= four
    Foo =Bar
    empty=

    # In your program
    use Config::Tiny;

    # Create a config
    my $Config = Config::Tiny->new();

    # Open the config
    $Config = Config::Tiny->read( 'file.conf' );

    # Reading properties
    my $rootproperty = $Config->{_}->{rootproperty};
    my $one = $Config->{section}->{one};
    my $Foo = $Config->{section}->{Foo};

    # Changing data
    $Config->{newsection} = { this => 'that' }; # Add a section
    $Config->{section}->{Foo} = 'Not Bar!';     # Change a value
    delete $Config->{_};                        # Delete a value or section

    # Save a config
    $Config->write( 'file.conf' );

=head1 DESCRIPTION

C<Config::Tiny> is a perl class to read and write .ini style configuration
files with as little code as possible, reducing load time and memory
overhead. Most of the time it is accepted that Perl applications use a lot
of memory and modules. The C<::Tiny> family of modules is specifically
intended to provide an ultralight alternative to the standard modules.

This module is primarily for reading human written files, and anything we
write shouldn't need to have documentation/comments. If you need something
with more power move up to L<Config::Simple>, L<Config::General> or one of
the many other C<Config::> modules. To rephrase, L<Config::Tiny> does B<not>
preserve your comments, whitespace, or the order of your config file.

=head1 CONFIGURATION FILE SYNTAX

Files are the same format as for windows .ini files. For example:

	[section]
	var1=value1
	var2=value2

If a property is outside of a section at the beginning of a file, it will
be assigned to the C<"root section">, available at C<$Config-E<gt>{_}>.

Lines starting with C<'#'> or C<';'> are considered comments and ignored,
as are blank lines.

When writing back to the config file, all comments, custom whitespace,
and the ordering of your config file elements is discarded. If you need
to keep the human elements of a config when writing back, upgrade to
something better, this module is not for you.

=head1 METHODS

=head2 new

The constructor C<new> creates and returns an empty C<Config::Tiny> object.

=head2 read $filename

The C<read> constructor reads a config file, and returns a new
C<Config::Tiny> object containing the properties in the file. 

Returns the object on success, or C<undef> on error.

=head2 read_string $string;

The C<read_string> method takes as argument the contents of a config file
as a string and returns the C<Config::Tiny> object for it.

=head2 write $filename

The C<write> method generates the file content for the properties, and
writes it to disk to the filename specified.

Returns true on success or C<undef> on error.

=head2 write_string

Generates the file content for the object and returns it as a string.

=head2 errstr

When an error occurs, you can retrieve the error message either from the
C<$Config::Tiny::errstr> variable, or using the C<errstr()> method.

=head1 SUPPORT

Bugs should be reported via the CPAN bug tracker at

L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Config-Tiny>

For other issues, or commercial enhancement or support, contact the author.

=head1 AUTHOR

Adam Kennedy, L<http://ali.as/>, cpan@aliI<.>as

Thanks to Sherzod Ruzmetov <sherzodr@cpan.org> for L<Config::Simple>,
which inspired this module by being not quite "simple" enough for me :)

=head1 SEE ALSO

L<Config::Simple>, L<Config::General>

=head1 COPYRIGHT

Copyright 2002 - 2005 Adam Kennedy. All rights reserved.
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the
LICENSE file included with this module.

=cut

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品久久一区二区三区| 久久99最新地址| 国产日韩欧美一区二区三区乱码| 欧美一级专区免费大片| 欧美亚洲日本国产| 亚洲另类春色校园小说| 亚洲欧洲国产专区| 亚洲黄一区二区三区| 日韩女同互慰一区二区| 日韩欧美综合在线| 97久久超碰国产精品| 91蝌蚪porny九色| 91福利在线导航| 久久精品国产999大香线蕉| 九一久久久久久| 亚洲国产cao| 精品中文av资源站在线观看| 国产一区二区三区不卡在线观看 | 26uuu国产在线精品一区二区| 粉嫩13p一区二区三区| 国产亚洲人成网站| 成年人网站91| 99精品视频在线观看免费| 国产午夜一区二区三区| 日韩理论片在线| 午夜精品久久久久久久蜜桃app| 欧美成人猛片aaaaaaa| 色88888久久久久久影院按摩| 国内精品国产三级国产a久久| 午夜欧美在线一二页| 久久草av在线| 青青草原综合久久大伊人精品| 国内精品久久久久影院一蜜桃| 99久久精品情趣| 日韩一级成人av| 欧美日韩一卡二卡| 久久午夜羞羞影院免费观看| 亚洲日本免费电影| 精品在线播放免费| 欧美日韩午夜影院| 欧美午夜寂寞影院| 欧美国产精品v| 国产欧美视频一区二区| 亚洲第一精品在线| 午夜亚洲福利老司机| 伊人开心综合网| 精品在线一区二区| 国产真实精品久久二三区| 在线亚洲免费视频| 中文字幕国产一区| 国产精品欧美久久久久一区二区| 亚洲国产成人av好男人在线观看| 久久国产人妖系列| 欧美久久久久免费| 亚洲一二三四久久| 97精品视频在线观看自产线路二| 精品91自产拍在线观看一区| 日韩欧美中文字幕制服| 一区二区三区在线观看欧美| 亚洲二区在线视频| 免费看欧美美女黄的网站| 一区二区三区中文在线| 樱桃视频在线观看一区| 国产+成+人+亚洲欧洲自线| 国产91综合网| 色综合网站在线| 欧美日本一区二区三区四区| 亚洲欧美精品午睡沙发| 亚洲超碰97人人做人人爱| 日韩不卡手机在线v区| 韩国欧美国产一区| 精品免费视频.| 国产精品欧美久久久久无广告 | 精品日产卡一卡二卡麻豆| 日韩精品一二三区| 国产精品99久久久久| 久久欧美一区二区| 亚洲激情图片小说视频| 乱一区二区av| 精品久久国产字幕高潮| 中文字幕亚洲精品在线观看| 一区二区三区四区视频精品免费| 99精品一区二区| 精品人在线二区三区| 国产一区日韩二区欧美三区| 久久久亚洲欧洲日产国码αv| 国产成人免费在线观看| 中文字幕一区二区三区在线观看| 日韩在线一区二区| 日韩精品一区二| 成人免费视频一区| 亚洲精品国产第一综合99久久| 色综合久久久久久久| 国产亚洲美州欧州综合国| 国产二区国产一区在线观看| 最新中文字幕一区二区三区| 99久久精品费精品国产一区二区| 亚洲自拍偷拍欧美| 精品国产欧美一区二区| 亚洲国产欧美日韩另类综合 | 紧缚捆绑精品一区二区| 国产欧美精品一区| 欧美亚洲高清一区二区三区不卡| 久久综合色播五月| 日本网站在线观看一区二区三区 | 亚洲伦理在线精品| 91精品国产91久久久久久一区二区 | 国产精品一区二区在线观看网站| 国产精品久久国产精麻豆99网站| 欧美日韩在线播| 床上的激情91.| 日韩精品1区2区3区| 国产三级精品在线| 7777精品久久久大香线蕉| 国产精品一区二区免费不卡| 欧美成人一区二区| 青青草91视频| 欧美老年两性高潮| 国产成人精品亚洲午夜麻豆| 亚洲国产精品久久一线不卡| 久久九九国产精品| 国产成人亚洲综合a∨婷婷 | 2024国产精品| 欧美日韩精品免费观看视频| 国产成人av电影| 免费av成人在线| 亚洲成人黄色小说| 国产拍欧美日韩视频二区| 欧美一级xxx| 美腿丝袜亚洲色图| 亚洲午夜影视影院在线观看| 国产精品久久久一区麻豆最新章节| 日韩欧美自拍偷拍| 欧美日韩国产一二三| 日韩av在线免费观看不卡| 日韩视频免费直播| 欧美性猛交xxxx黑人交| 青青草精品视频| 亚洲不卡av一区二区三区| 亚洲精品国产精华液| 亚洲色图都市小说| 国产精品色噜噜| 国产人伦精品一区二区| 久久久亚洲综合| 久久久久久久久久久久久女国产乱| 高清shemale亚洲人妖| 亚洲欧洲日产国产综合网| 欧洲国内综合视频| 激情综合色播激情啊| 裸体在线国模精品偷拍| 国产日韩精品一区二区三区| www久久精品| 久久久久久毛片| 久久午夜国产精品| 精品久久久久香蕉网| 99久久精品国产一区二区三区| 亚洲欧美日韩一区二区| 亚洲男同1069视频| 亚洲视频资源在线| 伊人色综合久久天天人手人婷| 亚洲免费在线观看视频| 日韩一级在线观看| 日韩视频在线观看一区二区| 精品日韩欧美在线| 欧美国产禁国产网站cc| 亚洲靠逼com| 精品国产乱码久久久久久久久 | 色狠狠综合天天综合综合| 精品一区二区三区免费视频| 国产在线视频一区二区| 成人高清在线视频| 美女视频网站久久| 高清beeg欧美| 欧洲精品中文字幕| www.亚洲国产| 欧美日韩亚洲综合| 99精品1区2区| 欧美揉bbbbb揉bbbbb| av在线不卡免费看| 欧美日韩一区二区三区高清| 日韩欧美一级精品久久| 久久久91精品国产一区二区精品| |精品福利一区二区三区| 香蕉久久一区二区不卡无毒影院| 韩国v欧美v日本v亚洲v| 99精品视频在线观看免费| 7777女厕盗摄久久久| 欧美国产一区在线| 久久精品亚洲国产奇米99| 亚洲精品免费电影| 国产一区二区三区久久久 | 26uuu亚洲| 亚洲精品欧美在线| 国产高清精品在线| 欧美日韩国产美女| 亚洲六月丁香色婷婷综合久久| 另类调教123区| 欧美日韩一区二区三区在线看| 色婷婷av一区二区| 欧美激情在线免费观看|