On 6/12/07, Lakshmi Sailaja <[EMAIL PROTECTED]> wrote:
snip
$sub = "xyz";
$prompt = "L:\\$sub";

my $t = Net::Telnet->new(
        Timeout => 10,
        Prompt  => "/$prompt/"
);

snip

from perldoc Net::Telnet
      What To Know Before Using

      ยท When constructing the match operator argument for "prompt()" or
        "waitfor()", always use single quotes instead of double quotes to
        avoid unexpected backslash interpretation (e.g. '/bash\$ $/').  If
        you're constructing a DOS like file path, you'll need to use four
        backslashes to represent one (e.g. '/c:\\\\users\\\\bill>$/i').

        Of course don't forget about regexp metacharacters like ".", "[", or
        "$".  You'll only need a single backslash to quote them.  The anchor
        metacharacters "^" and "$" refer to positions in the input buffer.
        To avoid matching characters read that look like a prompt, it's a
        good idea to end your prompt pattern with the "$" anchor.  That way
        the prompt will only match if it's the last thing read

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to