Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: If I was forced to program in another language, the Perl language feature I would miss most would be:

by Mutant (Priest)
on Oct 17, 2006 at 09:00 UTC ( #578714=note: print w/replies, xml ) Need Help??


in reply to If I was forced to program in another language, the Perl language feature I would miss most would be:

Actually, the big one for me that's missing is autovivification.

The other day I had a list of co-ordinates (pulled from a DB as a record set). To put them into a grid, I simply did this:
my @grid; foreach my $rec (@records) { $grid[$rec->{x}][$rec->{y}] = $rec; }
That would've been a lot harder in most other languages.
  • Comment on Re: If I was forced to program in another language, the Perl language feature I would miss most would be:
  • Download Code

Replies are listed 'Best First'.
Re^2: If I was forced to program in another language, the Perl language feature I would miss most would be:
by ikegami (Patriarch) on Oct 17, 2006 at 15:24 UTC

    Adding

    grow(grid, $rec->{x}); grow(grid[$rec->{x}], $rec->{y});

    is not that complicated. Personally, I wish auto-vivification was off by default, and togglable using a lexical pragma.

Re^2: If I was forced to program in another language, the Perl language feature I would miss most would be:
by jgamble (Pilgrim) on Oct 17, 2006 at 18:55 UTC

    I probably wouldn't have voted for autoviv if it were on the list, but the one time I needed it (as opposed to "cute, but wasn't necessary") it saved me the bother of writing a whole other subroutine. So yeah, can be very useful.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://578714]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2023-03-26 06:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (63 votes). Check out past polls.

    Notices?