better hachage

Discussion in 'Perl Misc' started by john.swilting, Aug 23, 2007.

  1. 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___"
    );
     
    john.swilting, Aug 23, 2007
    #1
    1. Advertising

  2. john.swilting <> wrote:

    > 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.


    --
    Tad McClellan
    email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
     
    Tad McClellan, Aug 24, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dot_net_junky

    Which is better, C# or C++?

    dot_net_junky, Feb 9, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    447
    Tor B├ądshaug
    Feb 14, 2005
  2. Peter Bencsik
    Replies:
    2
    Views:
    839
  3. Andrew Thompson
    Replies:
    8
    Views:
    154
    Premshree Pillai
    Jun 7, 2005
  4. Alextophi
    Replies:
    2
    Views:
    89
    Alextophi
    Sep 1, 2005
  5. Replies:
    2
    Views:
    56
    Mark H Harris
    May 13, 2014
Loading...

Share This Page