CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



db2lulu
New User

Jul 5, 2009, 12:24 AM

Post #1 of 3 (2595 views)
*rc=0 Can't Post

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


shawnhcorey
Enthusiast


Jul 5, 2009, 4:38 AM

Post #2 of 3 (2592 views)
Re: [db2lulu] *rc=0 [In reply to] Can't Post


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

Post #3 of 3 (2583 views)
Re: [shawnhcorey] *rc=0 [In reply to] Can't Post

I got it! Great Thanks!

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives