http://qs1969.pair.com?node_id=1168742


in reply to Crypt() usage

Hello fionbarr,

Yes, but apparently you can’t rely on the crypt function being available under Windows. From perlport#crypt:

May not be available if library or source was not provided when building perl. (Win32)

This may be important to bear in mind if your script is intended to run on platforms over which you have no direct control.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^2: Crypt() usage
by bart (Canon) on Jul 28, 2016 at 23:34 UTC
    That warning is well over 20 years old. I doubt if there is any perl version for Windows where crypt isn't properly implemented.
Re^2: Crypt() usage
by talexb (Chancellor) on Jul 28, 2016 at 21:26 UTC

    .. and, related to that, I wonder if the different line-endings (in Linux and Windows) might result in a different crypt result. I only have Windows here at work, so I cannot test this hypothesis right now.

    Alex / talexb / Toronto

    Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

      Line endings should only be an issue in I/O. By default perl strings use a single newline character as a record separator. PerlIO translates between this and whatever your OS requires. When processing files from another OS, specify the required translation on the open statement.
      Bill

        ...or use File::Edit::Portable which does the translations automatically for you, cross-platform, so you don't have to figure out which ending to use yourself ;)

        use File::Edit::Portable; my $rw = File::Edit::Portable->new; my $fh = $rw->read('file.txt');

        Disclaimer: author of said module here

Re^2: Crypt() usage
by Anonymous Monk on Jul 28, 2016 at 22:20 UTC
    Excellent point....thanks