Perl Tutorial : Perl data types
Perl Tutorial : Perl Operators
Perl Tutorial : Perl loops
Perl Tutorial : Perl Conditionals
Perl Tutorial : Perl Subroutines
Perl Tutorial : Perl regex
Perl Tutorial : Perl Files
Perl Tutorial : Perl & Databases
Perl Tutorial : Perl OOPs
Perl Tutorial : Perl signals
Perl Tutorial : Perl threads
Perl Tutorial : Perl Debugging

Introcution to Perl CGI

Introduction to modperl
Home >>

Type Glob

  • If you prefix the name of a Perl variable with an '*', you can refer to ALL the Perl objects (scalars, arrays, filehandles, subroutines) which have that name
  • Called a type glob (since the * represents a $ or @ or %)
  • When a type glob is assigned to another type glob, object aliasing is set up.
  • It is recommended that type globs be used as lvalues only inside local(). Otherwise, you may clobber an existing variable!
     Ex:
    
             @x = (5, 6, 7);
             &sub1 (*x); 
                                       
             sub sub1
             {
               local (*array) = @_;
    
               # Now any references to @array in the subroutine
               #   are really references to the global array @x.
               # Be careful!  All objects with name x have been
               #   aliased.  References to $array inside the subroutine
               #   will reference a global $x; same with %array
               #   and %x.
               # But now any array operation (for example, push/pop)
               #   can be done on @array and the changes made to the
               #   global @x.
         
             }
    

    Perl functions

    scalars and strings

    lc
    ord

    regex (regular expressions)

    arrays

    shift
    split

    More..

    eval
  • Share |

    call a stored procedure
    Home
    perl hello world!

    Perl examples

  • How to use Data::Dumper?
  • How to parse config file?
  • Include external module in perl..
  • Download perl

    download stable version of perl
    Perl 5.10.1
    Perl interview Questions
    sed tutorial
    awk tutorial

    Join us on Google Groups

    Subscribe to perl
    Email:
    Visit this group
    Perl Jobs


    privacy | sitemap | disclaim | contact us
    © 2009 perlhome.com