From 7e138ee6bb2909b6cf4930dbbafb732d159d8483 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Thu, 17 Jun 2010 19:15:33 +0200 Subject: [PATCH] added code examples --- README | 4 ++++ public/code/Cited Author.cleanup.pl | 4 ++++ public/code/Year.add_century.pl | 3 +++ public/code/autor.add_autors_count.pl | 1 + 4 files changed, 12 insertions(+) create mode 100644 public/code/Cited Author.cleanup.pl create mode 100644 public/code/Year.add_century.pl create mode 100644 public/code/autor.add_autors_count.pl diff --git a/README b/README index 80f414b..60f9b7a 100644 --- a/README +++ b/README @@ -65,3 +65,7 @@ array of values if you are creating new columns, even for single value. $_ = uc $_; # assigment is needed to modify value! } +Code examples are stored in public/code + +They use Column name.description.pl notatition so only snippets which have applicable +column will be shown. diff --git a/public/code/Cited Author.cleanup.pl b/public/code/Cited Author.cleanup.pl new file mode 100644 index 0000000..f709afa --- /dev/null +++ b/public/code/Cited Author.cleanup.pl @@ -0,0 +1,4 @@ +map { + s/^\.+//; + $_ = uc $_; +} @{ $rec->{'Cited Author'} }; diff --git a/public/code/Year.add_century.pl b/public/code/Year.add_century.pl new file mode 100644 index 0000000..c5b3c06 --- /dev/null +++ b/public/code/Year.add_century.pl @@ -0,0 +1,3 @@ +foreach my $year ( @{ $row->{Year} } ) { + push @{ $row->{century} }, int($year/100)+1; +} diff --git a/public/code/autor.add_autors_count.pl b/public/code/autor.add_autors_count.pl new file mode 100644 index 0000000..92b624b --- /dev/null +++ b/public/code/autor.add_autors_count.pl @@ -0,0 +1 @@ +$row->{autors_count} = [ $#{ $row->{autor} } + 1 ]; -- 2.20.1