Re: using join

2013-08-04 Thread Uri Guttman
On 08/04/2013 03:16 PM, Peter Gordon wrote: On Sun, 4 Aug 2013 07:10:59 +0100, timothy adigun wrote: my @fruits = qw( apple pear banana ) ; print join '', map "[$_]", @fruits ; now you can see each element surrounded by [] and then joined into one string for printing. you don't even need the j

Re: using join

2013-08-04 Thread Michael Rasmussen
On Sun, Aug 04, 2013 at 12:59:29PM +0800, *Shaji Kalidasan* wrote: > Greetings, > > I am facing some difficulty using join to display the array elements > > Here is the code snippet > > [code] > use strict; > use warnings; > > my @fruits = qw/apple mango orange banana guava/; > > print '[', jo

Re: using join

2013-08-04 Thread Shawn H Corey
On Sun, 4 Aug 2013 12:59:29 +0800 (SGT) *Shaji Kalidasan* wrote: > I am facing some difficulty using join to display the array elements > > Here is the code snippet > > [code] > use strict; > use warnings; > > my @fruits = qw/apple mango orange banana guava/; > > #print '[', join '][', @fruit

Re: using join

2013-08-04 Thread Peter Gordon
On Sun, 4 Aug 2013 10:40:47 +0100, timothy adigun wrote: > See the usage of "join", `perldoc -f join`,  what you wanted is >    my $str = join '', map "[$_]", @fruits; > say $str; Thanks Timothy, It was only after I copied join '', map "[$_]", @fruits; to the clipboard & entered it in a text editor

Re: using join

2013-08-04 Thread timothy adigun
Hi Peter, On Sun, Aug 4, 2013 at 8:16 PM, Peter Gordon wrote: > On Sun, 4 Aug 2013 07:10:59 +0100, timothy adigun wrote: > >my @fruits = qw( apple pear banana ) ; > >print join '', map "[$_]", @fruits ; > > > >now you can see each element surrounded by [] and then joined into > >one string for p

Re: using join

2013-08-04 Thread Shlomi Fish
Hi Peter, On Sun, 4 Aug 2013 19:16:32 GMT Peter Gordon wrote: > On Sun, 4 Aug 2013 07:10:59 +0100, timothy adigun wrote: > >my @fruits = qw( apple pear banana ) ; > >print join '', map "[$_]", @fruits ; > > > >now you can see each element surrounded by [] and then joined into > >one string for p

Re: using join

2013-08-04 Thread Peter Gordon
On Sun, 4 Aug 2013 07:10:59 +0100, timothy adigun wrote: >my @fruits = qw( apple pear banana ) ; >print join '', map "[$_]", @fruits ; > >now you can see each element surrounded by [] and then joined into >one string for printing. > >you don't even need the join if you are just printing it but i pu