Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
use strict;
use warnings;
my $status = 'apache22';
$status =~ /(apache22)/ ? print "OK" : print "error";
#!/usr/bin/perl
use strict;
use warnings;
use Mojo::Template;
my $mt = Mojo::Template->new;
my $output = $mt->render(<<'EOF');
% use Time::Piece;
<!DOCTYPE html>
<html>
<head><title>Simple</title></head>
#!/usr/bin/perl
use strict;
use Mojo::Template;
my @args;
$args[0] = '1';
my $mt = Mojo::Template->new;
my $output = $mt->render_file('1.html',@args);
print $output;
$VAR1 = "
<!DOCTYPE_ _>
<html>
<head>
<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=utf-8\\\" />
<title>\x{41e}\x{442}\x{447}\x{451}\x{442} \x{43f}\x{43e}\x{441}\x{435}\x{449}\x{430}\x{435}\x{43c}\x{43e}\x{441}\x{442}\x{438} \x{440}\x{430}\x{431}\x{43e}\x{442}\x{44b}</title>
</head>
<body><table border=1>\"
<tr>
21<td>hello</td>
<!DOCTYPE_ _>
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
<title>Отчёт посещаемости работы</title>
</head>
<body><table border=1>"
<tr>
21<td>hello</td>
<!DOCTYPE_ _>
<html>
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8" />
<title>Отчёт</title>
</head>
<body><table border=1>"
<tr>
21<td><div align=center>Власов Вадим</div></td>
</tr>
Server available at http://127.0.0.1:3000.
$VAR1 = "{
\"\x{41f}\x{43e}\x{43d}\x{438}\x{437}\x{43e}\x{432}\x{441}\x{43a}\x{438}\x{439} \x{415}\x{432}\x{433}\x{435}\x{43d}\x{438}\x{439}\" : {
\"Mon\" : {
\"start_time\" : \"10:00\"
},
\"Tue\" : {
\"start_time\" : \"10:00\"
},
\"Wed\" : {
sub get_content_from_file {
my ($file) = @_;
open FILE, $file or die "Couldn't open file: $!";
binmode(FILE, ":utf8");
my $string = join("", <FILE>);
close FILE;
return $string;
}
<?php
class BulkApi
{
public $host;
public $user;
public $secret_key;
public $hash;
public function __construct() {
<?php
class BulkApi
{
public $host;
public $user;
public $secret_key;
public $hash;
public $xml;