I'm coming from the other direction. I learned JavaScript first, and then Perl. Actually, the very first language I learned was BASIC, but it's amazing how many commonalities these languages share. Perl is a bit more like BASIC in the way it treats strings. You can do something like this : MID$(A$, 8, 1) = "A" in BASIC, which is the same as vec($A, 8, 8) = 65; in Perl. However, you can't do this in JavaScript. To achieve it anyway, you have to split the original string into two parts and add them together with the new "A" in the middle. This requires more memory, of course.

In Perl, you can access the command line through the @ARGV array. In BASIC, you can do it from COMMAND$ and there's a way to do it in JavaScript as well, but it varies depending on the application. For example in a HTA program, you would do it like this:

<HTA:APPLICATION ID="objTestHTA" ...>
</HEAD>

<SCRIPT>

alert( objTestHTA.commandLine );

</SCRIPT>

If you happen to write JavaScript for Node.js environment, then you'd use an array called process.argv to access the commandline arguments...


In reply to Re: A comparison of Perl vs. JavaScript -- a reference table. by harangzsolt33
in thread A comparison of Perl vs. JavaScript -- a reference table. by taint

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":