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

Re:Create a package

Thread Next
From:
Jorge Goncalvez
Date:
March 5, 2002 01:19
Subject:
Re:Create a package
Message ID:
200203050919.KAA19697@cabs40.col.bsf.alcatel.fr
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";
  $MountsKey->GetValues(\%Vals);
  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

GetMyRegPath.pm did not return a true value at bootnet3.pl line 40.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About