Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

  > join(‘,’,@{$foo->{‘bar’}})
Thank you for that example. I guess the equivalent in JavaScript is:

  foo.bar.join(',')


Correct. You can use libraries in Perl (autobox and a class offering "join") so you can write it in Perl as:

   $foo->{bar}->join(',')
I've done that in FunctionalPerl[1]:

  use FunctionalPerl ":autobox";
  my $foo= {bar=> ["hi", "there"]};
  is $foo->{bar}->join(','),
     'hi,there';
[1] https://metacpan.org/pod/FunctionalPerl




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: