from the error msg i conclude that line 29 is not producing a match. You
might want to add some print statements to see whats going on there.
if it holds meta chars like japhy said, you might also want to try
"quotemeta $_;" so you can be sure all 'special characters' are escaped for
the regex.

Regards,

Jos Bouamns

----- Original Message -----
From: "Anshu Anshu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, May 08, 2001 11:36 PM
Subject: Re: what's wrong in systax


> Thanks for reply. below is the varibales as defined -
>
> $LOCTAG = "<!--location-->";
> $TYPETAG = "<!-ategory-->";
>
> and error message was
>
> Name "main::JOBDATA" used only once: possible typo at gen_job.pl line 14.
> Name "main::CP" used only once: possible typo at gen_job.pl line 13.
> Use of uninitialized value in substitution (s///) at gen_job.pl line 35.
>
> Thanks
> AS
> ----- Original Message -----
> From: "Jeff Pinyan" <[EMAIL PROTECTED]>
> To: "Anshu Anshu" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Tuesday, May 08, 2001 5:28 PM
> Subject: Re: what's wrong in systax
>
>
> > On May 8, Anshu Anshu said:
> >
> > > 22  while (<IF>) {
> > >    23      if (/$LOCTAG/i) {
> > >    24          ($curloc) = /VALUE="([^"]+)"\s*\w*>/i;
> > >    25          $location .= "${curloc}::";
> > >    26      }
> > >    27
> > >    28      if (/$TYPETAG/i) {
> > >    29          ($curtype) = /VALUE="([^"]+)">/i;
> > >    30          $jobtype .= "${curtype}::";
> > >    31      }
> > >    32  }
> > >    33  close(IF);
> > >    34  $location =~ s/::$//;
> > >    35  $jobtype =~ s/::$//;
> >
> > It would be much appreciated if you gave us an error message.  My guess
is
> > that there are characters in $LOCTAG and $TYPETAG that Perl is using as
> > regex characters.  Try:
> >
> >   if (/\Q$LOCTAG\E/i) { ... }
> >   if (/\Q$TYPETAG\E/i) { ... }
> >
> > instead.  Or, consider using index() instead:
> >
> >   if (index(lc, lc($LOCTAG)) > -1) { ... }
> >
> > --
> > Jeff "japhy" Pinyan      [EMAIL PROTECTED]
http://www.pobox.com/~japhy/
> > Are you a Monk?  http://www.perlmonks.com/
http://forums.perlguru.com/
> > Perl Programmer at RiskMetrics Group, Inc.
http://www.riskmetrics.com/
> > Acacia Fraternity, Rensselaer Chapter.         Brother #734
> >
> >
>

Reply via email to