From mike at stok.ca Thu Jan 7 16:00:28 2010 From: mike at stok.ca (Mike Stok) Date: Thu, 7 Jan 2010 19:00:28 -0500 Subject: [tpm] Happy new year. Message-ID: I hope that all the Toronto Perl Mongers had a good holiday season, and have a good year in 2010. Does anyone have a presentation for January? The meeting should be on Thursday 28 January, and some of the ideas from last year included a hackathon, presentations about interesting / favorite modules, possibly an EXIF talk after April. If you have any ideas or suggestions then air them on the list. Regards, Mike -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply. -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoniosun at lavabit.com Sat Jan 9 09:52:36 2010 From: antoniosun at lavabit.com (Antonio Sun) Date: Sat, 9 Jan 2010 12:52:36 -0500 Subject: [tpm] Replace a string with the result of shell command Message-ID: Hi, Here is the simplified example of what I want to do: DB<1> $v = 'AAabcDDabc' DB<2> $v = m/abc/`echo $& | rev`/g Backticks found where operator expected . . . Please don't take it literally, and argue that shell invoking is not necessary -- I want to replace a certain string with the result of shell command, and pass the matched string to the shell command as well. Please help. Thanks Antonio -------------- next part -------------- An HTML attachment was scrubbed... URL: From indy at indigostar.com Sat Jan 9 10:27:13 2010 From: indy at indigostar.com (Indy Singh) Date: Sat, 9 Jan 2010 13:27:13 -0500 Subject: [tpm] Replace a string with the result of shell command References: Message-ID: <2DE119D484B740629A118415E55D3EE5@ROADKILL> This might be closer to what you want: $v = 'AAabcDDabc'; $v =~ s/abc/`echo $& | rev`/eg; Note: Replace '=' with '=~' Replace 'm' with 's' Use the /e operator Indy Singh IndigoSTAR Software -- www.indigostar.com ----- Original Message ----- From: Antonio Sun To: TPM Mongers Sent: Saturday, January 09, 2010 12:52 PM Subject: [tpm] Replace a string with the result of shell command Hi, Here is the simplified example of what I want to do: DB<1> $v = 'AAabcDDabc' DB<2> $v = m/abc/`echo $& | rev`/g Backticks found where operator expected . . . Please don't take it literally, and argue that shell invoking is not necessary -- I want to replace a certain string with the result of shell command, and pass the matched string to the shell command as well. Please help. Thanks Antonio ------------------------------------------------------------------------------ _______________________________________________ toronto-pm mailing list toronto-pm at pm.org http://mail.pm.org/mailman/listinfo/toronto-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at stok.ca Sat Jan 9 10:28:23 2010 From: mike at stok.ca (Mike Stok) Date: Sat, 9 Jan 2010 13:28:23 -0500 Subject: [tpm] Replace a string with the result of shell command In-Reply-To: References: Message-ID: <0E061607-8AE3-4AC4-BA20-A15715F7B8E7@stok.ca> On Jan 9, 2010, at 12:52 PM, Antonio Sun wrote: > Hi, > > Here is the simplified example of what I want to do: > > DB<1> $v = 'AAabcDDabc' > DB<2> $v = m/abc/`echo $& | rev`/g > Backticks found where operator expected . . . > > Please don't take it literally, and argue that shell invoking is not necessary -- I want to replace a certain string with the result of shell command, and pass the matched string to the shell command as well. f you really want to do it that way then you can use s///ge for example: DB<1> sub rev_chomp { my $v = `echo $_[0] | rev`; chomp $v; $v } DB<2> x rev_chomp 'foo' 0 'oof' DB<3> $v = 'AAabcDDabc' DB<4> $v =~ s/(abc)/rev_chomp($1)/ge DB<5> x $v 0 'AAcbaDDcba' Hope this helps, Mike -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply. -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoniosun at lavabit.com Sat Jan 9 10:58:25 2010 From: antoniosun at lavabit.com (Antonio Sun) Date: Sat, 9 Jan 2010 13:58:25 -0500 Subject: [tpm] Replace a string with the result of shell command In-Reply-To: <2DE119D484B740629A118415E55D3EE5@ROADKILL> References: <2DE119D484B740629A118415E55D3EE5@ROADKILL> Message-ID: On Sat, Jan 9, 2010 at 1:27 PM, Indy Singh wrote: > This might be closer to what you want: > $v = 'AAabcDDabc'; > $v =~ s/abc/`echo $& | rev`/eg; > Yep, that works fine. thanks a lot. -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam.prime at utoronto.ca Wed Jan 13 20:47:27 2010 From: adam.prime at utoronto.ca (Adam Prime) Date: Wed, 13 Jan 2010 23:47:27 -0500 Subject: [tpm] [Fwd: Re: [yapc] yapc Digest, Vol 48, Issue 1] Message-ID: <4B4EA1DF.6050701@utoronto.ca> FYI -------- Original Message -------- Subject: Re: [yapc] yapc Digest, Vol 48, Issue 1 Date: Wed, 13 Jan 2010 21:57:14 -0500 From: BAIRH at nationwide.com To: yapc at pm.org Just as an FYI YAPC::NA::2010 June 21, 22, 23rd, 2010. At Ohio State University, Knowlton Hall ( http://www.osu.edu/map/building.php?building=017 ) We are going to sign the hotel block tomorrow and once that is done I will send out details.) Larry, Randal, and Damian will all be there. Randal and Damian will also be teaching master classes on Thursday June 24th and Friday June 25th. From linux at alteeve.com Thu Jan 14 07:39:46 2010 From: linux at alteeve.com (Madison Kelly) Date: Thu, 14 Jan 2010 10:39:46 -0500 Subject: [tpm] fork and blessed hash references Message-ID: <4B4F3AC2.7000503@alteeve.com> Hi all, I want to put a shutdown timer on a spawnable daemon (specifically, a script spawned by dbus). To do this, I created a bless'ed "self" hash reference in my module's constructor, set a few time values in it and the call a timer method. In the timer method, I 'fork' and the child starts a loop and the main script returns and waits for method calls over dbus. The problem is that, in the child process, changes to the values in 'self' made by the parent do not appear in the child. Specifically, each method call changes a '$self->{SHUTDOWN_TIME}' value. I can understand this behavior to an extent, but when I print out the hash reference itself both in the parent and the child, they have the same reference string. Obviously though, they aren't actually using the same memory space. So two questions; 1. Why do the self references match when they don't (apparently) use the same memory space 2. What is the best way to "share" variables between children and parents? Currently I am working around the problem by writing out my timing info to a tmp file, but this seems to be unnecessarily expensive. Thanks all! Madi From fulko.hew at gmail.com Thu Jan 14 07:49:57 2010 From: fulko.hew at gmail.com (Fulko Hew) Date: Thu, 14 Jan 2010 10:49:57 -0500 Subject: [tpm] fork and blessed hash references In-Reply-To: <4B4F3AC2.7000503@alteeve.com> References: <4B4F3AC2.7000503@alteeve.com> Message-ID: <8204a4fe1001140749s492b3e8u8c274847f16fabc7@mail.gmail.com> On Thu, Jan 14, 2010 at 10:39 AM, Madison Kelly wrote: > Hi all, > > I want to put a shutdown timer on a spawnable daemon (specifically, a > script spawned by dbus). To do this, I created a bless'ed "self" hash > reference in my module's constructor, set a few time values in it and the > call a timer method. In the timer method, I 'fork' and the child starts a > loop and the main script returns and waits for method calls over dbus. > > The problem is that, in the child process, changes to the values in 'self' > made by the parent do not appear in the child. Specifically, each method > call changes a '$self->{SHUTDOWN_TIME}' value. I can understand this > behavior to an extent, but when I print out the hash reference itself both > in the parent and the child, they have the same reference string. Obviously > though, they aren't actually using the same memory space. > > So two questions; > > 1. Why do the self references match when they don't (apparently) use the > same memory space > Because a forked process contains a 'copy' of the parent process. Since its an exact copy, it effectively has exactly the same memory addresses. (but they are in a separate instance of memory space) > > 2. What is the best way to "share" variables between children and parents? > Pipes, shared memory, files, sockets, etc. There is no 'best' way. Originally forked process (parent/child) were intended to be 'very independent' and hence don't 'share memory', and are protected from the other's 'bugs', and your only choices are the ones above. Then the world invented threads, where everything runs in the same process space and effectively shares everything, were one thread can accidentally (bug) walk over everything. Currently I am working around the problem by writing out my timing info to a > tmp file, but this seems to be unnecessarily expensive. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From indy at indigostar.com Thu Jan 14 08:01:43 2010 From: indy at indigostar.com (Indy Singh) Date: Thu, 14 Jan 2010 11:01:43 -0500 Subject: [tpm] fork and blessed hash references References: <4B4F3AC2.7000503@alteeve.com> Message-ID: > 2. What is the best way to "share" variables between children and > parents? Have a look at 'perldoc perlipc' > 1. Why do the self references match when they don't (apparently) use > the same memory space The two processes use the same logical memory address, but it gets mapped to a differnt physical address. This way the processes are protected from each other. If you really wanted to share memory you would have to call the memory sharing functions provided by the OS. No sure how to do that from Perl, or if it is even worth the trouble. Indy Singh IndigoSTAR Software -- www.indigostar.com ----- Original Message ----- From: "Madison Kelly" To: "Toronto Perl Mongers" Sent: Thursday, January 14, 2010 10:39 AM Subject: [tpm] fork and blessed hash references > Hi all, > > I want to put a shutdown timer on a spawnable daemon (specifically, > a script spawned by dbus). To do this, I created a bless'ed "self" > hash reference in my module's constructor, set a few time values in it > and the call a timer method. In the timer method, I 'fork' and the > child starts a loop and the main script returns and waits for method > calls over dbus. > > The problem is that, in the child process, changes to the values in > 'self' made by the parent do not appear in the child. Specifically, > each method call changes a '$self->{SHUTDOWN_TIME}' value. I can > understand this behavior to an extent, but when I print out the hash > reference itself both in the parent and the child, they have the same > reference string. Obviously though, they aren't actually using the > same memory space. > > So two questions; > > 1. Why do the self references match when they don't (apparently) use > the same memory space > > 2. What is the best way to "share" variables between children and > parents? > > Currently I am working around the problem by writing out my timing > info to a tmp file, but this seems to be unnecessarily expensive. > > Thanks all! > > Madi > _______________________________________________ > toronto-pm mailing list > toronto-pm at pm.org > http://mail.pm.org/mailman/listinfo/toronto-pm From abram.hindle at softwareprocess.es Thu Jan 14 08:03:13 2010 From: abram.hindle at softwareprocess.es (Abram Hindle) Date: Thu, 14 Jan 2010 11:03:13 -0500 Subject: [tpm] fork and blessed hash references In-Reply-To: <4B4F3AC2.7000503@alteeve.com> (sfid-20100114_104214_549120_E1EAD265) References: <4B4F3AC2.7000503@alteeve.com> (sfid-20100114_104214_549120_E1EAD265) Message-ID: <4B4F4041.70006@softwareprocess.es> Madison Kelly wrote: > Hi all, > > I want to put a shutdown timer on a spawnable daemon (specifically, a > script spawned by dbus). To do this, I created a bless'ed "self" hash > reference in my module's constructor, set a few time values in it and > the call a timer method. In the timer method, I 'fork' and the child > starts a loop and the main script returns and waits for method calls > over dbus. > > The problem is that, in the child process, changes to the values in > 'self' made by the parent do not appear in the child. Specifically, each > method call changes a '$self->{SHUTDOWN_TIME}' value. I can understand > this behavior to an extent, but when I print out the hash reference > itself both in the parent and the child, they have the same reference > string. Obviously though, they aren't actually using the same memory space. They are clones of each other, their pointers are of the same value but the memory space each resides in belongs to a different process. Processes do not share pages. > So two questions; > > 1. Why do the self references match when they don't (apparently) use the > same memory space Fork produces a new process that is a copy of the old one. From your point of view they don't share the same the same memory, they are just clones of each other. (There's a bunch of other lameness and limitations but you can read 'man fork'). > 2. What is the best way to "share" variables between children and parents? You don't. You have to communicate. Generally you open a socket or a pipe between the processes and then when you want to share values you make up a protocol to do so. You can also used shared memory, like mmap, but even then you need to work out what you want to do. Perhaps you want to use threads? Other solutions are: RPC, CORBA, DBUS, etc. Forking is often easiest if you have 1 way communication, then you just write to the pipe from the parent and read from it as the child. You can use select (perldoc select) to periodically check if anything new has been sent down. perldoc perlipc abram -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 260 bytes Desc: OpenPGP digital signature URL: From uri at StemSystems.com Thu Jan 14 08:11:39 2010 From: uri at StemSystems.com (Uri Guttman) Date: Thu, 14 Jan 2010 11:11:39 -0500 Subject: [tpm] fork and blessed hash references In-Reply-To: (Indy Singh's message of "Thu\, 14 Jan 2010 11\:01\:43 -0500") References: <4B4F3AC2.7000503@alteeve.com> Message-ID: <87wrzkis3o.fsf@quad.sysarch.com> >>>>> "IS" == Indy Singh writes: >> 1. Why do the self references match when they don't (apparently) use >> the same memory space IS> The two processes use the same logical memory address, but it gets IS> mapped to a differnt physical address. This way the processes are IS> protected from each other. If you really wanted to share memory you IS> would have to call the memory sharing functions provided by the OS. just to be pedantic, they map to the same virtual address and you don't know or care about the physical address. in fact, some of the perl interpreter could map to same physical address if it is read only binary code. and some of the data space could also be mapped to the same physical address if that is marked copy-on-write. uri -- Uri Guttman ------ uri at stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com --------- From linux at alteeve.com Thu Jan 14 08:16:55 2010 From: linux at alteeve.com (Madison Kelly) Date: Thu, 14 Jan 2010 11:16:55 -0500 Subject: [tpm] fork and blessed hash references In-Reply-To: <8204a4fe1001140749s492b3e8u8c274847f16fabc7@mail.gmail.com> References: <4B4F3AC2.7000503@alteeve.com> <8204a4fe1001140749s492b3e8u8c274847f16fabc7@mail.gmail.com> Message-ID: <4B4F4377.8030304@alteeve.com> Fulko Hew wrote: > So two questions; > > 1. Why do the self references match when they don't (apparently) use > the same memory space > > > Because a forked process contains a 'copy' of the parent process. Since > its an exact copy, it > effectively has exactly the same memory addresses. (but they are in a > separate instance of memory space) > > > 2. What is the best way to "share" variables between children and > parents? > > > Pipes, shared memory, files, sockets, etc. There is no 'best' way. > Originally forked process (parent/child) were intended to be 'very > independent' > and hence don't 'share memory', and are protected from the other's 'bugs', > and your only choices are the ones above. > > Then the world invented threads, where everything runs in the same > process space > and effectively shares everything, were one thread can accidentally > (bug) walk over > everything. > > Currently I am working around the problem by writing out my timing > info to a tmp file, > > but this seems to be unnecessarily expensive. Thanks Fulko! I didn't realize that the "copy" duplicated what looked to me to be memory addresses while not actually being so. I ran this by my boss after sending this (it's not a work project, but he's a geek enough to take interest). He suggested posix's settimer, which perl doesn't seem to implement. However, that led us to 'alarm', which might just be the ticket. The idea is; Setup a SIGALARM handler that shuts down the daemon, then on setup set an alarm for X time in the future. After that, each method call can call 'alarm' for Y time in the future, hopefully clearing the current pending alarm(s) and pushing the back into the future. Once there is enough time with no activity, the SIGALARM will call the handler and will shut down the daemon. This should let me stay in the same memory space without the risks of threading while leaving the daemon ready to respond to method calls. Think this should work? Every day, something new to learn. I love this stuff. :3 Madi From stuart at morungos.com Thu Jan 14 08:25:30 2010 From: stuart at morungos.com (Stuart Watt) Date: Thu, 14 Jan 2010 11:25:30 -0500 Subject: [tpm] fork and blessed hash references In-Reply-To: <4B4F4377.8030304@alteeve.com> References: <4B4F3AC2.7000503@alteeve.com> <8204a4fe1001140749s492b3e8u8c274847f16fabc7@mail.gmail.com> <4B4F4377.8030304@alteeve.com> Message-ID: <4B4F457A.4030606@morungos.com> Madison Kelly wrote: > However, that led us to 'alarm', which might just be the ticket. > > The idea is; Setup a SIGALARM handler that shuts down the daemon, > then on setup set an alarm for X time in the future. After that, each > method call can call 'alarm' for Y time in the future, hopefully > clearing the current pending alarm(s) and pushing the back into the > future. Once there is enough time with no activity, the SIGALARM will > call the handler and will shut down the daemon. alarm works very well for timeouts - we even use it on Windows, which breaks fork() even more. If notification is all you need, not data sharing, its all fairly straightforward. For data sharing, it sounds slightly crazy, but the simplest solution for us was to use DBI and SQLite, with its exclusive transactions. These allows us to coordinate safe data access between processes, and it works on all platforms safely. All the best Stuart From janes.rob at gmail.com Thu Jan 14 08:49:30 2010 From: janes.rob at gmail.com (Rob Janes) Date: Thu, 14 Jan 2010 11:49:30 -0500 Subject: [tpm] fork and blessed hash references In-Reply-To: <4B4F457A.4030606@morungos.com> References: <4B4F3AC2.7000503@alteeve.com> <8204a4fe1001140749s492b3e8u8c274847f16fabc7@mail.gmail.com> <4B4F4377.8030304@alteeve.com> <4B4F457A.4030606@morungos.com> Message-ID: <83eac04d1001140849q56b2a360v1de05e201b93921a@mail.gmail.com> check out Time::HiRes for alarms with granularity less than one second. the perl ipc stuff allows you to access a shared memory region. From a c perspective, the ipc shared memory is truly shared. I looked at the perl shared memory code, and I believe what it does is copy the shared memory region into a perl variable. Updates to the shared memory must be copied back manually via call to perl ipc method. In order to make this work, you'll also have to get a semaphore to serialize access to the shared memory region. there is an alternative process. set a signal handler for one of the user signals SIGUSR1 say. Send a signal to that process and handler to reset the timer. Your SIGALRM handler then is in a process which also has a SIGUSR1 handler. The SIGUSR1 handler resets the timer. This way you don't need shared memory or semaphores. Much easier, much less complicated. All that needs to be known globally is the pid (process id) and maybe the tid (thread id) of the SIGUSR1 handler. -rob janes arjay at cpan.org On Thu, Jan 14, 2010 at 11:25 AM, Stuart Watt wrote: > Madison Kelly wrote: >> >> However, that led us to 'alarm', which might just be the ticket. >> >> ?The idea is; Setup a SIGALARM handler that shuts down the daemon, then on >> setup set an alarm for X time in the future. After that, each method call >> can call 'alarm' for Y time in the future, hopefully clearing the current >> pending alarm(s) and pushing the back into the future. Once there is enough >> time with no activity, the SIGALARM will call the handler and will shut down >> the daemon. > > alarm works very well for timeouts - we even use it on Windows, which breaks > fork() even more. If notification is all you need, not data sharing, its all > fairly straightforward. > > For data sharing, it sounds slightly crazy, but the simplest solution for us > was to use DBI and SQLite, with its exclusive transactions. These allows us > to coordinate safe data access between processes, and it works on all > platforms safely. > > All the best > Stuart > > _______________________________________________ > toronto-pm mailing list > toronto-pm at pm.org > http://mail.pm.org/mailman/listinfo/toronto-pm > From fulko.hew at gmail.com Thu Jan 14 09:13:25 2010 From: fulko.hew at gmail.com (Fulko Hew) Date: Thu, 14 Jan 2010 12:13:25 -0500 Subject: [tpm] fork and blessed hash references In-Reply-To: <83eac04d1001140849q56b2a360v1de05e201b93921a@mail.gmail.com> References: <4B4F3AC2.7000503@alteeve.com> <8204a4fe1001140749s492b3e8u8c274847f16fabc7@mail.gmail.com> <4B4F4377.8030304@alteeve.com> <4B4F457A.4030606@morungos.com> <83eac04d1001140849q56b2a360v1de05e201b93921a@mail.gmail.com> Message-ID: <8204a4fe1001140913i191e41b9ubb1f787165c14f2e@mail.gmail.com> On Thu, Jan 14, 2010 at 11:49 AM, Rob Janes wrote: ... snip ... > there is an alternative process. set a signal handler for one of the > user signals SIGUSR1 say. Send a signal to that process and handler > to reset the timer. Your SIGALRM handler then is in a process which > also has a SIGUSR1 handler. The SIGUSR1 handler resets the timer. > This way you don't need shared memory or semaphores. Much easier, > much less complicated. All that needs to be known globally is the pid > (process id) and maybe the tid (thread id) of the SIGUSR1 handler. > The caveat for using signals, is that they interrupt whatever might be going on, which is good, but if you were in the middle of a read or write (like to a socket or a file), the call to read, write, etc. can be interrupted. So if you are not looking at their return values (which sometimes tells you how much was 'actually' read or written), you might find out that the 'whole' buffer wasn't processed and you have to handle that (outstanding) fragment yourself. But thats just good programming anyway. But its not normally a condition you need to consider... if there is no way your application _could_ get interrupted. -------------- next part -------------- An HTML attachment was scrubbed... URL: From janes.rob at gmail.com Thu Jan 14 09:21:06 2010 From: janes.rob at gmail.com (Rob Janes) Date: Thu, 14 Jan 2010 12:21:06 -0500 Subject: [tpm] fork and blessed hash references In-Reply-To: <8204a4fe1001140913i191e41b9ubb1f787165c14f2e@mail.gmail.com> References: <4B4F3AC2.7000503@alteeve.com> <8204a4fe1001140749s492b3e8u8c274847f16fabc7@mail.gmail.com> <4B4F4377.8030304@alteeve.com> <4B4F457A.4030606@morungos.com> <83eac04d1001140849q56b2a360v1de05e201b93921a@mail.gmail.com> <8204a4fe1001140913i191e41b9ubb1f787165c14f2e@mail.gmail.com> Message-ID: <83eac04d1001140921r35a29a58q6d440031facd81a8@mail.gmail.com> good advice. this caveat applies to all signals, SIGALRM included. On Thu, Jan 14, 2010 at 12:13 PM, Fulko Hew wrote: > > > On Thu, Jan 14, 2010 at 11:49 AM, Rob Janes wrote: > ... snip ... > >> >> there is an alternative process. ?set a signal handler for one of the >> user signals SIGUSR1 say. ?Send a signal to that process and handler >> to reset the timer. ?Your SIGALRM handler then is in a process which >> also has a SIGUSR1 handler. ?The SIGUSR1 handler resets the timer. >> This way you don't need shared memory or semaphores. ?Much easier, >> much less complicated. ?All that needs to be known globally is the pid >> (process id) and maybe the tid (thread id) of the SIGUSR1 handler. > > The caveat? for using signals, is that they interrupt whatever might be > going on, > which is good, but if you were in the middle of a read or write (like to a > socket > or a file), the call to read, write, etc. can be interrupted.? So if you are > not looking > at their return values (which sometimes tells you how much was 'actually' > read or written), you might find out that the 'whole' buffer wasn't > processed > and you have to handle that (outstanding) fragment yourself.? But thats just > good programming anyway.? But its not normally a condition you need to > consider... if there is no way your application _could_ get interrupted. > > > > From arocker at vex.net Thu Jan 14 16:21:49 2010 From: arocker at vex.net (arocker at vex.net) Date: Thu, 14 Jan 2010 19:21:49 -0500 Subject: [tpm] Perl modules Message-ID: I defined a set of subroutines in a module. They worked perfectly well when the module was in the same directory as the caller. Then I moved the module to a directory on the @INC array, so it would become generally available, and now it's broken. Specifically, although the program compiles, when running it dies with an "Undefined subroutine &main::whatever" message. What have I done wrong? From sfryer at sourcery.ca Thu Jan 14 17:07:55 2010 From: sfryer at sourcery.ca (Shaun Fryer) Date: Thu, 14 Jan 2010 20:07:55 -0500 Subject: [tpm] Fwd: Perl modules In-Reply-To: <982579711001141705v3eb4bce9xfe7214386acc329f@mail.gmail.com> References: <982579711001141705v3eb4bce9xfe7214386acc329f@mail.gmail.com> Message-ID: <982579711001141707g667ac1d4geec92592e4cefdad@mail.gmail.com> without seeing the code, it's hard to know for sure, but my guess would be you tried to import something (or didn't) for which there's no export. the &main::whatever is the clue here. if you're doing something like... use Foo; foo_function(); and getting &main::foo_function(), it's because Foo is not automatically exporting foo_function(). you might try doing. use Foo; Foo::foo_function(); or perhaps you meant to do. use Foo qw(foo_function); and forgot..? or use Exporter (et al), or http://perl.plover.com/TPC/1998/Hardware-notes.html#Manual_Exporting anyway, that'd be my guess based on available info. cheers, -- Shaun Fryer On Thu, Jan 14, 2010 at 7:21 PM, wrote: > > I defined a set of subroutines in a module. > > They worked perfectly well when the module was in the same directory as > the caller. > > Then I moved the module to a directory on the @INC array, so it would > become generally available, and now it's broken. Specifically, although > the program compiles, when running it dies with an "Undefined subroutine > &main::whatever" message. > > What have I done wrong? > > > _______________________________________________ > toronto-pm mailing list > toronto-pm at pm.org > http://mail.pm.org/mailman/listinfo/toronto-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From uri at StemSystems.com Thu Jan 14 17:59:21 2010 From: uri at StemSystems.com (Uri Guttman) Date: Thu, 14 Jan 2010 20:59:21 -0500 Subject: [tpm] Perl modules In-Reply-To: (arocker@vex.net's message of "Thu\, 14 Jan 2010 19\:21\:49 -0500") References: Message-ID: <87my0gdt6u.fsf@quad.sysarch.com> >>>>> "a" == arocker writes: a> I defined a set of subroutines in a module. a> They worked perfectly well when the module was in the same directory as a> the caller. a> Then I moved the module to a directory on the @INC array, so it would a> become generally available, and now it's broken. Specifically, although a> the program compiles, when running it dies with an "Undefined subroutine a> &main::whatever" message. a> What have I done wrong? sounds like namespace issues. did you put a package name in the module? if you did, you need to export those subs to the main:: space (or whereever the module is used) so those sub names are visible. this is easily done with the Exporter module and some others do it too. the basic way would be something like this: package FooBar ; use base 'Exporter' ; our @EXPORT = qw( &foo &bar ) ; and in the main code: use FooBar ; then subs foo() and bar() should be available. if you didn't use a package command (which isn't needed but useful) then the subs would be in main:: anyhow and you wouldn't get that problem. but using a namespace for a module is a good idea as you can manage larger amounts of code that way. one other solution is to use fully qualified names in the main:: code: this calls the foo() sub in that module which you loaded earlier. FooBar::foo() ; uri -- Uri Guttman ------ uri at stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com --------- From mike at stok.ca Fri Jan 15 04:56:03 2010 From: mike at stok.ca (Mike Stok) Date: Fri, 15 Jan 2010 07:56:03 -0500 Subject: [tpm] January talk(s) Message-ID: As we don't have any presentation lined up for this month, I'm asking for volunteers to spend five or ten minutes to show us some Perl related trick(s), tool(s), or module(s) of their choice. Reasons for picking a module could include, but aren't limited to: * It' s something you have found invaluable over the past year(s) * It's the one solid module out of dozens which do the same thing, and you're glad you settled on it * It's entertaining * It has code which surprised or amazed you * It changed the way you do Perl projects * It changed the way you think about Perl * It's a commonly used module, but you've discovered a neat trick * etc. Think of the session as similar to lightning talks. Mike -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fulko.hew at gmail.com Fri Jan 15 05:44:17 2010 From: fulko.hew at gmail.com (Fulko Hew) Date: Fri, 15 Jan 2010 08:44:17 -0500 Subject: [tpm] January talk(s) In-Reply-To: References: Message-ID: <8204a4fe1001150544g7cbb9226p31ef127735c7349b@mail.gmail.com> On Fri, Jan 15, 2010 at 7:56 AM, Mike Stok wrote: > As we don't have any presentation lined up for this month, > Can someone do a quick talk on the 'SQL injection' problem and how to avoid it? Fulko -------------- next part -------------- An HTML attachment was scrubbed... URL: From arocker at vex.net Fri Jan 15 05:45:43 2010 From: arocker at vex.net (arocker at vex.net) Date: Fri, 15 Jan 2010 08:45:43 -0500 Subject: [tpm] Perl modules Message-ID: <84d6f38bdeea91f1cdec20e8c1aae5e0.squirrel@webmail.vex.net> Thanks, everybody for the ideas, most of which were quite close to the truth. As usual in an apparently paradoxical problem description, the answer lay in something omitted. I said "I" moved the module to a system library; actually it was a system administrator who did that. He moved it into a directory containing locally developed modules, and renamed it to match the local standard. What he forgot to do, and what didn't occur to until I went home, was to change the "package" statement in the module to match its new name. Consequently, Perl found the file, but didn't name the subroutines appropriately. E.g. Original filename - Foo.pm contains "package Foo:" - works New filename - Local/Foo contains "package Foo;" - broken Local/Foo contains "package Local::Foo" - works From linux at alteeve.com Fri Jan 15 06:22:01 2010 From: linux at alteeve.com (Madison Kelly) Date: Fri, 15 Jan 2010 09:22:01 -0500 Subject: [tpm] Saw this on Reddit this morning; MSNBOT DDoS against CPAN Message-ID: <4B507A09.3080505@alteeve.com> http://blogs.perl.org/users/cpan_testers/2010/01/msnbot-must-die.html Anyone have any more insight into it? Madi From uri at StemSystems.com Fri Jan 15 11:10:28 2010 From: uri at StemSystems.com (Uri Guttman) Date: Fri, 15 Jan 2010 14:10:28 -0500 Subject: [tpm] Perl modules In-Reply-To: <84d6f38bdeea91f1cdec20e8c1aae5e0.squirrel@webmail.vex.net> (arocker@vex.net's message of "Fri\, 15 Jan 2010 08\:45\:43 -0500") References: <84d6f38bdeea91f1cdec20e8c1aae5e0.squirrel@webmail.vex.net> Message-ID: <87wrzj89qz.fsf@quad.sysarch.com> >>>>> "a" == arocker writes: a> Thanks, everybody for the ideas, most of which were quite close to a> the truth. a> As usual in an apparently paradoxical problem description, the answer lay a> in something omitted. well, we weren't using PSI::ESP so we couldn't divine the truth! a> What he forgot to do, and what didn't occur to until I went home, a> was to change the "package" statement in the module to match its a> new name. Consequently, Perl found the file, but didn't name the a> subroutines appropriately. the usual mismatch of file/path name and package name. uri -- Uri Guttman ------ uri at stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com --------- From ceeshek at gmail.com Fri Jan 15 21:37:21 2010 From: ceeshek at gmail.com (Cees Hek) Date: Sat, 16 Jan 2010 16:37:21 +1100 Subject: [tpm] January talk(s) In-Reply-To: <8204a4fe1001150544g7cbb9226p31ef127735c7349b@mail.gmail.com> References: <8204a4fe1001150544g7cbb9226p31ef127735c7349b@mail.gmail.com> Message-ID: On Sat, Jan 16, 2010 at 12:44 AM, Fulko Hew wrote: > > Can someone do a quick talk on the 'SQL injection' problem and how to avoid > it? I always found this to be a good introduction to the SQL Injection problem ;) http://xkcd.com/327/ Cheers, Cees From arocker at vex.net Sat Jan 16 11:51:39 2010 From: arocker at vex.net (arocker at vex.net) Date: Sat, 16 Jan 2010 14:51:39 -0500 Subject: [tpm] Perl modules In-Reply-To: <87wrzj89qz.fsf@quad.sysarch.com> References: <84d6f38bdeea91f1cdec20e8c1aae5e0.squirrel@webmail.vex.net> <87wrzj89qz.fsf@quad.sysarch.com> Message-ID: <07121f20970aca75949288fb1e15404c.squirrel@webmail.vex.net> > a> new name. Consequently, Perl found the file, but didn't name the > a> subroutines appropriately. > > the usual mismatch of file/path name and package name. > > uri It should be possible to write an automatic checker/corrector for that. I'll have to think about it. From uri at StemSystems.com Sat Jan 16 12:05:47 2010 From: uri at StemSystems.com (Uri Guttman) Date: Sat, 16 Jan 2010 15:05:47 -0500 Subject: [tpm] Perl modules In-Reply-To: <07121f20970aca75949288fb1e15404c.squirrel@webmail.vex.net> (arocker@vex.net's message of "Sat\, 16 Jan 2010 14\:51\:39 -0500") References: <84d6f38bdeea91f1cdec20e8c1aae5e0.squirrel@webmail.vex.net> <87wrzj89qz.fsf@quad.sysarch.com> <07121f20970aca75949288fb1e15404c.squirrel@webmail.vex.net> Message-ID: <87wrzhx1b8.fsf@quad.sysarch.com> >>>>> "a" == arocker writes: a> new name. Consequently, Perl found the file, but didn't name the a> subroutines appropriately. >> >> the usual mismatch of file/path name and package name. >> >> uri a> It should be possible to write an automatic checker/corrector for that. a> I'll have to think about it. think hard for several reasons. you can have multiple package names in one file (only one with the matching path name will have its import method called by use) and multiple files can have the same package name. if your code is pure OO then no import() need to be called and that works with multiple classes in the same file. usually these are very related or helper classes. with multiple files with the same class name, again, it should be pure OO or with no importing needed. this is done when you have larger amounts of code in the same class and use multiple files to organize it better. i have used both multi's in the same system for the correct reasons but it was all pure OO so it works well. uri -- Uri Guttman ------ uri at stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com --------- From abram.hindle at softwareprocess.es Mon Jan 18 19:30:39 2010 From: abram.hindle at softwareprocess.es (Abram Hindle) Date: Mon, 18 Jan 2010 22:30:39 -0500 Subject: [tpm] January talk(s) In-Reply-To: (sfid-20100115_080007_146938_EAD1268B) References: (sfid-20100115_080007_146938_EAD1268B) Message-ID: <4B55275F.9000902@softwareprocess.es> I can volunteer 10 minutes of: Net::OpenID::Server and the subversion of OpenID 10mins I'll talk about the structure of OpenID, and give an overview of the protocol. As well I'll discuss how to use Net::OpenID::Server, how to make sure it is running quickly. I'll discuss how to use OpenID to have a non-identity. Then I'll discuss the hoops I had to jump through on shared hosting to get it all working. abram Mike Stok wrote: > As we don't have any presentation lined up for this month, I'm asking > for volunteers to spend five or ten minutes to show us some Perl related > trick(s), tool(s), or module(s) of their choice. Reasons for picking a > module could include, but aren't limited to: > > * It' s something you have found invaluable over the past year(s) > * It's the one solid module out of dozens which do the same thing, and > you're glad you settled on it > * It's entertaining > * It has code which surprised or amazed you > * It changed the way you do Perl projects > * It changed the way you think about Perl > * It's a commonly used module, but you've discovered a neat trick > * etc. > > Think of the session as similar to lightning talks. > > Mike > > -- > > Mike Stok > > http://www.stok.ca/~mike/ > > The "`Stok' disclaimers" apply. > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > toronto-pm mailing list > toronto-pm at pm.org > http://mail.pm.org/mailman/listinfo/toronto-pm -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 260 bytes Desc: OpenPGP digital signature URL: From mike at stok.ca Mon Jan 25 16:39:21 2010 From: mike at stok.ca (Mike Stok) Date: Mon, 25 Jan 2010 19:39:21 -0500 Subject: [tpm] Toronto Perl Mongers and the O'Reilly User Group Program Message-ID: <86114096-EEA6-49BD-B6F8-43CD021F17B6@stok.ca> I have signed the Toronto Perl Mongers up in the O'Reilly User Group Program, and from time to time I'll forward the User Group newsletter to the list. In return for that, and a banner on the TPM web site we can get review copies of books, on condition that we post the review, and discounts off books, e-books, and some conferences purchased from O'Reilly. Interesting bits of the welcome email sent to the group leader (ignoring the exciting administrivia): > O'Reilly offers free review copies of our books. As the group rep, you may request a copy for review in your newsletter, web site, blog, mail ing list, or for your group library. Requests for review copies must be submitted by you, as the contact for your group. If you wish for the review copy to be shipped to another group member, please supply the name, address, and phone number of that member for shipment. If a review of a book has been written, please forward a copy to me. We are also encouraging user group members to post reviews to sites such as Amazon, Slashdot, and oreilly.com. > Your group members receive a 35% discount on O'Reilly, Microsoft Press, No Starch, PC Publishing, Pragmatic Bookshelf, Rocky Nook, SitePoint, or YoungJin products purchased directly from O'Reilly. And 45% on ebooks. The discount code your members should use is ********. Orders can be placed online atoreilly.com or by calling 800-998-9938. Your members are also entitled to a discount on O'Reilly conferences and tutorials. Other special discount offers may also be forwarded to your group from time to time. (email me for the discount code - our mailing list archives are public and the discount is for group members.) > In addition, we regularly donate books and other promotional items for raffles or auctions to help your group raise money, or for meeting door prizes--just let me know if you're in need of something. (Please allow enough time for ground shipping.) If anyone wants to get a review copy of a book then get in touch with me and it can be organized quite quickly - and the book doesn't have to be directly related to Perl. Mike -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply. -------------- next part -------------- An HTML attachment was scrubbed... URL: From abram.hindle at softwareprocess.es Mon Jan 25 16:41:03 2010 From: abram.hindle at softwareprocess.es (Abram Hindle) Date: Mon, 25 Jan 2010 19:41:03 -0500 Subject: [tpm] January talk(s) In-Reply-To: (sfid-20100115_080007_146938_EAD1268B) References: (sfid-20100115_080007_146938_EAD1268B) Message-ID: <4B5E3A1F.9040002@softwareprocess.es> TPM is this week. So do we have enough talks? abram Mike Stok wrote: > As we don't have any presentation lined up for this month, I'm asking > for volunteers to spend five or ten minutes to show us some Perl related > trick(s), tool(s), or module(s) of their choice. Reasons for picking a > module could include, but aren't limited to: > > * It' s something you have found invaluable over the past year(s) > * It's the one solid module out of dozens which do the same thing, and > you're glad you settled on it > * It's entertaining > * It has code which surprised or amazed you > * It changed the way you do Perl projects > * It changed the way you think about Perl > * It's a commonly used module, but you've discovered a neat trick > * etc. > > Think of the session as similar to lightning talks. > > Mike > > -- > > Mike Stok > > http://www.stok.ca/~mike/ > > The "`Stok' disclaimers" apply. > > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > toronto-pm mailing list > toronto-pm at pm.org > http://mail.pm.org/mailman/listinfo/toronto-pm -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 260 bytes Desc: OpenPGP digital signature URL: From mike at stok.ca Mon Jan 25 17:03:27 2010 From: mike at stok.ca (Mike Stok) Date: Mon, 25 Jan 2010 20:03:27 -0500 Subject: [tpm] January talk(s) In-Reply-To: <4B5E3A1F.9040002@softwareprocess.es> References: (sfid-20100115_080007_146938_EAD1268B) <4B5E3A1F.9040002@softwareprocess.es> Message-ID: <321C3EF3-971D-494B-95E1-A627D07A7AC3@stok.ca> On Jan 25, 2010, at 7:41 PM, Abram Hindle wrote: > TPM is this week. So do we have enough talks? As things stand now, there are the three presenters, including Abram, on the web site. I have a couple of people who should be getting back to me. So things are looking pretty good. I'm going to ask the people in the meeting what sort of things they would like to happen at the meetings for the rest of the year, and based on those answers and some from the mailing list see if we can do stuff which people find useful / informative / entertaining. This month's meeting will be at Nexient in room 15 on the eighth floor. See the web site for more details. Mike > > abram > > Mike Stok wrote: >> As we don't have any presentation lined up for this month, I'm asking >> for volunteers to spend five or ten minutes to show us some Perl related >> trick(s), tool(s), or module(s) of their choice. Reasons for picking a >> module could include, but aren't limited to: >> >> * It' s something you have found invaluable over the past year(s) >> * It's the one solid module out of dozens which do the same thing, and >> you're glad you settled on it >> * It's entertaining >> * It has code which surprised or amazed you >> * It changed the way you do Perl projects >> * It changed the way you think about Perl >> * It's a commonly used module, but you've discovered a neat trick >> * etc. >> >> Think of the session as similar to lightning talks. >> >> Mike >> >> -- >> >> Mike Stok > >> http://www.stok.ca/~mike/ >> >> The "`Stok' disclaimers" apply. >> >> >> >> >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> toronto-pm mailing list >> toronto-pm at pm.org >> http://mail.pm.org/mailman/listinfo/toronto-pm > > > _______________________________________________ > toronto-pm mailing list > toronto-pm at pm.org > http://mail.pm.org/mailman/listinfo/toronto-pm -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply. From talexb at gmail.com Tue Jan 26 07:16:44 2010 From: talexb at gmail.com (Alex Beamish) Date: Tue, 26 Jan 2010 10:16:44 -0500 Subject: [tpm] January talk(s) In-Reply-To: <8204a4fe1001150544g7cbb9226p31ef127735c7349b@mail.gmail.com> References: <8204a4fe1001150544g7cbb9226p31ef127735c7349b@mail.gmail.com> Message-ID: On Fri, Jan 15, 2010 at 8:44 AM, Fulko Hew wrote: > > > On Fri, Jan 15, 2010 at 7:56 AM, Mike Stok wrote: >> >> As we don't have any presentation lined up for this month, > > Can someone do a quick talk on the 'SQL injection' problem and how to avoid > it? Hi Fulko, I've spoken with Mike Stok, and I will cover this, as well as the module that helps with arbitrary SQL inserts and updates. Tin foil hats should not be required. -- Alex Beamish Toronto, Ontario aka talexb From fulko.hew at gmail.com Tue Jan 26 08:00:45 2010 From: fulko.hew at gmail.com (Fulko Hew) Date: Tue, 26 Jan 2010 11:00:45 -0500 Subject: [tpm] January talk(s) In-Reply-To: References: <8204a4fe1001150544g7cbb9226p31ef127735c7349b@mail.gmail.com> Message-ID: <8204a4fe1001260800m25d1f3a9sf95b181c606043d6@mail.gmail.com> On Tue, Jan 26, 2010 at 10:16 AM, Alex Beamish wrote: > On Fri, Jan 15, 2010 at 8:44 AM, Fulko Hew wrote: > > > > > > On Fri, Jan 15, 2010 at 7:56 AM, Mike Stok wrote: > >> > >> As we don't have any presentation lined up for this month, > > > > Can someone do a quick talk on the 'SQL injection' problem and how to > avoid > > it? > > Hi Fulko, > > I've spoken with Mike Stok, and I will cover this, as well as the > module that helps with arbitrary SQL inserts and updates. > Thanks... then I'll be sure to show up! > Tin foil hats should not be required. > Awe... and I just bought myself a brand new shinny one too! :-( -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at stok.ca Tue Jan 26 08:46:28 2010 From: mike at stok.ca (Mike Stok) Date: Tue, 26 Jan 2010 11:46:28 -0500 Subject: [tpm] January talk(s) In-Reply-To: <8204a4fe1001260800m25d1f3a9sf95b181c606043d6@mail.gmail.com> References: <8204a4fe1001150544g7cbb9226p31ef127735c7349b@mail.gmail.com> <8204a4fe1001260800m25d1f3a9sf95b181c606043d6@mail.gmail.com> Message-ID: <74987D42-D31F-41C0-B585-66301A6F1229@stok.ca> On Jan 26, 2010, at 11:00 AM, Fulko Hew wrote: > Awe... and I just bought myself a brand new shinny one too! :-( Just wait till you see the new iHat Apple are releasing tomorrow, clear anodized aluminium with a multi-touch interface to control those thoughts... Mike -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.s.doyle at gmail.com Tue Jan 26 09:02:09 2010 From: dave.s.doyle at gmail.com (Dave Doyle) Date: Tue, 26 Jan 2010 12:02:09 -0500 Subject: [tpm] January talk(s) In-Reply-To: <74987D42-D31F-41C0-B585-66301A6F1229@stok.ca> References: <8204a4fe1001150544g7cbb9226p31ef127735c7349b@mail.gmail.com> <8204a4fe1001260800m25d1f3a9sf95b181c606043d6@mail.gmail.com> <74987D42-D31F-41C0-B585-66301A6F1229@stok.ca> Message-ID: Apple doesn't need a hat to control peoples thoughts. They're doing that already with Steve Jobs' turtleneck. -- dave.s.doyle at gmail.com On Tue, Jan 26, 2010 at 11:46 AM, Mike Stok wrote: > > On Jan 26, 2010, at 11:00 AM, Fulko Hew wrote: > > Awe... and I just bought myself a brand new shinny one too! :-( > > > Just wait till you see the new iHat Apple are releasing tomorrow, clear > anodized aluminium with a multi-touch interface to control those thoughts... > > Mike > > -- > > Mike Stok > http://www.stok.ca/~mike/ > > The "`Stok' disclaimers" apply. > > > > > > _______________________________________________ > toronto-pm mailing list > toronto-pm at pm.org > http://mail.pm.org/mailman/listinfo/toronto-pm > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at stok.ca Tue Jan 26 12:18:59 2010 From: mike at stok.ca (Mike Stok) Date: Tue, 26 Jan 2010 15:18:59 -0500 Subject: [tpm] January talk(s) In-Reply-To: <535358.54616.qm@web57606.mail.re1.yahoo.com> References: <535358.54616.qm@web57606.mail.re1.yahoo.com> Message-ID: On Jan 26, 2010, at 1:36 PM, J Z Tam wrote: > Hello Mike, > New to TPM here. What is the address for tommorow's TPM clustering? Welcome aboard Jordan. Here are the meeting details, I update http://to.pm.org before the meetings in case the time or location have to be adjusted. Usually we head out for refreshments after the talks. I hope to see you soon. Regards, Mike Location: 2 Bloor Street West, (usually) 8th or 16th floor. The room number will be announced on the mailing list a few days before the meeting. It will also be left with the security desk in the building (main floor lobby) shortly before the meeting starts (i.e. around 6pm). Time: 6:45 p.m. Directions: This building is on the north-west corner of Bloor and Yonge, accessible by subway from Bloor station. Pay parking is also ample in this area. Security note: The elevators in the building are "locked down" after 5:30pm to people without building access cards. Leading up to the meeting someone will come down to the main floor lobby every few minutes to ferry people upstairs. There will be a number of scheduled trips: ? 17:30 ? 18:00 ? 18:30 ? 18:45 ? 19:00 After 19:00, you can reach the access-card-carrying guy via a cell phone number that we'll leave with security in the front lobby. The room and floor numbers will be left with security too. > Thanks in advance. > jordan.tam > > --- On Mon, 1/25/10, Mike Stok wrote: > >> From: Mike Stok >> Subject: Re: [tpm] January talk(s) >> To: "TPM Mongers" >> Cc: "Abram Hindle" >> Received: Monday, January 25, 2010, 8:03 PM >> >> On Jan 25, 2010, at 7:41 PM, Abram Hindle wrote: >> >>> TPM is this week. So do we have enough talks? >> >> As things stand now, there are the three presenters, >> including Abram, on the web site. I have a couple of people >> who should be getting back to me. So things are looking >> pretty good. >> >> I'm going to ask the people in the meeting what sort of >> things they would like to happen at the meetings for the >> rest of the year, and based on those answers and some from >> the mailing list see if we can do stuff which people find >> useful / informative / entertaining. >> >> This month's meeting will be at Nexient in room 15 on the >> eighth floor. See the web site for more details. >> >> Mike >> >>> >>> abram >>> >>> Mike Stok wrote: >>>> As we don't have any presentation lined up for >> this month, I'm asking >>>> for volunteers to spend five or ten minutes to >> show us some Perl related >>>> trick(s), tool(s), or module(s) of their >> choice. Reasons for picking a >>>> module could include, but aren't limited to: >>>> >>>> * It' s something you have found invaluable >> over the past year(s) >>>> * It's the one solid module out of dozens >> which do the same thing, and >>>> you're glad you settled on it >>>> * It's entertaining >>>> * It has code which surprised or amazed you >>>> * It changed the way you do Perl projects >>>> * It changed the way you think about Perl >>>> * It's a commonly used module, but you've >> discovered a neat trick >>>> * etc. >>>> >>>> Think of the session as similar to lightning >> talks. >>>> >>>> Mike >>>> >>>> -- >>>> >>>> Mike Stok > > >>>> http://www.stok.ca/~mike/ >>>> >>>> The "`Stok' disclaimers" apply. >>>> >>>> >>>> >>>> >>>> >>>> >> ------------------------------------------------------------------------ >>>> >>>> _______________________________________________ >>>> toronto-pm mailing list >>>> toronto-pm at pm.org >>>> http://mail.pm.org/mailman/listinfo/toronto-pm >>> >>> >>> _______________________________________________ >>> toronto-pm mailing list >>> toronto-pm at pm.org >>> http://mail.pm.org/mailman/listinfo/toronto-pm >> >> -- >> >> Mike Stok >> http://www.stok.ca/~mike/ >> >> The "`Stok' disclaimers" apply. >> >> >> >> >> _______________________________________________ >> toronto-pm mailing list >> toronto-pm at pm.org >> http://mail.pm.org/mailman/listinfo/toronto-pm >> > > > __________________________________________________________________ > Connect with friends from any web browser - no download required. Try the new Yahoo! Canada Messenger for the Web BETA at http://ca.messenger.yahoo.com/webmessengerpromo.php -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply. From mike at stok.ca Tue Jan 26 12:37:42 2010 From: mike at stok.ca (Mike Stok) Date: Tue, 26 Jan 2010 15:37:42 -0500 Subject: [tpm] Fwd: Books and News from the O'Reilly User Group Program--January References: <1264521733.440.0.349312@post.oreilly.com> Message-ID: As part of the O'Reilly User Group Program I will forward the monthly user group news letter to the list. Mike Begin forwarded message: > > If you cannot read the information below, click here. > > Forward this annoucement to a friend > > > Jan 2010 Issue: > > Welcome > Register Now -- Free Upcoming Webcasts > Authors looking for Speaking Opportunites > Conference User Group Discounts and Call for Participation > 35-45% book discount and Slashdot and Book Reviews needed > The Call for Makers is Now Open for the 5th Annual Maker Faire Bay Area 2010 > Discount offers from Safari Books Online & The O'Reilly School of Technolgy > UG leaders only -- Put Up a Banner, Get a Free Book > Upcoming Events > New Releases: > > Building iPhone Apps with HTML, CSS, and JavaScript > By Jonathan Stark > > Building the Realtime User Experience: Rough Cuts Version > > CSS Cookbook, Third Edition > By Christopher Schmitt > > Domain-Driven Design Using Naked Objects > By Dan Haywood > > HTML & XHTML Pocket Reference, Fourth Edition > By Jennifer Niederst Robbins > > Java: The Good Parts: Rough Cuts Version > > jQuery: Novice to Ninja > By Earl Castledine > > Language Implementation Patterns > By Terence Parr > > Make: Technology on Your Time Volume 21 > By Mark Frauenfelder > > Mastering the Nikon D5000 > By Darrell Young > > Microsoft(R) Forefront(TM) Threat Management Gateway (TMG) Administrator > > The New How > By Nilofer Merchant > > Open Government > By Daniel Lathrop, Laurel Ruma > > Practical Digital Photomicrography > By Brian Matsumoto > > Programming Entity Framework Rough Cut, Second Edition > > Programming WCF Services: Rough Cuts Version, Third Edition > > R in a Nutshell > By Joseph Adler > > Security on Rails > By Ben Poweski, David Raphael > > Take Control of Easy Mac Backups > > Take Control of Running Windows on a Mac > > Three Songs, No Flash! > By Loe Beerens > > Stay Connected: > > O'Reilly on Twitter > > O'Reilly Authors on Twitter > > O'Reilly on Facebook > > O'Reilly on YouTube > > O'Reilly News & Commentary > > O'Reilly Answers: > > How to redirect to a mobile site based on the browser?s screen width using CSS > > Applying a Different Stylesheet Based on the Time of Day using CSS > > javascript: a definitive guide | suggest exercises > > what are the best books/sites for an absolute beginner? > > Should I upgrade my router? > > More Answers > > > Welcome > > Hi there, > > Even though it is storming in Sebastopol, CA this week--it's easy to see spring is coming. Community events and conferences are coming up everywhere such as Macworld, Microsoft Mix, PYCon, SCALE, RailsConf, MySQL Conference & Expo, DevConnections, FOSDEM, MountainWest RubyConf, and much more. If you're involved in a community event please make sure we send some books to give away. We can provide print or ebook versions. > > Don't forget we now offer 45% off our ebooks onoreilly.com. That includes Microsoft Press as well as O'Reilly Media titles. Just use the code DSUG when you check out. This same code give you 35% off print books too. Feel free to post this discount on your website, mailing list, twitter account, or other places where your members gather. We've also got a spiffy new PowerPoint or KeyNote slide with this information I can send you. > > I recently posted a question on O'Reilly Answers to ask for suggestions on reaching out to new members. Make sure you add your opinion and let me know when you post so I can give you a user group leader badge for your profile. > > We're looking for a few user groups interested in having a booth at Railsconf this year in Baltimore, MD. If you're interested, please drop me a line. We've got a limited number of tables. > > If you're thinking about learning a new technology, you should check out the new Great Series of videos from O'Reilly. They have friendly presentation style and the hands-on exercises let you learn as if you're sitting next to a good friend, sharing programmer to programmer. Let me know if you'd like to check it out. > > Travel Alert: I'll be attending Macworld 2010February 10 & 11. Please let me know if you're going to be in town. I'd like to say hi. > > I'm also headed to the O'Reilly Tools of Change for Publishing Conference in New York February 21 -24 and I'm looking for evening activities. Do you have a meeting or just want to get together? > > Please pass along any part of this newsletter to your group via email or your website and include the discount codes. We offer both a text and an HTML version. > > Thanks, > > --Marsee Henon > > P.S. Hope you've noticed our new $9.99 Ebook Deal of the Day on oreilly.com and our twitter account attwitter.com/oreillymedia. > > > Register Now -- Free Upcoming Webcasts > > What people are saying about our webcasts: "Content superb of course. But I also loved its "personality" - friendly, casual, expert, geeky: perfect!"-- Heather Young > > Our upcoming webcasts include: > > Tour the Top 10 Treats in Entity Framework 4 > The Science of Social Media Marketing > Check out our Webcast page for on-demand videos of past webcasts and more upcoming live events! > > > Authors looking for Speaking Opportunites > > Please send me an email if you're interested in any of the following speakers and I'll forward it along: > > > Joseph Adler, author of R in a Nutshell is available in Southern California or the San Francisco Bay Area. > > > Ed Wilson, author of Windows PowerShell 2.0 Best Practices and Microsoft Scripting Guy is available as a speaker in the Charlotte, NC region. He is also available virtually for any user group world-wide. For more information contact Ed directly at edwils (at) microsoft.com > > > Joan Preppernau, author of Windows 7 Step by Step is looking for speaking opportunities in the Dallas/Fort Worth area (FlowerMound) of Texas and in the Northport, Alabama area. Topics include Microsoft Office, Windows, certification, upgrading, and computing for children and young people, particularly girls. > > > Conference User Group Discounts and Call for Participation > > O'Reilly Tools of Change for Publishing Conference > Be Part of the Publishing Evolution > February 22-24, 2010 > New York, NY > > If you're interesting in attending, use code "toc10usrg" when you register, and receive 15% off the registration price. > > O'Reilly Where 2.0 Conference > Location Enabled > March 30 - April 1, 2010 > San Jose, CA > > If you're interesting in attending, use code "whr10usrg" when you register, and receive 25% off the registration price. > > O'Reilly MySQL Conference & Expo > Information Unleashed > April 12-15, 2010 > Santa Clara, CA > > If you're interesting in attending, use code "mys10usrg" when you register, and receive 20% off the registration price. > > Last Chance--The Call for Participation is Now Open for OSCON! Share how you're innovating with the Open Source Community. OSCON takes place July 19-23, 2010 at the Oregon Convention Center in Portland. Join over 2,500 experts, visionaries, and hackers in the trenches to explore all that open source has to offer. Be a part of it all and Submit your Proposal today! CFP ends February 1 and early registration opens April 2010. > > RailsConf 2010 Call for Participation is now open! > Join us in Baltimore, MD on June 7-10, 2010 for largest official conference dedicated to everything Rails. We're keeping the Call for Participation open until March 17 to leave room for even more up-to-the minute Rails topics to come through. Bring us your hardcore technical know-how and submit your proposal today. > > > 35-45% book discount and Slashdot and Book Reviews needed > > We're always looking for book reviewers, especially on our new releases. Titles we're excited about include Building iPhone Apps with HTML, CSS, and JavaScript, The New How, Windows PowerShell 2.0 Best Practices, and R in a Nutshell. If you'd like to write a review of any of these books for Amazon, Slashdot, your favorite book community site such as GoodReads, LibraryThing or Shelfari, or your blog, please send an email to your user group leader with the book title and where you'll review it. > > Get 35% off from O'Reilly, No Starch, Paraglyph, PC Publishing, Pragmatic Bookshelf, Rocky Nook, SitePoint, or YoungJin books and 45% off ebooksyou purchase directly from O'Reilly. Just use code DSUG when ordering online or by phone 800-998-9938. > > > The Call for Makers is Now Open for the 5th Annual Maker Faire Bay Area 2010 > > Maker Faire is a two-day, family-friendly event that celebrates the Do-It-Yourself (DIY) mindset. It's for creative, resourceful people of all ages and backgrounds who like to tinker and love to make things. So much to see, you will need 2 days to see it all! > > We are now accepting entries for Maker Faire Bay Area, May 22nd and 23rd, 2010 at the San Mateo County Event Center. This year's focus is on Young Makers. Join your fellow Makers for the most innovative, inspired and best Maker Faire yet! > > > Discount offers from Safari Books Online & The O'Reilly School of Technolgy > > 15% off Safari Books Online for 12 months for UG members > > Safari Books Online provides online access to more than 8,500 books and videos from the world's leading technology publishers, plus time- saving tools that make it easy to find and organize the information you need, when you need it, all for one low monthly price. Search the full content of books and videos from O'Reilly Media, Addison- Wesley, Cisco Press, Apress, Manning, John Wiley and Sons, Microsoft Press and dozens of others, together on one easy-to-use online platform. Be the first to learn about cutting-edge technologies with pre-published manuscripts. Create your own digital library with favorites, saved searches, bookmarks, highlights, notes, tags and more. > > We're offering User Group members an exclusive 15% discount on monthly subscriptions to Safari Books Online for 12 months. Subscriptions must be purchased before March 31, 2010. > > O'Reilly School of Technology Courses: UG Members Receive a 30% Discount > > By enrolling in the O'Reilly School of Technology, you can stay competitive in Information Technology without the high cost or huge time commitment. Our courses work around YOUR schedule, not the other way around. And within months, not only will you have the University of Illinois Certificate to display on your resume, you'll also have a portfolio of projects that are sure to impress in your interviews! > > OST's full-price tuitions are already lower than comparable continuing education or community college courses. However, as an O'Reilly User Group member, you save an additional 30% on all the courses in the following University of Illinois Certificate Series: > > Database Administration Certificate > Java Programming > PHP/SQL Programming > Linux/Unix System Administration > Web Programming > Open Source Programming > .NET Programming > Client-Side Web Programming featuring AJAX > To redeem, use Promotion Code "ORALL1" good for a 30% discount, in Step #2 of the enrollment process. Each course comes with a free O'Reilly book and a 7-day money-back guarantee. > > > UG leaders only -- Put Up a Banner, Get a Free Book > > We're looking for user groups to display our discount banners on their web sites. If you send me your group's site with one or more banners posted, I'll send you the O'Reilly book(s) of your choice. Choose from the following list: > > The New How > Confessions of a Public Speaker > slide:ology > O'Reilly Answers > Tools of Change for Publishing Conference > Where 2.0 Conference > MySQL Conference & Expo 2010 > O'Reilly School of Technology Banners > Customizable O'Reilly Book Widgets > 35% off User Group Discount Banner > > Upcoming Events > > > Tour the Top 10 Treats in Entity Framework 4 > When: Jan 27, 2010 > Visual Studio 2010 and .NET 4.0 bring us a new version of ADO.NET Entity Framework, called Entity Framework 4. From the designer, to the APIs to entire new feature sets to support agile development, even former EF skeptics are getting excited about this version. There is a lot to see. In this one hour webcast, Julie Lerman, who is currently working on the 2nd edition of Programming Entity Framework, will highlight the ten most significant changes to the Entity Framework. > > > The Science of Social Media Marketing > When: Jan 28, 2010 > More and more people are using social media sites like Twitter and Facebook to talk about companies and products with their friends and colleagues. Learn what drives people to share information and opinions online and learn scientifically proven best practices for spreading your content virally through social media. You'll have plenty of time for Q&A with Dan Zarrella, social media and viral marketing scientist and author of "The Social Media Marketing Book." > > > Dux Raymond Sy presents "How to Effectively Utilize MS Project 2010 with SharePoint 2010" at SharePoint Saturday NYC > When: Jan 30, 2010 > Where: Microsoft Office NYC New York > Dux Raymond Sy (SharePoint for Project Management) will show you how Microsoft Project 2010 can be utilized for project planning and tracking. In addition, you'll also see ShaePoint 2010 complements it by enabling collaborative capabilities. > > More Upcoming Events >> > > > > You are receiving this email because you are a User Group contact with O'Reilly Media. If you would like to stop receiving this newsletter please email marsee at oreilly.com with your request. > > O'Reilly Media, Inc. 1005 Gravenstein Highway North, Sebastopol, CA 95472 (707) 827-7000 > http://oreilly.com/ | http://ug.oreilly.com/ > > Forward this announcement:http://post.oreilly.com/f2f/9z1zcmvc3meed2o6o3v5rqnn32o4nifumbq9jgghas8 > > > -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmackay at tes.net Thu Jan 21 10:55:27 2010 From: mmackay at tes.net (Matthew MacKay) Date: Thu, 21 Jan 2010 13:55:27 -0500 Subject: [tpm] TES - The Employment Solution. Job Opportunity with IBM Canada! Message-ID: <918911A750DA3846A6103216137B88C37E19E5@tesex> Hello, I spoke with Alex MacKinnon in regards to a job opportunity that I currently have for someone with strong PERL scripting skills. He recommended that I take a look on the "Toronto PERL Mongers" website and see what I can find... This is a short 4 week contract opportunity with IBM Canada and we are looking to get started as soon as possible. Nice to have skills include shell scripting skills, experience with EBCEDIC files and knowledge of Autosys would be an advantage. IBM is looking to pay between $40 - $43/ hr for qualified candidates. Please, if any of your respective members are currently looking for work and you think they may be a good fit, you have my permission to forward them my contact information. We also get new PERL focused roles all the time, so anyone in the Toronto PERL Mongers currently looking to start work or switch jobs please tell them to contact me as soon as possible. Thanks for your help Webmaster! Kind Regards, Matt Mackay Placement Consultant, Information Technology The Employment Solution Tel: (416) 482 - 2420 ext- 223 Fax: (416) 482 - 8076 Toll Free: 1 (800) 818 4893 ext- 223 Email: mmackay at tes.net Web: www.tes.com This e-mail transmission may contain confidential or legally privileged information that is intended only for the individual or entity named in the e-mail address. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or reliance upon the contents of this e-mail is strictly prohibited. If you have received this e-mail transmission in error, please reply to the sender, so that we may resend it to the proper destination and then please delete the message from your in-box. The sender does not accept liability for any errors, omissions, corruption or viruses in the contents of this message, or in any attachments. -------------- next part -------------- An HTML attachment was scrubbed... URL: From legrady at gmail.com Tue Jan 26 20:00:42 2010 From: legrady at gmail.com (Tom Legrady) Date: Tue, 26 Jan 2010 23:00:42 -0500 Subject: [tpm] residential advice Message-ID: <3c9af5831001262000p2ecab71ew4b1dc359f9fe53ae@mail.gmail.com> I've just bought a house, so I'm looking for advice, some of it geeky. I'm going to need insurance, so if you're delighted with your agent and the rates you have, send me an email. I've stuck with CIA as my ISP just cause I like the name ( I went to them cause I hate Rogers ). What's your favourite ISP and telephone provider? See you all Thursday, if the housing gremlins don't get me. Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at stok.ca Wed Jan 27 07:59:55 2010 From: mike at stok.ca (Mike Stok) Date: Wed, 27 Jan 2010 10:59:55 -0500 Subject: [tpm] Meeting reminder - Thu 28 Jan 2010, 6:45pm, Nexient Message-ID: <0ABD3FA5-02E8-4B5A-A13F-3CA324EE1DDF@stok.ca> Date: Thu 28 Jan 2010 18:45 EST Title: Modules and Tips Venue: Nexient Learning; Room 15 on the 8th floor Description: A series of quick talks covering various modules which people have found useful or instructive. Some are old standbys, some are new. More details at http://to.pm.org Boilerplate from the web site: Location: 2 Bloor Street West, (usually) 8th or 16th floor. The room number will be announced on the mailing list a few days before the meeting. It will also be left with the security desk in the building (main floor lobby) shortly before the meeting starts (i.e. around 6pm). Time: 6:45 p.m. Directions: This building is on the north-west corner of Bloor and Yonge, accessible by subway from Bloor station. Pay parking is also ample in this area. Security note: The elevators in the building are "locked down" after 5:30pm to people without building access cards. Leading up to the meeting someone will come down to the main floor lobby every few minutes to ferry people upstairs. There will be a number of scheduled trips: 17:30 18:00 18:30 18:45 19:00 After 19:00, you can reach the access-card-carrying guy via a cell phone number that we'll leave with security in the front lobby. The room and floor numbers will be left with security too. If any latecomers call up there will be a final group elevator run at 19:10. After that, access will be ad-hoc; call up from security and somebody will try to come down and let you up. -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rburko at eliteanswers.com Wed Jan 27 14:16:10 2010 From: rburko at eliteanswers.com (Robert Burko) Date: Wed, 27 Jan 2010 17:16:10 -0500 Subject: [tpm] Perl Job Opening in Toronto Message-ID: <00a201ca9f9e$5510e460$ff32ad20$@com> Hello Everyone at Toronto Perl Mongers, I am writing you this email because our CTO, Jeff Horn, (who is a members of the Madison Area Perl Mongers in the US) suggested that I reach out to you with regards to a job opening we have for a Perl Programmer here in our Toronto office. I'm not sure if this is something you encourage so your members can benefit or if this is a violation of your policies. If this is against your policies, then please accept my sincere apologies as that was not my intention. In case you can forward this job announcement to your members, I have included all the information below. Thanks in advance, Robert Burko President, Eliteweb Inc. rburko at eliteanswers.com Toll-Free: 1-877-789-ELITE (3548) Fax: 1-877-FAX-ELITE Elite Email Marketing: www.EliteEmail.com www.EliteAnswers.com Perl Programmer Elite Answers is seeking a bright and motivated Perl programmer. Join the talented team at one of Canada's Top 25 Up & Coming IT Companies* where you will get to develop cutting-edge software, make decisions, manage projects, and have a big impact with your valued contributions right from the get go. We are looking for some who can think big, dream big, and execute with confidence. Our culture is fun and laid back, but our expectations are high. In return for your hard work and drive to succeed, we offer competitive pay, comprehensive flex benefits, and many accelerated growth opportunities. If you meet the requirements below and think you have what it takes to be Elite, send your resume and cover letter to jobs at eliteanswers.com. REQUIRED SKILLS ================= - Object Oriented Perl - Familiarity with CPAN - MySQL (query formulation mostly) - Javascript - HTML - Hard working BONUS SKILLS ============= - ORMs like Rose::DB, Class::DBI, etc. - MVC Frameworks (like Mojo, Catalyst, CGI::Application) - jQuery - HTML/CSS - Design / Photoshop About Elite Answers Inc. Elite Answers is a leading provider of software as a service (SaaS) business solutions. Our flagship program, Elite Email, has won several awards and was recently ranked #19 in Website Magazine's list of Top 50 Email Marketing Programs across the globe. Our client list includes ReMax, Sauza Tequila, Botox, SunTV, and many others. Elite Answers is headquartered in Toronto, Canada. Elite Answers is an equal opportunity employer. * Source: Branham Group Inc - Canada's Top 300 Tech Companies, 2007 -------------- next part -------------- An HTML attachment was scrubbed... URL: From rdice at pobox.com Thu Jan 28 06:40:23 2010 From: rdice at pobox.com (Richard Dice) Date: Thu, 28 Jan 2010 09:40:23 -0500 Subject: [tpm] Perl Job Opening in Toronto In-Reply-To: <00a201ca9f9e$5510e460$ff32ad20$@com> References: <00a201ca9f9e$5510e460$ff32ad20$@com> Message-ID: <5bef4baf1001280640x7a09062fo6f402b365b7bf1dd@mail.gmail.com> Hi Robert, I?m not sure if this is something you encourage so your members can benefit > or if this is a violation of your policies. If this is against your > policies, then please accept my sincere apologies as that was not my > intention. > > Our cultural norm regarding job postings on the Toronto.pm mailing list is that they're okay so long as the company / individual posting is up front about the job and about the company. I think your posting fits that description well. Something that would improve your posting would be some mention of the compensation that you're interested in providing. Cheers, - Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From linux at alteeve.com Fri Jan 29 12:55:20 2010 From: linux at alteeve.com (Madison Kelly) Date: Fri, 29 Jan 2010 15:55:20 -0500 Subject: [tpm] Stupid question time! Message-ID: <4B634B38.3080502@alteeve.com> What is the difference between: if (not $foo && $bar ne "") {} if ((not $foo) && ($bar ne "")) {} I assumed it was mainly an aesthetic/readability thing, but I realize that no, it's logically different. Thanks for enlightening me? Madi From alexcapsa at gmail.com Fri Jan 29 13:00:31 2010 From: alexcapsa at gmail.com (Alexandru Capsa) Date: Fri, 29 Jan 2010 16:00:31 -0500 Subject: [tpm] Stupid question time! In-Reply-To: <4B634B38.3080502@alteeve.com> References: <4B634B38.3080502@alteeve.com> Message-ID: A quick look at operator precedence can help http://www.perl.com/doc/manual/html/pod/perlop.html the brackets help you override that precedence so they can change the logic. Alex On Fri, Jan 29, 2010 at 3:55 PM, Madison Kelly wrote: > What is the difference between: > > if (not $foo && $bar ne "") {} > if ((not $foo) && ($bar ne "")) {} > > I assumed it was mainly an aesthetic/readability thing, but I realize that > no, it's logically different. Thanks for enlightening me? > > Madi > _______________________________________________ > toronto-pm mailing list > toronto-pm at pm.org > http://mail.pm.org/mailman/listinfo/toronto-pm > -- Alexandru Capsa -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.s.doyle at gmail.com Fri Jan 29 13:02:05 2010 From: dave.s.doyle at gmail.com (Dave Doyle) Date: Fri, 29 Jan 2010 16:02:05 -0500 Subject: [tpm] Stupid question time! In-Reply-To: <4B634B38.3080502@alteeve.com> References: <4B634B38.3080502@alteeve.com> Message-ID: the "not" operator is a more loosely binding version of ! because && is stronger the first statement would evaluate as not ($foo && ($bar ne "") ) If you use ! instead of not both statements would be equivalent. -- dave.s.doyle at gmail.com On Fri, Jan 29, 2010 at 3:55 PM, Madison Kelly wrote: > What is the difference between: > > if (not $foo && $bar ne "") {} > if ((not $foo) && ($bar ne "")) {} > > I assumed it was mainly an aesthetic/readability thing, but I realize that > no, it's logically different. Thanks for enlightening me? > > Madi > _______________________________________________ > toronto-pm mailing list > toronto-pm at pm.org > http://mail.pm.org/mailman/listinfo/toronto-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at stok.ca Fri Jan 29 13:03:09 2010 From: mike at stok.ca (Mike Stok) Date: Fri, 29 Jan 2010 16:03:09 -0500 Subject: [tpm] Stupid question time! In-Reply-To: <4B634B38.3080502@alteeve.com> References: <4B634B38.3080502@alteeve.com> Message-ID: <4C99048B-27FA-468B-96F9-E3E0E50E09D5@stok.ca> On Jan 29, 2010, at 3:55 PM, Madison Kelly wrote: > What is the difference between: > > if (not $foo && $bar ne "") {} > if ((not $foo) && ($bar ne "")) {} > > I assumed it was mainly an aesthetic/readability thing, but I realize that no, it's logically different. Thanks for enlightening me? It's a precedence thing, here's how to get perl to show you what it's doing: ratdog:~ mike$ perl -MO=Deparse,-p -e 'if (not $foo && $bar ne "") {}' if ((not ($foo && ($bar ne '')))) { (); } -e syntax OK ratdog:~ mike$ perl -MO=Deparse,-p -e 'if ((not $foo) && ($bar ne "")) {}' if (((not $foo) and ($bar ne ''))) { (); } -e syntax OK The "symbol" logical operators have a higher precedence than the "word" operators, so mixing them can be an exercise in memory and/or parenthesization. See perldoc perlop. Hope this helps, Mike -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply. From fulko.hew at gmail.com Fri Jan 29 13:05:33 2010 From: fulko.hew at gmail.com (Fulko Hew) Date: Fri, 29 Jan 2010 16:05:33 -0500 Subject: [tpm] Stupid question time! In-Reply-To: <4B634B38.3080502@alteeve.com> References: <4B634B38.3080502@alteeve.com> Message-ID: <8204a4fe1001291305s5f806975t99684e7c837710d4@mail.gmail.com> On Fri, Jan 29, 2010 at 3:55 PM, Madison Kelly wrote: > What is the difference between: > > if (not $foo && $bar ne "") {} > if ((not $foo) && ($bar ne "")) {} > > I assumed it was mainly an aesthetic/readability thing, but I realize that > no, it's logically different. Thanks for enlightening me? > Read the perlop document on operator precedence. I see that: ne binds first && binds second and not has the lowest precedence I think you expected it to be 'just as high' as the 'ne' -------------- next part -------------- An HTML attachment was scrubbed... URL: From yam at nerd.cx Fri Jan 29 13:12:40 2010 From: yam at nerd.cx (William Witteman) Date: Fri, 29 Jan 2010 16:12:40 -0500 Subject: [tpm] Stupid question time! In-Reply-To: <4B634B38.3080502@alteeve.com> References: <4B634B38.3080502@alteeve.com> Message-ID: <20100129211240.GA9379@yam.witteman.ca> On Fri, Jan 29, 2010 at 03:55:20PM -0500, Madison Kelly wrote: >What is the difference between: > >if (not $foo && $bar ne "") {} >if ((not $foo) && ($bar ne "")) {} > >I assumed it was mainly an aesthetic/readability thing, but I realize >that no, it's logically different. Thanks for enlightening me? I think that it has to do with operator precedence - though I could not concisely tell you the mechanism of the difference in your example. I look here: http://www.perl.com/doc/manual/html/pod/perlop.html and find that the textual boolean operators are well down the list, so it would likely evaluate the && first, then the other two left to right in the first example, whereas in the second the not and the ne would be evaluated first. That's just a guess though. -- yours, William From stuart at morungos.com Fri Jan 29 13:38:14 2010 From: stuart at morungos.com (Stuart Watt) Date: Fri, 29 Jan 2010 16:38:14 -0500 Subject: [tpm] Continuous integration In-Reply-To: <4B634B38.3080502@alteeve.com> References: <4B634B38.3080502@alteeve.com> Message-ID: <4B635546.3010604@morungos.com> Good to meet you folks last night! Anyway, a simple question: do any of you use a continuous integration system with Perl? I've used (and am using) Buildbot but I was wondering if there is one that is any better for Perly stuff. Getting nicely formatted test results out via Buildbot's Python code has been a little cumbersome, and I'd really like it to be neater. Or should I just build one? All the best Stuart From linux at alteeve.com Fri Jan 29 13:46:36 2010 From: linux at alteeve.com (Madison Kelly) Date: Fri, 29 Jan 2010 16:46:36 -0500 Subject: [tpm] Stupid question time! In-Reply-To: References: <4B634B38.3080502@alteeve.com> Message-ID: <4B63573C.4010804@alteeve.com> Dave Doyle wrote: > the "not" operator is a more loosely binding version of ! > > because && is stronger the first statement would evaluate as > > not ($foo && ($bar ne "") ) > > If you use ! instead of not both statements would be equivalent. Ah, ya, I thought "!" and "not" where equiv. I switched all of my "!" to the word "not" to make the code more readable. Oh well, now I know. Thanks to all for the answers! Madi From mike at stok.ca Fri Jan 29 13:46:26 2010 From: mike at stok.ca (Mike Stok) Date: Fri, 29 Jan 2010 16:46:26 -0500 Subject: [tpm] Continuous integration In-Reply-To: <4B635546.3010604@morungos.com> References: <4B634B38.3080502@alteeve.com> <4B635546.3010604@morungos.com> Message-ID: On Jan 29, 2010, at 4:38 PM, Stuart Watt wrote: > Good to meet you folks last night! > > Anyway, a simple question: do any of you use a continuous integration system with Perl? I've used (and am using) Buildbot but I was wondering if there is one that is any better for Perly stuff. Getting nicely formatted test results out via Buildbot's Python code has been a little cumbersome, and I'd really like it to be neater. > > Or should I just build one? > > All the best > Stuart Ilia did a presentation on Hudson as a CI server about a year ago: > Thursday, Feb 26 2009 > > Location: Classroom 11 on the 8th floor > Speaker: Ilia Lobsanov > Continuous Integration (CI) for Perl Projects. > Description: > We will look at the Test Anything Protocol (TAP). We will convert TAP output to JUnit format. Once in JUnit we can use a number of JVM based CI servers, like Hudson. The end goal is to see Rakudo Perl6 test suite on the Hudson web UI. Some groups use it at work and it is a lot nicer than cruise control. I haven't used it. Mike -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply. From rdice at pobox.com Fri Jan 29 14:05:30 2010 From: rdice at pobox.com (Richard Dice) Date: Fri, 29 Jan 2010 17:05:30 -0500 Subject: [tpm] Continuous integration In-Reply-To: <4B635546.3010604@morungos.com> References: <4B634B38.3080502@alteeve.com> <4B635546.3010604@morungos.com> Message-ID: <5bef4baf1001291405s491645e4w2515991f5e96aaad@mail.gmail.com> > Anyway, a simple question: do any of you use a continuous integration > system with Perl? I've used (and am using) Buildbot but I was wondering if > there is one that is any better for Perly stuff. Getting nicely formatted > test results out via Buildbot's Python code has been a little cumbersome, > and I'd really like it to be neater. > > Or should I just build one? > > Check out Michael Peter's Smolder, a Perl CI system: http://search.cpan.org/dist/Smolder/ Sorry I missed the meeting last night! Cheers, - Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From sfryer at sourcery.ca Fri Jan 29 16:40:00 2010 From: sfryer at sourcery.ca (Shaun Fryer) Date: Fri, 29 Jan 2010 19:40:00 -0500 Subject: [tpm] Stupid question time! In-Reply-To: <4B63573C.4010804@alteeve.com> References: <4B634B38.3080502@alteeve.com> <4B63573C.4010804@alteeve.com> Message-ID: <982579711001291640y340ee86ence43d282bb38fc0f@mail.gmail.com> I often find myself doing things like this... my $bar = $foo if $foo; ...and I wish there were an assignment operator conditional on right-hand truthiness. maybe... my $bar ?= $foo; # as opposed to $bar ||= $foo; Thoughts? Have I overlooked an existing operator? Is this just a bad idea? -- Shaun Fryer -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam.prime at utoronto.ca Fri Jan 29 17:26:20 2010 From: adam.prime at utoronto.ca (Adam Prime) Date: Fri, 29 Jan 2010 20:26:20 -0500 Subject: [tpm] Stupid question time! In-Reply-To: <982579711001291640y340ee86ence43d282bb38fc0f@mail.gmail.com> References: <4B634B38.3080502@alteeve.com> <4B63573C.4010804@alteeve.com> <982579711001291640y340ee86ence43d282bb38fc0f@mail.gmail.com> Message-ID: <4B638ABC.8020202@utoronto.ca> 5.10 has defined or which isn't quite the same thing but you could achieve something like it with my $bar = $foo // undef; Adam Shaun Fryer wrote: > I often find myself doing things like this... > > my $bar = $foo if $foo; > > ...and I wish there were an assignment operator conditional on > right-hand truthiness. maybe... > > my $bar ?= $foo; # as opposed to $bar ||= $foo; > > Thoughts? Have I overlooked an existing operator? Is this just a bad idea? > -- > Shaun Fryer > > > ------------------------------------------------------------------------ > > _______________________________________________ > toronto-pm mailing list > toronto-pm at pm.org > http://mail.pm.org/mailman/listinfo/toronto-pm From fulko.hew at gmail.com Fri Jan 29 17:38:31 2010 From: fulko.hew at gmail.com (Fulko Hew) Date: Fri, 29 Jan 2010 20:38:31 -0500 Subject: [tpm] Stupid question time! In-Reply-To: <982579711001291640y340ee86ence43d282bb38fc0f@mail.gmail.com> References: <4B634B38.3080502@alteeve.com> <4B63573C.4010804@alteeve.com> <982579711001291640y340ee86ence43d282bb38fc0f@mail.gmail.com> Message-ID: <8204a4fe1001291738m49637ee4x5fa4b77ee4d1df91@mail.gmail.com> On Fri, Jan 29, 2010 at 7:40 PM, Shaun Fryer wrote: > I often find myself doing things like this... > > my $bar = $foo if $foo; > > ...and I wish there were an assignment operator conditional on right-hand > truthiness. maybe... > > my $bar ?= $foo; # as opposed to $bar ||= $foo; > > Thoughts? Have I overlooked an existing operator? Is this just a bad idea I would have thought $bar = $foo unless $bar; ...might be more intuitive.? ... in retrospect. I guess it depends if yout think the glass is half full, or half empty? but I don't think you want to put the my in front because ISTR that the variable would only poof into existence if the condition evaluated true. so it would still be longer. I suppose the alternative is my $bar = $bar || $foo; (now you could safely put the 'my' on) but thats still a little redundant :-( I don't think the 'if right-handed truthiness' operator exists .. in a short hand form worth using :-| -------------- next part -------------- An HTML attachment was scrubbed... URL: From sfryer at sourcery.ca Fri Jan 29 18:12:26 2010 From: sfryer at sourcery.ca (Shaun Fryer) Date: Fri, 29 Jan 2010 21:12:26 -0500 Subject: [tpm] Stupid question time! In-Reply-To: <8204a4fe1001291738m49637ee4x5fa4b77ee4d1df91@mail.gmail.com> References: <4B634B38.3080502@alteeve.com> <4B63573C.4010804@alteeve.com> <982579711001291640y340ee86ence43d282bb38fc0f@mail.gmail.com> <8204a4fe1001291738m49637ee4x5fa4b77ee4d1df91@mail.gmail.com> Message-ID: <982579711001291812ge9eb1e2tf50479bc0be6de02@mail.gmail.com> On Fri, Jan 29, 2010 at 8:38 PM, Fulko Hew wrote: > I would have thought > > $bar = $foo unless $bar; ...might be more intuitive.? > > ... in retrospect. I guess it depends if yout think the glass is half full, > or half empty? > The most common example would be creating a hash which I'm populating with values, and don't want a given key to exist() if the right hand side is undef. my %foo; $foo{bar} = $baz if $baz; In this case... $foo{bar} = $baz // undef; ...while interesting, isn't appropriate. Another (related) example might be a dual use setter/getter, for the moment disregarding the ": lvalue" attribute. sub foo { my ($self, $value) = @_; $self->{foo} = $value if $value; return $self->{foo}; } Now you could this... $obj->foo('bar'); # set foo $bar = $obj->foo; # get foo Anyway, these are just simple examples off the top of my head. It can easily be more complex. I've found myself thinking this periodically, so I figured worth asking. Maybe someone has a good reason why it's a dumb idea to worry about in the first place? > but I don't think you want to put the my in front because ISTR that > the variable would only poof into existence if the condition evaluated > true. > so it would still be longer. > You're absolute right about that. Noticed it right after I clicked send, but didn't want to create more noise by correcting myself. > I don't think the 'if right-handed truthiness' operator exists > .. in a short hand form worth using :-| > I wasn't sure, but then that only means it's time to avail myself of those more in the know. ;) Would be a cool/useful feature though, in my opinion. -- Shaun Fryer -------------- next part -------------- An HTML attachment was scrubbed... URL: From uri at StemSystems.com Fri Jan 29 18:56:51 2010 From: uri at StemSystems.com (Uri Guttman) Date: Fri, 29 Jan 2010 21:56:51 -0500 Subject: [tpm] Stupid question time! In-Reply-To: <4B638ABC.8020202@utoronto.ca> (Adam Prime's message of "Fri\, 29 Jan 2010 20\:26\:20 -0500") References: <4B634B38.3080502@alteeve.com> <4B63573C.4010804@alteeve.com> <982579711001291640y340ee86ence43d282bb38fc0f@mail.gmail.com> <4B638ABC.8020202@utoronto.ca> Message-ID: <87r5p8b8r0.fsf@quad.sysarch.com> >>>>> "AP" == Adam Prime writes: please learn to bottom quote. now i can't comment on your code in respect to the OP since it reads upside down. AP> 5.10 has defined or which isn't quite the same thing but you could AP> achieve something like it with AP> my $bar = $foo // undef; the OP's code will not assign to $bar unless $foo is true. your code always assigns something to $bar. uri -- Uri Guttman ------ uri at stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com --------- From uri at StemSystems.com Fri Jan 29 18:59:20 2010 From: uri at StemSystems.com (Uri Guttman) Date: Fri, 29 Jan 2010 21:59:20 -0500 Subject: [tpm] Stupid question time! In-Reply-To: <8204a4fe1001291738m49637ee4x5fa4b77ee4d1df91@mail.gmail.com> (Fulko Hew's message of "Fri\, 29 Jan 2010 20\:38\:31 -0500") References: <4B634B38.3080502@alteeve.com> <4B63573C.4010804@alteeve.com> <982579711001291640y340ee86ence43d282bb38fc0f@mail.gmail.com> <8204a4fe1001291738m49637ee4x5fa4b77ee4d1df91@mail.gmail.com> Message-ID: <87mxzwb8mv.fsf@quad.sysarch.com> >>>>> "FH" == Fulko Hew writes: FH> On Fri, Jan 29, 2010 at 7:40 PM, Shaun Fryer wrote: FH> I often find myself doing things like this... FH> my $bar = $foo if $foo; FH> ...and I wish there were an assignment operator conditional on right-hand FH> truthiness. maybe... FH> my $bar ?= $foo; # as opposed to $bar ||= $foo; FH> Thoughts? Have I overlooked an existing operator? Is this just a bad idea FH> I would have thought FH> $bar = $foo unless $bar;???? ...might be more intuitive.? your code has the same bug at the other replier. you are not testing $foo but $bar for truth. he want to set $bar only if $foo is true. FH> my $bar = $bar || $foo; you should make that $bar = $foo || $bar; but that won't allow a my declare of $bar since $bar is referenced. uri -- Uri Guttman ------ uri at stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com --------- From uri at StemSystems.com Fri Jan 29 20:53:03 2010 From: uri at StemSystems.com (Uri Guttman) Date: Fri, 29 Jan 2010 23:53:03 -0500 Subject: [tpm] Stupid question time! In-Reply-To: <982579711001291812ge9eb1e2tf50479bc0be6de02@mail.gmail.com> (Shaun Fryer's message of "Fri\, 29 Jan 2010 21\:12\:26 -0500") References: <4B634B38.3080502@alteeve.com> <4B63573C.4010804@alteeve.com> <982579711001291640y340ee86ence43d282bb38fc0f@mail.gmail.com> <8204a4fe1001291738m49637ee4x5fa4b77ee4d1df91@mail.gmail.com> <982579711001291812ge9eb1e2tf50479bc0be6de02@mail.gmail.com> Message-ID: <87zl3w9osw.fsf@quad.sysarch.com> >>>>> "SF" == Shaun Fryer writes: SF> The most common example would be creating a hash which I'm SF> populating with values, and don't want a given key to exist() if SF> the right hand side is undef. SF> my %foo; SF> $foo{bar} = $baz if $baz; well, that doesn't check for undef, just truth. add defined in there if you are checking for undef. if you are populating a whole hash from another one (as in adding or setting options with defaults) there are better ways than doing it one at a time. i won't put code in here unless you ask about needing such a beast. you can do several neat tricks with hash overrides, slices, map, etc. SF> In this case... SF> $foo{bar} = $baz // undef; SF> ...while interesting, isn't appropriate. your original if modifier is about the best you can do for a scalar check. uri -- Uri Guttman ------ uri at stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com --------- From uri at StemSystems.com Sat Jan 30 16:42:50 2010 From: uri at StemSystems.com (Uri Guttman) Date: Sat, 30 Jan 2010 19:42:50 -0500 Subject: [tpm] Stupid question time! In-Reply-To: <4B63573C.4010804@alteeve.com> (Madison Kelly's message of "Fri\, 29 Jan 2010 16\:46\:36 -0500") References: <4B634B38.3080502@alteeve.com> <4B63573C.4010804@alteeve.com> Message-ID: <87fx5n3y0l.fsf@quad.sysarch.com> >>>>> "MK" == Madison Kelly writes: MK> Ah, ya, I thought "!" and "not" where equiv. I switched all of my "!" MK> to the word "not" to make the code more readable. Oh well, now I know. i just posted to comp.lang.perl.misc about this. seems appropriate to repost it here: 'and' and '&&' do the exact same operation. the ONLY difference is precedence. this is true for all the boolean ops which have symbolic and spelled out names. the spelled out names were added to perl5 later. they were made lower precedence on purpose so you could do boolean ops which bind lower than things such as assignment, func calls, etc. the reason they are there is so you can have a CHOICE in precedence. it allows for different syntax and some like it one way or the other. look at these two common lines: open( my $foo, $file ) || die "can't open $file $!" ; open my $foo, $file or die "can't open $file $!" ; the 'or' allows you to drop the () on the open call. a good rule (courtesy of peter scott) about when to use which form is: use the symbolic forms (||, &&, !) when doing a boolean expression use the spelled forms( or, and, not) when doing flow control the precedence levels work best in those situations. $foo = $bar and last ; $foo = $bar || $default ; uri -- Uri Guttman ------ uri at stemsystems.com -------- http://www.sysarch.com -- ----- Perl Code Review , Architecture, Development, Training, Support ------ --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com --------- From mike at stok.ca Sun Jan 31 13:52:34 2010 From: mike at stok.ca (Mike Stok) Date: Sun, 31 Jan 2010 16:52:34 -0500 Subject: [tpm] A handfull of books from O'Reilly. Message-ID: <8E68F8D5-3DEE-4F10-9B95-A30B18224D10@stok.ca> O'Reilly have sent TPM a few books. They are: Security on Rails, Poweski & Raphael, Dec 2009, http://pragprog.com/titles/fr_secure/security-on-rails My New Mac (Snow Leopard Edition), Wang, Aug 2009, http://oreilly.com/catalog/9781593272098 Regular Expression Cookbook, Goyvaerts & Levithan, May 2009, http://oreilly.com/catalog/9780596520687 Programming Perl (third edition), Wall, Christiansen, & Orwant, July 2000, http://oreilly.com/catalog/9780596000271 If you want one of these then just let me know and I can bring it to a meeting (or figure out some other way of getting it to you.) All that you need to do if you want a book is produce a brief review within a few (3-ish) months of getting it so I can add the review to the TPM web site. First come, first served. If you want some other O'Reilly / Pragmatic Programmer / No Starch / Paraglyph etc. books then one way to get them for "free" is to harass me for a review copy, and review it. Mike -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at stok.ca Sun Jan 31 16:33:09 2010 From: mike at stok.ca (Mike Stok) Date: Sun, 31 Jan 2010 19:33:09 -0500 Subject: [tpm] A handfull of books from O'Reilly. In-Reply-To: <8E68F8D5-3DEE-4F10-9B95-A30B18224D10@stok.ca> References: <8E68F8D5-3DEE-4F10-9B95-A30B18224D10@stok.ca> Message-ID: <17372452-F341-4EC5-8578-3221CDE69BD1@stok.ca> The Regular Expression Cookbook has been claimed. Mike On Jan 31, 2010, at 4:52 PM, Mike Stok wrote: > O'Reilly have sent TPM a few books. They are: > > Security on Rails, Poweski & Raphael, Dec 2009, http://pragprog.com/titles/fr_secure/security-on-rails > My New Mac (Snow Leopard Edition), Wang, Aug 2009, http://oreilly.com/catalog/9781593272098 > Regular Expression Cookbook, Goyvaerts & Levithan, May 2009, http://oreilly.com/catalog/9780596520687 > Programming Perl (third edition), Wall, Christiansen, & Orwant, July 2000, http://oreilly.com/catalog/9780596000271 > > If you want one of these then just let me know and I can bring it to a meeting (or figure out some other way of getting it to you.) All that you need to do if you want a book is produce a brief review within a few (3-ish) months of getting it so I can add the review to the TPM web site. First come, first served. > > If you want some other O'Reilly / Pragmatic Programmer / No Starch / Paraglyph etc. books then one way to get them for "free" is to harass me for a review copy, and review it. > > Mike > > -- > > Mike Stok > http://www.stok.ca/~mike/ > > The "`Stok' disclaimers" apply. > > > > > _______________________________________________ > toronto-pm mailing list > toronto-pm at pm.org > http://mail.pm.org/mailman/listinfo/toronto-pm -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply. -------------- next part -------------- An HTML attachment was scrubbed... URL: