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...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.