escaping ~

A

Alythh

I am confused.

when using the script:
....
$t = new Net::Telnet (Timeout => 10, Prompt => 'sisrv1:\~> ');
....
I keep on getting the warning:

ignoring bad Prompt argument "sisrv1:~> ": missing opening delimiter
of match operator at /0ale/excursions/digital/script/bck-net.pl line
13

this even when I use "sisrv1:\~> ", or quotemeta("sisrv1:\~>")

how do I escape that damned ~ ?

thanks!

Alessandro Magni
 
A

Anno Siegel

Alythh said:
I am confused.

when using the script:
...
$t = new Net::Telnet (Timeout => 10, Prompt => 'sisrv1:\~> ');
...
I keep on getting the warning:

ignoring bad Prompt argument "sisrv1:~> ": missing opening delimiter
of match operator at /0ale/excursions/digital/script/bck-net.pl line
13

this even when I use "sisrv1:\~> ", or quotemeta("sisrv1:\~>")

how do I escape that damned ~ ?

Swearing won't help, especially because ~ is innocent. It would have
helped more to take it out for a test:

Net::Telnet->new( Timeout => 10, Prompt => 'sisrv1:> ');

That gives you the same error as before.

Net::Telnet expects a complete regex for the Prompt parameter, including
the delimiting //, so

Net::Telnet->new( Timeout => 10, Prompt => '/sisrv1:~> /');

would work.

Anno
 
B

Brian McCauley

Net::Telnet expects a complete regex for the Prompt parameter, including
the delimiting //, so

Net::Telnet->new( Timeout => 10, Prompt => '/sisrv1:~> /');

I think the terminology "complete regex" is confusing. The shashes
you see in a regex literal are no more part of a regex than the quotes
you see in a string literal are part of the string.

What Net::Telnet expects is a fragment of Perl source code containing
a match operator. As I said just recently[1]: Yuch!

[1] http://groups.google.com/[email protected]

--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,999
Latest member
MakersCBDGummiesReview

Latest Threads

Top