Re: perl reference

2011-07-31 Thread Rob Dixon
On 31/07/2011 00:55, Rob Dixon wrote: It may be helpful here to read and understand perldoc "What is the difference between a list and an array" That should be perldoc -q "What is the difference between a list and an array" Rob -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org F

Re: perl reference

2011-07-30 Thread Rob Dixon
On 29/07/2011 23:57, Rajeev Prasad wrote: Hello, from here: http://www.troubleshooters.com/codecorn/littperl/perlsub.htm i found: In Perl, you can pass only one kind of argument to a subroutine: a scalar. To pass any other kind of argument, you need to convert it to a scalar. You do that by pa

Re: perl reference

2011-07-30 Thread Emeka
Timo, Noted!...However, one could work that into his code. #!/usr/bin/perl -wl use strict; my @voo = ("boon", 12, "man"); # note this 3 elements array die "Must be even elements" if @voo % 2; my %coo = @voo; while(my ($key, $val) = each %coo){ $line.="$key => $val\n"; } print $line; Emeka

Re: perl reference

2011-07-30 Thread timothy adigun
Emeka, Yes in a way, but the point am making here is that one can also pass hash into a subroutine. Context is everything in Perl! Caution has to be taken however when converting array into hash. Hash elements must be even in number, whereas odd numbers of elements could be in array, one is passin

Re: perl reference

2011-07-30 Thread John W. Krahn
Rajeev Prasad wrote: Hello, Hello, from here: http://www.troubleshooters.com/codecorn/littperl/perlsub.htm i found: In Perl, you can pass only one kind of argument to a subroutine: a scalar. To pass any other kind of argument, you need to convert it to a scalar. You do that by passing a re

Re: perl reference

2011-07-30 Thread Emeka
Timo, One can even pass hash to a subroutine with a little trick, 'cos the default argument of a subroutine is an array "@_". ** Check Example 2, in the code below. I think this trick is formalized by context rule. @voo = ("boon", 12, "man", 88); %coo = @voo; my $line = ""; while(my ($key, $val)

Re: perl reference

2011-07-29 Thread shawn wilson
As you can see, the answer is a bit more complex than it would seem. If you go by what ref() says, there 4+. If you go by their fundamental structure there are just scalar they are interpolated into whatever it should be. That said, when you deal with most things, using references are the best. It

Re: perl reference

2011-07-29 Thread timothy adigun
Hi Rajeev, with the link you provided, the statement "In Perl, you can pass only one kind of argument to a subroutine: a scalar... a pointer (sort of)." was made Reference sub-topic. So, it will not be a total truth that one can pass "only" one kind of argument to subroutine. Generally in perl the

Re: perl reference

2011-07-29 Thread Jim Gibson
On 7/29/11 Fri Jul 29, 2011 3:57 PM, "Rajeev Prasad" scribbled: > Hello, > > from here: http://www.troubleshooters.com/codecorn/littperl/perlsub.htm > > i found: > > In Perl, you can pass only one kind of argument to a subroutine: a scalar. > To pass any other kind of argument, you need to c

perl reference

2011-07-29 Thread Rajeev Prasad
Hello, from here: http://www.troubleshooters.com/codecorn/littperl/perlsub.htm i found: In Perl, you can pass only one kind of argument to a subroutine: a scalar. To pass any other kind of argument, you need to convert it to a scalar. You do that by passing a reference to it. A reference to anyt

Re: Perl Reference Books.

2010-03-22 Thread Shawn H Corey
Greg Kurts wrote: > http://learn.perl.org/books.html has a good listing of books for all levels. > > > These two are pretty standard for folks new to Perl: > > http://www.amazon.com/Learning-Perl-5th-Randal-Schwartz/dp/0596520107/ref=sr_1_1?ie=UTF8&s=books&qid=1269272420&sr=1-1 > http://www.amaz

Re: Perl Reference Books.

2010-03-22 Thread Greg Kurts
http://learn.perl.org/books.html has a good listing of books for all levels. These two are pretty standard for folks new to Perl: http://www.amazon.com/Learning-Perl-5th-Randal-Schwartz/dp/0596520107/ref=sr_1_1?ie=UTF8&s=books&qid=1269272420&sr=1-1 http://www.amazon.com/Programming-Perl-3rd-Larr

Re: Perl Reference Books.

2010-03-22 Thread Dermot
On 22 March 2010 15:31, wrote: > Hi, I am a new to Perl programming, please can anyone advice me right book to > understand Perl. Hello and Welcome, > Thanks, > Prasad Prabhakara > Infrastructure Applications > Cell:480-889-4171 > Phone:83-6041 If you checkout the footer that it appened to yo

Perl Reference Books.

2010-03-22 Thread Prasad . Prabhakara
Hi, I am a new to Perl programming, please can anyone advice me right book to understand Perl. Thanks, Prasad Prabhakara Infrastructure Applications Cell:480-889-4171 Phone:83-6041 Email Firewall made the following annotations -

Perl reference

2001-08-01 Thread Romek KrisztiƔn
Hello! I would like to offer you this reference. I've downloaded that and looked very easy to use! http://freshmeat.net/projects/perl-reference/ About: Perl-reference is a program to quickly display reference documentation for a Perl function, variable, regexp operator, or language ke