From lisakachold at obnosis.com Fri Apr 1 13:22:39 2011 From: lisakachold at obnosis.com (Lisa Kachold) Date: Fri, 1 Apr 2011 13:22:39 -0700 Subject: [Phoenix-pm] Perl developer opportunity In-Reply-To: <7107E0161F60429FB7062655884CAE3B@idx8> References: <7107E0161F60429FB7062655884CAE3B@idx8> Message-ID: Perl Developer is needed in Scottsdale, AZ. If you would be interested in this job- please email me your resume in Word format. I'd love to speak with you! *Summary:* This position will work as part of a team of developers to code software and architect solutions supporting customers and our own internal technical requirements. Expertise in design, coding, debugging and testing of code operating in mixed environments will be required. Will be expected to adhere to departmental standards of development and implementation. Primary skills are as follows: Perl, SQL programming, MySQL, Apache, Shell Scripting, Object Oriented Development, CVS and Linux System Administration. Secondary skills that are beneficial but not required are: HTML, CSS, Javascript and mod_Perl. We are looking for a Perl developer with extensive programming and database expertise. Must have the ability to methodically troubleshoot and streamline existing code and STRONG scripting data skills. * * *Essential Job Functions:* This position interfaces with all aspects of the organization. - Proactively obtain and maintain a working knowledge of the architecture and platform(s), product features and benefits, usability, and the operational ?lifecycle? of setting up and managing new clients and projects. - Desire to learn and internalize business model, clients and technologies and provide positive impact on overall solution designs. - Proactively create and maintain open, day-to-day communications with the management to efficiently meet deadlines and drive the overall progress of both assigned and associated tasks. - Work with team members to maintain and create technical documentation. - Work within established change control environment for production changes. - Effectively test and trouble-shoot code as developed, both for self and others as part of overall code base. - Work with QA personnel to establish effective testing plans. - Maintain and seek ongoing communication with project stakeholders and team members on project statuses, challenges or new ideas. - Position is 50% Application Development, 20% Database Development, 15% QA & Testing and 15% Technical Documentation. *Essential Job Requirements:* - Education: Computer Science degree preferred. - Experience: At least (3-5) years of heavy experience in enterprise environment working with Linux, Apache, Perl and MySQL. - Required Skills: ? Expertise in accessing and utilizing data in MySQL to import, export and generate reports. ? Experience with Windows and Linux. ? Expertise in Object Oriented Development, Perl, SQL, Shell Scripting and Linux administration. ? Ability to work independently to troubleshoot and track down code functionality and potential issues. ? Proven ability to create professional technical and requirements documents. ? Ability to communicate verbally with both technical and non-technical users. ? Expertise in working with complex solutions that have little/no documentation. ? Must be self-motivated and be able to manage multiple deadlines and tasks in a fast paced, changing environment. - Preferred Skills: ? VMWare Experience ? Postfix Administration ? MySQL Master/Slave Administration Support Sincerely, Cindy Yetka, TSC TECHSTAFF INC The Technical Placement Specialists 4450 S. Rural Road Suite E126 Tempe, AZ 85282 480-456-4050 480-456-4048 fax cindy at techstaffaz.com www.techstaff.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From temanite at gmail.com Tue Apr 5 11:16:20 2011 From: temanite at gmail.com (Brent Roberts) Date: Tue, 5 Apr 2011 11:16:20 -0700 Subject: [Phoenix-pm] Perl developer opportunity In-Reply-To: References: <7107E0161F60429FB7062655884CAE3B@idx8> Message-ID: Hello all. I am setting up a mod_perl instance to send (html) emails. Does anyone have any quick suggestions for me? postifx? sendmail? Some library from cpan? Obviously, I want things to work as quickly as possible, and use the least amount of resources. thank you for any thoughts. -Brent -------------- next part -------------- An HTML attachment was scrubbed... URL: From friedman at highwire.stanford.edu Tue Apr 5 11:45:52 2011 From: friedman at highwire.stanford.edu (Michael Friedman) Date: Tue, 5 Apr 2011 11:45:52 -0700 Subject: [Phoenix-pm] Perl developer opportunity In-Reply-To: References: <7107E0161F60429FB7062655884CAE3B@idx8> Message-ID: Brent, If you don't mind sendmail, I've used Mail::Sendmail for quite a while and it works like a charm. You create a hash with all the bits of the email you want to send (To, From, Subject, content, attachments, etc.) and then the module takes care of sending it through sendmail or to an SMTP server. http://search.cpan.org/~mivkovic/Mail-Sendmail-0.79/ Don't be scared by the 2003 release date. Sendmail itself hasn't changed that much since then either. :-) -- Mike ______________________________________________________________________________ Mike Friedman | HighWire Press, Stanford Univ | friedman at highwire.stanford.edu On Apr 5, 2011, at 11:16 AM, Brent Roberts wrote: > Hello all. > > I am setting up a mod_perl instance to send (html) emails. Does anyone have > any quick suggestions for me? postifx? sendmail? Some library from cpan? > > > Obviously, I want things to work as quickly as possible, and use the least > amount of resources. > > > thank you for any thoughts. > > > -Brent > _______________________________________________ > Phoenix-pm mailing list > Phoenix-pm at pm.org > http://mail.pm.org/mailman/listinfo/phoenix-pm From temanite at gmail.com Tue Apr 5 13:12:59 2011 From: temanite at gmail.com (Brent Roberts) Date: Tue, 5 Apr 2011 13:12:59 -0700 Subject: [Phoenix-pm] Perl developer opportunity In-Reply-To: References: <7107E0161F60429FB7062655884CAE3B@idx8> Message-ID: <2C0B24B4-72C3-40A0-9266-0906C69E3961@gmail.com> Mike - Thanks for the detailed response. I appreciate it! I'll give it a whirl ... -Brent Sent from my iPhone On Apr 5, 2011, at 11:45 AM, Michael Friedman wrote: > Brent, > > If you don't mind sendmail, I've used Mail::Sendmail for quite a while and it works like a charm. You create a hash with all the bits of the email you want to send (To, From, Subject, content, attachments, etc.) and then the module takes care of sending it through sendmail or to an SMTP server. > > http://search.cpan.org/~mivkovic/Mail-Sendmail-0.79/ > > Don't be scared by the 2003 release date. Sendmail itself hasn't changed that much since then either. :-) > > -- Mike > ______________________________________________________________________________ > Mike Friedman | HighWire Press, Stanford Univ | friedman at highwire.stanford.edu > > On Apr 5, 2011, at 11:16 AM, Brent Roberts wrote: > >> Hello all. >> >> I am setting up a mod_perl instance to send (html) emails. Does anyone have >> any quick suggestions for me? postifx? sendmail? Some library from cpan? >> >> >> Obviously, I want things to work as quickly as possible, and use the least >> amount of resources. >> >> >> thank you for any thoughts. >> >> >> -Brent >> _______________________________________________ >> Phoenix-pm mailing list >> Phoenix-pm at pm.org >> http://mail.pm.org/mailman/listinfo/phoenix-pm > From doug at veritablesoftware.com Wed Apr 6 16:22:50 2011 From: doug at veritablesoftware.com (Douglas E. Miles) Date: Wed, 06 Apr 2011 16:22:50 -0700 Subject: [Phoenix-pm] Meeting 04/07/2011 7:00 PM In-Reply-To: <4D952BB6.2030403@veritablesoftware.com> References: <4D952BB6.2030403@veritablesoftware.com> Message-ID: <4D9CF5CA.90303@veritablesoftware.com> See you tomorrow night. Please RSVP if you haven't already. On 3/31/2011 6:34 PM, Douglas E. Miles wrote: > Doug Miles will be presenting "Automating Your CRUD" on Thursday > 04/07/2011 at 7:00 PM. Please RSVP so we know to expect you... > > Liquid Web office in the Waste Management Building > 7025 N. Scottsdale Rd. > Ste. 230 > Scottsdale, AZ 85258 > > The cross-streets are Scottsdale Rd. just North of Indian Bend. There > is a light at 7025 and Scottsdale Rd. Here is a Google Map with > directions from Indian Bend: > > http://maps.google.com/maps?f=d&source=s_d&saddr=N+Scottsdale+Rd+%26+E+Indian+Bend+Rd,+Scottsdale,+Maricopa,+Arizona&daddr=E+Apartment&geocode=FY_C_wEdeiZU-SmV17ocPwsrhzHgZVw84qEytg%3BFf7I_wEdkyhU-Q&hl=en&mra=pd&mrcr=0&sll=33.539526,-111.925475&sspn=0.010767,0.022058&ie=UTF8&ll=33.539615,-111.92524&spn=0.002692,0.005515&t=h&z=18 > > > Do not trust the directions from Google Maps if you type the address > in yourself. In fact, don't trust anything Google Maps has to say > about Scottsdale. ;) > > The doors are locked, so there will be someone waiting to let you in. > Please be prompt. If you are late, call 480-788-PERL (480-788-7375), > and someone will come and let you in. > > > _______________________________________________ > Phoenix-pm mailing list > Phoenix-pm at pm.org > http://mail.pm.org/mailman/listinfo/phoenix-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From doug at veritablesoftware.com Wed Apr 6 20:07:17 2011 From: doug at veritablesoftware.com (Douglas E. Miles) Date: Wed, 06 Apr 2011 20:07:17 -0700 Subject: [Phoenix-pm] Meeting 04/07/2011 7:00 PM In-Reply-To: <4554DBAC-1D48-4D49-8E79-81EEE8C9227A@me.com> References: <4D952BB6.2030403@veritablesoftware.com> <4D9CF5CA.90303@veritablesoftware.com> <4554DBAC-1D48-4D49-8E79-81EEE8C9227A@me.com> Message-ID: <4D9D2A65.30202@veritablesoftware.com> It's all right. It's a CRUDy presentation anyway. :P Thanks to John we'll get it up on youtube at some point. On 4/6/2011 4:25 PM, Derek Cline wrote: > Just a heads up I can't make this month's meeting. > > On Apr 6, 2011, at 4:22 PM, Douglas E. Miles wrote: > >> See you tomorrow night. Please RSVP if you haven't already. >> >> On 3/31/2011 6:34 PM, Douglas E. Miles wrote: >>> Doug Miles will be presenting "Automating Your CRUD" on Thursday >>> 04/07/2011 at 7:00 PM. Please RSVP so we know to expect you... >>> >>> Liquid Web office in the Waste Management Building >>> 7025 N. Scottsdale Rd. >>> Ste. 230 >>> Scottsdale, AZ 85258 >>> >>> The cross-streets are Scottsdale Rd. just North of Indian Bend. >>> There is a light at 7025 and Scottsdale Rd. Here is a Google Map >>> with directions from Indian Bend: >>> >>> http://maps.google.com/maps?f=d&source=s_d&saddr=N+Scottsdale+Rd+%26+E+Indian+Bend+Rd,+Scottsdale,+Maricopa,+Arizona&daddr=E+Apartment&geocode=FY_C_wEdeiZU-SmV17ocPwsrhzHgZVw84qEytg%3BFf7I_wEdkyhU-Q&hl=en&mra=pd&mrcr=0&sll=33.539526,-111.925475&sspn=0.010767,0.022058&ie=UTF8&ll=33.539615,-111.92524&spn=0.002692,0.005515&t=h&z=18 >>> >>> >>> Do not trust the directions from Google Maps if you type the address >>> in yourself. In fact, don't trust anything Google Maps has to say >>> about Scottsdale. ;) >>> >>> The doors are locked, so there will be someone waiting to let you >>> in. Please be prompt. If you are late, call 480-788-PERL >>> (480-788-7375), and someone will come and let you in. >>> >>> >>> _______________________________________________ >>> Phoenix-pm mailing list >>> Phoenix-pm at pm.org >>> http://mail.pm.org/mailman/listinfo/phoenix-pm >> >> _______________________________________________ >> Phoenix-pm mailing list >> Phoenix-pm at pm.org >> http://mail.pm.org/mailman/listinfo/phoenix-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From doug at veritablesoftware.com Mon Apr 11 12:01:44 2011 From: doug at veritablesoftware.com (Douglas E. Miles) Date: Mon, 11 Apr 2011 12:01:44 -0700 Subject: [Phoenix-pm] Automating Your CRUD Video and Slides Message-ID: <4DA35018.5020701@veritablesoftware.com> All, Here are the links to the video and slides for the "Automating Your CRUD" presentation: http://www.youtube.com/watch?v=RqJ5nQWfGzQ http://pm.veritablesoftware.com/slides/CRUD/index.html Thanks to John, as always for the video work! From leegold at fastmail.fm Wed Apr 13 10:32:54 2011 From: leegold at fastmail.fm (leegold) Date: Wed, 13 Apr 2011 10:32:54 -0700 Subject: [Phoenix-pm] wxPerl: Perl questions In-Reply-To: References: Message-ID: <1302715974.31504.1440779489@webmail.messagingengine.com> Hi, I am trying to lean wx, so far IMHO the wxPerl code is easier to understand than wxPython in this case. What I'm going for is simplicity here. I'm going to ask some possibly newbie questions, I've search the web for answers but haven't come up with anything clear so I'm asking. >From a wxPerl program: use Wx; package MyApp; use base 'Wx::App'; What is difference between a module and a package? What exactly is MyApp? It's a package but I can't find any documentation on it. There's no "MyApp" in my C:\Perl folder... Tried to find info in "use base" keywords but no simple explainations. What does "use base" do? Here's the script: # load wxPerl main module use Wx; # every application must create an application object package MyApp; use base 'Wx::App'; sub OnInit { # parent window, Window ID -1 means any, # title, # default position, # size my $frame = Wx::Frame->new( undef, -1, 'wxPerl rules', [-1, -1], [250, 150]); $frame->Show( 1 ); } package main; # create the application object, this will call OnInit my $app = MyApp->new; # process GUI events from the application this function will not # return until the last frame is closed $app->MainLoop; Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From friedman at highwire.stanford.edu Wed Apr 13 10:50:22 2011 From: friedman at highwire.stanford.edu (Michael Friedman) Date: Wed, 13 Apr 2011 10:50:22 -0700 Subject: [Phoenix-pm] wxPerl: Perl questions In-Reply-To: <1302715974.31504.1440779489@webmail.messagingengine.com> References: <1302715974.31504.1440779489@webmail.messagingengine.com> Message-ID: <30D4100F-4DD4-430E-BC77-584007071831@highwire.stanford.edu> leegold, Newbie questions are our specialty! First and foremost, a very good book that gives a good overview of what all this stuff means is _Modern Perl_, by chromatic. It's a free download, completely searchable, and easy to read, even for someone new to Perl. http://www.onyxneon.com/books/modern_perl/index.html > >> From a wxPerl program: > > use Wx; > package MyApp; > use base 'Wx::App'; > > > What is difference between a module and a package? A module is a file on the filesystem containing Perl code. They usually end with .pm. A package is the equivalent of a class in many other languages. You can have more than one package in a file, if you're being tricky. In general, there's one package per module and the module is named the same as the package. So "package MyApp;" is in the file "MyApp.pm". That way Perl can auto-locate the file containing the package when you use it from some other file. (A package isn't really a class -- it's just a way of segmenting code by giving it a namespace -- but modern perl uses packages in the same way other languages use classes, most of the time.) > > What exactly is MyApp? It's a package but I can't find any > documentation on it. There's no "MyApp" in my C:\Perl folder... Your own modules go wherever you want them. So you don't find a MyApp.pm because you haven't saved this code in a file on your own computer yet. :-) Since the same syntax ('use ;') is used for loading both modules installed from CPAN and your own modules, it can sometimes be hard to tell which are which. I recommend naming your own modules with some top-level name that relates to the project/company/section/whatever so it's easier to tell the difference. I work for a company named "HighWire", so our custom modules are called like so: package Highwire::Resource::Citation; which is in a file in my home directory called ~/projects/Highwire/Resource/Citation.pm . That way it's easy to see which are modules I wrote and which are from CPAN. > > Tried to find info in "use base" keywords but no simple > explainations. What does "use base" do? > > "use base" means that the named package is the parent of this package. When you're calling methods on an object, it'll search in the local package first and then start walking through everything in "use base". If you're using a version of perl > 5.10 (I think) you can also use "use parent" instead. http://perldoc.perl.org/base.html http://perldoc.perl.org/parent.html all the 'use' pragmas: http://perldoc.perl.org/index-pragmas.html In this case, by having "use base Wx::App;", you're saying that "if you can't find a method in this file, go look in Wx::App, which probably has it." That's subclassing! Good luck! -- Mike Friedman > > Here's the script: > > # load wxPerl main module > use Wx; > # every application must create an application object > package MyApp; > use base 'Wx::App'; > sub OnInit { > > # parent window, Window ID -1 means any, # title, # > default position, # size > my $frame = Wx::Frame->new( undef, -1, 'wxPerl rules', [-1, > -1], [250, 150]); > > $frame->Show( 1 ); > } > package main; > # create the application object, this will call OnInit > my $app = MyApp->new; > # process GUI events from the application this function will not > # return until the last frame is closed > $app->MainLoop; > > Thanks > _______________________________________________ > Phoenix-pm mailing list > Phoenix-pm at pm.org > http://mail.pm.org/mailman/listinfo/phoenix-pm From friedman at highwire.stanford.edu Wed Apr 13 12:13:14 2011 From: friedman at highwire.stanford.edu (Michael Friedman) Date: Wed, 13 Apr 2011 12:13:14 -0700 Subject: [Phoenix-pm] wxPerl: Perl questions In-Reply-To: <55371540-6081-4D23-9B4B-947C469F2A56@highwire.stanford.edu> References: <1302715974.31504.1440779489@webmail.messagingengine.com> <30D4100F-4DD4-430E-BC77-584007071831@highwire.stanford.edu> <1302721319.475.1440808465@webmail.messagingengine.com> <55371540-6081-4D23-9B4B-947C469F2A56@highwire.stanford.edu> Message-ID: Er, left off the list... Sorry. ______________________________________________________________________________ Mike Friedman | HighWire Press, Stanford Univ | friedman at highwire.stanford.edu On Apr 13, 2011, at 12:12 PM, Michael Friedman wrote: > Yep, that's exactly right. > > 'package' is file-scoped, until you hit another package statement or EOF, so it "contains" everything from there down. > > "package main;" is a special statement. Just like in C or Java (or probably other languages that I'm not as familiar with) the "main" package is the one that contains global definitions and handles command-line arguments and such. Effectively it's acting as an "end package" statement here, since Perl doesn't use braces around packages. > > -- Mike F > ______________________________________________________________________________ > Mike Friedman | HighWire Press, Stanford Univ | friedman at highwire.stanford.edu > > On Apr 13, 2011, at 12:01 PM, leegold wrote: > >> Hi, >> >> So if "package" creates classes and thus namespaces then take the snip: >> >> ... >> package MyApp; >> use base 'Wx::App'; >> sub OnInit { >> # parent window, Window ID -1 means any, # title, # default >> position, # size >> my $frame = Wx::Frame->new( undef, -1, 'wxPerl rules', [-1, -1], >> [250, 150]); >> $frame->Show( 1 ); >> } >> ... >> >> Rewriting it a little. Could it be thought of like this ?: >> >> package MyApp; # class MyApp >> #{ >> use base 'Wx::App'; >> sub OnInit { >> # parent window, Window ID -1 means any, # title, # default >> position, # size >> my $frame = Wx::Frame->new( undef, -1, 'wxPerl rules', [-1, >> -1], [250, 150]); >> $frame->Show( 1 ); >> } >> #} end class MyApp >> >> Because that's what seems like is going on to me. And then further down >> in the script the main namespace is re-established and a MyApp object is >> instantiated...? >> >> Thanks, >> >> Lee G. >> >> >> >> >> On Wed, 13 Apr 2011 10:50 -0700, "Michael Friedman" >> wrote: >>> leegold, >>> >>> Newbie questions are our specialty! >>> >>> First and foremost, a very good book that gives a good overview of what >>> all this stuff means is _Modern Perl_, by chromatic. It's a free >>> download, completely searchable, and easy to read, even for someone new >>> to Perl. >>> http://www.onyxneon.com/books/modern_perl/index.html >>> >>>> >>>>> From a wxPerl program: >>>> >>>> use Wx; >>>> package MyApp; >>>> use base 'Wx::App'; >>>> >>>> >>>> What is difference between a module and a package? >>> >>> A module is a file on the filesystem containing Perl code. They usually >>> end with .pm. >>> >>> A package is the equivalent of a class in many other languages. You can >>> have more than one package in a file, if you're being tricky. In general, >>> there's one package per module and the module is named the same as the >>> package. So "package MyApp;" is in the file "MyApp.pm". That way Perl can >>> auto-locate the file containing the package when you use it from some >>> other file. >>> >>> (A package isn't really a class -- it's just a way of segmenting code by >>> giving it a namespace -- but modern perl uses packages in the same way >>> other languages use classes, most of the time.) >>> >>>> >>>> What exactly is MyApp? It's a package but I can't find any >>>> documentation on it. There's no "MyApp" in my C:\Perl folder... >>> >>> Your own modules go wherever you want them. So you don't find a MyApp.pm >>> because you haven't saved this code in a file on your own computer yet. >>> :-) >>> >>> Since the same syntax ('use ;') is used for loading both modules >>> installed from CPAN and your own modules, it can sometimes be hard to >>> tell which are which. I recommend naming your own modules with some >>> top-level name that relates to the project/company/section/whatever so >>> it's easier to tell the difference. I work for a company named >>> "HighWire", so our custom modules are called like so: >>> >>> package Highwire::Resource::Citation; >>> >>> which is in a file in my home directory called >>> ~/projects/Highwire/Resource/Citation.pm . That way it's easy to see >>> which are modules I wrote and which are from CPAN. >>> >>>> >>>> Tried to find info in "use base" keywords but no simple >>>> explainations. What does "use base" do? >>>> >>>> >>> >>> "use base" means that the named package is the parent of this package. >>> When you're calling methods on an object, it'll search in the local >>> package first and then start walking through everything in "use base". If >>> you're using a version of perl > 5.10 (I think) you can also use "use >>> parent" instead. >>> >>> http://perldoc.perl.org/base.html >>> http://perldoc.perl.org/parent.html >>> all the 'use' pragmas: http://perldoc.perl.org/index-pragmas.html >>> >>> In this case, by having "use base Wx::App;", you're saying that "if you >>> can't find a method in this file, go look in Wx::App, which probably has >>> it." That's subclassing! >>> >>> Good luck! >>> -- Mike Friedman >>> >>>> >>>> Here's the script: >>>> >>>> # load wxPerl main module >>>> use Wx; >>>> # every application must create an application object >>>> package MyApp; >>>> use base 'Wx::App'; >>>> sub OnInit { >>>> >>>> # parent window, Window ID -1 means any, # title, # >>>> default position, # size >>>> my $frame = Wx::Frame->new( undef, -1, 'wxPerl rules', [-1, >>>> -1], [250, 150]); >>>> >>>> $frame->Show( 1 ); >>>> } >>>> package main; >>>> # create the application object, this will call OnInit >>>> my $app = MyApp->new; >>>> # process GUI events from the application this function will not >>>> # return until the last frame is closed >>>> $app->MainLoop; >>>> >>>> Thanks >>>> _______________________________________________ >>>> Phoenix-pm mailing list >>>> Phoenix-pm at pm.org >>>> http://mail.pm.org/mailman/listinfo/phoenix-pm >>> > From doug at veritablesoftware.com Thu Apr 14 08:50:10 2011 From: doug at veritablesoftware.com (Douglas E. Miles) Date: Thu, 14 Apr 2011 08:50:10 -0700 Subject: [Phoenix-pm] wxPerl: Perl questions In-Reply-To: References: <1302715974.31504.1440779489@webmail.messagingengine.com> <30D4100F-4DD4-430E-BC77-584007071831@highwire.stanford.edu> <1302721319.475.1440808465@webmail.messagingengine.com> <55371540-6081-4D23-9B4B-947C469F2A56@highwire.stanford.edu> Message-ID: <4DA717B2.2090208@veritablesoftware.com> I'll just add one thing to Michael's excellent explanation. Like he said, in general you're being tricky if you have more than one package per module, but I wanted to warn you that almost all examples of wx code you find will do this. I don't know why that is. If it confuses you, you can always break the packages out into separate files and then use them in your main program. On 04/13/2011 12:13 PM, Michael Friedman wrote: > Er, left off the list... Sorry. > > ______________________________________________________________________________ > Mike Friedman | HighWire Press, Stanford Univ | friedman at highwire.stanford.edu > > On Apr 13, 2011, at 12:12 PM, Michael Friedman wrote: > >> Yep, that's exactly right. >> >> 'package' is file-scoped, until you hit another package statement or EOF, so it "contains" everything from there down. >> >> "package main;" is a special statement. Just like in C or Java (or probably other languages that I'm not as familiar with) the "main" package is the one that contains global definitions and handles command-line arguments and such. Effectively it's acting as an "end package" statement here, since Perl doesn't use braces around packages. >> >> -- Mike F >> ______________________________________________________________________________ >> Mike Friedman | HighWire Press, Stanford Univ | friedman at highwire.stanford.edu >> >> On Apr 13, 2011, at 12:01 PM, leegold wrote: >> >>> Hi, >>> >>> So if "package" creates classes and thus namespaces then take the snip: >>> >>> ... >>> package MyApp; >>> use base 'Wx::App'; >>> sub OnInit { >>> # parent window, Window ID -1 means any, # title, # default >>> position, # size >>> my $frame = Wx::Frame->new( undef, -1, 'wxPerl rules', [-1, -1], >>> [250, 150]); >>> $frame->Show( 1 ); >>> } >>> ... >>> >>> Rewriting it a little. Could it be thought of like this ?: >>> >>> package MyApp; # class MyApp >>> #{ >>> use base 'Wx::App'; >>> sub OnInit { >>> # parent window, Window ID -1 means any, # title, # default >>> position, # size >>> my $frame = Wx::Frame->new( undef, -1, 'wxPerl rules', [-1, >>> -1], [250, 150]); >>> $frame->Show( 1 ); >>> } >>> #} end class MyApp >>> >>> Because that's what seems like is going on to me. And then further down >>> in the script the main namespace is re-established and a MyApp object is >>> instantiated...? >>> >>> Thanks, >>> >>> Lee G. >>> >>> >>> >>> >>> On Wed, 13 Apr 2011 10:50 -0700, "Michael Friedman" >>> wrote: >>>> leegold, >>>> >>>> Newbie questions are our specialty! >>>> >>>> First and foremost, a very good book that gives a good overview of what >>>> all this stuff means is _Modern Perl_, by chromatic. It's a free >>>> download, completely searchable, and easy to read, even for someone new >>>> to Perl. >>>> http://www.onyxneon.com/books/modern_perl/index.html >>>> >>>>>> From a wxPerl program: >>>>> use Wx; >>>>> package MyApp; >>>>> use base 'Wx::App'; >>>>> >>>>> >>>>> What is difference between a module and a package? >>>> A module is a file on the filesystem containing Perl code. They usually >>>> end with .pm. >>>> >>>> A package is the equivalent of a class in many other languages. You can >>>> have more than one package in a file, if you're being tricky. In general, >>>> there's one package per module and the module is named the same as the >>>> package. So "package MyApp;" is in the file "MyApp.pm". That way Perl can >>>> auto-locate the file containing the package when you use it from some >>>> other file. >>>> >>>> (A package isn't really a class -- it's just a way of segmenting code by >>>> giving it a namespace -- but modern perl uses packages in the same way >>>> other languages use classes, most of the time.) >>>> >>>>> What exactly is MyApp? It's a package but I can't find any >>>>> documentation on it. There's no "MyApp" in my C:\Perl folder... >>>> Your own modules go wherever you want them. So you don't find a MyApp.pm >>>> because you haven't saved this code in a file on your own computer yet. >>>> :-) >>>> >>>> Since the same syntax ('use ;') is used for loading both modules >>>> installed from CPAN and your own modules, it can sometimes be hard to >>>> tell which are which. I recommend naming your own modules with some >>>> top-level name that relates to the project/company/section/whatever so >>>> it's easier to tell the difference. I work for a company named >>>> "HighWire", so our custom modules are called like so: >>>> >>>> package Highwire::Resource::Citation; >>>> >>>> which is in a file in my home directory called >>>> ~/projects/Highwire/Resource/Citation.pm . That way it's easy to see >>>> which are modules I wrote and which are from CPAN. >>>> >>>>> Tried to find info in "use base" keywords but no simple >>>>> explainations. What does "use base" do? >>>>> >>>>> >>>> "use base" means that the named package is the parent of this package. >>>> When you're calling methods on an object, it'll search in the local >>>> package first and then start walking through everything in "use base". If >>>> you're using a version of perl > 5.10 (I think) you can also use "use >>>> parent" instead. >>>> >>>> http://perldoc.perl.org/base.html >>>> http://perldoc.perl.org/parent.html >>>> all the 'use' pragmas: http://perldoc.perl.org/index-pragmas.html >>>> >>>> In this case, by having "use base Wx::App;", you're saying that "if you >>>> can't find a method in this file, go look in Wx::App, which probably has >>>> it." That's subclassing! >>>> >>>> Good luck! >>>> -- Mike Friedman >>>> >>>>> Here's the script: >>>>> >>>>> # load wxPerl main module >>>>> use Wx; >>>>> # every application must create an application object >>>>> package MyApp; >>>>> use base 'Wx::App'; >>>>> sub OnInit { >>>>> >>>>> # parent window, Window ID -1 means any, # title, # >>>>> default position, # size >>>>> my $frame = Wx::Frame->new( undef, -1, 'wxPerl rules', [-1, >>>>> -1], [250, 150]); >>>>> >>>>> $frame->Show( 1 ); >>>>> } >>>>> package main; >>>>> # create the application object, this will call OnInit >>>>> my $app = MyApp->new; >>>>> # process GUI events from the application this function will not >>>>> # return until the last frame is closed >>>>> $app->MainLoop; >>>>> >>>>> Thanks >>>>> _______________________________________________ >>>>> Phoenix-pm mailing list >>>>> Phoenix-pm at pm.org >>>>> http://mail.pm.org/mailman/listinfo/phoenix-pm > _______________________________________________ > Phoenix-pm mailing list > Phoenix-pm at pm.org > http://mail.pm.org/mailman/listinfo/phoenix-pm