Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: What does my ($data) = @_ mean?

by wolv (Pilgrim)
on May 16, 2004 at 22:19 UTC ( [id://353827]=note: print w/replies, xml ) Need Help??

in reply to What does my ($data) = @_ mean?

I recommend that you get your hands on some good documentation. Perldoc ("perldoc perl" on your commandline/shell) will be always helpful. I also recommend Beginning Perl (available online), which is a really good book for Perl beginners.

Replies are listed 'Best First'.
Re: Re: What does my ($data) = @_ mean?
by Anonymous Monk on May 18, 2004 at 11:07 UTC
    Had I posted this, I would have lost all my points! Anyway, here is the explaination:

    my = declare a variable.
    $data = variable name.
    () = similar to shift or pop.
    @_ = an array that you populate and send it off to a sub routine or a function.

    $var = 'some sort of data'; &My_Sub($var); sub My_Sub { my($data) = @_; Print $data . "\n"; } output: some sort of data

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://353827]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-05-20 05:50 GMT
Find Nodes?
    Voting Booth?

    No recent polls found