develooper Front page | perl.beginners | Postings from February 2002

RE: No access to /etc/protocols

Thread Previous | Thread Next
From:
Jenda Krynicky
Date:
February 28, 2002 04:44
Subject:
RE: No access to /etc/protocols
Message ID:
3C7E3428.17803.333A03@localhost
From:           	"Paul Murphy" <beginnersperl@zencore.co.uk>
> This *is* my new ISP.  I understand their stance, they work are
> working from a standard security perspective.  "Don't open it unless
> you need to".  This is an admirable stance, although misapplied in
> this case.  You always have to strike a balance between security and
> funcionality and I feel that they have erred more on the side of
> security than is necessary and so removed a fundamental part of
> functionality.
> 
> So I need to work around the problem.
> 
> Jenda has kindly provided me a way to get around it, and I have now
> encountered my next problem.
> 
> getprotobyname() returns a list: { $name, $alias, $number }
> 
> If I do
> 
>  @proto = getprotobyname();
>  print @proto;
> 
> I get "tcpTCP6".
> 
> My getprotobyname() has a 
> 
>   return { "tcp", "TCP", "6" } ;
> 
> But if I do:
> 
>  @proto = getprotobyname();
>  print @proto;
> 
> I get HASH<whatever>.

Use round brackets, not curlies.

	return ("tcp", "TCP", "6") ;

with curlies you create a new anonymous hash, not a list nor array.

Jenda


=========== Jenda@Krynicky.cz == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
					--- me

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About