We recently had need to grab a small file from a machine (network management devices running NT4 client) to a Perl script. We can’t make changes on these clients but the file is available on a network share.
Enter the Filesys::SmbClient module, the documentation of which shows the use of a Tie that would make reading the file much easier. The example however does not pass any parameters like login credentials.
Below are a couple of examples on how to make this work: