Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Can Perl do anything Java can do?

by shmem (Chancellor)
on Jul 19, 2017 at 12:38 UTC ( [id://1195449]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Can Perl do anything Java can do?
in thread Can Perl do anything Java can do?

Won't the Perl code run in Unix (our code will be running in Linux machines) and Windows both??

Definitely on Linux, and surely on Windows, too. But I don't have enough expertise on Windows to assert that all perl code portably written on Linux/UNIX runs on Windows without (trivial) changes. Others should step in here.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
  • Comment on Re^3: Can Perl do anything Java can do?

Replies are listed 'Best First'.
Re^4: Can Perl do anything Java can do?
by stevieb (Canon) on Jul 19, 2017 at 12:45 UTC

    As with any 'portable' language, not all programs can be just copied between *nix and Windows. Many can, some can with effort, and others can't.

    It is particularly difficult if the program has implemented functionality that relies on platform specific libraries for instance, or attempts to do things on an OS where the capabilities don't exist or work reliably ($SIG{ALRM} comes to mind).

    Again though, the vast majority of the time, if a Perl script can't be migrated from one platform to another, neither can a similarly-written program written in another language.

    Here's an example Makefile.PL of a Perl distribution that is specifically designed to work cross-platform. That file, and the entire codebase of the dist checks to see what OS its on, and sets itself up accordingly. In this case, the code had to be written in this fashion as it requires a lot of OS-specifics. Most of my other distributions are cross platform without any need to do any specific checking at all.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-20 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found