Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation


by akm2 (Scribe)
on Mar 31, 2001 at 20:27 UTC ( #68665=perlquestion: print w/replies, xml ) Need Help??
akm2 has asked for the wisdom of the Perl Monks concerning the following question:

I' using the following code to read the windows registry and create a startmenu shortcut accordingly.

sub MakeShortcut{ use Config; use Win32::API; use Win32::Shortcut; use Win32::TieRegistry; use strict; use Win32::TieRegisry ( Delimiter=>"/" ); my ($key); if ($configUser || Win32::IsWin95()) { $key = 'CUser/Software/Microsoft/Windows/CurrentVersion/Explor +er/Shell Folders//Programs'; } else { $key = 'LMachine/SOFTWARE/Microsoft/Windows/CurrentVersion/Exp +lorer/Shell Folders//Common Programs'; } my $folderdir = $Registry->{$key}; my $folderpath = "$folderdir\\$shortcutfoldername"; print "Creating shortcut folder $folderpath\n"; mkdir ($folderpath, 0777); print "Making shortcut Tk Solitaire\n"; my $LINK=new Win32::Shortcut(); $LINK->{'Path'}="\\Tk Solitaire\\Tk Solitaire.exe"; $LINK->{'Arguments'}=""; $LINK->{'WorkingDirectory'}=\\Tk Solitaire; $LINK->{'Description'}="Tk Solitaire"; $LINK->{'ShowCmd'}=SW_SHOWNORMAL; $LINK->Save("$folderpath\\Tk Solitaire.lnk"); $LINK->Close(); }

When I try to run the above code on my Windows2000 Advanced Server system using ActiveState ActivePerl version I get the following error.

Can't locate Win32/ in @INC (@INC contains: E:/Perl/lib E +:/Perl/sit e/lib .) at line 8. BEGIN failed--compilation aborted at line 8.

I thought Win32::TieRegistry was included in the distribution of ActivePerl? What's wrong here?

Replies are listed 'Best First'.
(tye)Re: Win32::TieRegistry
by tye (Sage) on Mar 31, 2001 at 21:56 UTC

    use Win32::TieRegisry ( Delimiter=>"/" );

    Can't locate Win32/ in @INC

    It is called a Registry. (:

            - tye (but my friends call me "Tye")
      Ouch, posting a stupid mistake to pm...

      That's why, when on a win32 platform and already dealing with ActiveState, I use Komodo, their IDE. It handles a bunch of stuff, from python to c++ to html, but I only use it for perl. It has, among other things, the ability to automatically check your code as you go (I think what it does is run perl in the background and send stderr to the statusbar or some such equvilient procedure). It's built with Mozilla, and with the constant running of perl to check everything, it gets pretty slow on this ol' 233, but it works. I like it.


        This has absolutley nothing to do with the original post, but I thought I'd second the recomendation for Komodo. It has the _potential_ to be one of the best IDE's out there. Once they work out the.. uhm.. features of course. The (half working) features like code folding and immeidate syntax checking are a huge plus. It's like running -w before execution. There's also a "technology preview" for Linux but I haven't looked at it since I don't run X on my linux boxes.
Re: Win32::TieRegistry
by dws (Chancellor) on Apr 02, 2001 at 10:22 UTC
    I'm surprised that   $LINK->{'WorkingDirectory'}=\\Tk Solitaire;
    didn't generate a warning when you compiled with -w

    Or is "\\Tk Solitaire" quoted in the original?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://68665]
Approved by root
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2018-03-19 16:51 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (244 votes). Check out past polls.