On Fri, Jul 16, 2010 at 12:06 PM, Sharan Basappa
<sharan.basa...@gmail.com>wrote:

> Thanks, Vishal.
>
> I was confused with usage {}. So you are saying that it will
> dereference the array.
> Isn't @$tableRef not enough in that case?
>
> Regards,
> Sharan
>
>
> On Fri, Jul 16, 2010 at 3:33 PM, Vishal Gupta
> <vishal.knit2...@hotmail.com> wrote:
> > Hi Sharan,
> >
> > Please find below the answers:
> >
> > 1) what does @{$tableRef} really do?
> >
> > This will de-reference the "$tableRef", which is suppose to be an array
> > reference.
> >
> > 2) what does @table contain?
> >
> > @table will contains the original array, which is referenced by
> "$tableRef".
> >
> > Regards,
> > Vishal
> > ________________________________
> > Manage your finance and manage money through MSN Money Special Drag n'
> drop
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>
>
>
Hi Sharan,

Yes it is the same but for readability reasons is better to use the @{}
solution. Think about a complex structure you could get something like
@%$variable which looks more like you are cursing cartoon style
then writing code certainly if the data structure gets a little more complex
then that.
So in nice looking code and for prosperity (you will not believe how long
some scripts can remain in use, they can quite often remain in use many
years after you stop working for a company) we should as smart perl coders
always use the cleaner looking and easier to read @{ %{ $variable } } } even
though the other way might save a few key strokes.

Regards,

Rob

Reply via email to