|
Hello.
I'm a little confused about how I can spawn a new session when using PoCo::Generic with Net::FTP.
Net::FTP needs the host and port in new(), and both SSH2 and Telnet used in the examples returns "empty" objects which you call either open() or connect() on.
Maybe I could do something like below? I'm not sure how I can have the results for it returned to a function though..
my $ftp = POE::Component::Generic->spawn(
package => 'Net::FTP',
object_options => [{Host=>'localhost',Port=>26000,Debug=>1} ],
alias => 'telnet',
debug => 1,
verbose => 1,
}
I thought about making a "wrapper" module for Net::FTP which returns an object with a ftp_login() function that does both the connection and login (this would be most convenient), and returns the result in e.g connected or failed_connect.
I'm not sure how exactly i could make that wrapper module (I'm still pretty new to OO), or if this
is the right approach.
Anyone have any tips on how I should do this?
Thanks
Thom
|