On Feb 26, Daryl J. Hoyt said: >If there is only one of the lines |GRP| this will work. Otherwise I would >push the lines into a an array instead of a variable. > >@Out = `$Cmd`; >$WhatFollowsGRP = ""; > >foreach my $line (@Out) >{ > if($line =~ /|GRP|/)
You need to escape those |'s. They're special to a regex. > { > $line =~ s/|GRP|//; Whenever I see if (/foo/) { s/foo//; ... }, I suggest it be shortened to if (s/foo//) { ... } It's less work. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/ ** Look for "Regular Expressions in Perl" published by Manning, in 2002 ** <stu> what does y/// stand for? <tenderpuss> why, yansliterate of course. [ I'm looking for programming work. If you like my work, let me know. ] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]