Not 100% sure, but $check[0] will never equal " " due to your split command..


At 05:25 PM 5/29/2001 -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 " ") {

## why not try
if ($vobs =~ /^\*/)             ## I don't know if $vobs is the right 
variable- use the variable you have chosen that gets the entire line: * 
/ebppvobstore/vobs/Core /ebppvobstore/vobs/aci.vbs publ" As long as the 
line begins with an "*" this should work

>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.
>
>Thanks
>Kailash

Reply via email to