--- Paul Johnson <[EMAIL PROTECTED]> wrote:
> On Fri, Sep 07, 2001 at 06:33:23AM -0400, agc wrote:
> > what does &extra' mean? or for example &extra'itemstotalbe(scalar, 
> > @colwith)
> > in genral what does the &<>' mean?
> 
> ' is the old (pre Perl 5) way of writing ::    - it is obsolete

It's going away in Perl 6.  This, of course, has dire implications for the D'oh! module
(http://theoryx5.uwinnipeg.ca/CPAN/data/D-oh/D/oh.html)

> & is the old (pre Perl 5) way of calling a sub - it is obsolete in most cases

This might also go the way of the d'ohd'oh (ooh, that was bad) in Perl 6, but I think 
it's still
up in the air (don::t quote me on that (ooh, that was worese)).  However, it behaves 
much
differently from calling a sub with parentheses and programmers should be aware of 
that.

If a sub is called with a leading ampersand and *no* parenthese, the current value of 
@_ is passed
to the sub that is called:

    foo(5);

    sub foo {
        &bar;
    }

    sub bar {
        print $_[0];
    }

That will print "5".  However, if &bar is changed to bar(), it will print nothing, 
because no
arguments are passed.  This can introduce some very annoying bugs if one is not aware 
of this
feature.

Cheers,
Curtis "Ovid" Poe

=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/

__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

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

Reply via email to