Click here to get back home

difference between $ and @

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
difference between $ and @ vimal 03-14-2008
Posted by vimal on March 14, 2008, 3:08 am
Please log in for more thread options
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

Posted by Peter Makholm on March 14, 2008, 3:12 am
Please log in for more thread options

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

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

//Makholm

Posted by vimal on March 14, 2008, 3:29 am
Please log in for more thread options
> > i am new to perl. i just want to know the difference between @ and $
> > prefixes for variables.
>
> http://search.cpan.org/~rgarcia/perl-5.10.0/pod/perldata.pod
>
> //Makholm

Thats a cool one and now i got that.

thank u

Posted by Tad J McClellan on March 14, 2008, 7:40 am
Please log in for more thread options
>> > i am new to perl. i just want to know the difference between @ and $
>> > prefixes for variables.
>>
>> http://search.cpan.org/~rgarcia/perl-5.10.0/pod/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.noitatibaher0cmdat/"

Posted by Jürgen Exner on March 14, 2008, 9:50 am
Please log in for more thread options
>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

Similar ThreadsPosted
What is the difference between if( -f $f ) and unless( -d $f )? October 25, 2004, 8:07 pm
FAQ 8.46: What's the difference between require and use? December 18, 2004, 12:03 pm
Difference between redirects January 22, 2005, 1:16 pm
FAQ 8.46 What's the difference between require and use? March 23, 2005, 12:03 pm
difference between two files April 1, 2005, 2:43 pm
FAQ 8.46 What's the difference between require and use? June 5, 2005, 11:03 am
FAQ 8.46 What's the difference between require and use? September 29, 2005, 4:03 am
FAQ 8.46 What's the difference between require and use? January 30, 2006, 12:03 pm
FAQ 8.46 What's the difference between require and use? February 7, 2006, 12:03 am
FAQ 8.46 What's the difference between require and use? September 12, 2006, 9:03 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap