This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $alpha = 0.1; | |
my $omega = 10; | |
my $t1 = 50; | |
my @x; | |
for my $t (0..$t1) { | |
push @x, exp(-$alpha*$t)*sin($omega*$t); | |
} | |
plot(\@x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#use strict; | |
sub Vacancy_Menu { | |
################################################################################ | |
### Выборка из таблиц по заданным параметрам | |
my $data=$dbh->prepare("SELECT * FROM ${pref}_rubrika ORDER BY stepshift ASC"); | |
$data->execute(); | |
if ($my{'c'} eq ''){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Util::YKO::GetTag; | |
my $html = <<END; | |
<html> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
my %hash; | |
# Fill %hash with 20 random values 0 - 99 | |
for (1 .. 20) { | |
my $rand = int(rand(100)); | |
$hash{$rand} = $rand; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use DBI; | |
use Test::More tests => 1; | |
use utf8; | |
use Encode; | |
my $options = {mysql_enable_utf8 => 1}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use DBI; | |
use Test::More tests => 3; | |
use strict; | |
use warnings; | |
my $options = {mysql_auto_reconnect => 1}; | |
my $dbh = DBI->connect("dbi:mysql:", undef, undef, $options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# Get all modules who depends on provided | |
use v5.10; | |
use strict; | |
use warnings; | |
use LWP::UserAgent; | |
use JSON; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use POSIX ":sys_wait_h"; | |
use LWP::UserAgent; | |
my $url = 'http://google.com'; | |
my $ua = LWP::UserAgent->new; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojo::UserAgent; | |
my $size = shift || 5; | |
my $ua = Mojo::UserAgent->new; | |
my $counter; | |
for (1..$size) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use AnyEvent::HTTP; | |
my $size = shift || 5; | |
my $counter; | |
for (1..$size) { | |
run("http://google.com"); | |
} |