freefox <robert.lo...@privat.utfors.se> asked:
> As join is a build in I guess it should/could be called without
> parenthesis.
> However these two lines gives me two different answers.
> 
> my @strings = ('foo', 'bar');
> 
> my $string1 = q{('} . join q{', '}, @strings . q{')};
> my $string2 = q{('} . join(q{', '}, @strings) . q{')};
> 
> print "$string1\n";
> print "$string2\n";
> 
> Output:
> ('2')
> ('foo', 'bar')
> 
> Anyone who knows/understands why?

See http://perl.plover.com/context.html for a complete explanation.

HTH,
Thomas



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to