X7ROOT File Manager
Current Path:
/usr/libexec/webmin/lpadmin
usr
/
libexec
/
webmin
/
lpadmin
/
📁
..
📄
CHANGELOG
(1.16 KB)
📄
acl_security.pl
(4.4 KB)
📄
aix-lib.pl
(9.45 KB)
📄
ascii.txt
(4.19 KB)
📄
base_coas_driver
(560 B)
📄
bw.fig
(2.75 KB)
📄
bw.ps
(6.46 KB)
📄
caldera-driver.pl
(12.31 KB)
📄
cancel_all.cgi
(535 B)
📄
catalog.devices
(12.34 KB)
📄
cgi_args.pl
(284 B)
📄
cluster.cgi
(2.06 KB)
📄
cluster_add.cgi
(2.13 KB)
📄
cluster_delete.cgi
(529 B)
📄
colour.fig
(2.91 KB)
📄
colour.ps
(6.63 KB)
📄
config-AlmaLinux-7.0-ALL
(323 B)
📄
config-Amazon-Linux-2-ALL
(323 B)
📄
config-CentOS-Linux-7.0-ALL
(323 B)
📄
config-CentOS-Stream-Linux-8.0-ALL
(323 B)
📄
config-Oracle-Linux-8.0-ALL
(323 B)
📄
config-Redhat-Enterprise-Linux-7.0-ALL
(323 B)
📄
config-Rocky-Linux-7.0-ALL
(323 B)
📄
config-Scientific-Linux-7.0-ALL
(323 B)
📄
config-aix
(281 B)
📄
config-coherent-linux
(323 B)
📄
config-corel-linux
(228 B)
📄
config-debian-linux
(228 B)
📄
config-debian-linux-3.1-3.9
(327 B)
📄
config-debian-linux-4.0-ALL
(333 B)
📄
config-freebsd
(230 B)
📄
config-generic-linux
(228 B)
📄
config-gentoo-linux
(248 B)
📄
config-hpux
(323 B)
📄
config-irix
(213 B)
📄
config-macos
(230 B)
📄
config-mandrake-linux
(245 B)
📄
config-mandrake-linux-8.0-ALL
(276 B)
📄
config-msc-linux
(228 B)
📄
config-netbsd
(230 B)
📄
config-open-linux
(309 B)
📄
config-open-linux-3.1e
(239 B)
📄
config-openbsd
(230 B)
📄
config-openmamba-linux
(229 B)
📄
config-pardus-linux
(228 B)
📄
config-redhat-linux
(228 B)
📄
config-redhat-linux-24.0-ALL
(339 B)
📄
config-redhat-linux-7.0
(283 B)
📄
config-redhat-linux-7.1
(286 B)
📄
config-redhat-linux-7.2-8.1
(394 B)
📄
config-redhat-linux-9.0-23.0
(337 B)
📄
config-slackware-linux
(228 B)
📄
config-slackware-linux-8.1-ALL
(246 B)
📄
config-solaris
(304 B)
📄
config-solaris-10-ALL
(330 B)
📄
config-solaris-9
(296 B)
📄
config-suse-linux
(226 B)
📄
config-suse-linux-8.2-ALL
(322 B)
📄
config-trustix-linux
(313 B)
📄
config-turbo-linux
(228 B)
📄
config-united-linux
(322 B)
📄
config-unixware
(302 B)
📄
config.info
(1.31 KB)
📄
config.info.ca
(1.53 KB)
📄
config.info.cs
(1.25 KB)
📄
config.info.de
(1.43 KB)
📄
config.info.es
(1.17 KB)
📄
config.info.fr
(1.63 KB)
📄
config.info.hu
(707 B)
📄
config.info.ja
(823 B)
📄
config.info.nl
(1.41 KB)
📄
config.info.no
(1.37 KB)
📄
config.info.pl
(1.45 KB)
📄
config.info.pt_BR
(1.58 KB)
📄
config.info.ru
(1.74 KB)
📄
config.info.sv
(651 B)
📄
config.info.tr
(1.39 KB)
📄
config.info.uk
(1.81 KB)
📄
config.info.zh
(573 B)
📄
config.info.zh_TW
(539 B)
📄
cups-driver.pl
(6.37 KB)
📄
cups-lib.pl
(8.67 KB)
📄
defaultacl
(73 B)
📄
delete_printer.cgi
(690 B)
📄
delete_printers.cgi
(839 B)
📄
drivers
(18.34 KB)
📄
edit_printer.cgi
(10.08 KB)
📄
freebsd-lib.pl
(7.26 KB)
📄
hpux-driver.pl
(3.13 KB)
📄
hpux-lib.pl
(9.83 KB)
📁
images
📄
index.cgi
(5.83 KB)
📄
irix-driver.pl
(3.13 KB)
📄
irix-lib.pl
(10.68 KB)
📁
lang
📄
linux-lib.pl
(8.97 KB)
📄
list_jobs.cgi
(2.25 KB)
📄
log_parser.pl
(1021 B)
📄
lpadmin-lib.pl
(19.89 KB)
📄
lprng-lib.pl
(10.26 KB)
📄
module.info
(494 B)
📄
module.info.af
(0 B)
📄
module.info.af.auto
(159 B)
📄
module.info.ar
(0 B)
📄
module.info.ar.auto
(223 B)
📄
module.info.be
(0 B)
📄
module.info.be.auto
(290 B)
📄
module.info.bg
(0 B)
📄
module.info.bg.auto
(306 B)
📄
module.info.ca
(167 B)
📄
module.info.ca.auto
(16 B)
📄
module.info.cs
(31 B)
📄
module.info.cs.auto
(155 B)
📄
module.info.da
(0 B)
📄
module.info.da.auto
(168 B)
📄
module.info.de
(148 B)
📄
module.info.de.auto
(16 B)
📄
module.info.el
(0 B)
📄
module.info.el.auto
(362 B)
📄
module.info.es
(38 B)
📄
module.info.es.auto
(157 B)
📄
module.info.eu
(0 B)
📄
module.info.eu.auto
(217 B)
📄
module.info.fa
(0 B)
📄
module.info.fa.auto
(246 B)
📄
module.info.fi
(0 B)
📄
module.info.fi.auto
(168 B)
📄
module.info.fr
(39 B)
📄
module.info.fr.auto
(176 B)
📄
module.info.he
(0 B)
📄
module.info.he.auto
(205 B)
📄
module.info.hr
(0 B)
📄
module.info.hr.auto
(188 B)
📄
module.info.hu
(19 B)
📄
module.info.hu.auto
(173 B)
📄
module.info.it
(0 B)
📄
module.info.it.auto
(177 B)
📄
module.info.ja
(27 B)
📄
module.info.ja.auto
(213 B)
📄
module.info.ko
(25 B)
📄
module.info.ko.auto
(176 B)
📄
module.info.lt
(0 B)
📄
module.info.lt.auto
(219 B)
📄
module.info.lv
(0 B)
📄
module.info.lv.auto
(189 B)
📄
module.info.ms
(152 B)
📄
module.info.ms.auto
(16 B)
📄
module.info.mt
(0 B)
📄
module.info.mt.auto
(196 B)
📄
module.info.nl
(33 B)
📄
module.info.nl.auto
(133 B)
📄
module.info.no
(31 B)
📄
module.info.no.auto
(137 B)
📄
module.info.pl
(160 B)
📄
module.info.pl.auto
(16 B)
📄
module.info.pt
(39 B)
📄
module.info.pt.auto
(149 B)
📄
module.info.pt_BR
(42 B)
📄
module.info.pt_BR.auto
(155 B)
📄
module.info.ro
(0 B)
📄
module.info.ro.auto
(199 B)
📄
module.info.ru
(25 B)
📄
module.info.ru.auto
(245 B)
📄
module.info.sk
(0 B)
📄
module.info.sk.auto
(184 B)
📄
module.info.sl
(0 B)
📄
module.info.sl.auto
(192 B)
📄
module.info.sv
(30 B)
📄
module.info.sv.auto
(141 B)
📄
module.info.th
(0 B)
📄
module.info.th.auto
(393 B)
📄
module.info.tr
(27 B)
📄
module.info.tr.auto
(166 B)
📄
module.info.uk
(0 B)
📄
module.info.uk.auto
(281 B)
📄
module.info.ur
(0 B)
📄
module.info.ur.auto
(304 B)
📄
module.info.vi
(0 B)
📄
module.info.vi.auto
(189 B)
📄
module.info.zh
(24 B)
📄
module.info.zh.auto
(136 B)
📄
module.info.zh_TW
(30 B)
📄
module.info.zh_TW.auto
(142 B)
📄
old-caldera-driver.pl
(9.74 KB)
📄
openbsd-lib.pl
(7.26 KB)
📄
prefs.info
(40 B)
📄
printconf-driver.pl
(9.52 KB)
📄
rbac-mapping
(248 B)
📄
redhat-driver.pl
(12.42 KB)
📄
restart.cgi
(301 B)
📄
save_printer.cgi
(5.85 KB)
📄
solaris-driver.pl
(4.03 KB)
📄
solaris-lib.pl
(12.17 KB)
📄
sortdrivers-by-drv.pl
(222 B)
📄
sortdrivers.pl
(242 B)
📄
start.cgi
(377 B)
📄
stop.cgi
(374 B)
📄
stp
(2.45 KB)
📄
suse-driver.pl
(10.62 KB)
📄
test_form.cgi
(887 B)
📄
test_print.cgi
(1.19 KB)
📄
unixware-lib.pl
(7.81 KB)
📄
view_job.cgi
(909 B)
📄
webmin-driver.pl
(1.04 KB)
Editing: caldera-driver.pl
# caldera-driver.pl # Functions for printer drivers as generated by COAS %paper_sizes = ( 'a4', 'A4', 'a3', 'A3', 'a5', 'A5', 'letter', 'US Letter', 'legal', 'Legal', 'ledger', 'Ledger' ); $driver_dir = "/etc/sysconfig/printers"; $base_driver = "/usr/libexec/printers/genericfilter"; open(BASE, "<".$base_driver); $base_driver_text = join(<BASE>); close(BASE); $webmin_windows_driver = 1; # is_windows_driver(path) # Returns the server, share, username, password, workgroup, program # if path is a webmin windows driver sub is_windows_driver { return &is_webmin_windows_driver(@_); } # is_driver(path, &printer) # Returns the driver name and dpi if some path is a webmin driver, or undef sub is_driver { if (!$_[0]) { return { 'mode' => 0, 'desc' => "$text{'caldera_none'}" }; } open(DRV, "<".$_[0]); local @lines = <DRV>; close(DRV); local %conf; if ($lines[1] =~ /^source ($driver_dir\/\S+)/) { # Looks like a 2.3 caldera driver! Read the sysconfig file &read_env_file($1, \%conf); if ($conf{'GSDEVICE'} eq 'NET' || $conf{'GSDEVICE'} eq 'RAW') { # Driver isn't even used return { 'mode' => 0, 'desc' => 'None' }; } elsif ($conf{'GSDEVICE'} eq 'uniprint') { # Uniprint driver foreach $u (&list_uniprint()) { $desc = $u->[1] if ($u->[0] eq $conf{'UPP'}); } $desc =~ s/,.*$//g; return { 'mode' => 3, 'upp' => $conf{'UPP'}, 'paper' => $conf{'PAPERSIZE'}, 'double' => lc($conf{'DOUBLEPAGE'}), 'eof' => lc($conf{'SENDEOF'}), 'desc' => $desc ? $desc : $conf{'UPP'} }; } else { # A caldera printer driver open(COAS, "<".$config{'coas_printers'}); local $plist = &parse_coas(COAS); close(COAS); local ($prn, $p); foreach $p (values %$plist) { $prn = $p if ($p->{'type'}->{'0'} eq $conf{'GSDEVICE'} && !$desc); } return { 'mode' => 1, 'gsdevice' => $conf{'GSDEVICE'}, 'gsname' => $conf{'GSNAME'}, 'res' => $conf{'RESOLUTION'}, 'paper' => $conf{'PAPERSIZE'}, 'eof' => lc($conf{'SENDEOF'}), 'double' => lc($conf{'DOUBLEPAGE'}), 'gsopts' => $conf{'GSOPTS'}, 'ddesc' => $prn->{'description'}, 'desc' => $conf{'GSNAME'} ? $conf{'GSNAME'} : $prn->{'description'} }; } } elsif (join(@lines) eq $base_driver_text) { # Looks like a 2.4 caldera driver! &read_env_file("$driver_dir/$_[1]->{'name'}", \%conf); if ($conf{'GSDEVICE'} eq 'NET' || $conf{'GSDEVICE'} eq 'RAW') { # Driver isn't even used return { 'mode' => 0, 'desc' => 'None' }; } else { # A new caldera printer driver open(COAS, "<".$config{'coas_printers'}); local $plist = &parse_coas(COAS); close(COAS); local ($prn, $p, $type); foreach $p (values %$plist) { $type = ref($p->{'type'}) ? $p->{'type'}->{'0'} : $p->{'type'}; $prn = $p if ($type eq $conf{'GSDEVICE'} && !$prn && ($p->{'description'} eq $conf{'DESC'} || $p->{'description'} eq $conf{'GSNAME'})); } if (!$prn) { foreach $p (values %$plist) { $type = ref($p->{'type'}) ? $p->{'type'}->{'0'} : $p->{'type'}; $prn = $p if ($type eq $conf{'GSDEVICE'} && !$prn); } } return { 'mode' => 1, 'gsdevice' => $conf{'GSDEVICE'}, 'gsname' => $conf{'GSNAME'}, 'res' => $conf{'RESOLUTION'}, 'paper' => $conf{'PAPERSIZE'}, 'eof' => lc($conf{'SENDEOF'}), 'double' => lc($conf{'DOUBLEPAGE'}), 'gsopts' => $conf{'GSOPTS'}, 'upp' => $conf{'UPP'}, 'ddesc' => $prn->{'description'}, 'desc' => $conf{'GSNAME'} ? $conf{'GSNAME'} : $prn->{'description'} }; } } else { # A driver of some kind, but not caldera's return { 'mode' => 2, 'file' => $_[0], 'desc' => $_[0] }; } } # create_windows_driver(&printer, &driver) sub create_windows_driver { return &create_webmin_windows_driver(@_); } # create_driver(&printer, &driver) sub create_driver { &lock_file("$driver_dir/$_[0]->{'name'}"); if ($_[1]->{'mode'} == 0) { unlink("$driver_dir/$_[0]->{'name'}"); &unlock_file("$driver_dir/$_[0]->{'name'}"); return undef; } elsif ($_[1]->{'mode'} == 2) { unlink("$driver_dir/$_[0]->{'name'}"); &unlock_file("$driver_dir/$_[0]->{'name'}"); return $_[1]->{'file'}; } else { # Create or update the parameters file local %conf; &read_env_file("$driver_dir/$_[0]->{'name'}", \%conf); $conf{'GSDEVICE'} = $_[1]->{'gsdevice'}; $conf{'GSNAME'} = $_[1]->{'gsname'}; $conf{'NAME'} = $_[0]->{'name'}; $conf{'RESOLUTION'} = $_[1]->{'res'}; $conf{'PAPERSIZE'} = $_[1]->{'paper'}; $conf{'DESC'} = $_[0]->{'desc'}; $conf{'SENDEOF'} = $_[1]->{'eof'}; $conf{'DOUBLEPAGE'} = $_[1]->{'double'}; $conf{'GSOPTS'} = $_[1]->{'gsopts'}; $conf{'UPP'} = $_[1]->{'upp'}; &write_env_file("$driver_dir/$_[0]->{'name'}", \%conf); &unlock_file("$driver_dir/$_[0]->{'name'}"); &lock_file("$config{'spool_dir'}/$_[0]->{'name'}"); mkdir("$config{'spool_dir'}/$_[0]->{'name'}", 0755); &unlock_file("$config{'spool_dir'}/$_[0]->{'name'}"); local $drv = "$config{'spool_dir'}/$_[0]->{'name'}/printfilter"; &lock_file($drv); if ($gconfig{'os_version'} >= 2.4) { # Create the 2.4 driver program ©_source_dest($base_driver, $drv); } else { # Create the 2.3 driver program open(DRIVER, "<".$base_driver); local @lines = <DRIVER>; close(DRIVER); &open_tempfile(DRV, ">$drv"); &print_tempfile(DRV, "#!/bin/bash\n"); &print_tempfile(DRV, "source $driver_dir/$_[0]->{'name'}\n"); &print_tempfile(DRV, @lines); &close_tempfile(DRV); } &unlock_file($drv); return $drv; } } # delete_driver(name) sub delete_driver { &delete_webmin_driver($_[0]); &lock_file("$driver_dir/$_[0]"); unlink("$driver_dir/$_[0]"); &unlock_file("$driver_dir/$_[0]"); } # driver_input(&printer, &driver) sub driver_input { local $mode = $_[1]->{'mode'}; printf "<tr> <td><input type=radio name=mode value=0 %s> %s</td>\n", $mode == 0 ? 'checked' : '', $text{'caldera_none'}; print "<td>($text{'caldera_nonemsg'})</td> </tr>\n"; printf "<tr> <td><input type=radio name=mode value=2 %s> %s</td>", $mode == 2 ? 'checked' : '', $text{'caldera_prog'}; printf "<td><input name=program size=40 value='%s'></td> </tr>\n", $mode == 2 ? $_[0]->{'iface'} : ''; # Normal driver options printf "<tr> <td valign=top><input type=radio name=mode value=1 %s> %s</td>\n", $mode == 1 ? 'checked' : '', $text{'caldera_coas'}; print "<td><table width=100%>\n"; local $sels = $gconfig{'os_version'} < 2.4 ? 5 : 10; print "<tr> <td valign=top><b>$text{'caldera_printer'}</b></td>\n"; print "<td colspan=3><select size=$sels name=gsdevice onChange='setres(0)'>\n"; open(COAS, "<".$config{'coas_printers'}); local $plist = &parse_coas(COAS); close(COAS); local ($i, $j, $p, $k, $found, $select_res); foreach $p (values %$plist) { if ($p->{'description'} eq $_[1]->{'gsname'} && $p->{'type'}->{'0'} ne $_[1]->{'gsdevice'}) { # COAS has changed the device $_[1]->{'gsname'} = undef; } } foreach $k (sort { $a <=> $b } keys %$plist) { $p = $plist->{$k}; local $type = ref($p->{'type'}) ? $p->{'type'}->{'0'} : $p->{'type'}; next if ($type =~ /NET|RAW/); local @thisres = values %{$p->{'resolution'}}; #local $got = ($_[1]->{'gsname'} eq $p->{'description'} && # $_[1]->{'gsdevice'} eq $type) || # (!$_[1]->{'gsname'} && !$found && # $_[1]->{'gsdevice'} eq $type); local $got = $_[1]->{'ddesc'} eq $p->{'description'}; printf "<option %s value='%s'>%s</option>\n", $got ? 'selected' : '', $p->{'description'}.";".join(";", @thisres), $p->{'description'}; $found = $p if ($got); $select_res = &indexof($_[1]->{'res'}, @thisres) if ($got); map { $gotres{$_}++ } @thisres; } print "</select><select name=res size=$sels>\n"; foreach $r (sort { $a <=> $b} keys %gotres) { printf "<option %s>%s</option>\n", $_[1]->{'res'} eq $r ? 'selected' : '', $r; } print "</select></td> </tr>\n"; print "<tr> <td><b>$text{'caldera_eof'}</b></td>\n"; printf "<td><input type=radio name=eof value=true %s> $text{'yes'}\n", $_[1]->{'eof'} eq 'true' ? 'checked' : ''; printf "<input type=radio name=eof value=false %s> $text{'no'}</td>\n", $_[1]->{'eof'} eq 'true' ? '' : 'checked'; print "<td><b>$text{'caldera_paper'}</b></td> <td><select name=paper>\n"; foreach $p (sort { $a cmp $b } keys %paper_sizes) { printf "<option value='%s' %s>%s</option>\n", $p, $_[1]->{'paper'} eq $p ? 'selected' : '', $paper_sizes{$p}; } print "</select></td> </tr>\n"; print "<tr> <td><b>$text{'caldera_double'}</b></td>\n"; printf "<td><input type=radio name=double value=true %s> $text{'yes'}\n", $_[1]->{'double'} eq 'true' ? 'checked' : ''; printf "<input type=radio name=double value=false %s> $text{'no'}</td>\n", $_[1]->{'double'} eq 'true' ? '' : 'checked'; if ($found) { $_[1]->{'gsopts'} =~ s/\s*$found->{'gsoptions'}\s*//; } print "<td><b>$text{'caldera_gsopts'}</b></td>\n"; printf "<td><input name=gsopts size=30 value='%s'></td> </tr>\n", $_[1]->{'gsopts'}; print "</table></td></tr>\n"; if ($gconfig{'os_version'} < 2.4) { # Uniprint driver options printf "<tr> <td valign=top><input type=radio name=mode value=3 %s> %s</td>\n", $mode == 3 ? 'checked' : '', $text{'caldera_uniprint'}; print "<td><table width=100%>\n"; print "<tr> <td valign=top><b>$text{'caldera_printer'}</b></td>\n"; print "<td colspan=3><select name=uniprint size=5>\n"; foreach $u (&list_uniprint()) { printf "<option value=%s %s>%s</option>\n", $u->[0], $u->[0] eq $_[1]->{'upp'} ? 'selected' : '', $u->[1]; } closedir(DIR); print "</select></td> </tr>\n"; print "<tr> <td><b>$text{'caldera_eof'}</b></td>\n"; printf "<td><input type=radio name=ueof value=true %s> $text{'yes'}\n", $_[1]->{'eof'} eq 'true' ? 'checked' : ''; printf "<input type=radio name=ueof value=false %s> $text{'no'}</td>\n", $_[1]->{'eof'} eq 'true' ? '' : 'checked'; print "<td><b>$text{'caldera_paper'}</b></td> <td><select name=upaper>\n"; foreach $p (sort { $a cmp $b } keys %paper_sizes) { printf "<option value='%s' %s>%s</option>\n", $p, $_[1]->{'paper'} eq $p ? 'selected' : '', $paper_sizes{$p}; } print "</select></td> </tr>\n"; print "<tr> <td><b>$text{'caldera_double'}</b></td>\n"; printf "<td><input type=radio name=udouble value=true %s> $text{'yes'}\n", $_[1]->{'double'} eq 'true' ? 'checked' : ''; printf "<input type=radio name=udouble value=false %s> $text{'no'}</td>\n", $_[1]->{'double'} eq 'true' ? '' : 'checked'; print "</table></td></tr>\n"; } return <<EOF; <script> function setres(sel) { var idx = document.forms[0].gsdevice.selectedIndex; var v = new String(document.forms[0].gsdevice.options[idx].value); var vv = v.split(";"); var res = document.forms[0].res; res.length = 0; for(var i=1; i<vv.length; i++) { res.options[i-1] = new Option(vv[i], vv[i]); } if (res.length > 0) { res.options[sel].selected = true; } } setres($select_res); </script> EOF } # parse_driver() # Parse driver selection from %in and return a driver structure sub parse_driver { if ($in{'mode'} == 0) { return { 'mode' => 0 }; } elsif ($in{'mode'} == 2) { $in{'program'} =~ /^(\S+)/ && -x $1 || &error(&text('caldera_eprog', $in{'program'})); return { 'mode' => 2, 'file' => $in{'program'} }; } elsif ($in{'mode'} == 1) { # Normal ghostscript driver open(COAS, "<".$config{'coas_printers'}); local $plist = &parse_coas(COAS); close(COAS); $in{'gsdevice'} || &error($text{'caldera_edriver'}); $in{'gsdevice'} =~ s/;(.*)$//; local ($p, $prn); foreach $p (values %$plist) { $prn = $p if ($p->{'description'} eq $in{'gsdevice'}); } local $gsdevice = ref($prn->{'type'}) ? $prn->{'type'}->{'0'} : $prn->{'type'}, $gsdevice eq 'PostScript' || $in{'res'} || &error($text{'caldera_eres'}); if ($prn->{'gsoptions'}) { $in{'gsopts'} .= " ".$prn->{'gsoptions'}; } return { 'mode' => 1, 'gsdevice' => $gsdevice, 'upp' => $prn->{'uniprint'}, 'gsname' => $in{'gsdevice'}, 'res' => $in{'res'}, 'paper' => $in{'paper'}, 'eof' => $in{'eof'}, 'double' => $in{'double'}, 'gsopts' => $in{'gsopts'} }; } else { # Uniprint ghostscript driver under 2.3 $in{'uniprint'} || &error($text{'caldera_edriver'}); return { 'mode' => 3, 'gsdevice' => 'uniprint', 'upp' => $in{'uniprint'}, 'paper' => $in{'upaper'}, 'eof' => $in{'ueof'}, 'double' => $in{'udouble'} }; } } # parse_coas(handle) sub parse_coas { local $h = $_[0]; local (%rv, $_); while(<$h>) { s/#.*$//g; s/\r|\n//g; if (/^\s*(\S+)\s+{/) { # start of a section local $k = $1; $rv{$k} = &parse_coas($h); } elsif (/^\s*}/) { # end of a section last; } elsif (/^\s*(\S+)\s+(.*)/) { # a value in a section $rv{$1} = $2; } } return \%rv; } 1;
Upload File
Create Folder