FW: Re: [Visualperl-discuss] remote debugger gives error and 'use' is not working
by Tom Humphrey other posts by this author
Apr 18 2005 11:56AM messages near this date
view in the new Beta List Site
RE: [Visualperl-discuss] not importing namespace "System"
|
[Visualperl-discuss] fonts and colors not setting properly with underscore...
Hello discussion members. I am having a "hello world" problem that I hope
someone can assist me with. Please read the following discussion I had with
Eric at activestate:
Tom Humphrey wrote:
> Thanks for the comments. I purchased the book you mentioned, thanks for the
> link.
>
> Maybe you could get me up on my feet here.
>
> I have a simple .pl script that uses a managed DLL (right click->add
> reference in solution explorer).
> # Simple Perl File
> # Project : testPerlHelloWorldDLL
> # Generated by Visual Perl from a template in C:\Program Files\ActiveState
> Visual Perl\Wizards\PerlSimpleWiz\Templates\1033
> #
>
> use strict;
> BEGIN {push(@INC, "c:\\shoe\\perlHelloWorldDLL");}
> use perlHelloWorldDLL; # no more error!
>
> hello_world();
> #my $hw = new perlHelloWorldDLL();
> #print $hw->hello_world();
>
>
> and I have a DLL file that looks like this:
>
> # perlHelloWorldDLL --
> #
> # Generated by Visual Perl from a template in C:\Program Files\ActiveState
> Visual Perl\Wizards\PerlManagedDllWiz\Templates\1033
> #
> #
> # If you want to discuss PerlNet, or provide bug fixes/enhancements please
> do so
> # on the PerlNet mailing list at:
> # http://aspn.activestate.com/ASPN/Mail/Browse/Threaded/perl.net
> #
> # You will need to subscribe to the mailing list to post messages.
>
> package perlHelloWorldDLL;
>
> use strict;
>
> =for interface
> [interface: pure]
> static perlHelloWorldDLL();
> =cut
>
>
> sub hello_world {
> my $hw = "Hello World\n";
> return $hw;
> }
>
> 1;
>
>
> The error message I get is:
> C:\Shoe\testPerlHelloWorldDLL>perl testPerlHelloWorldDLL.pl
> Undefined subroutine &main::hello_world called at testPerlHelloWorldDLL.pl
> line 10.
>
> Do i need to add an interface to sub hello_world? how do i do this? what
> language is the interface in? I mean, this doesn't look like perl code:
>
> =for interface
> [interface: pure]
> static perlHelloWorldDLL();
> =cut
>
>
> Thanks Eric, sorry to bug you. I really want to start writing my Business
> Logic and I am tripped up on this small stuff.
>
> Regards
>
> Tom Humphrey
>
> BTW you may post this on the discussion board if you feel like it.
>
>
>
>
>
> ----Original Message Follows----
> From: Eric Promislow <ericp@[...].com>
> CC: visualperl-discuss@[...].com, Subject: Re:
> [Visualperl-discuss] remote debugger gives error and 'use' is not
> working
> Date: Fri, 15 Apr 2005 10:30:52 -0700
>
> Tom Humphrey wrote:
>
> >Hello,
> >
> > I have been programming with Komodo for the past few years and just
> >recently purchased Visual Perl. I would like some assistance with getting
> >my hello world program to run smoothly. This script runs perfectly from
> >Komodo.
> >
> >Here is my simple script:
> >
> >#!/usr/bin/perl -w
> >use strict;
> >BEGIN {push(@INC, "c:\\foo\\bar");}
> >#use Foobar; # Foobar.pm exists in c:\foo\bar, so why the compile error?
> >require Foobar;
> >print "Hello World!\n";
> >
> >
> >1. Error messages that popup when I run the script: (I have no idea what
> >these are but I definitely do not want remote debugging (or at least I
> >don't think I do - am i missing a design concept here?)).
> >
> >"Waiting for the Perl debugger session to start, at port 3000. Please
> >press the Cancel button to stop waiting."
>
>
> Is Project-properties|Debugging|DebugMode set to "Project"?
>
> >
> >"Attaching the Visual Perl DE debugger to process '[2944]
> >sl_perl_debugger.exe' on machine 'PAVILION' falied. Error code
> >0x80004005."
>
>
> This is a Visual Studio message that pops up when the Perl debugger
> ends prematurely. We haven't found a way to squelch it.
>
> >
> >2. When 'use' is in effect it gives a compile error. 'require' works just
> >fine. How can I get 'use' statements to work? I do not want 'require'.
>
>
> I couldn't duplicate the error. Is there no other instance of
> "Foobar.pm" that the interpreter could be picking up instead?
> Does your module end with a "1;" or some other truthful value?
>
> >
> >3. I noticed that I can set the @INC variable in
> >project->properties->configuration properties->perl options. I can still
> >do it the old-fashioned way right? Well, either way I get an error with my
> >'use' statement.
> >
> >4. when it prints "Hello World" to a console, the console pops up for a
> >split second and disappears. What is up with that? There isn't a "push
> >button to continue" or anything. Also, how can I have the program output
> >go to the output pane in the IDE?
>
>
> VS doesn't have a builtin pause mode for Console applications -- if you
> build a hello world app in C#, VB.Net, C++, etc., you'll get the
> same behavior. We actually incorporated a pause at the end of
> running a program outside the debugger, but not in the debugger. Is
> it not working?
>
> >
> >5. Getting help! I am sorry if this is not the correct forum to address
> >these issues. Please direct me to the proper resources so I can figure
> >this stuff out myself.
>
>
> This list is the best place.
>
> >
> >6. Where can I read up on the differences between a Managed DLL Library
> >(isn't that redundant?), a Control Library, a Executable, a Managed Exe, a
> >Project, etc. I am not sure how these things operate within the .NET
> >framework. What is each one good for? Where is their documentation?
> >Unfortunately,
> >http://aspn.activestate.com/ASPN/docs/VisualPerl/manual.html and
> >http://aspn.activestate.com/ASPN/docs/VisualPerl/demo.html are not
> >satisfying my issues. Any more help?
>
>
> http://www.amazon.com/exec/obidos/ASIN/0130652067/qid%3D1025293038/sr%3D8-1/ref%3Dsr%5F8%5F
1/103-2933687-4567804
>
> (http://tinyurl.com/a3d42)
>
> Current used price is $10.59 -- the first half of the book just
> recapitulates an intro to Perl, but Yevgeny goes deeper into
> Perl.Net in the second half.
>
> For a glossary:
>
> "Managed DLL Library" => PerlNet .Net object, with 2-way interaction with
> .Net
> "Control Library" => PerlCtrl COM object
> "Executable" => Perlapp exe
> "Managed Exe" => PerlNet EXE, with access to the .Net framework
> "Project" => the standard Perl interpreter
> "Tray Application" and "Windows Service" map to PerlTray and PerlSvc
>
> - Hope this helps
>
>
> >
> >
> >Thanks a bunch, I appreciate any help I can get.
> >
> >Regards,
> >
> >Tom Humphrey
> >
> >
> >_______________________________________________
> >VisualPerl-discuss mailing list
> >VisualPerl-discuss@[...].com
> >To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>
_______________________________________________
VisualPerl-discuss mailing list
VisualPerl-discuss@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
|