Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env perl
- sub another_sub {
- my ($args_ref) = @_;
- }
- sub parse_config_line {
- local $_=shift;
- my $confs=shift;
- my $key;
- unless (/^\s*[;\#]/ or /^\s*$/) {
- chomp;
- if (/^\s*([a-zA-Z_]+[a-zA-Z_0-9]*(::[a-zA-Z_]+[a-zA-Z_0-9:]*)?)\s*=\s*('(?:[^\\']|\\.)*'|"(?:[^\\"]|\\.)*"|(?:\s*(?:[^;\\\s]|\\.)+)*)/) {
- $key = $2 ? $1 : lc($1);
- $confs->{$key}=$3;
- $confs->{$key}=~s/\\(.)/$1/g;
- $confs->{$key}=$1 if ($confs->{$key}=~/^'(.*)'$/ or $confs->{$key}=~/^"(.*)"$/);
- }
- }
- }
- sub another_sub2 {
- my ($args_ref) = @_;
- }
- sub another_sub3 {
- if (/^\s*([a-zA-Z_]+[a-zA-Z_0-9]*(::[a-zA-Z_]+[a-zA-Z_0-9:]*)?)\s*=\s*('(?:[^\\']|\\.)*'|"(?:[^\\"]|\\.)*"|(?:\s*(?:[^;\\\s]|\\.)+)*)/) {
- $key = $2 ? $1 : lc($1);
- $confs->{$key}=$3;
- $confs->{$key}=~s/\\(.)/$1/g;
- $confs->{$key}=$1 if ($confs->{$key}=~/^'(.*)'$/ or $confs->{$key}=~/^"(.*)"$/);
- }
- }
- sub another_sub4 {
- if (/^\s*([a-zA-Z_]+[a-zA-Z_0-9]*(::[a-zA-Z_]+[a-zA-Z_0-9:]*)?)\s*=\s*('(?:[^\\']|\\.)*'|"(?:[^\\"]|\\.)*"|(?:\s*(?:[^;\\\s]|\\.)+)*)/) {
- $key = $2 ? $1 : lc($1);
- $confs->{$key}=$3;
- $confs->{$key}=~s/\\(.)/$1/g;
- $confs->{$key}=$1 if ($confs->{$key}=~/^'(.*)'$/ or $confs->{$key}=~/^"(.*)"$/);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement