Skip to content

Instantly share code, notes, and snippets.

Andrew Solomon andrewsolomon

Block or report user

Report or block andrewsolomon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View catch.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
sub oops {
die "It happened";
}
@andrewsolomon
andrewsolomon / gitlog2graph.pl
Created Apr 15, 2019 — forked from bfs-dfs/gitlog2graph.pl
Transforming a git repository into a co-modification graph
View gitlog2graph.pl
#!/usr/bin/perl
# Converts a gitlog file to a list of edges in an undirected weighted graph
# Author: Aron Lurie
# Date: 2018-08-15
# Usage: git log --pretty=oneline --name-only | perl git.pl > mylogfile.txt
my @files = ();
my %adjacent = ();
while (<STDIN>) {
View car-04.pl
{
package Brand;
use Moo::Role;
has name => (
is => 'rw',
lazy => 1,
default => sub { die "name is required" }
);
View car-03.out
./car-03.pl
Use of uninitialized value in concatenation (.) or string at ./car-03.pl line 15.
This is a nice
View car-03.pl
{
package Brand;
use Moo::Role;
has name => ( is => 'rw', required => 1 ); # made rw
sub description { "This is a nice ". shift->name }
}
{
View car-02.pl
has name => ( is => 'ro', required => 1 );
# This will die: my $car = Car->new;
View car-02.out
> ./car-02.pl
This is a nice Peugeot
Missing required arguments: name at (eval 12) line 49.
@andrewsolomon
andrewsolomon / car-01.out
Created Dec 17, 2017
Output with an undefined attribute
View car-01.out
> ./car-01.pl
This is a nice Peugeot
Use of uninitialized value in concatenation (.) or string at ./car-01.pl line 15.
This is a nice
@andrewsolomon
andrewsolomon / car-01.pl
Created Dec 17, 2017
Role applied to the class
View car-01.pl
{
package Brand;
use Moo::Role;
has name => ( is => 'ro' );
sub description { "This is a nice ". shift->name }
}
{
View passing_in_undef.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dump 'pp';
sub foo {
my %args = (
@_
);
You can’t perform that action at this time.