in reply to subroutine function
First off fellow monk understand just what you are doing here.
Those dots you are referring to are the string concatenation operator. Each operator has a left hand side and a right hand side. I won't even start getting into precedence here since it reall y doesn't matter all that much.
In the above example when $thing is printed it will result in "CocaCola" being printed.my $thing = "Coca" . "Cola";
As far as the variables them selves consider this code block:
that will give you the same result asmy ($left,$right)=@_;
which is the same asmy $left=$_[0]; my $right=$_[1];
but not necessarily the same asmy $left = shift @_; my $right = shift @_;
# # NEVER ASSUME!!! my $right = pop @_; my $left = pop @_; # # You may not get the result you are after!!
Clear as mud?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: subroutine function
by tobyink (Canon) on Oct 11, 2012 at 19:55 UTC | |
by runrig (Abbot) on Oct 11, 2012 at 20:43 UTC | |
|
Re^2: subroutine function
by bimleshsharma (Beadle) on Oct 12, 2012 at 09:46 UTC | |
by Mr. Muskrat (Canon) on Oct 12, 2012 at 14:28 UTC | |
|
Re^2: subroutine function
by truthseeker66 (Novice) on Oct 11, 2012 at 19:52 UTC |