Re: Matching a Scalar Variable



On 11/29/05, Mazhar <syedmazhar.hasan@xxxxxxxxx> wrote:
>
> Sorry i am passing the OPEN as
> Open (FILE1,"<one Fuile");
> Open (FILE,"<Second File");
>
> Still the string is ot matching. Help me please



Use like this:


open FD, "< file1";
open FD1, "< file2";

while (<FD>)
{
$line1=chomp($_); # chomp() Needed

while (<FD1>)
{
$line = chomp($_); # chomp() Needed
if ($line =~ /.*$line1.*/) # (.*)Not needed
{
print "Got the String\n";
}

}
}
Revert on having more queries.


Relevant Pages

  • Re: Elementary string-parsing
    ... "return" and passing arguments). ... stack at the end; hence they appear sort of global. ... "ValueError" if the string isn't a representation of a number? ... Convert a string or a number to floating point. ...
    (comp.lang.python)
  • Re: equivalent of chomp in perl
    ... on Perl, comparable to K&R). ... chomp VARIABLE ... string that doesn't end in a newline. ... char *s; ...
    (comp.lang.c)
  • Re: WindowsIdentity - Invalid token; it cannot be duplicated
    ... Because the login method will be used by asp.net application and also used ... passing the token to Login method and it tries to get the Priniciple. ... IntPtr iToken, string domainName, string userName) ... and why do you have to pass tokens around?? ...
    (microsoft.public.dotnet.security)
  • Re: equivalent of chomp in perl
    ... chomp VARIABLE ... string that doesn't end in a newline. ... and not just any last character. ... char *s; ...
    (comp.lang.c)
  • Re: C String Interop
    ... char) on passing to C. ... to C as a string, ... override the conversion for cases where that wasn't intended. ... But I would oppose special-casing of argument passing ...
    (comp.lang.fortran)