Re: how to concatenate two lists

2010-09-20 Thread Shlomi Fish
On Monday 20 September 2010 09:49:27 rahul patil wrote: > Hello all, > > below is sample code i have written.Is it right way to declare ar4 which is > concatenation of ar and ar1 > > #!/usr/bin/perl > @ar = {"rahul","patil"}; You shouldn't use { ... } for arrays (this is not C). Use: my @ar = (

Re: how to concatenate two lists

2010-09-20 Thread Uri Guttman
> "PK" == Parag Kalra writes: PK> #!/usr/bin/perl PK> use strict; PK> use warnings; PK> my @ar = ("rahul","patil"); PK> my @ar1 = ("nitin"); PK> my @ar4; PK> push @ar4, (@ar, @ar1); PK> print "@ar4"; it is nice that you are trying to help but your code can be better. there is

Re: how to concatenate two lists

2010-09-20 Thread rahul patil
On Mon, Sep 20, 2010 at 1:30 PM, Chaitanya Yanamadala < dr.virus.in...@gmail.com> wrote: > @ar = ("rahul","patil"); > @ar1 = ("nitin"); > @ar4 = (@ar,@ar1); > > the only problem is u should not define the array with this { } it should > be defined within this brackets (); > > Chaitanya > > This wo

Re: how to concatenate two lists

2010-09-20 Thread Chaitanya Yanamadala
@ar = ("rahul","patil"); @ar1 = ("nitin"); @ar4 = (@ar,@ar1); the only problem is u should not define the array with this { } it should be defined within this brackets (); Chaitanya On Mon, Sep 20, 2010 at 1:19 PM, rahul patil wrote: > Hello all, > > below is sample code i have written.Is it

Re: how to concatenate two lists

2010-09-20 Thread Parag Kalra
#!/usr/bin/perl use strict; use warnings; my @ar = ("rahul","patil"); my @ar1 = ("nitin"); my @ar4; push @ar4, (@ar, @ar1); print "@ar4"; Cheers, Parag On Mon, Sep 20, 2010 at 12:49 AM, rahul patil wrote: > Hello all, > > below is sample code i have written.Is it right way to declare ar4 whi

how to concatenate two lists

2010-09-20 Thread rahul patil
Hello all, below is sample code i have written.Is it right way to declare ar4 which is concatenation of ar and ar1 #!/usr/bin/perl @ar = {"rahul","patil"}; @ar1 = {"nitin"}; @ar4 = {...@ar,@ar1}; print @ar4[2]; if yes, why it is not printing output as nitin on my system -- Regards, Rahul Patil