$_ is the default scalar variable (sort of).  Perl will sometimes set this
variable for you so that you don't need to create your own.  It's just a
shortcut of sorts.  Here is an example...

foreach ( @list ) {
        print $_;
}

For each item in the array @list Perl will set the variable $_ to the value
of that item.  You can then just use it.  ...And actually the "print"
function works on $_ by default.  So this is the same as above...

foreach ( @list ) {
        print;
}

It just saves typing.

@_ is the default array.  Under certain circumstances Perl will set this for
you, like when you call a subroutine, and sometimes a function uses @_ by
default.  Again, it saves some typing.

"use Quantum::Entanglement" tells Perl to load the "Quantum::Entanglement"
library which will allow you to use it's functionality.  The way you use the
functionality depends on how the author of the library set it up.  You can
access tons of libraries and their documentation at www.cpan.org.

Rob



-----Original Message-----
From: Anthony LaBerge [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 12:55 PM
To: [EMAIL PROTECTED]
Subject: Syntax of Messages


I'm a new subscribee, and also an Extream Newbie at perl, so I'm having 
trouble understanding the syntax of the coding, You use $_, @_, and 
other things that I do not quite understand. There is also one more 
thing I donot understand, that is: What are the 
' use Quantum::Entanglement ' lines in the code?

Thanks for your help.

Another Message
>From The Webmaster
At LabAnt.net


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to