Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > difference between $ and @

Reply
Thread Tools

difference between $ and @

 
 
vimal
Guest
Posts: n/a
 
      03-14-2008
hi monks,

i am new to perl. i just want to know the difference between @ and $
prefixes for variables.

when should i use $ and @ as prefix.
an example may be a little useful


regards,

vimal
 
Reply With Quote
 
 
 
 
Peter Makholm
Guest
Posts: n/a
 
      03-14-2008
vimal <(E-Mail Removed)> writes:

> i am new to perl. i just want to know the difference between @ and $
> prefixes for variables.


http://search.cpan.org/~rgarcia/perl...d/perldata.pod

//Makholm
 
Reply With Quote
 
 
 
 
vimal
Guest
Posts: n/a
 
      03-14-2008
On Mar 14, 12:12 pm, Peter Makholm <(E-Mail Removed)> wrote:
> vimal <(E-Mail Removed)> writes:
> > i am new to perl. i just want to know the difference between @ and $
> > prefixes for variables.

>
> http://search.cpan.org/~rgarcia/perl...d/perldata.pod
>
> //Makholm


Thats a cool one and now i got that.

thank u
 
Reply With Quote
 
Tad J McClellan
Guest
Posts: n/a
 
      03-14-2008
vimal <(E-Mail Removed)> wrote:
> On Mar 14, 12:12 pm, Peter Makholm <(E-Mail Removed)> wrote:
>> vimal <(E-Mail Removed)> writes:
>> > i am new to perl. i just want to know the difference between @ and $
>> > prefixes for variables.

>>
>> http://search.cpan.org/~rgarcia/perl...d/perldata.pod
>>
>> //Makholm

>
> Thats a cool one and now i got that.



If you had perl installed, then you already had that, as perl ships
and installs that document, along with a boatload of other docs.


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      03-14-2008
vimal <(E-Mail Removed)> wrote:
>hi monks,


What does religious asceticism have to do with Perl?

>i am new to perl. i just want to know the difference between @ and $
>prefixes for variables.


See the first page or so of perldoc perldata. It is a rather terse but
well-written introduction into that subject matter.

>when should i use $ and @ as prefix.


Use $ whenever you are talking about a single value aka scalar. Use @ when
you are talking about a collection of values which is indexed by consecutive
natural numbers.

>an example may be a little useful


perldoc perldata has numerous examples.

jue
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FAQ 7.17 What's the difference between dynamic and lexical (static) scoping? Between local() and my()? PerlFAQ Server Perl Misc 0 04-15-2011 04:00 AM
FAQ 7.17 What's the difference between dynamic and lexical (static) scoping? Between local() and my()? PerlFAQ Server Perl Misc 0 01-06-2011 05:00 PM
difference between between these "char"s arnuld C++ 33 03-05-2007 03:11 PM
Difference between bin and obj directories and difference between project references and dll references jakk ASP .Net 4 03-22-2005 09:23 PM
Exact difference between 'const char *' and 'char *', also diff between 'const' and 'static' Santa C Programming 1 07-17-2003 02:10 PM



Advertisments