pradeep reddy wrote:
> Hello all,

Hello,

> Iam new member to this group and also beginner to PERL.
> Here is my question,plz let me know your inpus:
> I have a PERL script which gives error report at the end.
> Here is the output.
>  
> cleartool: Error: Unable to create label "Pradeep" on 
> "/vob/rootinclude/paer.c" version "/main/3".
> cleartool: Error: Unable to create label "Pradeep" on 
> "/vob/rootinclude/pcme.h" version "/main/2".
> 
> I need to grab the two elements between the two quotes.
> Iam very much beginer to the PERL script.
> Iam trying this bit of code, not sure how to go on.
>  
> foreach (@problemLines) {
>    push $outLine,@problemLines; /"here Iam trying to get the each line into 
> outLine"/

The first argument to push() must be an array so that will not work.


>   if ($outLine =~ / cleartool: Error: Unable to create label /) {    /"here 
> Iam trying to match the pattern"/
> my @values = split(' " ',$outline);    /"Here Iam splitting the outline"/
> my $pathName = @values[3];
> my $Version = @values[5];
> cleartool mklabel $RECURSE $REPLACE -version $Version $labelName $pathName;   
> /"This is the comand Iam using"/
> print "$_\n";
> 
> } 

You probably want something like this:

my ( $labelName, $pathName, $Version ) = $outline =~ /"([^"]+)"/g;



John
-- 
Perl isn't a toolbox, but a small machine shop where you can special-order
certain sorts of tools at low cost and in short order.       -- Larry Wall

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to