Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Crypt() usage

by Athanasius (Archbishop)
on Jul 28, 2016 at 16:28 UTC ( #1168742=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2022-05-27 22:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (98 votes). Check out past polls.

    Notices?