Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Tie and Filesys::SmbClient

by okram (Monk)
on Mar 07, 2008 at 23:37 UTC ( [id://672909]=note: print w/replies, xml ) Need Help??


in reply to Tie and Filesys::SmbClient

Hi
tie works like this: "tie VARIABLE,CLASSNAME,LIST".
The "variable" is your *FD, "classname", correctly, is 'Filesys::SmbClient', and all the other stuff afterwards is exactly what you'd pass to Filesys::SmbClient->new().
You would basically want to change your code to read:
local *FD; tie *FD, 'Filesys::SmbClient', @args; open FD, 'smb://host/directory/file' or die "Can't read file:", $!, "\n"; print while (<FD>); close (FD);

If you skip the part about "using the two or three params open()" (use the right one), this *should* work.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-03-29 00:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found