better hachage

J

john.swilting

I know this type of writing.
which is the best style

#!/usr/bin/perl -w

use strict;
use warnings;

my %Conf = (
XferMethod => "rsync",
XferLogLevel => "1",
RsyncShareName => "___1___",
ClientNameAlias => "___2___"
);
 
T

Tad McClellan

john.swilting said:
which is the best style

#!/usr/bin/perl -w

#!/usr/bin/perl


use strict;
use warnings;


Lexical warnings are better than the -w switch.

my %Conf = (
XferMethod => "rsync",
XferLogLevel => "1",
RsyncShareName => "___1___",
ClientNameAlias => "___2___"
);


my %Conf = (
XferMethod => 'rsync',
XferLogLevel => '1',
RsyncShareName => '___1___',
ClientNameAlias => '___2___'
);


Double quotes give you 2 things beyond what single quotes give you,
variable interpolation and backslash escapes.

It is misleading (ie. bad style) to use double quotes when you are
not making use of one of those two things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top