in reply to login to juniper ERX

I guess that one of the problems with your code is with the following parameter:

Prompt => '/[ERX02#]/'

This most likely does not do what you want. It will match any string containing a "E", "R", "X", "0", "2" or "#". See perlre. Most likely you want this instead:

Prompt => '/\\[ERX02#\\]/'

Why did you comment out use strict; in your code? Using strict helps you to find errors in your variable declarations.

I find it quite rude of you to post a new top-level question without any hint to your previous question and the answer you got there already. Also, you could have formatted your session output in code tags so it reads nicer and doesn't get the square brackets interpolated.

Replies are listed 'Best First'.
Re^2: login juniper ERX
by ikegami (Patriarch) on Jun 09, 2008 at 10:29 UTC

    Quick tip:

    If you don't want to worry about escaping stuff twice, you can use

    Prompt => map("/$_/", qr/...any regexp.../)

    as in

    Prompt => map("/$_/", qr/\[ERX02#\]/)

    You can even safely use modifiers like i and x on the qr//.

          use strict; forces you to declare all your variables. It does that so any mistyped variable names get caught early on instead of trough a long and painful process of debugging. strict has a short description of what strict enforces - think of it as wearing a protection helmet while riding your motorbike.

        A reply falls below the community's threshold of quality. You may see it by logging in.