after writing perl scripts for about 3 years now, I still have trouble with the
basic datatypes.
I know that variables that start with '$' are scalars.
This covers Hashes ($HASH{$key}), Arrays ( $_[0] ), and
regular scalar values ( $foobar );
The code I write as well other's code is still unreadable to me even though I have followed examples from the Camel book, many other Perl books from O'Reilly and online references. I have also used perldoc on many occasions.
There are still some things that haven't sunk in, such as:
If I want to add Hash keys to another Hash, I do the following:
%HASH = ( 1 => 'one' ); #NO BRACES OR ELSE....
%HASH2 = ( 2 => 'two' ); AGAIN, NO BRACES OR ELSE...
@HASH2{ keys %HASH } = "";
#confusing, considering it's the symbol used for arraysTo get the length of an array, it's $#array, not [EMAIL PROTECTED] or #$array. Usually, I use scalar @array;
Problems with subroutines where the array is the first argument
sub badsub()
{
my (@array,$scalar) = @_;
#Pass Array last!
#my ($scalar,@array) = @_:
...
}I still don't know how to declare arrays using only '$' instead of '@'
anyway, Is it possible to write scripts using only '$' instead of other prefix symbols?
In other words, a php-style script written in perl
Thanks in advance. -gohaku
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>
