http://www.perlmonks.org?node_id=1100813


in reply to Re: whats wrong? it gives me many error
in thread whats wrong? it gives me many error

my ($host, $port, $request, $proto) = ('tcp');

But that assigns 'tcp' to $host. Shouldn't it be assigned to $proto?

So, maybe one of these:

my ($host, $port, $request, $proto) = ( undef, undef, undef, 'tcp' ); # or my ($host, $port, $request, $proto) = ( '', '', '', 'tcp' ); # or my ($host, $port, $request, $proto); $proto = 'tcp';

Replies are listed 'Best First'.
Re^3: whats wrong? it gives me many error
by LanX (Saint) on Sep 16, 2014 at 19:59 UTC
    > my ($host, $port, $request, $proto) = ('tcp');

     my ($proto, $host, $port, $request) = ('tcp');

    But ikegami already showed this on SO... :)

    Cheers Rolf

    (addicted to the Perl Programming Language and ☆☆☆☆ :)

Re^3: whats wrong? it gives me many error
by blue_cowdawg (Monsignor) on Sep 16, 2014 at 19:25 UTC

    Personally I'd go with the latter.


    Peter L. Berghold -- Unix Professional
    Peter -at- Berghold -dot- Net; Blog: http://blog.berghold.net Warning: No political correctness allowed.