Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Curious about Perl's strengths in 2018

by harangzsolt33 (Friar)
on Dec 13, 2019 at 17:33 UTC ( #11110077=note: print w/replies, xml ) Need Help??


in reply to Re: Curious about Perl's strengths in 2018
in thread Curious about Perl's strengths in 2018

I think, part of what really makes any scripting language great is what it can be used for and the number of computers it can run on.

I think, the language that comes closes to Perl is JavaScript. JavaScript can run inside any computer browser even in cell phones, which is why it is such a popular language. But it is used for client-side scripting mostly. In Windows, some HP printer setup programs are written entirely in JavaScript, which is very cool. But these scripts will only work on Windows!

The JavaScript that runs in a web browser vs the one that installs HP printer drivers run on different levels. The latter one requires administrator privilege to run. The former one is not even allowed to access files on the user's hard drive! So, JavaScript is very limited in a sense. When working with binary files, Perl can easily read just the first 512 bytes of a 5gb iso file. JavaScript cannot do that. It would try to read the entire file first, and there's nothing you can do to go around that. lol

Perl can be used on the web and so can JavaScript be used on the web. But Perl can run on Windows, but a JS script won't run on Linux!

  • Comment on Re^2: Curious about Perl's strengths in 2018

Replies are listed 'Best First'.
Re^3: Curious about Perl's strengths in 2018
by jdporter (Canon) on Dec 13, 2019 at 18:23 UTC
    a JS script won't run on Linux!

    The hell you say. Javascript runs everywhere.

Re^3: Curious about Perl's strengths in 2018
by marto (Cardinal) on Dec 13, 2019 at 19:41 UTC

    Pretty much everything here is outdated. JavaScript has no issue on a Linux system, I dare say Node.js runs on more Linux systems than anything else. You insist on running a dead distro of Perl (TinyPerl) on a dead OS (Windows XP). You're missing out on what modern perl and modern frameworks can offer.

      And also (apparently) modern operating systems.

Re^3: Curious about Perl's strengths in 2018
by haukex (Bishop) on Dec 14, 2019 at 23:31 UTC
    When working with binary files, Perl can easily read just the first 512 bytes of a 5gb iso file. JavaScript cannot do that. It would try to read the entire file first, and there's nothing you can do to go around that. lol
    #!/usr/bin/node "use strict"; /* perl -wMstrict -le 'open my $fh, "<:raw", "5gig.iso" or die $!; seek($fh,0x8000,0) or die $!; read($fh,my $buf,512)==512 or die; print unpack("H*",$buf)' */ // https://nodejs.org/docs/latest-v12.x/api/fs.html const fs = require('fs'); fs.open( '5gig.iso', 'r', function (err, fd) { if (err) throw err; var buf = Buffer.alloc(512); fs.read(fd, buf, 0, buf.length, 0x8000, function (err, bytesRead, buffer) { if (err) throw err; if (bytesRead!=buf.length) throw "not enough bytes read!"; console.log(buffer.toString('hex')); }); } );
Re^3: Curious about Perl's strengths in 2018
by stevieb (Canon) on Dec 13, 2019 at 17:43 UTC

    I think that Python is much more comparable to Perl than JS is.

Re^3: Curious about Perl's strengths in 2018
by LanX (Cardinal) on Dec 14, 2019 at 02:31 UTC
    > In Windows, some HP printer setup programs are written entirely in JavaScript, which is very cool. But these scripts will only work on Windows!

    I think you are referring to JScript, MS's own dialect from 20 years ago.

    That's no good comparison to modern JS.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11110077]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (1)
As of 2020-10-25 06:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (249 votes). Check out past polls.

    Notices?