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
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
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
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
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
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)
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
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
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
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
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
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
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
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
-
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
15 matches
Mail list logo