http://qs321.pair.com?node_id=799212


in reply to Re: GLOB reference problem
in thread GLOB reference problem

A bit more background...this code was originally written to utilise Net::FTP. However, I've needed to modify it as I need to run the code without actually FTPing anything outside the server, so I've created my own dummy FTP package. FTP->new (mine) is returning a HASH reference, but it looks like Net::FTP->new returns a GLOB reference.

What construction's needed in my 'new' subroutine to return a GLOB reference. I have:-

sub new { my ($pkg, $server, $user, $timeout, @args) = @_; my $self = { %fields }; my $ftp = bless $self, $pkg; $ftp->server($server); $ftp->user($user); $ftp->timeout($timeout); $ftp->initialize(); return $ftp; }