Good afternoon,
To work, I suddenly need to know Perl, and although I did art many years ago, I seem to be completely lost. For the Haskell / Java programmer, all of these unstructured typings can be nervous.
However, I wrote this one sub, which should take an array of single-line strings and combine them into one, multi-line string. I had this:
sub unlines {
my ( @lines ) = @_;
my $str = "";
foreach $line ( @lines ) {
$str = join $str, chomp($line), "\n";
}
return $str;
}
And then I wanted to check it, of course:
print unlines(("GET / http1.1", "Host: localhost", ""));
And the result of the thing
000
And a lot of new lines. I have no idea why this is. Can someone help me and explain, perhaps, how all these arguments passed to subtitles in Perl work? It seems very interesting to work with things like @_and shift, but typing ... it's a nightmare.
Thank you for listening.
Lanbo