Find the answer to your Linux question:
Results 1 to 2 of 2
Hey guys, Im somewhat new at perl and was wondering if there was a way to run a perl script or tool made from perl, from a USB pen that ...
  1. #1
    Just Joined!
    Join Date
    Nov 2010
    Posts
    3

    Perl from USB pen to run on both linux and windows

    Hey guys,

    Im somewhat new at perl and was wondering if there was a way to run a perl script or tool made from perl, from a USB pen that would work both on Linux and on Windows?

    Thank you

    Any help would be greatly appreciated.

  2. #2
    Just Joined!
    Join Date
    May 2011
    Posts
    44
    short answer:
    Yes, the Perl interpreter is platform specific, but the Perl code is (or -can- be) platform independent.

    There are some caveats. Specifically file paths are different.
    However, Perl does understand the following are equivalent.

    Code:
    my $path = 'C:\foo\bar\';
    my $path = 'C:/foo/bar/';
    I do believe that file paths are not case sensitive, tho I am unable to test this at this time.

    the windows shbang line looks different
    Code:
    #!C:/perl/perl.exe
    but if you invoke the program through Perl from the CLI.
    e.g.:
    Code:
    perl foo.pl
    shbang doesn't matter.

    Also, you can't use linux system commands on a windows box, and vice versa. Stick to the Perl library.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...