Re: How to search/match a variable pattern

2006-08-11 Thread benbart
Hi John, Thanks for a very quick response John. It gives the error as below: Trailing \ in regex m/D:\STUDY\PERL\MYFTP\/ at D:\Study\Perl\MyFtp\Ftp1.pl line 109. ($base,$path,$type) = fileparse($ARGV[0]); $pattern=$path; print "matches" if $string =~ m/$pattern/; I print $pattern and it is

Re: How to search/match a variable pattern

2006-08-11 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > Quoting "John W. Krahn" <[EMAIL PROTECTED]>: > >> [EMAIL PROTECTED] wrote: >> >>> Can some please advise how to get this to work? >>> >>>print "matches" if $string =~ m/$pattern/; >> >> You probably have regex meta-characters in $pattern that need to be >> escaped

Re: How to search/match a variable pattern

2006-08-11 Thread Mumia W.
On 08/11/2006 11:50 PM, [EMAIL PROTECTED] wrote: Hi John, Thanks for a very quick response John. It gives the error as below: Trailing \ in regex m/D:\STUDY\PERL\MYFTP\/ at D:\Study\Perl\MyFtp\Ftp1.pl line 109. ($base,$path,$type) = fileparse($ARGV[0]); $pattern=$path; print "matches" if $s

Re: How to search/match a variable pattern

2006-08-11 Thread benbart
Hi John, Thanks for a very quick response John. It gives the error as below: Trailing \ in regex m/D:\STUDY\PERL\MYFTP\/ at D:\Study\Perl\MyFtp\Ftp1.pl line 109. ($base,$path,$type) = fileparse($ARGV[0]); $pattern=$path; print "matches" if $string =~ m/$pattern/; I print $pattern and it is

Re: How to search/match a variable pattern

2006-08-11 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > Hi all, Hello, > Can some please advise how to get this to work? > >print "matches" if $string =~ m/$pattern/; > > Am trying to search for a pattern but the pattern has to be a variable. Thanks > in advance. How did this "not work"? What is it not doing that you

How to search/match a variable pattern

2006-08-11 Thread benbart
Hi all, Can some please advise how to get this to work? print "matches" if $string =~ m/$pattern/; Am trying to search for a pattern but the pattern has to be a variable. Thanks in advance. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]