Problem s handlerem v hashi
Honza Pazdziora
adelton na informatics.muni.cz
Středa Srpen 8 10:26:44 MEST 2001
On Wed, Aug 08, 2001 at 08:29:15AM +0200, Lukas Zapletal wrote:
>
> snazim se ulozit do hashe TCP socket:
>
> $this->{_socket} = new IO::Socket::INET (...);
>
> Kdyz se ho snazim pouzit:
>
> print $this->{_socket} "Hello\n";
>
> tak Perl hlasi, ze naseh string "Hello" tam, kde ocekava operator.
>
> Co to znamena? Co delam spatne? Kdyz pouziji normalni promennou, tak to
> jde...
Snazite se udelat
print $this->{_socket}, "Hello\n";
Prvek hashe v tomto kontextu neni rozeznan jako filehandle.
Jedna moznost je volat ten print jako meotdu, druha moznost je obalit
tu specifikaci toho filehandlu slozenymi zavorkami, myslim.
--
------------------------------------------------------------------------
Honza Pazdziora | adelton na fi.muni.cz | http://www.fi.muni.cz/~adelton/
.project: Perl, DBI, Oracle, MySQL, auth. WWW servers, DBD::XBase.
Will be off email until Aug 15 -- please don't expect responses until then.
Další informace o konferenci Perl