A bit off topic, but a best practice:

On Wed, Feb 17, 2016 at 5:54 AM, Rui Fernandes <rui.kep...@gmail.com> wrote:

>
> my $VAR1 = {
>           'group1' => '10.100.27.52',
>           'group2' => '10.100.27.53',
>           'group3' => '10.100.27.54',
>           'group4' => '10.100.27.55',
>           'group5' => '10.100.27.56',
>           'group6' => '10.100.27.57' #Last element has no comma...
>
>         };


is to leave that last comma *on* the last element for lists like that.
What often happens is you go to add another "group" here, copy/paste the
last line and change it

my $VAR1 = {
          'group1' => '10.100.27.52',
          'group2' => '10.100.27.53',
          'group3' => '10.100.27.54',
          'group4' => '10.100.27.55',
          'group5' => '10.100.27.56',
          'group6' => '10.100.27.57' #Last element has no comma...
          'group7' => '10.100.27.57' #Last element has no comma...
        };


and now you have a syntax error. You can leave the last element's comma,
Perl will basically ignore it in building the hash (or array)

-- 

a

Andy Bach,
afb...@gmail.com
608 658-1890 cell
608 261-5738 wk

Reply via email to