From joshua.mcadams at gmail.com Thu Jun 1 08:19:01 2006 From: joshua.mcadams at gmail.com (Joshua McAdams) Date: Thu, 1 Jun 2006 11:19:01 -0400 Subject: [VPM] YAPC::NA Message-ID: <49d805d70606010819t27035a44t163eab9f7dc84a9a@mail.gmail.com> Hi there fellow Perl Mongers. I'm writing to remind you all that YAPC::NA is only a few weeks away. The conference will be held in Chicago June 26th through 28th and will feature four simultaneous sessions of Perl talks for three days in addition to a job fair, banquet, and auction. After the conference Damian Conway, Randal Schwartz, and brian d foy will be sticking around and conducting professional training classes and extremely reduced prices. This email is a little spammy (sorry about that), but I just wanted to remind you all about the conference and also ask for your help in promoting it so that we can fill up the few spots that are remaining. For more information check out http://www.yapcchicago.org. We invite you to put up posters: http://yapcchicago.org/yapc_poster.pdf http://yapcchicago.org/yapc_poster_white.pdf Or maybe a web banner: http://www.yapcchicago.org/yapc_banner_wide.jpg http://www.yapcchicago.org/yapc_banner_narrow.jpg Thank you for your help in making YAPC a success once again, Josh McAdams From darren at DarrenDuncan.net Thu Jun 1 14:15:12 2006 From: darren at DarrenDuncan.net (Darren Duncan) Date: Thu, 1 Jun 2006 14:15:12 -0700 Subject: [VPM] YAPC::NA In-Reply-To: <49d805d70606010819t27035a44t163eab9f7dc84a9a@mail.gmail.com> References: <49d805d70606010819t27035a44t163eab9f7dc84a9a@mail.gmail.com> Message-ID: As it is, I would very much like to go to YAPC::NA, as well as participate in the Pugs / Perl 6 Hackathon taking place afterwards. However, I determined this week that I can't afford the cost of the trip right now. Hopefully I can go to a later event, such as YAPC::NA 2007. And I'll try to participate in the Hackathon remotely, if that makes sense. -- Darren Duncan At 11:19 AM -0400 6/1/06, Joshua McAdams wrote: >Hi there fellow Perl Mongers. I'm writing to remind you all that >YAPC::NA is only a few weeks away. The conference will be held in >Chicago June 26th through 28th and will feature four simultaneous >sessions of Perl talks for three days in addition to a job fair, >banquet, and auction. After the conference Damian Conway, Randal >Schwartz, and brian d foy will be sticking around and conducting >professional training classes and extremely reduced prices. > >This email is a little spammy (sorry about that), but I just wanted to >remind you all about the conference and also ask for your help in >promoting it so that we can fill up the few spots that are remaining. > >For more information check out http://www.yapcchicago.org. > >We invite you to put up posters: > > http://yapcchicago.org/yapc_poster.pdf > http://yapcchicago.org/yapc_poster_white.pdf > >Or maybe a web banner: > > http://www.yapcchicago.org/yapc_banner_wide.jpg > http://www.yapcchicago.org/yapc_banner_narrow.jpg > >Thank you for your help in making YAPC a success once again, > >Josh McAdams From pzelnip at telus.net Sat Jun 3 22:10:27 2006 From: pzelnip at telus.net (Adam Parkin) Date: Sat, 03 Jun 2006 22:10:27 -0700 Subject: [VPM] Symbolic references with use strict in effect. Message-ID: <44826B43.50407@telus.net> Hi all, I have a question for the Perl guru's on this list. What I want to do is have my Perl script read from a text file some config data that looks something like: [DataEntry] SubRoutineToHandleThisEntry="foo" ArgumentsToSub="hello world" The idea is that the string "foo" is supposed to be the name of a subroutine in my Perl script, and the string "hello world" is the argument to pass to this subroutine. I can do something like this: $nameOfSub = "foo"; # name of sub to call $args = "hello world!"; # args to pass to sub &$nameOfSub ($args); # call foo() via a symbolic reference sub foo { print "In foo with args: @_\n"; } And this works, but there is (IMHO) one very major problem with this: it is a symbolic reference, and thus if I put "use strict" at the top of my script, this trick no longer works. Does anybody have a way of getting around this limitation? I *very* much want "use strict" to be in effect for my script, but I still want the flexibility of being able to read from a file the name of a subroutine to call. I could do something like have a hash in my script which maps string tokens to subroutine references, like so: my %tokenToSubHash = ( "foo" => \&foo, "bar" => \&bar); &{$tokenToSubHash{"foo"}}("hello world"); but this just seems a bit awkward as I now have to make sure I have an entry in this hash for every subroutine which is "visible" from the config file. Anybody have any other creative ideas? Thanks in advance. -- Adam Parkin E-mail: pzelnip at telus.net -------------------------- At the source of every error which is blamed on the computer you will find at least two human errors, including the error of blaming it on the computer. From abez at abez.ca Sat Jun 3 22:19:33 2006 From: abez at abez.ca (abez) Date: Sun, 4 Jun 2006 01:19:33 -0400 (EDT) Subject: [VPM] Symbolic references with use strict in effect. In-Reply-To: <44826B43.50407@telus.net> Message-ID: no strict "subs"; perldoc strict will tell you the rest. abram On Sat, 3 Jun 2006, Adam Parkin wrote: > Hi all, I have a question for the Perl guru's on this list. What I want > to do is have my Perl script read from a text file some config data that > looks something like: > > [DataEntry] > SubRoutineToHandleThisEntry="foo" > ArgumentsToSub="hello world" > > The idea is that the string "foo" is supposed to be the name of a > subroutine in my Perl script, and the string "hello world" is the > argument to pass to this subroutine. I can do something like this: > > $nameOfSub = "foo"; # name of sub to call > $args = "hello world!"; # args to pass to sub > > &$nameOfSub ($args); # call foo() via a symbolic reference > > sub foo { > print "In foo with args: @_\n"; > } > > And this works, but there is (IMHO) one very major problem with this: it > is a symbolic reference, and thus if I put "use strict" at the top of my > script, this trick no longer works. Does anybody have a way of getting > around this limitation? I *very* much want "use strict" to be in effect > for my script, but I still want the flexibility of being able to read > from a file the name of a subroutine to call. I could do something like > have a hash in my script which maps string tokens to subroutine > references, like so: > > my %tokenToSubHash = ( "foo" => \&foo, "bar" => \&bar); > > &{$tokenToSubHash{"foo"}}("hello world"); > > but this just seems a bit awkward as I now have to make sure I have an > entry in this hash for every subroutine which is "visible" from the > config file. > > Anybody have any other creative ideas? > > Thanks in advance. > -- abez ------------------------------------------ http://www.abez.ca/ Abram Hindle (abez at abez.ca) ------------------------------------------ abez From darren at DarrenDuncan.net Sat Jun 3 22:25:35 2006 From: darren at DarrenDuncan.net (Darren Duncan) Date: Sat, 3 Jun 2006 22:25:35 -0700 Subject: [VPM] Symbolic references with use strict in effect. In-Reply-To: <44826B43.50407@telus.net> References: <44826B43.50407@telus.net> Message-ID: At 10:10 PM -0700 6/3/06, Adam Parkin wrote: >&$nameOfSub ($args); # call foo() via a symbolic reference > >And this works, but there is (IMHO) one very major problem with this: it >is a symbolic reference, and thus if I put "use strict" at the top of my >script, this trick no longer works. Does anybody have a way of getting >around this limitation? One solution is to turn off strict for just that line of code, and have it on for the rest of the file. Eg, if your example line works without strict, then you can do this: use strict; # code here is required to be strict { no strict; &$nameOfSub ($args); # not strict } # code here is required to be strict This said, there are inherent security risks in doing such symbolic references like this. What if someone puts 'system' as the name of the function to call, and 'rm -rf' as the argument. If you're going to let people just call functions like that, it is better to do this in an object-oriented context, where you have an object that defines the functions they can call, and then do something like this instead: $obj->$nameOfSub ($args); # syntax may be wrong Now they can't call any functions except for the methods you defined in the object. Generally speaking it is good to validate input on a whitelist basis anyway; so that the config file doesn't invoke anything except a predefined list of allowed things. -- Darren Duncan From jeremygwa at hotmail.com Sun Jun 4 06:55:52 2006 From: jeremygwa at hotmail.com (Jer A) Date: Sun, 04 Jun 2006 06:55:52 -0700 Subject: [VPM] Perl 6...taking sooo long...is it dead? In-Reply-To: Message-ID: hey all, I'd like to jump on the band wagon, and use perl 6 on the parrot vm, but I cannot seem to get a working distrobution, and I cannot find enough documentation. When i do a search on perl 6, it is all about the development of perl 6 and parrot. I wanna code perl 6 on parrot ....now;) They have been talking about this perl 6 ever since I have picked up perl......is there a betas available, that are in binary form and run on Win32? Thanks for all your help. -Jer A From pzelnip at telus.net Sun Jun 4 09:26:11 2006 From: pzelnip at telus.net (Adam Parkin) Date: Sun, 04 Jun 2006 09:26:11 -0700 Subject: [VPM] Symbolic references with use strict in effect. In-Reply-To: <448307EC.7090904@telus.net> References: <44826B43.50407@telus.net> <448307EC.7090904@telus.net> Message-ID: <448309A3.2050103@telus.net> First off, sorry Darren I didn't mean to send this message to your personal account, but when I hit "reply" to your VPM post Thunderbird automatically put your address in the "To" field instead of "victoria-pm at pm.org", and I didn't notice this until after I had hit "send". Darren Duncan wrote: > One solution is to turn off strict for just that line of code, and > have it on for the rest of the file. Hmm, okay, I like that idea: only having strict off for a block of code, but on everywhere else. But wouldn't the "no strict" still apply to the subroutines that get called? use strict; { no strict; my $nameOfSub = "foo"; &$nameOfSub ($args); } sub foo { # in here no strict is still in effect so I could do something like $variableWithoutUsingMy = .....; # print the wrong thing by mistake print "$avriableWithoutUsingMy\n"; } I could do like Abram suggested and use no strict "subs" rather than no strict, but still I believe the relaxed strictness will apply to the called sub (which I don't really want). I wonder, could I do something like: use strict; my $fnRef; { my $nameOfSub = "foo"; no strict "subs"; $fnRef = \&$nameOfSub; } &$fnRef ($args); That is, just turn the strict off long enough to get a real (not symbolic) reference to the sub, then turn use strict back on before calling the sub through the reference. I think I shall try this to see what happens. =8-> >> This said, there are inherent security risks in doing such symbolic >> references like this. What if someone puts 'system' as the name of >> the function to call, and 'rm -rf' as the argument. Of course, and I am fully aware of that, but given that this is a pet project to be used by myself and only myself I'm not to worried about myself being a malicious user. =8-p Thanks for the suggestions! -- Adam Parkin E-mail: pzelnip at telus.net -------------------------- We often spend so much time coping with problems along our path that we forget why we are on that path in the first place. The result is that we only have a dim, or even inaccurate, view of what's really important to us. -- Peter Senge, The Fifth Discipline From kencl at shaw.ca Mon Jun 5 05:21:22 2006 From: kencl at shaw.ca (Ken Clarke) Date: Mon, 05 Jun 2006 05:21:22 -0700 Subject: [VPM] Symbolic references with use strict in effect. References: <44826B43.50407@telus.net> Message-ID: <002d01c6889a$8e8e7640$1000a8c0@kens> You could use the string form of eval to call it: use strict; my $nameOfSub = "foo"; my $args = "hello world!"; my $subCall = "\&$nameOfSub"; eval "$subCall('$args')"; >> Ken Clarke >> Contract Web Programmer / E-commerce Technologist >> www.PerlProgrammer.net From Peter at psdt.com Mon Jun 5 07:51:42 2006 From: Peter at psdt.com (Peter Scott) Date: Mon, 05 Jun 2006 07:51:42 -0700 Subject: [VPM] Symbolic references with use strict in effect. In-Reply-To: <448309A3.2050103@telus.net> References: <44826B43.50407@telus.net> <448307EC.7090904@telus.net> <448309A3.2050103@telus.net> Message-ID: At 9:26 AM -0700 6/4/06, Adam Parkin wrote: >First off, sorry Darren I didn't mean to send this message to your >personal account, but when I hit "reply" to your VPM post Thunderbird >automatically put your address in the "To" field instead of >"victoria-pm at pm.org", and I didn't notice this until after I had hit "send". > >Darren Duncan wrote: >> One solution is to turn off strict for just that line of code, and >> have it on for the rest of the file. > >Hmm, okay, I like that idea: only having strict off for a block of code, >but on everywhere else. But wouldn't the "no strict" still apply to the >subroutines that get called? No, its scope is lexical, not dynamic. >use strict; > >{ > no strict; > my $nameOfSub = "foo"; > &$nameOfSub ($args); >} > >sub foo { > # in here no strict is still in effect No it isn't. >so I could do something like No you couldn't :-) From Peter at psdt.com Mon Jun 5 07:57:53 2006 From: Peter at psdt.com (Peter Scott) Date: Mon, 05 Jun 2006 07:57:53 -0700 Subject: [VPM] Symbolic references with use strict in effect. In-Reply-To: References: Message-ID: At 1:19 AM -0400 6/4/06, abez wrote: >no strict "subs"; I beg to differ. no strict 'refs'; The alternative without violating strict is to maintain a dispatch table: hash of names vs subrefs. However, I have used the strict-violating shortcut myself. It boils down to whether I want to validate the routine to be called. If I find myself writing "if defined &$sub2call" I know I'd be better off with the dispatch table. >On Sat, 3 Jun 2006, Adam Parkin wrote: > >> Hi all, I have a question for the Perl guru's on this list. What I want >> to do is have my Perl script read from a text file some config data that >> looks something like: >> >> [DataEntry] >> SubRoutineToHandleThisEntry="foo" >> ArgumentsToSub="hello world" >> >> The idea is that the string "foo" is supposed to be the name of a >> subroutine in my Perl script, and the string "hello world" is the >> argument to pass to this subroutine. I can do something like this: >> >> $nameOfSub = "foo"; # name of sub to call >> $args = "hello world!"; # args to pass to sub >> >> &$nameOfSub ($args); # call foo() via a symbolic reference >> >> sub foo { >> print "In foo with args: @_\n"; >> } >> >> And this works, but there is (IMHO) one very major problem with this: it >> is a symbolic reference, and thus if I put "use strict" at the top of my >> script, this trick no longer works. Does anybody have a way of getting >> around this limitation? I *very* much want "use strict" to be in effect >> for my script, but I still want the flexibility of being able to read >> from a file the name of a subroutine to call. I could do something like >> have a hash in my script which maps string tokens to subroutine >> references, like so: >> >> my %tokenToSubHash = ( "foo" => \&foo, "bar" => \&bar); >> >> &{$tokenToSubHash{"foo"}}("hello world"); >> >> but this just seems a bit awkward as I now have to make sure I have an >> entry in this hash for every subroutine which is "visible" from the >> config file. >> >> Anybody have any other creative ideas? >> >> Thanks in advance. >> > >-- >abez ------------------------------------------ >http://www.abez.ca/ Abram Hindle (abez at abez.ca) >------------------------------------------ abez > >_______________________________________________ >Victoria-pm mailing list >Victoria-pm at pm.org >http://mail.pm.org/mailman/listinfo/victoria-pm From Peter at PSDT.com Mon Jun 12 08:19:50 2006 From: Peter at PSDT.com (Peter Scott) Date: Mon, 12 Jun 2006 08:19:50 -0700 Subject: [VPM] June meeting Message-ID: <6.2.3.4.2.20060612081922.02573428@mail.webquarry.com> Any takers for the June Perl Mongers meeting topics? -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ http://www.perlmedic.com/ From Peter at PSDT.com Tue Jun 13 11:32:28 2006 From: Peter at PSDT.com (Peter Scott) Date: Tue, 13 Jun 2006 11:32:28 -0700 Subject: [VPM] Perl Mongers meeting cancelled Message-ID: <6.2.3.4.2.20060613113031.02616b30@mail.webquarry.com> The June Perl Mongers meeting is cancelled; part of the meeting on July 18 will be devoted to a preview of my OSCON session, "Mind Like Water: The Path to Perl Bliss". Anyone with ideas for the other half of the time, please contact me. Thanks. -- Peter Scott Pacific Systems Design Technologies http://www.perldebugged.com/ http://www.perlmedic.com/ From mike at nachbaur.com Fri Jun 16 10:53:57 2006 From: mike at nachbaur.com (Michael Nachbaur) Date: Fri, 16 Jun 2006 10:53:57 -0700 Subject: [VPM] RDF and Perl slides Message-ID: <0C82AAD1-6BBF-48B5-9EA6-118009154346@nachbaur.com> A friend and colleague of mine, Kjetil Kjernsmo, gave a lightning talk at the Norwegian Perl Workshop today on Perl and RDF. He's put the slides online at: http://my.opera.com/kjetilk/homes/files/perlrdf1.html On a related note, RDF::Helper has been released today to CPAN. There's unfortunately no documentation for it yet, but those will be coming either when I get some spare time, or someone sends a patch. My goal over the next week or two (or so) is to create a sample application demonstrating the use of RDF::Helper, to help people get started. If anyone has questions, please feel free to ask.