[32033] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3297 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 23 00:09:33 2011

Date: Tue, 22 Feb 2011 21:09:15 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 22 Feb 2011     Volume: 11 Number: 3297

Today's topics:
    Re: books on perl <jurgenex@hotmail.com>
    Re: data transformation, Perl and MicroSoft <cwilbur@chromatico.net>
    Re: Imager module with GIFs <glex_no-spam@qwest-spam-no.invalid>
    Re: Imager module with GIFs <sherm.pendley@gmail.com>
    Re: Imager module with GIFs <sherm.pendley@gmail.com>
    Re: Imager module with GIFs <jwkrahn@example.com>
    Re: Imager module with GIFs <rvtol+usenet@xs4all.nl>
    Re: List Separator $, behaving oddly <derykus@gmail.com>
    Re: List Separator $, behaving oddly <nospam-abuse@ilyaz.org>
        passing (and getting) references to/from functions <k4monk@gmail.com>
    Re: passing (and getting) references to/from functions sln@netherlands.com
    Re: passing (and getting) references to/from functions sln@netherlands.com
    Re: passing (and getting) references to/from functions <jurgenex@hotmail.com>
    Re: passing (and getting) references to/from functions <xhoster@gmail.com>
    Re: Ruby on rails training for Perl developers <monkey_vegas@cox.net>
    Re: Ruby on rails training for Perl developers <cwilbur@chromatico.net>
    Re: Telnet to cisco <bogus@pozdrawiam.spamerow.pl>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 22 Feb 2011 19:09:55 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: books on perl
Message-Id: <30u8m6l9aai3nhjqe2123j2efvigehirgb@4ax.com>

K4 Monk <k4monk@gmail.com> wrote:
>Thank you! btw, I posted this in another newsgroup but never got a
>response. After reading this thread and one of the booke (HOP) I have
>realized that I don't know Perl. I've never used functions extensively
>and don't understand how they work. 

See "perldoc perlsub"

>And here's a program I wrote to
>prove it.
>
>#!/usr/bin/perl
>use strict;

Good. But you should also enable warnings.

	use warnings;

>sub func {
>	my %list;
>	$list{"map"} = "key";
>	$list{"l"}="j";

You can write such an initialization more easily as 
	my %list = (
	    "map" => "key",
	    "l" => "j");

>	my @arr;
>	push (@arr, "egg");
>	push (@arr, "hell");

Most people would probably do a simple
	my @arr = ('egg", "hell");

>	return (%list, @arr);

You are aware that you are returning a list with 6 elements, mixing your
hash and array elements indiscrimently togehter, aren't you?
Just like arguments the return value of a sub is just a list of scalars,
too,  and any sub-structure or composite data will be flattened.

>}
>
> my @arrref = &func();

Just print the lenght of the array here
	print scalar(@arrref);
and it will tell you that @arrref contains 6 elements.

> my %l = %{$arrref[0]};
> my @r = @{$arrref[1]};

Whatever you are trying to do here doesn't work because @arrref already
contains the wrong data. If you want to preserve your return hash and
return array from sub func then first of all you have to return a
reference to them instead of their values (see "Make Rule 1" in "Making
References" in "perldoc perlreftut")

	return (\%list, \@arr);

Then the rest will more or less fall into place on its own.

jue


------------------------------

Date: Tue, 22 Feb 2011 21:37:01 -0500
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: data transformation, Perl and MicroSoft
Message-Id: <86aahnfpde.fsf@mithril.chromatico.net>

>>>>> "cc" == ccc31807  <cartercc@gmail.com> writes:

    cc> Ordinarily, people buy stuff that they perceive has value over
    cc> and above the purchase price. 

Yes.  However, you seem to be assuming that the *perception* of value
actually adds value, and that the added value will be in an area that
you find useful.  Those are both unwarranted leaps.

Charlton

-- 
Charlton Wilbur
cwilbur@chromatico.net


------------------------------

Date: Tue, 22 Feb 2011 14:19:19 -0600
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Imager module with GIFs
Message-Id: <4d6409c0$0$46845$815e3792@news.qwest.net>

jwcarlton wrote:
>> Where's the following:
>>
>> use Imager;
>> use strict;
>> use warnings;
>>
>> ???
> 
> I obviously didn't want to paste the entire script, just the relevant
> parts. I'm also using use CGI::Carp qw(fatalsToBrowser).

Obviously...  Ever read the posting guidelines?

> 
> 
>>> ($filename, $ext) = $pic =~ m/(.*)\.(.*)/;
>> What's the value of $pic?
> 
> $pic is the file name of the uploaded image. In this case, it's found
> with the following:
> 
> $old_pic = upload('pic');

etc..
what does $image->write_types() report?

Possibly you don't have the GIF library installed or when installing 
Imager it didn't find it.  Did make test work?

Check the README for hints on giflib.

I'd suggest removing CGI from the equation and start with an
image on your machine and make sure you can read/write to
other formats, if that works, then it should work as a CGI,
provided it works for other formats.


------------------------------

Date: Tue, 22 Feb 2011 15:42:27 -0500
From: Sherm Pendley <sherm.pendley@gmail.com>
Subject: Re: Imager module with GIFs
Message-Id: <m2bp23ol70.fsf@sherm.shermpendley.com>

jwcarlton <jwcarlton@gmail.com> writes:

> open PIC, ">$path/$pic";

Scalar file handles and the three-arg form of open() are preferred in
this century. And always, yes ALWAYS check the return value of open().

open(my $pic, '>', "$path/$pic") or die "Could not open '$path/$pic': $!";

In the above, including '$path/$pic' in the error message will verify
that you're *really* trying to open what you think you're trying to open,
and $! will tell you why the open failed.

sherm--

-- 
Sherm Pendley
                                   <http://camelbones.sourceforge.net>
Cocoa Developer


------------------------------

Date: Tue, 22 Feb 2011 15:45:38 -0500
From: Sherm Pendley <sherm.pendley@gmail.com>
Subject: Re: Imager module with GIFs
Message-Id: <m21v2zol1p.fsf@sherm.shermpendley.com>

Sherm Pendley <sherm.pendley@gmail.com> writes:

> Scalar file handles and the three-arg form of open() are preferred in
> this century.

*Lexical* file handles.

Bleh. I lern tu tipe gud sum dae!

sherm--

-- 
Sherm Pendley
                                   <http://camelbones.sourceforge.net>
Cocoa Developer


------------------------------

Date: Tue, 22 Feb 2011 19:48:32 -0800
From: "John W. Krahn" <jwkrahn@example.com>
Subject: Re: Imager module with GIFs
Message-Id: <ls%8p.27516$4g3.4487@newsfe04.iad>

jwcarlton wrote:
>
> $pic = lc($old_pic);
>    $pic =~ s {.*[\:\\\/]} []gos;

You have no variables in that pattern so the /o option is superfluous.

perldoc -q /o


>    $pic =~ s/[^A-Za-z0-9\._ \-=@\x80-\xFE]/_/go;

Same as above.  The characters A-Z, a-z, 0-9 and _ can be abbreviated 
with \w.


>    $pic =~ s/ /_/g;

Probably better as:

    $pic =~ tr/ /_/;


> open PIC, ">$path/$pic";
>    binmode (PIC);
>    while ($bytes = read($old_pic,$data,16384)) { print PIC $data; }

If read() only returns one byte and that byte contains "0" then your 
loop will exit prematurely.


> close PIC;



John
-- 
Any intelligent fool can make things bigger and
more complex... It takes a touch of genius -
and a lot of courage to move in the opposite
direction.                   -- Albert Einstein


------------------------------

Date: Wed, 23 Feb 2011 05:10:36 +0100
From: "Dr.Ruud" <rvtol+usenet@xs4all.nl>
Subject: Re: Imager module with GIFs
Message-Id: <4d6488bc$0$81478$e4fe514c@news.xs4all.nl>

On 2011-02-23 04:48, John W. Krahn wrote:
> jwcarlton wrote:

>> $pic =~ s/[^A-Za-z0-9\._ \-=@\x80-\xFE]/_/go;
>
> [...] The characters A-Z, a-z, 0-9 and _ can be abbreviated
> with \w.

Be careful with that advice. A \w matches many, many code points.

-- 
Ruud


------------------------------

Date: Tue, 22 Feb 2011 11:14:30 -0800 (PST)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: List Separator $, behaving oddly
Message-Id: <0f31b595-0739-4e06-840d-3c64b8e5a71f@y30g2000prf.googlegroups.com>

On Feb 22, 7:16=A0am, sharma...@hotmail.com wrote:
> On Feb 21, 10:02=A0am, "C.DeRykus" <dery...@gmail.com> wrote:
>
>
>
> > On Feb 20, 6:16=A0pm, sharma...@hotmail.com wrote:
>
> > > On Feb 21, 12:37=A0am, Ilya Zakharevich <nospam-ab...@ilyaz.org> wrot=
e:
>
> > > > On 2011-02-20, sharma...@hotmail.com <sharma...@hotmail.com> wrote:
>
> > > > > So what you are implying is that Perl looks at the "address" of $=
,
> > > > > to enable its magic.
>
> > > > Do not think it is a productive way to describe the situation.
>
> > > > The ACTUAL way things happen is that nobody ever reads $, . =A0A ce=
rtain
> > > > container is attached to a "scalar" slot of *, ; Perl internals rea=
d
> > > > THIS CONTAINER when print() happens. =A0*foo =3D \BAR reassign the =
scalar
> > > > slot of *foo.
>
> > > > > And why doesn't this behavior impacting the Exporter ?
>
> > > > It is not clear what are you asking. =A0After
> > > > =A0 *foo =3D \$, ;
> > > > assignments to $foo would change the same container as assignments =
to
> > > > $, .
>
> > > > =A0 > perl -wle "*foo =3D \$, ; $foo =3D 12; print 1,2"
> > > > =A0 1122
>
> > > > Ilya
>
> > > How do we explain what is going on in this scenario:
>
> > > #!/usr/local/bin/perl
> > > use strict; use warnings;
>
> > > print "Before:...";
> > > print "\$,=3D[$,]";
> > > print "\\\$,=3D",\$,;
> > > print qw(A B); #< -- AB
>
> > > no strict 'refs';
> > > =A0 =A0 =A0 =A0 *{"::,"} =3D \do{":"};
> > > use strict 'refs';
> > > print "After1:...";
> > > print "\$,=3D[$,]";
> > > print "\\\$,=3D",\$,;
> > > print qw(A B); # <---- AB
>
> > > =A0 =A0 =A0 =A0 $, =3D "+";
> > > print "After2:...";
> > > print "\$,=3D[$,]";
> > > print "\\\$,=3D",\$,; #
> > > print qw(A B); # <--- AB
> > > __END__
>
> > > Even when $, is reassigned as "+" the print is not taking it.
> > > maybe coz container is still pointing to the do{":}" even now.
> > > That means perl has stored the address of the "original" container of
> > > $, and looks at that when print() is invoked. And that is
> > > an undocumented feature.

>
     [snip]


>
> printf("perl v%vd OS %s\n",$^V, $^O);
> $, =3D '_';
> my $sep =3D '*';
> *{"::,"} =3D \$sep;
> print "ok", "[$,]\n";
> #---------------------- Displays results shown below:
>
> perl v5.8.9 OS linux
> ok_[*]
>
> #########################################################################=
###############################
> My question is basically the following:
>
> "print" when it spits out a list, separates the list elements by the
> $, variable's value.
>
> Now, in the print statement I have above, one of the list elements is
> $, itself. When it prints
> $, it picks '*' (that's coz $, has been aliased to $sep).
> But the elements are separated by '_' which is the original value of
> $,
>
> Why does print not use the new aliased value of $, for separating the
> list elements? Could it be the print has squirreled away
> the value of $, at compile time, which it'll use at run time to
> separate the elements?
> #############################
>


I'm suggesting that Perl's approach has evolved away from
the quirkiness of pre-5.10 versions (ie, your 5.89) and
how they dealt with '$,'. And if I understand correctly
what Ilya was saying, '$,' was special cased so that '$,'
glob accesses dealt only with the scalar slot and not the
entire glob.

My speculation is that there was a change to make '$,'
glob behavior more consistent with what you'd expect.
That is, you should be able to assign references to the
glob and have the appropriate parts of the glob change.

    perl -wle'local *foo =3D \do{"bar"}; print $foo'
    --> bar

Symmetrically, in your case:

    perl -wle 'local *{"::,"} =3D \do{q[:]}; print $,'
    --> :

And this expected behavior does occur in 5.10 and higher
but not your 5.89 distro.


--
Charles DeRykus

P.s.  If you look at the 5.10/5.12 examples I cited, there's
even some differing behavior between 5.10 and 5.12 so there's
still some evolution it seems.


------------------------------

Date: Tue, 22 Feb 2011 23:33:12 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: List Separator $, behaving oddly
Message-Id: <slrnim8htn.t3d.nospam-abuse@powdermilk.math.berkeley.edu>

On 2011-02-22, C.DeRykus <derykus@gmail.com> wrote:
>> Why does print not use the new aliased value of $, for separating the
>> list elements?

You did not alias $, - you aliased TO $,.  After this "THAT" $, is not
magical - it is just an alias for something "normal".

>> Could it be the print has squirreled away
>> the value of $, at compile time, which it'll use at run time to
>> separate the elements?

???

> what Ilya was saying, '$,' was special cased so that '$,'
> glob accesses dealt only with the scalar slot and not the
> entire glob.

???  All is said is that no globs are (were?) magic.  What may (have)
be(en) magic is a container referenced by the glob.  (At least,
referenced at the Perl startup.)

I do not see much reason to document results of symbol table
manipulation.  ("One is not supposed to do this" is quite enough.  ;-)

> Symmetrically, in your case:
>
>     perl -wle 'local *{"::,"} = \do{q[:]}; print $,'
>     --> :
>
> And this expected behavior does occur in 5.10 and higher
> but not your 5.89 distro.

This is a different topic: the last $, is (was?) compiled to ${*{'::,'}},
then *{'::,'} was pre-calculated at compile time (a very important
optimization, since hash access in Perl is painfully slow).

One may want to remember that access to non-lexical scalar has two
redirections: first *{P::NAME} is calculated, then ${ *{P::NAME} }; in
other words: first a 'P::NAME' slot of the symbol table (one gets a
glob), then the scalar slot of this glob.

Both slots may be reset: the first one with
   *{P::NAME} = *new_foo;	# sp?
the second one with
   *{P::NAME} = \$new_bar;

Well, to be completely honest, the slot of symbol table is also
calculated in several steps (first %{main::}{P::}, then
${main::}{P::}{NAME}, so there are many other slots to redirect in
between...

Ilya


------------------------------

Date: Tue, 22 Feb 2011 11:55:45 -0800 (PST)
From: K4 Monk <k4monk@gmail.com>
Subject: passing (and getting) references to/from functions
Message-Id: <6fc7c499-6681-40f2-b14a-57bd83445d4a@q40g2000prh.googlegroups.com>

I don't understand references very well (even after reading some docs
on this). How can I get a mixed array of hash and array back from a
function? How do I send it such a list of mixed types? Can someone
please help!

#!/usr/bin/perl
use strict;

sub func {
	my @list;
	push (@list, "map");
	push (@list, "key");
	push (@list, "l");
	push (@list, "j");

	my @arr;
	push (@arr, "egg");
	push (@arr, "hell");


	return ( \@list, \@arr );

}

sub func {
	my $pid=shift;
	my $p=shift;
	my $ref=shift;
	print "$ref\n";
	my %funcs=%{\$ref};
	foreach my $key(keys %funcs) { print "$key\n"; }
}

 my @arrref = &func();
 my @l = @{$arrref[0]};
 my @r = @{$arrref[1]};

 print "keys\n";
foreach my $k(@l) { print "$k\n"; }
print "array\n";
foreach my $rr(@r) { print "$rr\n"; }

my $pid=10;
my $p=11;
my %hash;
$hash{"derp"} = 10;
$hash{"herp"} = 11;

&func($pid, $p, \(%hash));


------------------------------

Date: Tue, 22 Feb 2011 13:07:25 -0800
From: sln@netherlands.com
Subject: Re: passing (and getting) references to/from functions
Message-Id: <5988m65rkfr8eab1fp6811kjj07tn136hs@4ax.com>

On Tue, 22 Feb 2011 11:55:45 -0800 (PST), K4 Monk <k4monk@gmail.com> wrote:

>I don't understand references very well (even after reading some docs
>on this). How can I get a mixed array of hash and array back from a
>function? How do I send it such a list of mixed types? Can someone
>please help!
>

$subref = sub { my @junkary; 
                my @mixed = (    # start of mixed array
                  [1,2,3,"string"],  # element 0, a anonymous array ref
                  \@junkary,         # element 1, a reference to a named array
                  {                  # element 2, a anonymous hash ref
                     vals1 => 'hello',
                     vals2 => [            # key val2 element = anonymous array ref
                                'a','b','c'
                              ],
                   },
                     # ...           # element 3 ...
                );                # end of mixed array
                return \@mixed;
                # or, return @mixed;
          }

$mixedref = $subref->();
print  $mixedref->[2]->{vals2}->[1];
     #or  $mixedref->[2]{vals2}[1]   but I would test this
__END__
b


>#!/usr/bin/perl
>use strict;
>
>sub func {
>	my @list;
>	push (@list, "map");
>	push (@list, "key");
>	push (@list, "l");
>	push (@list, "j");
>
>	my @arr;
>	push (@arr, "egg");
>	push (@arr, "hell");
>
>
>	return ( \@list, \@arr );
>
>}
>
>sub func {
>	my $pid=shift;
>	my $p=shift;
>	my $ref=shift;
>	print "$ref\n";
>	my %funcs=%{\$ref};
>	foreach my $key(keys %funcs) { print "$key\n"; }
>}

 ^^^^^^
I don't think subs can be overloaded in Perl, so these would need
different names.


>
> my @arrref = &func();
> my @l = @{$arrref[0]};
> my @r = @{$arrref[1]};
>

This is ok, you are dereferencing the array refs.

> print "keys\n";
>foreach my $k(@l) { print "$k\n"; }
>print "array\n";
>foreach my $rr(@r) { print "$rr\n"; }
>

Use some proper style here,
  for () {
   ...
  }
  elsif () {
   ...
  }
  else {
   ...
  }

>my $pid=10;
>my $p=11;
>my %hash;
>$hash{"derp"} = 10;
>$hash{"herp"} = 11;
>
>&func($pid, $p, \(%hash));
 ^
Drop the ampersand. There is a use for it but its more just
a carryover from legacy Perl, otherwise the called sees @_

-sln



------------------------------

Date: Tue, 22 Feb 2011 13:12:59 -0800
From: sln@netherlands.com
Subject: Re: passing (and getting) references to/from functions
Message-Id: <ik98m6p4t1gsc599d4ba6c14sr18ukabts@4ax.com>

On Tue, 22 Feb 2011 13:07:25 -0800, sln@netherlands.com wrote:

>
>> print "keys\n";
>>foreach my $k(@l) { print "$k\n"; }
>>print "array\n";
>>foreach my $rr(@r) { print "$rr\n"; }
>>
>
>Use some proper style here,
>  for () {
>   ...
>  }

whoops!!
   if () {
    ...
   }
   elsif () {
>   ...
>  }
>  else {
>   ...
>  }
>

-sln


------------------------------

Date: Tue, 22 Feb 2011 19:22:39 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: passing (and getting) references to/from functions
Message-Id: <plu8m6puqq9fhgnjdk1qri2urlcrebdaok@4ax.com>

K4 Monk <k4monk@gmail.com> wrote:
>I don't understand references very well (even after reading some docs
>on this). How can I get a mixed array of hash and array back from a
>function? 

You can't. The return value of a function is always a flat list of
scalars. However of course you can return a list of references, each
reference pointing to whatever complex data structure you can envision.

>How do I send it such a list of mixed types? 

Same way as you return them from a sub.

>#!/usr/bin/perl
>use strict;
>
>sub func {
>	my @list;
>	push (@list, "map");
>	push (@list, "key");
>	push (@list, "l");
>	push (@list, "j");
>
>	my @arr;
>	push (@arr, "egg");
>	push (@arr, "hell");
>
>
>	return ( \@list, \@arr );

This looks good to me. Where does the code doesn't do what you expect it
to do?

>sub func {

???? 
Two subs with the same name?
I am getting 
	Subroutine func redefined at t.pl line 22.

>	my $pid=shift;
>	my $p=shift;
>	my $ref=shift;
>	print "$ref\n";
>	my %funcs=%{\$ref};
>	foreach my $key(keys %funcs) { print "$key\n"; }
>}
>
> my @arrref = &func();

Don't do that unless you know exactly why you have to do it. There is no
good reason to call a function with the &. You don't use prototypes
(nobody does), so why do you want to override them? Not to mention the
other side effects.

[more code snipped]

Please clearly state what 
- you expect your code to do
- you actually observe your code doing
and -unless obvious- how those two are different

Otherwise it is impossible to tell where you are asking for help.

jue


------------------------------

Date: Tue, 22 Feb 2011 18:47:55 -0800
From: Xho Jingleheimerschmidt <xhoster@gmail.com>
Subject: Re: passing (and getting) references to/from functions
Message-Id: <4d647e03$0$14942$ed362ca5@nr5-q3a.newsreader.com>

K4 Monk wrote:
> I don't understand references very well (even after reading some docs
> on this). How can I get a mixed array of hash and array back from a
> function? How do I send it such a list of mixed types? Can someone
> please help!
> 
> #!/usr/bin/perl
> use strict;

You should also "use warnings;"


> sub func {
 ...
> sub func {

You should use different names for different functions.  If you turn on 
warnings, it would tell you about that problem.

Beyond that, it is hard to figure out what you *expect* to happen, so it 
is hard to explain why your expectations were not met.

Xho


------------------------------

Date: Tue, 22 Feb 2011 17:48:23 -0800
From: James Wright <monkey_vegas@cox.net>
Subject: Re: Ruby on rails training for Perl developers
Message-Id: <ik1p1e$g2e$1@news.eternal-september.org>

On 02/21/11 21:19, Wan Li Zhu wrote:
> If you're a Perl developer in the Boston area looking to learn Ruby,
> Fairhaven Capital and thoughtbot are teaming up to offer Ruby on Rails
> training courses in Boston at 50% off regular price ($600 for 2 full
> days of training, intro and advanced levels).
>
> Details at http://workshops.thoughtbot.com/fairhaven

Yeah, way to appeal to the Perl people, not even including them in the 
description, grouping them under those familiar with 'other web 
technologies' but mentioning Java and PHP.


------------------------------

Date: Tue, 22 Feb 2011 21:40:14 -0500
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Ruby on rails training for Perl developers
Message-Id: <8662sbfp81.fsf@mithril.chromatico.net>

>>>>> "WLZ" == Wan Li Zhu <zhurama@gmail.com> writes:

    WLZ> If you're a Perl developer in the Boston area looking to learn
    WLZ> Ruby, 

 ... which I am...

    WLZ> Fairhaven Capital and thoughtbot are teaming up to offer
    WLZ> Ruby on Rails training courses in Boston at 50% off regular
    WLZ> price ($600 for 2 full days of training, intro and advanced
    WLZ> levels).

And now I know who to avoid because they're filthy spammers! Thanks!

Charlton


-- 
Charlton Wilbur
cwilbur@chromatico.net


------------------------------

Date: Wed, 23 Feb 2011 05:06:15 +0100
From: =?UTF-8?B?Qm9ndcWb?= <bogus@pozdrawiam.spamerow.pl>
Subject: Re: Telnet to cisco
Message-Id: <ik213n$80i$1@node2.news.atman.pl>

W dniu 2011-02-21 13:01, Bogus pisze:
> Hi,
>
> [cut]
>
> Thanks

Hi

I finally found what I was looking for:

http://cpansearch.perl.org/src/AJWOOD/Term-VT102-0.91/VT102/examples/telnet-usage.pl

this works just like normal telnet client without expect (I don't need 
it) - after adding Term::ANSIColor I have what I want :)

Thanks to Martijn and John for their propositions



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 3297
***************************************


home help back first fref pref prev next nref lref last post