in reply to over loading
If you've used strict and wanrings instead Perl would ask you to intervene and check if there is something it thinks is suspicious "in this case the same variable having been set twice". I am just giving you a very simple example to illustrate this concept but this is the norm of the other data types in Perl too.$number = 3; $number = 4; $string = "Hello"; $string ++ print "$var\n"; #would print 4 and overwrite 3. print "$string"; #prints "hellp" and you don't know why "hello" didn' +t print
The same concept can be stretched further to subroutines naming and conventions so be careful and happy Perl Programming :)
(UPDATED): Made some amendment to cover two scenarios.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: over loading
by GrandFather (Saint) on Aug 20, 2009 at 21:41 UTC |