food for thought

User: david-delikat
Date: 1/15/2013 7:13 pm
Views: 304
Rating: 2    Rate [
|
]


food-for-thought.pdf food-for-thought.pdf

Replies

Flat
Re: food for thought
User: david-delikat
Date: 1/26/2013 8:52 pm
Rating: -1    Rate [
|
]
Status: Approved

I thought of another positive point to idea in this presentation.

--begin recap or presentation--

given $x is an array reference the array can be accessed using

$x->@

while this is not handy for a simple scalar it is handy for complicated structures: 

$a->{c}[1]{q}->@

it has a nice left to right syntax

--end recap--

also for subs that return an array or results, rather than use wantarray inside the sub, just return an arrayref and use the new syntax:

mySub(parm0,parm1)->@

again a nice left to right syntax.

I like this better than using wantarray because with wantarray you never get what you want from this:

doSomething(

    parm => $value,

     parm2 => subReturnsList($parm),

  );


PreviousBackNext
Madison Area Perl Mongers