On Tue, May 29, 2001 at 05:25:18PM -0400, [EMAIL PROTECTED] wrote:
> 
> 
> Hi All,
>       I am working on the following output.
> 
> * /ebppvobstore/vobs/Core /ebppvobstore/vobs/aci.vbs public
> * /ebppvobstore/vobs/UCMCQ /ebppvobstore/vobs/UCMCQ.vbs public (ucmvob)
>   /ebppvobstore/vobs/Comp_Care /ebppvobstore/vobs/Comp_Care.vbs/ public
> 
> I want to check for the asterisks and if found do something else do something. I
> am having a little trouble to make this work.
> This is the code
> 
> use strict ;
> my @vobtags = `cleartool lsvob` ;
> my $vobs ;
> my @check ;
> foreach $vobs (@vobtags) {
> chomp $vobs ;
> @check = split /\s+/, $vobs ;
> chomp $check[0] ;
> if ($check[0] ne " ") {
> print "$check[1] \n" ;
> }
> else{
> print " The vob $check[1] is not mounted\n ";
> }
> }
> 
> This is the output I am getting (obviously not what I want)
> dug # perl vobmount
> /ebppvobstore/vobs/Core
> /ebppvobstore/vobs/UCMCQ
> /ebppvobstore/vobs/Comp_Care
> 
> 
> I would appreciate if somebody can help me, point my blunder.

A few hints:

1.  Indent your code.

2.  When code isn't doing what you expect, a good first step is to
either run the code in the debugger or print out the variable that
doesn't contain what you think it does.  Here you're assuming that
$check[0] will be a space on lines that don't start with a *, but in
fact it's an empty string ("").

Walt

-- 
Walter C. Mankowski
Senior Software Engineer        Myxa Corporation
phone: (610) 234-2626           fax: (610) 234-2640
email: [EMAIL PROTECTED]            http://www.myxa.com

Reply via email to