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
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
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
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
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
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
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
Uri,
On Sun, Aug 4, 2013 at 6:58 AM, Uri Guttman wrote:
> On 08/04/2013 01:44 AM, timothy adigun wrote:
>
>
>> OR some like to write it like so:
>> {
>> local $" = '][';
>> print '[', "@fruits", ']';
>> }
>>
>
> that is a poor idea. setting $" isn't needed to do a simple join.
>
Yes I agre
On 08/04/2013 01:44 AM, timothy adigun wrote:
OR some like to write it like so:
{
local $" = '][';
print '[', "@fruits", ']';
}
that is a poor idea. setting $" isn't needed to do a simple join.
but what no one has said is a more direct way to do this. you need map
and join but it is muc
On Sun, Aug 4, 2013 at 6:28 AM, timothy adigun <2teezp...@gmail.com> wrote:
>
> Hi,
> You want to read:
>
> On Sun, Aug 4, 2013 at 5:59 AM, *Shaji Kalidasan* wrote:
>
>> Greetings,
>>
>> I am facing some difficulty using join to display the array elements
>>
>> Here is the code snippet
>>
>> [code
o God.
---
From: timothy adigun <2teezp...@gmail.com>
To: *Shaji Kalidasan*
Cc: Perl Beginners
Sent: Sunday, 4 August 2013 10:58 AM
Subject: Re: using join
Hi,
You want to read:
On Sun, Aug 4, 2013 at 5:59 AM, *Shaji Kalida
o God.
---
From: Michael Rasmussen
To: *Shaji Kalidasan*
Cc: Perl Beginners
Sent: Sunday, 4 August 2013 10:37 AM
Subject: Re: using join
On Sun, Aug 04, 2013 at 12:59:29PM +0800, *Shaji Kalidasan* wrote:
> Greetings,
>
> I am facing s
Hi,
You want to read:
On Sun, Aug 4, 2013 at 5:59 AM, *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/;
>
> #pri
13 matches
Mail list logo