I think he is missing quotes while assigning. $a = abc\/edf\/a #is wrong ! José.
-----Original Message----- From: Rob Dixon [mailto:[EMAIL PROTECTED] Sent: Friday, July 25, 2003 1:52 PM To: [EMAIL PROTECTED] Subject: Re: search and match > > "Boon Chong Ang" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > ismsg03.altera.priv.altera.com... > Hi, > Just say i have a variable being assigned as follow, > > $a = abc/edf/a > > i want it to search from another file for the file that contains > exactly the same words, what i do is to modify the variable a become > $a = abc\/edf\/a and then print if /$a/; but it failed > even if i tried print if "/$a/"; it also failed. Can anyone point out > my mistake or show me the correct way to do this? > > I'm not sure what your problem is here. Even without the escape characters this works fine. Can you tell us more of what you're doing, and why you think it doesn't work? Rob use strict; use warnings; my $a = 'abc/edf/a'; while (<DATA>) { print if /$a/; } __DATA__ abc/edf/a acb/ecf/a ffabc/edf/a dsa/bc/edf/a abc/edf/agg OUTPUT abc/edf/a ffabc/edf/a abc/edf/agg -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] **** DISCLAIMER **** "This e-mail and any attachment thereto may contain information which is confidential and/or protected by intellectual property rights and are intended for the sole use of the recipient(s) named above. Any use of the information contained herein (including, but not limited to, total or partial reproduction, communication or distribution in any form) by other persons than the designated recipient(s) is prohibited. If you have received this e-mail in error, please notify the sender either by telephone or by e-mail and delete the material from any computer". Thank you for your cooperation. For further information about Proximus mobile phone services please see our website at http://www.proximus.be or refer to any Proximus agent. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]