OK one more try:
This is valid JS Code: ¹
var fruits = ["Banana", "Orange", "Apple", "Mango"]; document.write(fruits.push("Kiwi") + "<br />"); document.write(fruits.push("Lemon","Pineapple") + "<br />"); document.write(fruits);
this is still valid JS-Code
var $fruits = ["Banana", "Orange", "Apple", "Mango"]; document.write($fruits.push("Kiwi") + "<br />"); document.write($fruits.push("Lemon","Pineapple") + "<br />"); document.write($fruits);
with the help of autobox this could become valid perl code:
my $fruits = ["Banana", "Orange", "Apple", "Mango"]; document->write($fruits->push("Kiwi") + "<br />"); document->write($fruits->push("Lemon","Pineapple") + "<br />"); document->write($fruits);
or maybe better without overloading +
my $fruits = ["Banana", "Orange", "Apple", "Mango"]; document->write($fruits->push("Kiwi") . "<br />"); document->write($fruits->push("Lemon","Pineapple") . "<br />"); document->write($fruits);
Real world enough for you???
Cheers Rolf
¹) from my first google hit on "javascript push" http://www.w3schools.com/jsref/jsref_push.asp
UPDATE: corrected . to ->
In reply to Re^4: What are the drawbacks of autobox?
by LanX
in thread What are the drawbacks of autobox?
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |