From: Johnny Ingersoll <[EMAIL PROTECTED]>
> my first "serious" perl module is simple parse of IBM MVS JCL. In the
> following routine, I'm looking for program name in a parm line that
> may be of the form: PARM='BMP,WEAAC202,WEAAC202,,,,,,,,80,,,,,,' (in
> this instance it's supposed to go after the first 'WEAAC202')
>
> #!/usr/bin/perl
> use strict;
> use warnings;
> my $F=0;
> .......... Main Part of Program Here .................
> sub PARin
> {
> if ($_ =~ /PARM=\(\'[\w\/]*\',([\w]{6,8}),/) {
This should be
if ($_ =~ /PARM=\(\'[\w\/]*\',(\w{6,8}),/) {
\w means any "word" character, no need for the group there.
> if ($F == 1) {
> print "\n$ARGV[0],$St,$1";
> }
> } elsif ($_ =~ /PARM=\'(BMP)|(DLI),([\w]{6,8}),/) { <----A
| meand "or" in a regexp and it has the "lowest precedence". This
means that the regexp matches either
PARM='BMP
or
DLI,\w{6,8},
I guess you meant
/PARM=\'(BMP|DLI),([\w]{6,8}),/
and then
print "\n$ARGV[0],$St,$2";
HTH, Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]