Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: (what are the evils of quoting lone scalars?) Re: Re: Should be simple, What don't I see?

by Abigail-II (Bishop)
on Jun 14, 2002 at 12:18 UTC ( #174471=note: print w/replies, xml ) Need Help??


in reply to (what are the evils of quoting lone scalars?) Re: Re: Should be simple, What don't I see?
in thread Should be simple, What don't I see?

I don't understand your update. Is it a specific version if "why would anyone make a mistake"? I wouldn't know, but I'll keep warnings enabled and continue using strict anyway. Or do you mean why would they do:
foo = "$foo" if ref $foo;
In that case, I don't see what that has to do with the thread.

Needless quoting of scalar is evil. You get into a habit where you easily make a mistake. Like quoting a ref. It might go well 99 times, but you are getting bitten the 100th time.

Abigail

  • Comment on Re: (what are the evils of quoting lone scalars?) Re: Re: Should be simple, What don't I see?
  • Download Code

Replies are listed 'Best First'.
Re: Re: (what are the evils of quoting lone scalars?) Re: Re: Should be simple, What don't I see?
by crazyinsomniac (Prior) on Jun 14, 2002 at 12:34 UTC
      Do you really consider my $email = "$firstName" . "_" . "$lastName\@email.com"; quoting of a lone scalar?

      I think it is, especially when you could just as well do:

      my $email = "$firstName\_$lastName\@email.com"; or ............"${firstName}_$lastName\@email.com";

      runrig - who has been doing too much VBScripting lately and is really appreciating perl's string interpolation.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2019-06-24 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Is there a future for codeless software?



    Results (100 votes). Check out past polls.

    Notices?