in reply to Re: Trying to close Expect.pm telnet timeout situation to avoid overwhelming a small target device
in thread Trying to close Expect.pm telnet timeout situation to avoid overwhelming a small target device

I believe the $VAR1 = around the object is a artifact of Dump::Dumper.
  • Comment on Re^2: Trying to close Expect.pm telnet timeout situation to avoid overwhelming a small target device

Replies are listed 'Best First'.
Re^3: Trying to close Expect.pm telnet timeout situation to avoid overwhelming a small target device
by GrandFather (Saint) on Nov 25, 2008 at 03:46 UTC

    I believe you are wrong (or at least the [] is important as almut suggests):

    use Data::Dumper; my $blessedBe = bless {}, 'Wibble'; print Dumper $blessedBe; print Dumper [$blessedBe];

    Prints:

    $VAR1 = bless( {}, 'Wibble' ); $VAR1 = [ bless( {}, 'Wibble' ) ];

    Perl reduces RSI - it saves typing
Re^3: Trying to close Expect.pm telnet timeout situation to avoid overwhelming a small target device
by almut (Canon) on Nov 25, 2008 at 03:35 UTC

    Sure, the $VAR1 = is an artifact, but not the square brackets... (which indicate that Data::Dumper was given an arrayref).  Compare with your first dump in the line:

    scriptbed login: $VAR1 = bless( \*Symbol::GEN0, 'Expect' );
      Ah, yes. Your modification works as expected:
      sub { my $fh = shift; print Dumper $fh; $fh->[0]->do_soft_close(); die "Timed out\n"; }
      No errors. Thank you.