Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Difference between my() and $var = false

Reply
Thread Tools

Difference between my() and $var = false

 
 
Jason C
Guest
Posts: n/a
 
      12-14-2011
Is there a technical difference between these two?

my($var);
$var = false;
 
Reply With Quote
 
 
 
 
Jason C
Guest
Posts: n/a
 
      12-14-2011
On Tuesday, December 13, 2011 11:52:27 PM UTC-5, Jason C wrote:
> Is there a technical difference between these two?
>
> my($var);
> $var = false;


Or, well, I guess I should say $var = undef, not $var = false. Sorry, I haven't really programmed in Perl in awhile.
 
Reply With Quote
 
 
 
 
Mart van de Wege
Guest
Posts: n/a
 
      12-14-2011
Jason C <(E-Mail Removed)> writes:

> Is there a technical difference between these two?
>
> my($var);
> $var = false;


The first declares a lexically scoped variable.

The second declares a global variable (and will die on 'use strict').

Mart

--
"We will need a longer wall when the revolution comes."
--- AJS, quoting an uncertain source.
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      12-14-2011
Jason C <(E-Mail Removed)> wrote:
>Is there a technical difference between these two?
>
>my($var);
>$var = false;


Hmmmm, do they have anything in common?

jue
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
False positive, false intrusion, false alarm Nick Computer Security 3 04-26-2006 07:40 PM
Difference between bin and obj directories and difference between project references and dll references jakk ASP .Net 4 03-22-2005 09:23 PM
false instance and false class and set_trace_func trans. (T. Onoma) Ruby 1 09-25-2004 06:01 PM
false instance and false class and set_trace_func trans. (T. Onoma) Ruby 0 09-25-2004 05:34 PM
difference between return true; and return false; w i l l Javascript 4 07-04-2003 10:05 PM



Advertisments