Home: Perl Programming Help: Advanced:
*rc=0



db2lulu
New User

Jul 5, 2009, 12:24 AM


Views: 4983
*rc=0

Hi,
What does * mean here?
also rc|=0, how to interpret it?
thanks!


shawnhcorey
Enthusiast


Jul 5, 2009, 4:38 AM


Views: 4980
Re: [db2lulu] *rc=0


In Reply To
Hi,
What does * mean here?
also rc|=0, how to interpret it?
thanks!


The * gives access to the typeglob. See `perldoc perldata` and search for /typeglob/. In this case, it is aliasing the `our` variable $r with the special variable $0.

Code
#!/usr/bin/perl 

use strict;
use warnings;

our $r;
*r = 0;
print "This script name is $r\n";


$rc |= 0; means to bit-wise OR the variable $rc with 0 (zero). This is equivalent to: $rc = $rc | 0;

See `perldoc perlop` and search for /Assignment Operators/.

__END__

I love Perl; it's the only language where you can bless your thingy.

Perl documentation is available at perldoc.perl.org. The list of standard modules and pragmatics is available in perlmodlib.

Get Markup Help. Please note the markup tag of "code".


db2lulu
New User

Jul 5, 2009, 1:00 PM


Views: 4971
Re: [shawnhcorey] *rc=0

I got it! Great Thanks!