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
:
Fun With Perl
:
Perl Quizzes - Learn Perl the Fun Way
:
Aha vs. Doh
Print Thread
perlplexer
Deleted
Nov 30, 2000, 4:46 AM
Post #1 of 3 (47532 views)
Aha vs. Doh
Can't Post
What does the following code print and _why_?
----------------------Cut-------------------------------
print "aha\n" and exit if (my $foo = 1 and $foo == 1);
print "doh\n";
----------------------Cut-------------------------------
sleuth
Enthusiast
Dec 1, 2000, 9:35 PM
Post #2 of 3 (47532 views)
Re: Aha vs. Doh
[
In reply to
]
Can't Post
It prints "Doh",
Becaaaaause, $foo != 1, it isn't defined.
That's a great one, :)
Sleuth
perlplexer
Deleted
Dec 4, 2000, 5:19 AM
Post #3 of 3 (47532 views)
Re: Aha vs. Doh
[
In reply to
]
Can't Post
Yes, sleuth, you are correct!
'my $var' declarations do not become "visible" until after the current statement...
perlplexer
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