RE: Regexp needed

2002-03-05 Thread Thomas Bätzler
Lee Goddard [[EMAIL PROTECTED]] suggested: > 1. Read the regex POD (perldoc perlre) or better > buy the Programming Perl book and read its great regex pages. An of course ORA also has the wonderful "Mastering Regular Expressions" by Jeffrey Friedl (aka the Owl book), which gives you a nice ground

re:Regexp needed

2002-03-05 Thread Lee Goddard
At 11:20 05/03/2002 +0100, Jorge Goncalvez wrote: >my ($Path) = $MountsPath =~ /(.+?)cygwin/; >but I wanted to get rid of the "/". >because $MountsPath could be c:/cygwin or c:/xyz/cygwin or >c:/xyz/zyx/cygwin and >i wanted $Path = c: or c:/xyz or c:/xyz/zyx . >And now $Path= c:/ or c:/xyz or c:

Re: Regexp needed

2002-03-05 Thread $Bill Luebkert
Jorge Goncalvez wrote: > hi, i have this: > my ($Path) = $MountsPath =~ /(.+?)cygwin/; > but I wanted to get rid of the "/". > because $MountsPath could be c:/cygwin or c:/xyz/cygwin or c:/xyz/zyx/cygwin and > i wanted $Path = c: or c:/xyz or c:/xyz/zyx . > And now $Path= c:/ or c:/xyz or c:/xyz

re:Regexp needed

2002-03-05 Thread Jorge Goncalvez
hi, i have this: my ($Path) = $MountsPath =~ /(.+?)cygwin/; but I wanted to get rid of the "/". because $MountsPath could be c:/cygwin or c:/xyz/cygwin or c:/xyz/zyx/cygwin and i wanted $Path = c: or c:/xyz or c:/xyz/zyx . And now $Path= c:/ or c:/xyz or c:/xyz/zyx. How can I do ? thanks.

RE: Create a package

2002-03-05 Thread Thomas Bätzler
Jorge Goncalvez [[EMAIL PROTECTED]] asked: > Hi, I wanted to create a package like this: [...] > but it fails and i have this why? > GetMyRegPath.pm did not return a true value at bootnet3.pl line 40. There you have your answer :-) Per definition, a package must always return true. You should a

Re:Create a package

2002-03-05 Thread Jorge Goncalvez
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";