CGI/Perl Guide
|
Learning Center
|
Forums
|
Advertise
|
Login
Site Search:
in
Perl Guide
PerlGuru Forums
Learning Ctr
MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN
Home
:
Perl Programming Help
:
Beginner
:
String comparisons... which is better?
Print Thread
Calab
Novice
Aug 29, 2012, 10:36 PM
Post #1 of 3 (1281 views)
String comparisons... which is better?
Can't Post
When doing a string comparison, which is better?
if ( $mystring eq 'abc' )
...or...
if ( "$mystring" eq 'abc' )
???
Laurent_R
Veteran / Moderator
Aug 30, 2012, 1:45 AM
Post #2 of 3 (1280 views)
Re: [Calab] String comparisons... which is better?
[
In reply to
]
Can't Post
Both versions will work, but I would use the first one, which is simpler and more natural.
BillKSmith
Veteran
Aug 30, 2012, 4:40 AM
Post #3 of 3 (1271 views)
Re: [Calab] String comparisons... which is better?
[
In reply to
]
Can't Post
Read the FAQ: perldoc -q "What's wrong with always quoting"
Good Luck,
Bill
Announcements
PerlGuru Announcements
Perl Programming Help
Frequently Asked Questions
Beginner
Intermediate
Advanced
Regular Expressions
mod_perl
DBI
Win32 Programming Help
Fun With Perl
Perl Quizzes - Learn Perl the Fun Way
Perl Golf
Perl Poetry
Need a Custom or Prewritten Perl Program?
I need a program that...
I Need a Programmer for Freelance Work
Throw Down The Gauntlet
General Discussions
General Questions
Feedback
Tutorial/Article Suggestions for The Learning Cent
Internet Security
Other Programming Languages
Javascript
PHP
Search
this forum
this category
all forums
for
All words
Any words
Whole Phrase
(
options
)
Powered by
Gossamer Forum v.1.2.0
Web Applications
&
Managed Hosting
Powered by Gossamer Threads
Visit our
Mailing List Archives