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 -w | |
# chat_client.pl | |
use strict; | |
use IO::Socket::INET; | |
my $port = shift or die "No port\n"; | |
my $server = shift or die "No server\n"; | |
my $client_socket = IO::Socket::INET->new( | |
PeerPort => $port, | |
PeerAddr => $server, |
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 -w | |
# chat_server.pl | |
use strict; | |
use IO::Socket::INET; | |
my $port = shift or die "Port required!\n"; | |
my $socket = IO::Socket::INET->new( | |
LocalPort => $port, | |
Proto => 'tcp', | |
Listen => SOMAXCONN |
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 5.010; | |
use Time::Piece; | |
my $in_format = '%Y-%m-%d %H:%M:%S'; | |
my $out_format = '%Y-%m-%dT%H:%M:%SZ'; |
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 | |
#Author: Chandra Prakash Pathak | |
#Date: 23/02/2015 10:15 AM | |
#Always use strict and warnings in each Perl program | |
use strict; | |
use warnings; | |
use Selenium::Remote::Driver; | |
use Selenium::Remote::WDKeys qw(KEYS); | |
use Config::Simple; | |
use POSIX qw/strftime/; |
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 v5.12; | |
use strict; | |
use warnings; | |
use Test::More; | |
my %tests = ( | |
1 => "A", |
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 Glib qw/TRUE FALSE/; | |
use Gtk2 '-init'; | |
my $window=Gtk2::Window->new(); | |
$window->set_title("Image Resizer"); | |
$window->signal_connect('delete_event',sub{Gtk2::main_quit;}); |
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; | |
sub merge { | |
my($s, @b) = @_; | |
my(@a) = splice(@b, $s); | |
if (@a * @b == 0) { return @a, @b; } | |
my($head) = $a[0] < $b[0] ? shift(@a) : shift(@b); |
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 LWP::UserAgent; | |
use HTML::TreeBuilder::XPath; | |
my $stringsearch = "solutions"; | |
my $url = "http://www.matrixx.com/"; | |
my $ua = LWP::UserAgent->new; | |
my $response = $ua->get($url); |
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 LWP::UserAgent; | |
use Mojo::DOM; | |
my $date = localtime; | |
print "First page results for Google query on YouTube\nAuthor: Chankey Pathak (chankey\@cpan.org)\tDate: $date\n\n\n"; | |
my $url = q{http://www.youtube.com/results?search_query=google}; | |
my $ua = LWP::UserAgent->new( agent => 'Mozilla/5.0 (Windows NT 5.1; rv:10.0.1) Gecko/20100101 Firefox/10.0.1'); | |
my $get = $ua->get($url)->content; |
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 5.010; | |
use open qw(:locale); | |
use strict; | |
use utf8; | |
use warnings qw(all); | |
use Mojo::UserAgent; | |
my @urls = map { Mojo::URL->new($_) } qw( |