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 | |
print STDERR "Press ^C to exit\n"; | |
my $cmd_line = 'wc ' . join ' ', @ARGV; | |
my $out; | |
while (1) { | |
$out = `$cmd_line`; | |
chomp $out; | |
print "\cM$out"; | |
sleep 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/perl -pw | |
use strict; | |
s{#([[:xdigit:]])\1([[:xdigit:]])\2([[:xdigit:]])\3}{#$1$2$3}g; | |
s{<(b|i|em|strong)></\1>}{}gi; | |
s{</(b|i|em|strong)><\1>}{}gi; |
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 -wl | |
use strict; | |
=head1 DESCRIPTION | |
Print out GPS coordinates from images | |
=head1 AUTHOR | |
Alexander Sapozhnikov |
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 -n | |
use Term::ANSIColor; | |
print colored( $_, 'red' ) and next if /^</; | |
print colored( $_, 'green' ) and next if /^>/; | |
print colored( $_, 'bold blue' ) and next if /^[\d,]+[acd][\d,]+$/; | |
print; | |
=head1 NAME |
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
Example if gettext usage via Locale::TextDomain | |
How to use: | |
0. cd po && make | |
1. ../example/1.pl | |
or | |
env LANGUAGE=ru ../example/1.pl | |
or |
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 Mojolicious::Lite; | |
get '/' => sub { | |
my $self = shift; | |
$self->render( | |
'template' => 'index', | |
'count' => int rand 33, | |
); |
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 Mojolicious::Lite; | |
get '/' => sub { | |
my $self = shift; | |
$self->render( | |
'template' => 'index', | |
'count' => int rand 33, | |
); |
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
package MyApp::Model::DBI; | |
use strict; | |
use warnings; | |
use base 'Catalyst::Model::DBI'; | |
# skipped some configuration statements | |
__PACKAGE__->config( | |
'dsn' => 'dbi:mysql:' . $config->{'sql'}->{'database'} . ':' . $config->{'sql'}->{'host'}, |
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
perl -le 'while(<*.png>){next if -l;print}' |
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
head -n 1 tab-separated.txt \ | |
| perl -na -F'\t' \ | |
-e 'map { printf "=item %d\n\n%s / %s\n\n", $i++, chr(0x40+$i), $_ } @F ' |
OlderNewer