develooper Front page | perl.beginners | Postings from March 2002

Re:Create a package

Thread Next
Jorge Goncalvez
March 5, 2002 01:19
Re:Create a package
Message ID:
Hi, I wanted to create a package like this:
package GetMyRegPath;

use Win32::Registry;

sub GetCygwinMountsPath(){
  my %Vals = ();
  my $RegPath = "SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/";
  $main::HKEY_LOCAL_MACHINE->Open($RegPath, my $MountsKey) || die "Couldn't
open $RegPath\n";
  foreach my $Val (keys %Vals){
    my $Key = $Vals{$Val};
    if ($$Key[0] eq "native"){
      my $MountsPath = $$Key[2];

      my ($Path) = $MountsPath =~ /(.+?)cygwin/;

      return  ($Path);

    } #end if
  } #end foreach
} #end sub

use GetMyRegPath;

but it fails and i have this why?
thanks did not return a true value at line 40.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About