Earlier quoted context omitted.
They look fine to me and it also look good written in Perl :) use List::Util qw(sum max min); # 1 map { $_ * 2 } 1..10; # 2 sum 1..1000; # 3 my @wordlist = ("scala", "akka", "play framework", "sbt", "typesafe"); my $tweet = "This is an example tweet talking about scala and sbt."; grep { $tweet =~ m/\b$_\b/ } @wordlist; # 4 my $file_text = do { local $/ = undef; open my $fh, ' }; chomp( my @file_lines = do { open my $…
my $file_text = do { local $/ = undef; open my $fh, ' }; I have absolutely no idea what this line does. local? undef? ' ? This is how you read a file in Perl?
Nope. I use Path::Class from CPAN...
use Path::Class 'file';
my $file_text = file('data.txt')->slurp;