This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
язык_программирования_perl [2019/09/24 11:28] val [Пример 3] |
язык_программирования_perl [2024/11/03 09:50] (current) val [Пример 3] |
||
---|---|---|---|
Line 57: | Line 57: | ||
my ($ip) = @ARGV; | my ($ip) = @ARGV; | ||
- | if (not defined $ip) { | + | unless($ip) { |
die "Need ip\n"; | die "Need ip\n"; | ||
} | } | ||
Line 125: | Line 125: | ||
$sth = $dbh->prepare(qq{insert into table1 (b) values ($b)}); | $sth = $dbh->prepare(qq{insert into table1 (b) values ($b)}); | ||
+ | #print $sth->{Statement}; | ||
$sth->execute() or next MAINLOOP; | $sth->execute() or next MAINLOOP; | ||
Line 157: | Line 158: | ||
* Использование UTF8 | * Использование UTF8 | ||
- | * Работа с XML форматом | + | * Работа с XML форматом ([[https://stackoverflow.com/questions/46167194/get-value-of-elements-using-xmldom|Get value of elements using XML::DOM]]) |
=== Исходный файл === | === Исходный файл === | ||
Line 201: | Line 202: | ||
foreach my $node (@nodes) { | foreach my $node (@nodes) { | ||
+ | |||
+ | # print $node->toString; | ||
+ | | ||
my $uuid = $node->getAttributeNode ("uuid")->getValue; | my $uuid = $node->getAttributeNode ("uuid")->getValue; | ||
my $lastname = $node->getAttributeNode ("lastname")->getValue; | my $lastname = $node->getAttributeNode ("lastname")->getValue; | ||
Line 208: | Line 212: | ||
} | } | ||
</code> | </code> | ||
- | |||
==== Пример 5 ==== | ==== Пример 5 ==== | ||
- | * Работа с Communigate | + | * [[http://www.communigate.ru/CGPerl/|CommuniGate Pro Perl Interface]] |
+ | * [[https://www.communigate.ru/main/purchase/scriptrepository.html|Библиотека скриптов для CommuniGate Pro (бесплатно)]] | ||
<code> | <code> | ||
- | # wget http://www.stalker.com/CGPerl/CLI.pm | + | # wget https://www.communigate.ru/CGPerl/CLI.pm |
# mv CLI.pm /etc/perl/ | # mv CLI.pm /etc/perl/ | ||
Line 247: | Line 251: | ||
exit; | exit; | ||
</code><code> | </code><code> | ||
- | mail# ./addcgpuser.pl user3 'Сидор Сидорович Сидоров' cpassword3 | + | mail# ./addcgpuser.pl user3 'Сидор Сидорович Сидоров' password3 |
</code> | </code> | ||
Line 273: | Line 277: | ||
|; | |; | ||
</code> | </code> | ||
+ | |||
+ | ==== Ссылки ==== | ||
+ | |||
+ | * [[http://codecry.com/perl/random-password-generator|Random Password Generator in Perl]] | ||
+ | * [[http://www.xgu.ru/wiki/%D0%A2%D1%80%D0%B0%D0%BD%D1%81%D0%BB%D0%B8%D1%82|Транслит]] |