Lee Cullip wrote, on Wednesday, November 20, 2002 06:50
: Can anybody tell me what is wrong with the following line ? 
:
:   $prmpt = /(^.*[:]\/home\/oracle[:=>]{1,2})/;
:
: I'm trying to use the value of $prmpt in a call to Net::Telnet but before I can
: use the variable $prmpt, perl is complaining about the format of the pattern.

Please try to post in plain text. Thanks.

Do you really want $prmpt to be true if $_ matched your pattern,
and false if it didn't? Perhaps you meant "=~" instead of "=".

What exactly is Perl's "complaint" about your pattern? I have a
few suggestions:

        o Use a different pattern delimiter if you want to match
                forward slashes, to avoid the "leaning toothpick"
                phenomenon.
        o You don't need to turn a single character into a 
                character class: remove the brackets from the "[:]".
        o Unless you need $1 later, you don't need parentheses
                around the whole pattern. My guess is that Perl
                didn't like having the "start" anchor inside parens.

Rewriting your pattern, then, I get this:

   $prmpt =~ !^(.*:/home/oracle[:=>]{1,2})!;
   $prmpt = $1;

Is that what you really meant?

Good luck,

Joe

==============================================================
          Joseph P. Discenza, Sr. Programmer/Analyst
               mailto:[EMAIL PROTECTED]
 
          Carleton Inc.   http://www.carletoninc.com
          574.243.6040 ext. 300    fax: 574.243.6060
 
Providing Financial Solutions and Compliance for over 30 Years
***** Please note that our Area Code has changed to 574! ***** 

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to