From jason at hostedlabs.com Sun Dec 2 10:44:01 2007 From: jason at hostedlabs.com (Jason Rexilius) Date: Sun, 02 Dec 2007 12:44:01 -0600 Subject: [Chicago-talk] BARcamp Updates - Events, Jobs Message-ID: <4752FCF1.9000304@hostedlabs.com> Hi Everyone! Another update about upcoming events and some other good stuff! ################### This Thursday 12/6/07, 6pm @ Debonair Social Club 1575 N Milwaukee Ave in Wicker Park... Ignite-Chicago! Sean Harper is putting together a great winter-time event, a little more organized than BARcamp ;-) Ignite Chicago is a small conference, free and open to the community, built around 5 minute presentations that include 20 slides each (allowing for 15 seconds / slide). http://ignite-chicago.org/ RSVP at http://upcoming.yahoo.com/event/309951 ################### Also wanted to tell everyone about some great jobs out there: HostedLABS (my company) is hiring a CTO, Software Engineers, and PHP developers. Will be at Ignite, would love to chat with people there! Tribune is hiring some SA's, DBA's and QA folk (work on Metromix) Harvest Trading is looking for a Unix SA. Ludorum is looking for a Director of Technology. Take a look at the Job Board (and feel free to post yours, its free for everyone): http://barcampbeta.jobcoin.com/ ################### Last tid-bit.. Seems most people who replied wanted (2) BARcamps per year.. I am thinking seriously about that but think that perhaps doing Winter and Summer would be good timing for not conflicting with other BARcamps. Also winter is kinda dead ;-) Any one have any last opinions on the 1 or 2 BARcamps per year questions? Take care and see you all at Ignite this Thursday! -jason From me at heyjay.com Sun Dec 2 15:28:49 2007 From: me at heyjay.com (Jay Strauss) Date: Sun, 2 Dec 2007 17:28:49 -0600 Subject: [Chicago-talk] What's up with Perl 6? Message-ID: Hi, What's the scoop with Perl 6? I was surfing the perl6 site and I see that Parrot still has active development, but I don't see any activity on the Perl 6 side. I want to make sure I understand things correctly. Parrot is a VM upon which you will/can run a multitude of languages. Those languages must compile down to their native byte code, and then there will be some sort of plug in bytecode converter, that will convert the native bytecode to something that will run on Parrot? Lastly, I thought there were plans to run Java upon Parrot, but I don't see that in the languages. I thought I also heard a couple of years ago was that one would be able to write hybrid Perl/Java swing, compile it into Java bytecode, and run it in the JVM? Did I hear that wrong, is there any movement in that type of direction? Just curious. Thanks Jay From me at heyjay.com Sun Dec 2 15:32:38 2007 From: me at heyjay.com (Jay Strauss) Date: Sun, 2 Dec 2007 17:32:38 -0600 Subject: [Chicago-talk] Compiling Perl Message-ID: Hi, (one more) I was reading the perldoc on perlcc. Does it compile into a stand alone executable? That is can it make an executable that I could give to my mom, who does not have Perl installed on her MS machine, and it would run? Or do I use PAR, or Perl2exe, or Perlbin... I was thinking of writing an app that I could put on some machines without Perl installed. What are your suggestions for doing this? Thanks Jay From andy at petdance.com Sun Dec 2 16:14:00 2007 From: andy at petdance.com (Andy Lester) Date: Sun, 2 Dec 2007 18:14:00 -0600 Subject: [Chicago-talk] Compiling Perl In-Reply-To: References: Message-ID: On Dec 2, 2007, at 5:32 PM, Jay Strauss wrote: > Hi, (one more) > > I was reading the perldoc on perlcc. Does it compile into a stand > alone executable? That is can it make an executable that I could give > to my mom, who does not have Perl installed on her MS machine, and it > would run? > > Or do I use PAR, or Perl2exe, or Perlbin... > > I was thinking of writing an app that I could put on some machines > without Perl installed. > > What are your suggestions for doing this? Check the Perl FAQ on this very question. xoa -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From jon at jrock.us Sun Dec 2 15:45:23 2007 From: jon at jrock.us (Jonathan Rockway) Date: Sun, 02 Dec 2007 17:45:23 -0600 Subject: [Chicago-talk] Compiling Perl In-Reply-To: References: Message-ID: <1196639123.5875.53.camel@bar.jrock.us> On Sun, 2007-12-02 at 17:32 -0600, Jay Strauss wrote: > Hi, (one more) > > I was reading the perldoc on perlcc. Does it compile into a stand > alone executable? That is can it make an executable that I could give > to my mom, who does not have Perl installed on her MS machine, and it > would run? > > Or do I use PAR, or Perl2exe, or Perlbin... PAR. Regards, Jonathan Rockway -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/pipermail/chicago-talk/attachments/20071202/69c330a1/attachment.bin From jon at jrock.us Sun Dec 2 15:57:26 2007 From: jon at jrock.us (Jonathan Rockway) Date: Sun, 02 Dec 2007 17:57:26 -0600 Subject: [Chicago-talk] What's up with Perl 6? In-Reply-To: References: Message-ID: <1196639846.5875.64.camel@bar.jrock.us> On Sun, 2007-12-02 at 17:28 -0600, Jay Strauss wrote: > Hi, > > What's the scoop with Perl 6? I was surfing the perl6 site and I see > that Parrot still has active development, but I don't see any activity > on the Perl 6 side. You really need to subscribe to the mailing lists or join the IRC channels for up-to-date information. People are spending most of their time working on the implementation, not updating their websites. The Pugs blog is generally has enjoyable articles: http://pugs.blogs.com/ > Those languages > must compile down to their native byte code, and then there will be > some sort of plug in bytecode converter, that will convert the native > bytecode to something that will run on Parrot? Nope. A compiler targeting Parrot takes the program text as its input and produces parrot bytecode as output. (This is the same as javac compiling java files into classes that run on the JVM.) Take a look at the abc for an idea of how this sort of thing is implemented: https://svn.perl.org/parrot/trunk/languages/abc This is a very simple programming language that compiles to run on Parrot. > Lastly, I thought there were plans to run Java upon Parrot, but I > don't see that in the languages. I thought I also heard a couple of > years ago was that one would be able to write hybrid Perl/Java swing, > compile it into Java bytecode, and run it in the JVM? Did I hear that > wrong, is there any movement in that type of direction? Someone was probably working on this at some point. dotnet is similar and more complete: https://svn.perl.org/parrot/trunk/languages/dotnet Jonathan Worthington did a lot of this work, and has some good articles on his web site: http://www.jnthn.net/articles.shtml Regards, Jonathan Rockway -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/pipermail/chicago-talk/attachments/20071202/a9da1a26/attachment.bin From me at heyjay.com Sun Dec 2 18:33:42 2007 From: me at heyjay.com (Jay Strauss) Date: Sun, 2 Dec 2007 20:33:42 -0600 Subject: [Chicago-talk] What's up with Perl 6? In-Reply-To: <1196639846.5875.64.camel@bar.jrock.us> References: <1196639846.5875.64.camel@bar.jrock.us> Message-ID: > The Pugs blog is generally has enjoyable articles: > > http://pugs.blogs.com/ I'm not sure if I really get what Pugs is. I think: Perl6 is a language specification. Pugs reads Perl6 source and executes it, but instead of being written in C, its written is Haskell? Whereas, in some future, there will be a Perl compiler, that will compile down to a Parrot bytecode? At that point, when you write a Perl6 script, to run it, I'll just say "perl somefile.pl" and behind the scenes it will be compiled using the Perl6 compiler, and executed by the Parrot machine? > ...Someone was probably working on this at some point. dotnet is similar > and more complete: > > https://svn.perl.org/parrot/trunk/languages/dotnet > > Jonathan Worthington did a lot of this work, and has some good articles > on his web site: > > http://www.jnthn.net/articles.shtml > > Regards, > Jonathan Rockway Thanks, I'll surf the links you provided. Jay From andy at petdance.com Sun Dec 2 18:38:42 2007 From: andy at petdance.com (Andy Lester) Date: Sun, 2 Dec 2007 20:38:42 -0600 Subject: [Chicago-talk] What's up with Perl 6? In-Reply-To: References: <1196639846.5875.64.camel@bar.jrock.us> Message-ID: <83651FFD-CC9B-4AF5-A6B9-0FF2F54F6D70@petdance.com> > > I'm not sure if I really get what Pugs is. I think: > Perl6 is a language specification. Pugs reads Perl6 source and > executes it, but instead of being written in C, its written is > Haskell? Pretty much, yes. Pugs is Perl 6 implemented in Haskell. The final Perl 6 project will be Perl 6 implemented in Parrot. See also this article: http://perlbuzz.com/2007/11/a-roadmap-for-perl-6-and-parrot.html and the roadmap it points to. -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From merlyn at stonehenge.com Sun Dec 2 19:47:55 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Sun, 02 Dec 2007 19:47:55 -0800 Subject: [Chicago-talk] What's up with Perl 6? In-Reply-To: <83651FFD-CC9B-4AF5-A6B9-0FF2F54F6D70@petdance.com> (Andy Lester's message of "Sun, 2 Dec 2007 20:38:42 -0600") References: <1196639846.5875.64.camel@bar.jrock.us> <83651FFD-CC9B-4AF5-A6B9-0FF2F54F6D70@petdance.com> Message-ID: <86odd88mms.fsf@blue.stonehenge.com> >>>>> "Andy" == Andy Lester writes: Andy> Pugs is Perl 6 implemented in Haskell. Well, an *obsolete* version of Perl 6, since nobody is maintaining Pugs, even though the Perl 6 definition has changed. Andy> The final Perl 6 project will be Perl 6 implemented in Parrot. No. The final Perl 6 project will be Perl 6 implemented in Perl 6, with various translators from that to things like Parrot. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From me at heyjay.com Wed Dec 5 13:55:37 2007 From: me at heyjay.com (Jay Strauss) Date: Wed, 5 Dec 2007 15:55:37 -0600 Subject: [Chicago-talk] chown inside a script Message-ID: Hi, I'm trying to change a group of files that all have the same file number, but different extensions (suffix). When I'm in the shell I can do: chown jblum /opt/montrose/private/active/PROSPECT/07120415* BUT: jstrauss at fs1:~/bin$ cat t my $f = "/opt/montrose/private/active/PROSPECT/07120415"; system("chown", "jblum", "$f*"); jstrauss at fs1:~/bin$ perl t chown: cannot access `/opt/montrose/private/active/PROSPECT/07120415*': No such file or directory I've tried various incantations of the wildcard but none work. Is there some sort of quoting I should be using to make this work, or some other secret? I'd rather use a wildcard than globing a list of files to iterate over. Thanks Jay From andy at petdance.com Wed Dec 5 13:58:09 2007 From: andy at petdance.com (Andy Lester) Date: Wed, 5 Dec 2007 15:58:09 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: References: Message-ID: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> > > I've tried various incantations of the wildcard but none work. Is > there some sort of quoting I should be using to make this work, or > some other secret? The shell is what does the globbing, but you're not calling the shell. You're calling chown directly. > I'd rather use a wildcard than globing a list of files to iterate > over. You don't need to iterate. Pass all the filenames as arguments to system(). system( 'chown', 'whoever', glob( '/home/blah/blah/whatever*' ) ); -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From me at heyjay.com Wed Dec 5 14:06:36 2007 From: me at heyjay.com (Jay Strauss) Date: Wed, 5 Dec 2007 16:06:36 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> Message-ID: Oh, ok. Thanks On Dec 5, 2007 3:58 PM, Andy Lester wrote: > > > > I've tried various incantations of the wildcard but none work. Is > > there some sort of quoting I should be using to make this work, or > > some other secret? > > The shell is what does the globbing, but you're not calling the > shell. You're calling chown directly. > > > > I'd rather use a wildcard than globing a list of files to iterate > > over. > > > You don't need to iterate. Pass all the filenames as arguments to > system(). > > system( 'chown', 'whoever', glob( '/home/blah/blah/whatever*' ) ); > > > > -- > Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance > > > > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > From jon at jrock.us Wed Dec 5 15:19:42 2007 From: jon at jrock.us (Jonathan Rockway) Date: Wed, 05 Dec 2007 17:19:42 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> Message-ID: <1196896782.5875.89.camel@bar.jrock.us> On Wed, 2007-12-05 at 15:58 -0600, Andy Lester wrote: > system( 'chown', 'whoever', glob( '/home/blah/blah/whatever*' ) ); BTW, chown is a builtin function: chown $uid, $gid, Regards, Jonathan Rockway -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/pipermail/chicago-talk/attachments/20071205/26191231/attachment.bin From briank at kappacs.com Wed Dec 5 18:42:07 2007 From: briank at kappacs.com (Brian Katzung) Date: Wed, 05 Dec 2007 20:42:07 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: <1196896782.5875.89.camel@bar.jrock.us> References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> <1196896782.5875.89.camel@bar.jrock.us> Message-ID: <4757617F.3090406@kappacs.com> Jonathan Rockway wrote: > On Wed, 2007-12-05 at 15:58 -0600, Andy Lester wrote: >> system( 'chown', 'whoever', glob( '/home/blah/blah/whatever*' ) ); > > BTW, chown is a builtin function: > > chown $uid, $gid, > > Regards, > Jonathan Rockway Putting it all together (except for error checking :-), chown scalar(getpwnam "jblum"), -1, glob("/opt/montrose/private/active/PROSPECT/07120415*"); Programming by committee. We should qualify for government work. :-) - Brian -- Brian Katzung, Kappa Computer Solutions, LLC Leveraging UNIX, GNU/Linux, open source, and custom software solutions for business and beyond Phone: 877.367.8837 x1 http://www.kappacs.com From me at heyjay.com Wed Dec 5 20:28:37 2007 From: me at heyjay.com (Jay Strauss) Date: Wed, 5 Dec 2007 22:28:37 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: <4757617F.3090406@kappacs.com> References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> Message-ID: Thanks. But I don't think that will work in my case, because I'm doing it from a web page, I had to create an suid link to chown, to call from my cgi. Unless there is some way to do it from inside perl, but still change ownership of file not owned by the webserver. Thanks Jay On Dec 5, 2007 8:42 PM, Brian Katzung wrote: > > > > Jonathan Rockway wrote: > > On Wed, 2007-12-05 at 15:58 -0600, Andy Lester wrote: > >> system( 'chown', 'whoever', glob( '/home/blah/blah/whatever*' ) ); > > > > BTW, chown is a builtin function: > > > > chown $uid, $gid, > > > > Regards, > > Jonathan Rockway > > Putting it all together (except for error checking :-), > > chown scalar(getpwnam "jblum"), -1, > glob("/opt/montrose/private/active/PROSPECT/07120415*"); > > Programming by committee. We should qualify for government work. :-) > > - Brian > > -- > Brian Katzung, Kappa Computer Solutions, LLC > Leveraging UNIX, GNU/Linux, open source, and custom > software solutions for business and beyond > Phone: 877.367.8837 x1 http://www.kappacs.com > > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > From wsmith at etc.com Wed Dec 5 19:27:26 2007 From: wsmith at etc.com (wsmith at etc.com) Date: 6 Dec 2007 03:27:26 -0000 Subject: [Chicago-talk] UniForum: Pizza Party Message-ID: <20071206032726.16802.qmail@hurricane.etc.com> There's no tech talk for December's suburban Chicago Perl Mongers meeting, but there pizza and beer. Note the location! xoxo, Andy ------------------------------------------------------------------------------- UniForum Chicago Pizza Party Tuesday, December 11th at 7pm Come Network with your fellow UniForum Chicago members ------------------------------------------------------ Join us at a year-end Pizza Party to celebrate another year of UniForum Chicago. Pizza and soda will be *on the house* (paid for by UniForum Chicago). Paying for beer or other alcoholic beverages will be the responsibility of those who order it. Non-members will be encouraged to either join UniForum Chicago at the Pizza Party (at the standard cost of $25 per year), or to pay $10 for attending if they will be joining in the eating & drinking. Anyone can show up for free if they just want to join the conversation. Please help us out in determining how much pizza to pre-order by contacting us if you plan to attend. We don't require an RSVP, but if you know you're going to be coming we'd appreciate a call or a note. This will help us get our pizza and drink in a timely manner once we arrive at Connie's - we'll overestimate slightly to account for those who aren't able to RSVP. Just reply to this e-mail to send your RSVP. Meeting Location ---------------- The next general meeting of UniForum Chicago will be from 7:00 pm to 9:00 pm on Tuesday, December 11th, 2007, at Connie's Pizza in Naperville. Connie's Pizza 1170 Iroquois Ave Naperville IL 60640 Take I-88 (East-West Tollway) west. Take the Naperville Rd exit. Turn right (south) at the exit's traffic light. Continue south on Naperville Rd until the Ogden Ave intersection. Turn right (west) at the Ogden Ave. traffic light. Continue west till the Iroquois Ave traffic light. Turn right (north) onto Iroquois. Connie's is on the left. For additional information contact Scott Nemec at (630) 990-6265 or president at uniforum.chi.il.us, or visit the UniForum Chicago web site at: http://www.uniforum.chi.il.us/ From jason at hostedlabs.com Wed Dec 5 20:59:14 2007 From: jason at hostedlabs.com (Jason Rexilius) Date: Wed, 05 Dec 2007 22:59:14 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> Message-ID: <475781A2.9080806@hostedlabs.com> No, thats a function of the OS.. It shouldnt allow you you to do that without explicit suid.. By the way, suid access from CGI or web UI is very very dangerous.. You had best really understand what you are doing from a security perspective. Jay Strauss wrote: > Thanks. > > But I don't think that will work in my case, because I'm doing it from > a web page, I had to create an suid link to chown, to call from my > cgi. > > Unless there is some way to do it from inside perl, but still change > ownership of file not owned by the webserver. > > Thanks > Jay > > On Dec 5, 2007 8:42 PM, Brian Katzung wrote: >> >> >> Jonathan Rockway wrote: >>> On Wed, 2007-12-05 at 15:58 -0600, Andy Lester wrote: >>>> system( 'chown', 'whoever', glob( '/home/blah/blah/whatever*' ) ); >>> BTW, chown is a builtin function: >>> >>> chown $uid, $gid, >>> >>> Regards, >>> Jonathan Rockway >> Putting it all together (except for error checking :-), >> >> chown scalar(getpwnam "jblum"), -1, >> glob("/opt/montrose/private/active/PROSPECT/07120415*"); >> >> Programming by committee. We should qualify for government work. :-) >> >> - Brian >> >> -- >> Brian Katzung, Kappa Computer Solutions, LLC >> Leveraging UNIX, GNU/Linux, open source, and custom >> software solutions for business and beyond >> Phone: 877.367.8837 x1 http://www.kappacs.com >> >> >> _______________________________________________ >> Chicago-talk mailing list >> Chicago-talk at pm.org >> http://mail.pm.org/mailman/listinfo/chicago-talk >> > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk From briank at kappacs.com Wed Dec 5 22:22:17 2007 From: briank at kappacs.com (Brian Katzung) Date: Thu, 06 Dec 2007 00:22:17 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> Message-ID: <47579519.4050704@kappacs.com> Jay, A couple of alternatives come to mind, depending on what you're trying to accomplish: Have you ruled out the use of group-based access and a set-gid directory rather than changing file ownership? A sudo rule for the web-server user might be better than a suid "link" to chown (or rules for whatever subsequent actions might be required by users other than the owner). If your system supports it, you could mount a file system (e.g. vfat) that supports the uid= option so that all the files are owned by the desired user regardless of who creates them. Feel free to contact me directly if you want to discuss any of these options. - Brian Jay Strauss wrote: > Thanks. > > But I don't think that will work in my case, because I'm doing it from > a web page, I had to create an suid link to chown, to call from my > cgi. > > Unless there is some way to do it from inside perl, but still change > ownership of file not owned by the webserver. > > Thanks > Jay > > On Dec 5, 2007 8:42 PM, Brian Katzung wrote: >> >> >> Jonathan Rockway wrote: >>> On Wed, 2007-12-05 at 15:58 -0600, Andy Lester wrote: >>>> system( 'chown', 'whoever', glob( '/home/blah/blah/whatever*' ) ); >>> BTW, chown is a builtin function: >>> >>> chown $uid, $gid, >>> >>> Regards, >>> Jonathan Rockway >> Putting it all together (except for error checking :-), >> >> chown scalar(getpwnam "jblum"), -1, >> glob("/opt/montrose/private/active/PROSPECT/07120415*"); >> >> Programming by committee. We should qualify for government work. :-) >> >> - Brian -- Brian Katzung, Kappa Computer Solutions, LLC Leveraging UNIX, GNU/Linux, open source, and custom software solutions for business and beyond Phone: 877.367.8837 x1 http://www.kappacs.com From merlyn at stonehenge.com Wed Dec 5 23:23:05 2007 From: merlyn at stonehenge.com (Randal L. Schwartz) Date: Wed, 05 Dec 2007 23:23:05 -0800 Subject: [Chicago-talk] chown inside a script In-Reply-To: (Jay Strauss's message of "Wed, 5 Dec 2007 22:28:37 -0600") References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> Message-ID: <86d4tkz3qe.fsf@blue.stonehenge.com> >>>>> "Jay" == Jay Strauss writes: Jay> But I don't think that will work in my case, because I'm doing it from Jay> a web page, I had to create an suid link to chown, to call from my Jay> cgi. Ouch. Really dangerous. Can you explain more about why you need to change the ownership of a file *during a web hit*? -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training! From jon at jrock.us Wed Dec 5 20:38:10 2007 From: jon at jrock.us (Jonathan Rockway) Date: Wed, 05 Dec 2007 22:38:10 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> Message-ID: <1196915890.5875.91.camel@bar.jrock.us> On Wed, 2007-12-05 at 22:28 -0600, Jay Strauss wrote: > Thanks. > > But I don't think that will work in my case, because I'm doing it from > a web page, I had to create an suid link to chown, to call from my > cgi. > > Unless there is some way to do it from inside perl, but still change > ownership of file not owned by the webserver. This is a massive security nightmare. Consider the case where someone symlinks /path/that/matches/your.glob to /etc/shadow. You've just rendered the system unusable. Also, keep in mind that you can't create a "setuid link". chmod follows symlinks and updates the original file. Regards, Jonathan Rockway -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/pipermail/chicago-talk/attachments/20071205/7e47368d/attachment.bin From tzz at lifelogs.com Thu Dec 6 07:59:25 2007 From: tzz at lifelogs.com (Ted Zlatanov) Date: Thu, 06 Dec 2007 09:59:25 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: <1196915890.5875.91.camel@bar.jrock.us> (Jonathan Rockway's message of "Wed, 05 Dec 2007 22:38:10 -0600") References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> <1196915890.5875.91.camel@bar.jrock.us> Message-ID: <86y7c7n7aa.fsf@lifelogs.com> On Wed, 05 Dec 2007 22:38:10 -0600 Jonathan Rockway wrote: JR> On Wed, 2007-12-05 at 22:28 -0600, Jay Strauss wrote: >> Thanks. >> >> But I don't think that will work in my case, because I'm doing it from >> a web page, I had to create an suid link to chown, to call from my >> cgi. >> >> Unless there is some way to do it from inside perl, but still change >> ownership of file not owned by the webserver. JR> This is a massive security nightmare. Consider the case where someone JR> symlinks /path/that/matches/your.glob to /etc/shadow. You've just JR> rendered the system unusable. JR> Also, keep in mind that you can't create a "setuid link". chmod follows JR> symlinks and updates the original file. I think chroot to a known good path that contains only data files (plus a minimal chown setup) would work. Symlinks to the outside won't resolve inside such an environment. Hard links will, if the filesystem was shared, so don't put the data files on the /etc filesystem. The worst an attacker could do is corrupt the data inside the chroot environment. It's a pain to set it all up, though. Ted From me at heyjay.com Thu Dec 6 11:39:51 2007 From: me at heyjay.com (Jay Strauss) Date: Thu, 6 Dec 2007 13:39:51 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: <86y7c7n7aa.fsf@lifelogs.com> References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> <1196915890.5875.91.camel@bar.jrock.us> <86y7c7n7aa.fsf@lifelogs.com> Message-ID: Hi All, I figured if I showed my hand, everyone would call me a crazy person with an insecure system (which I'm not denying). Here's the deal: I run a MS application to which the files are stored on my samba server. Currently, when a user creates a file, that user/owner is the only user with read (and write) access to said file. BUT, when the file is "closed", I (me), the manager, use the application to move the file from one "folder" to a different "folder". Behind the scenes the app, copies the file from one directory to another, and deletes the original. As a result, I (jstrauss), become the owner of the file, and the person who created it, no longer has access. I want to retain the original ownership, so that the creator can still look at the file (but no one else can). So I wrote a cgi to change ownership, rather than sshing to the box, cd'ing to the directory, looking up the filename in the application, and then chown'ing filname*, everytime someone wants to see a "closed" file. If there are better, easier, more secure ways to do this I'd welcome suggestions. Please NOTE, the webserver is an internal webserver (behind my firewall), and my company includes me and 3 employees (really only 2.5 if you measured productivity :). Jay On Dec 6, 2007 9:59 AM, Ted Zlatanov wrote: > On Wed, 05 Dec 2007 22:38:10 -0600 Jonathan Rockway wrote: > > JR> On Wed, 2007-12-05 at 22:28 -0600, Jay Strauss wrote: > >> Thanks. > >> > >> But I don't think that will work in my case, because I'm doing it from > >> a web page, I had to create an suid link to chown, to call from my > >> cgi. > >> > >> Unless there is some way to do it from inside perl, but still change > >> ownership of file not owned by the webserver. > > JR> This is a massive security nightmare. Consider the case where someone > JR> symlinks /path/that/matches/your.glob to /etc/shadow. You've just > JR> rendered the system unusable. > > JR> Also, keep in mind that you can't create a "setuid link". chmod follows > JR> symlinks and updates the original file. > > I think chroot to a known good path that contains only data files (plus > a minimal chown setup) would work. Symlinks to the outside won't > resolve inside such an environment. Hard links will, if the filesystem > was shared, so don't put the data files on the /etc filesystem. The > worst an attacker could do is corrupt the data inside the chroot > environment. It's a pain to set it all up, though. > > Ted > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > From tprinty at mail.edisonave.net Thu Dec 6 13:32:03 2007 From: tprinty at mail.edisonave.net (Tom Printy) Date: Thu, 06 Dec 2007 15:32:03 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> <1196915890.5875.91.camel@bar.jrock.us> <86y7c7n7aa.fsf@lifelogs.com> Message-ID: <1196976723.21459.37.camel@localhost> What if instead of doing a copy you use the scp with the -p flag. I think this will preserve the permissions and any other attributes of the file.... -Tom On Thu, 2007-12-06 at 13:39 -0600, Jay Strauss wrote: > Hi All, > > I figured if I showed my hand, everyone would call me a crazy person > with an insecure system (which I'm not denying). > > Here's the deal: > > I run a MS application to which the files are stored on my samba > server. Currently, when a user creates a file, that user/owner is the > only user with read (and write) access to said file. BUT, when the > file is "closed", I (me), the manager, use the application to move the > file from one "folder" to a different "folder". Behind the scenes the > app, copies the file from one directory to another, and deletes the > original. > > As a result, I (jstrauss), become the owner of the file, and the > person who created it, no longer has access. I want to retain the > original ownership, so that the creator can still look at the file > (but no one else can). > > So I wrote a cgi to change ownership, rather than sshing to the box, > cd'ing to the directory, looking up the filename in the application, > and then chown'ing filname*, everytime someone wants to see a "closed" > file. > > If there are better, easier, more secure ways to do this I'd welcome > suggestions. Please NOTE, the webserver is an internal webserver > (behind my firewall), and my company includes me and 3 employees > (really only 2.5 if you measured productivity :). > > Jay > > > > On Dec 6, 2007 9:59 AM, Ted Zlatanov wrote: > > On Wed, 05 Dec 2007 22:38:10 -0600 Jonathan Rockway wrote: > > > > JR> On Wed, 2007-12-05 at 22:28 -0600, Jay Strauss wrote: > > >> Thanks. > > >> > > >> But I don't think that will work in my case, because I'm doing it from > > >> a web page, I had to create an suid link to chown, to call from my > > >> cgi. > > >> > > >> Unless there is some way to do it from inside perl, but still change > > >> ownership of file not owned by the webserver. > > > > JR> This is a massive security nightmare. Consider the case where someone > > JR> symlinks /path/that/matches/your.glob to /etc/shadow. You've just > > JR> rendered the system unusable. > > > > JR> Also, keep in mind that you can't create a "setuid link". chmod follows > > JR> symlinks and updates the original file. > > > > I think chroot to a known good path that contains only data files (plus > > a minimal chown setup) would work. Symlinks to the outside won't > > resolve inside such an environment. Hard links will, if the filesystem > > was shared, so don't put the data files on the /etc filesystem. The > > worst an attacker could do is corrupt the data inside the chroot > > environment. It's a pain to set it all up, though. > > > > Ted > > > > _______________________________________________ > > Chicago-talk mailing list > > Chicago-talk at pm.org > > http://mail.pm.org/mailman/listinfo/chicago-talk > > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk From jason at hostedlabs.com Thu Dec 6 13:47:51 2007 From: jason at hostedlabs.com (Jason Rexilius) Date: Thu, 06 Dec 2007 15:47:51 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> <1196915890.5875.91.camel@bar.jrock.us> <86y7c7n7aa.fsf@lifelogs.com> Message-ID: <47586E07.8030908@hostedlabs.com> Yeah, that isn't as bad as having this exposed to the internet. Here is a way that breaks the tasks apart and gives you ability to wrap security controls around bits. 1) Write a cron job that runs every minute, as root that simply does a mv or a cp -p && rm of filenames in a list (for security sake, stripping out any '..' and prepending a hard-coded path prefix.) 2) Write a cgi-script that simply writes a list of files to be moved that the cron job reads. Something as simple as a touch /tmp/movefiles/[name_of_file] (which cron does readdir then removes tmp files when done). I just like keeping suid root script out of line of cgi.. Jay Strauss wrote: > Hi All, > > I figured if I showed my hand, everyone would call me a crazy person > with an insecure system (which I'm not denying). > > Here's the deal: > > I run a MS application to which the files are stored on my samba > server. Currently, when a user creates a file, that user/owner is the > only user with read (and write) access to said file. BUT, when the > file is "closed", I (me), the manager, use the application to move the > file from one "folder" to a different "folder". Behind the scenes the > app, copies the file from one directory to another, and deletes the > original. > > As a result, I (jstrauss), become the owner of the file, and the > person who created it, no longer has access. I want to retain the > original ownership, so that the creator can still look at the file > (but no one else can). > > So I wrote a cgi to change ownership, rather than sshing to the box, > cd'ing to the directory, looking up the filename in the application, > and then chown'ing filname*, everytime someone wants to see a "closed" > file. > > If there are better, easier, more secure ways to do this I'd welcome > suggestions. Please NOTE, the webserver is an internal webserver > (behind my firewall), and my company includes me and 3 employees > (really only 2.5 if you measured productivity :). > > Jay > > > > On Dec 6, 2007 9:59 AM, Ted Zlatanov wrote: >> On Wed, 05 Dec 2007 22:38:10 -0600 Jonathan Rockway wrote: >> >> JR> On Wed, 2007-12-05 at 22:28 -0600, Jay Strauss wrote: >>>> Thanks. >>>> >>>> But I don't think that will work in my case, because I'm doing it from >>>> a web page, I had to create an suid link to chown, to call from my >>>> cgi. >>>> >>>> Unless there is some way to do it from inside perl, but still change >>>> ownership of file not owned by the webserver. >> JR> This is a massive security nightmare. Consider the case where someone >> JR> symlinks /path/that/matches/your.glob to /etc/shadow. You've just >> JR> rendered the system unusable. >> >> JR> Also, keep in mind that you can't create a "setuid link". chmod follows >> JR> symlinks and updates the original file. >> >> I think chroot to a known good path that contains only data files (plus >> a minimal chown setup) would work. Symlinks to the outside won't >> resolve inside such an environment. Hard links will, if the filesystem >> was shared, so don't put the data files on the /etc filesystem. The >> worst an attacker could do is corrupt the data inside the chroot >> environment. It's a pain to set it all up, though. >> >> Ted >> >> _______________________________________________ >> Chicago-talk mailing list >> Chicago-talk at pm.org >> http://mail.pm.org/mailman/listinfo/chicago-talk >> > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk From briank at kappacs.com Thu Dec 6 13:57:30 2007 From: briank at kappacs.com (Brian Katzung) Date: Thu, 06 Dec 2007 15:57:30 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> <1196915890.5875.91.camel@bar.jrock.us> <86y7c7n7aa.fsf@lifelogs.com> Message-ID: <4758704A.70204@kappacs.com> Jay et al, I'm not sure about the "easier" part, but I would probably do something like this: - Create a queue directory for each employee, e.g. /some/path/closed/{emp1,emp2,emp3} with access by managers (you) - When you "close" the employees' files in your app, save them to the appropriate employee queue - Have a root script monitor the queue tree (you could use "fam" (file alteration monitor) API or roll your own) - When plain files appear in the employee queues, the root script would move them to some standardized place (e.g. to ~emp/my_app_closed_files/) with appropriate checks for file (directory) types, name collisions, etc. and chown them. - Brian Jay Strauss wrote: > Hi All, > > I figured if I showed my hand, everyone would call me a crazy person > with an insecure system (which I'm not denying). > > Here's the deal: > > I run a MS application to which the files are stored on my samba > server. Currently, when a user creates a file, that user/owner is the > only user with read (and write) access to said file. BUT, when the > file is "closed", I (me), the manager, use the application to move the > file from one "folder" to a different "folder". Behind the scenes the > app, copies the file from one directory to another, and deletes the > original. > > As a result, I (jstrauss), become the owner of the file, and the > person who created it, no longer has access. I want to retain the > original ownership, so that the creator can still look at the file > (but no one else can). > > So I wrote a cgi to change ownership, rather than sshing to the box, > cd'ing to the directory, looking up the filename in the application, > and then chown'ing filname*, everytime someone wants to see a "closed" > file. > > If there are better, easier, more secure ways to do this I'd welcome > suggestions. Please NOTE, the webserver is an internal webserver > (behind my firewall), and my company includes me and 3 employees > (really only 2.5 if you measured productivity :). > > Jay > > > > On Dec 6, 2007 9:59 AM, Ted Zlatanov wrote: >> On Wed, 05 Dec 2007 22:38:10 -0600 Jonathan Rockway wrote: >> >> JR> On Wed, 2007-12-05 at 22:28 -0600, Jay Strauss wrote: >>>> Thanks. >>>> >>>> But I don't think that will work in my case, because I'm doing it from >>>> a web page, I had to create an suid link to chown, to call from my >>>> cgi. >>>> >>>> Unless there is some way to do it from inside perl, but still change >>>> ownership of file not owned by the webserver. >> JR> This is a massive security nightmare. Consider the case where someone >> JR> symlinks /path/that/matches/your.glob to /etc/shadow. You've just >> JR> rendered the system unusable. >> >> JR> Also, keep in mind that you can't create a "setuid link". chmod follows >> JR> symlinks and updates the original file. >> >> I think chroot to a known good path that contains only data files (plus >> a minimal chown setup) would work. Symlinks to the outside won't >> resolve inside such an environment. Hard links will, if the filesystem >> was shared, so don't put the data files on the /etc filesystem. The >> worst an attacker could do is corrupt the data inside the chroot >> environment. It's a pain to set it all up, though. >> >> Ted >> >> _______________________________________________ >> Chicago-talk mailing list >> Chicago-talk at pm.org >> http://mail.pm.org/mailman/listinfo/chicago-talk >> > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > > -- Brian Katzung, Kappa Computer Solutions, LLC Leveraging UNIX, GNU/Linux, open source, and custom software solutions for business and beyond Phone: 877.367.8837 x1 http://www.kappacs.com From me at heyjay.com Thu Dec 6 14:50:11 2007 From: me at heyjay.com (Jay Strauss) Date: Thu, 6 Dec 2007 16:50:11 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: <1196976723.21459.37.camel@localhost> References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> <1196915890.5875.91.camel@bar.jrock.us> <86y7c7n7aa.fsf@lifelogs.com> <1196976723.21459.37.camel@localhost> Message-ID: On Dec 6, 2007 3:32 PM, Tom Printy wrote: > What if instead of doing a copy you use the scp with the -p flag. I > think this will preserve the permissions and any other attributes of the > file.... > > -Tom Its a vendor supplied app, so I don't have control of it's mechanism. Jay From me at heyjay.com Thu Dec 6 14:51:24 2007 From: me at heyjay.com (Jay Strauss) Date: Thu, 6 Dec 2007 16:51:24 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: <47586E07.8030908@hostedlabs.com> References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> <1196915890.5875.91.camel@bar.jrock.us> <86y7c7n7aa.fsf@lifelogs.com> <47586E07.8030908@hostedlabs.com> Message-ID: On Dec 6, 2007 3:47 PM, Jason Rexilius wrote: > Yeah, that isn't as bad as having this exposed to the internet. > > Here is a way that breaks the tasks apart and gives you ability to wrap > security controls around bits. > > 1) Write a cron job that runs every minute, as root that simply does a > mv or a cp -p && rm of filenames in a list (for security sake, stripping > out any '..' and prepending a hard-coded path prefix.) > > 2) Write a cgi-script that simply writes a list of files to be moved > that the cron job reads. Something as simple as a touch > /tmp/movefiles/[name_of_file] (which cron does readdir then removes tmp > files when done). > > I just like keeping suid root script out of line of cgi.. I guess better yet, just run the cron job on the "closed" directory, and do the code I'm currently doing in the cgi to determine file ownership. thanks Jay From me at heyjay.com Thu Dec 6 14:53:18 2007 From: me at heyjay.com (Jay Strauss) Date: Thu, 6 Dec 2007 16:53:18 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: <4758704A.70204@kappacs.com> References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> <1196915890.5875.91.camel@bar.jrock.us> <86y7c7n7aa.fsf@lifelogs.com> <4758704A.70204@kappacs.com> Message-ID: On Dec 6, 2007 3:57 PM, Brian Katzung wrote: > Jay et al, > > I'm not sure about the "easier" part, but I would probably do something > like this: > > - Create a queue directory for each employee, e.g. > /some/path/closed/{emp1,emp2,emp3} > with access by managers (you) > > - When you "close" the employees' files in your app, save them to the > appropriate employee queue > > - Have a root script monitor the queue tree (you could use "fam" (file > alteration monitor) API or roll your own) > > - When plain files appear in the employee queues, the root script would > move them to some standardized place (e.g. to ~emp/my_app_closed_files/) > with appropriate checks for file (directory) types, name collisions, > etc. and chown them. > > - Brian The queue part seems hard, but I'll look into the "fam" API and maybe have a root script do the chown without the cgi. Thanks Jay From briank at kappacs.com Thu Dec 6 16:41:04 2007 From: briank at kappacs.com (Brian Katzung) Date: Thu, 06 Dec 2007 18:41:04 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: References: <90BA27F0-7E9B-4E51-87BE-09079407D3E6@petdance.com> <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> <1196915890.5875.91.camel@bar.jrock.us> <86y7c7n7aa.fsf@lifelogs.com> <4758704A.70204@kappacs.com> Message-ID: <475896A0.7090208@kappacs.com> Jay, Here's a rough code snippet to get you started. use File::Find; # Queue looks like /some/path/closed/user_name/file_name my $base_dir = '/some/path/closed'; sub proc_files { return unless (-f $File::Find::name && $File::Find::name =~ m{^\Q$base_dir\E/([^/]+)/([^/]+)$}); my ($user, $file) = ($1, $2); print "Process file $file in queue for user $user\n"; } find({ 'wanted' => \&proc_files, 'follow' => 0, 'no_chdir' => 1 }, $basedir); - Brian Jay Strauss wrote: > On Dec 6, 2007 3:57 PM, Brian Katzung wrote: >> Jay et al, >> >> I'm not sure about the "easier" part, but I would probably do something >> like this: >> >> - Create a queue directory for each employee, e.g. >> /some/path/closed/{emp1,emp2,emp3} >> with access by managers (you) >> >> - When you "close" the employees' files in your app, save them to the >> appropriate employee queue >> >> - Have a root script monitor the queue tree (you could use "fam" (file >> alteration monitor) API or roll your own) >> >> - When plain files appear in the employee queues, the root script would >> move them to some standardized place (e.g. to ~emp/my_app_closed_files/) >> with appropriate checks for file (directory) types, name collisions, >> etc. and chown them. >> >> - Brian > > The queue part seems hard, but I'll look into the "fam" API and maybe > have a root script do the chown without the cgi. > > Thanks > Jay > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > > -- Brian Katzung, Kappa Computer Solutions, LLC Leveraging UNIX, GNU/Linux, open source, and custom software solutions for business and beyond Phone: 877.367.8837 x1 http://www.kappacs.com From me at heyjay.com Thu Dec 6 17:54:10 2007 From: me at heyjay.com (Jay Strauss) Date: Thu, 6 Dec 2007 19:54:10 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: <475896A0.7090208@kappacs.com> References: <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> <1196915890.5875.91.camel@bar.jrock.us> <86y7c7n7aa.fsf@lifelogs.com> <4758704A.70204@kappacs.com> <475896A0.7090208@kappacs.com> Message-ID: On Dec 6, 2007 6:41 PM, Brian Katzung wrote: > Jay, > > Here's a rough code snippet to get you started. > > use File::Find; > > # Queue looks like /some/path/closed/user_name/file_name > my $base_dir = '/some/path/closed'; > > sub proc_files > { > return unless (-f $File::Find::name && > $File::Find::name =~ m{^\Q$base_dir\E/([^/]+)/([^/]+)$}); > > my ($user, $file) = ($1, $2); > print "Process file $file in queue for user $user\n"; > } > > find({ 'wanted' => \&proc_files, 'follow' => 0, 'no_chdir' => 1 }, > $basedir); > > - Brian Thanks Brian, I'm not exactly sure what the regex does. I don't know wher \Q and \E do, the other part I think is match and remember the directory and filename. Also, I already know where the files are, what's the advantage of using File::Find? Jay From andy at petdance.com Thu Dec 6 18:46:46 2007 From: andy at petdance.com (Andy Lester) Date: Thu, 6 Dec 2007 20:46:46 -0600 Subject: [Chicago-talk] Please test my new speedy ack-1.75_01.tar.gz References: <200712070241.lB72fbA1024561@pause.perl.org> Message-ID: <3CB52609-B20A-431A-A6BB-FFAF6E79FB3D@petdance.com> I've released 1.75_01 which is a big speedup for what I suspect is the most common case of scanning large directories of many relatively (<100K) small files and not finding matches in all of them. Here's what it does: It checks the size of each file, and if it's <100K, slurps up the entire file. Then, it scans the entire 100K file at once, and if there are no matches, then there's no need to do the line-by-line more expensive searching. In my test scanning a couple of big source directories like ~/parrot, it saved about 40% run-time. If I had -C or -B to store context, it saved about 70% run-time because the saving of context is more expensive. So, please, check it out and make sure all is still working. Also, any eyes on the algorithm I'm using would be appreciated, too. I'm sure I can do things cleaner or a bit more speedily, but right now I'm mostly worried about accuracy. xoxo, Andy Begin forwarded message: > From: PAUSE > Date: December 6, 2007 8:41:37 PM CST > To: "Andy Lester" > Subject: CPAN Upload: P/PE/PETDANCE/ack-1.75_01.tar.gz > Reply-To: cpan-testers at perl.org > > The uploaded file > > ack-1.75_01.tar.gz > > has entered CPAN as > > file: $CPAN/authors/id/P/PE/PETDANCE/ack-1.75_01.tar.gz > size: 51701 bytes > md5: 43673ac643d9d58df24f4e349640791d > > No action is required on your part > Request entered by: PETDANCE (Andy Lester) > Request entered on: Fri, 07 Dec 2007 02:41:10 GMT > Request completed: Fri, 07 Dec 2007 02:41:37 GMT > > Thanks, > -- > paused, v937 > -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From briank at kappacs.com Thu Dec 6 19:56:52 2007 From: briank at kappacs.com (Brian Katzung) Date: Thu, 06 Dec 2007 21:56:52 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: References: <1196896782.5875.89.camel@bar.jrock.us> <4757617F.3090406@kappacs.com> <1196915890.5875.91.camel@bar.jrock.us> <86y7c7n7aa.fsf@lifelogs.com> <4758704A.70204@kappacs.com> <475896A0.7090208@kappacs.com> Message-ID: <4758C484.5020101@kappacs.com> Jay Strauss wrote: > On Dec 6, 2007 6:41 PM, Brian Katzung wrote: >> Jay, >> >> Here's a rough code snippet to get you started. >> >> use File::Find; >> >> # Queue looks like /some/path/closed/user_name/file_name >> my $base_dir = '/some/path/closed'; >> >> sub proc_files >> { >> return unless (-f $File::Find::name && >> $File::Find::name =~ m{^\Q$base_dir\E/([^/]+)/([^/]+)$}); >> >> my ($user, $file) = ($1, $2); >> print "Process file $file in queue for user $user\n"; >> } >> >> find({ 'wanted' => \&proc_files, 'follow' => 0, 'no_chdir' => 1 }, >> $basedir); >> >> - Brian > > Thanks Brian, I'm not exactly sure what the regex does. It makes sure the current path being examined is the base_dir plus two components, remembering those two components (think of it as a path check, split, and splice all in one). > I don't know > wher \Q and \E do, the other part I think is match and remember the > directory and filename. I'm going to make you do *some* work. :-) See man/perldoc perlre. > Also, I already know where the files are, what's the advantage of > using File::Find? And it's a good thing you know, too, because File::Find doesn't "find" files! It's a directory tree iterator, which is exactly what I wanted here (with the "filtering" as indicated)--to iterate over each "queued" file. > Jay - Brian -- Brian Katzung, Kappa Computer Solutions, LLC Leveraging UNIX, GNU/Linux, open source, and custom software solutions for business and beyond Phone: 877.367.8837 x1 http://www.kappacs.com From me at heyjay.com Thu Dec 6 20:23:25 2007 From: me at heyjay.com (Jay Strauss) Date: Thu, 6 Dec 2007 22:23:25 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: <4758C484.5020101@kappacs.com> References: <1196915890.5875.91.camel@bar.jrock.us> <86y7c7n7aa.fsf@lifelogs.com> <4758704A.70204@kappacs.com> <475896A0.7090208@kappacs.com> <4758C484.5020101@kappacs.com> Message-ID: On Dec 6, 2007 9:56 PM, Brian Katzung wrote: > Jay Strauss wrote: > > On Dec 6, 2007 6:41 PM, Brian Katzung wrote: > >> Jay, > >> > >> Here's a rough code snippet to get you started. > >> > >> use File::Find; > >> > >> # Queue looks like /some/path/closed/user_name/file_name > >> my $base_dir = '/some/path/closed'; > >> > >> sub proc_files > >> { > >> return unless (-f $File::Find::name && > >> $File::Find::name =~ m{^\Q$base_dir\E/([^/]+)/([^/]+)$}); > >> > >> my ($user, $file) = ($1, $2); > >> print "Process file $file in queue for user $user\n"; > >> } > >> > >> find({ 'wanted' => \&proc_files, 'follow' => 0, 'no_chdir' => 1 }, > >> $basedir); > >> > >> - Brian > > > > Thanks Brian, I'm not exactly sure what the regex does. > > It makes sure the current path being examined is the base_dir plus two > components, remembering those two components (think of it as a path > check, split, and splice all in one). > > > I don't know > > wher \Q and \E do, the other part I think is match and remember the > > directory and filename. > > I'm going to make you do *some* work. :-) See man/perldoc perlre. > > > Also, I already know where the files are, what's the advantage of > > using File::Find? > > And it's a good thing you know, too, because File::Find doesn't "find" > files! It's a directory tree iterator, which is exactly what I wanted > here (with the "filtering" as indicated)--to iterate over each "queued" > file. > > > Jay > > - Brian Oh, it iterates, makes sense now. I read the perldoc on File::Find and paid more attention to what the args of find were for. Didn't think about what it returns . \E end case modification (think vi) \Q quote (disable) pattern metacharacters till \E I guess your using that in case the contents of $base_dir contains metachars? Just to be clear, you're suggesting using a script like something above, and call it with FAM when the directory changes? I confused, why would I iterate over the entire directory, when it looks like FAM can report when a single file is created, and I could operate on that specific file? I'm probably missing some important point. Thanks for all the help. Jay From briank at kappacs.com Thu Dec 6 20:53:50 2007 From: briank at kappacs.com (Brian Katzung) Date: Thu, 06 Dec 2007 22:53:50 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: References: <1196915890.5875.91.camel@bar.jrock.us> <86y7c7n7aa.fsf@lifelogs.com> <4758704A.70204@kappacs.com> <475896A0.7090208@kappacs.com> <4758C484.5020101@kappacs.com> Message-ID: <4758D1DE.9060103@kappacs.com> Previously, Jay Strauss wrote: > The queue part seems hard, but I'll look into the "fam" API and maybe > have a root script do the chown without the cgi. More recently, Jay Strauss wrote: > I confused, why would I iterate over the entire directory, when it > looks like FAM can report when a single file is created, and I could > operate on that specific file? > > I'm probably missing some important point. > > Thanks for all the help. > Jay When you wrote "The queue part seems hard, but I'll look into ... fam", I thought you meant you weren't sure how to approach processing the queue if you didn't use FAM. - Brian -- Brian Katzung, Kappa Computer Solutions, LLC Leveraging UNIX, GNU/Linux, open source, and custom software solutions for business and beyond Phone: 877.367.8837 x1 http://www.kappacs.com From me at heyjay.com Fri Dec 7 05:44:38 2007 From: me at heyjay.com (Jay Strauss) Date: Fri, 7 Dec 2007 07:44:38 -0600 Subject: [Chicago-talk] chown inside a script In-Reply-To: <4758D1DE.9060103@kappacs.com> References: <86y7c7n7aa.fsf@lifelogs.com> <4758704A.70204@kappacs.com> <475896A0.7090208@kappacs.com> <4758C484.5020101@kappacs.com> <4758D1DE.9060103@kappacs.com> Message-ID: > When you wrote "The queue part seems hard, but I'll look into ... fam", > I thought you meant you weren't sure how to approach processing the > queue if you didn't use FAM. > > > - Brian Oh, Ok. Thanks a ton. I like the idea of FAM, I can use it for some other tasks too, which could come in handy. Jay From jason at hostedlabs.com Mon Dec 10 08:44:27 2007 From: jason at hostedlabs.com (Jason Rexilius) Date: Mon, 10 Dec 2007 10:44:27 -0600 Subject: [Chicago-talk] OT: job(s) posting Message-ID: <475D6CEB.5090108@hostedlabs.com> Hey everyone! Forgive the job spam here but its slightly different from a standard job posting. My company, HostedLABS http://hostedlabs.com/ is looking to solve a number of problems and some can be tackled in different ways. The things I am looking to do are: a) sponsor or pay people to work on a couple of open-source projects. b) part-time work for poor but smart college students. c) full-time employment with the company (salary + stock). So in that context let me describe what I'm looking for: 1) paid open-source project development: port the p0f daemon to an apache module. See http://lcamtuf.coredump.cx/p0f.shtml 2) paid open-source project development: djbdns (tinydns) modifications, adding two modules or extensions to the NS server. see: http://cr.yp.to/djbdns.html 3) paid open-source project development: further code modifications to siege load test tool. see: http://www.joedog.org/JoeDog/Siege 4) part-time work: general linux systems admin work, evening/weekend hours. some coding also possible if desired. 5) full-time employment: I really need at least two developers and one hard-core systems engineer (more than just SA). The software development roles can be different but I have a general need for the following: - low-level network, OS, filesystem, cluster development, usually in C/C++. Familiarity with libraries such as Spread http://www.spread.org/ hack in Erlang, work on VFS or distributed lock managers. etc. Just call it core development. - systems management software development, Python, perl &| C/C++ where called for. Self awareness and overall management of everything from IP space and network stacks to code deployment and system versioning. SVN interface, OS tools usage, heartbeat libraries, rsync, etc. etc. Call it large scale system management. - web library and framework internals development, PHP. perl, python and Ruby. Re-writing modules or libraries, hacking packages (such as Rails), etc. There may be some C/C++ in the mix for some of these. This category is web library development. For the systems engineer, knowledge of linux internals, virtuialization, advanced networking, building OS from scratch, cluster and grid filesystems, cluster computing, PXE boot, etc. Lots of fun stuff to play with. Architecture and design of large scale systems is on the plate. Really looking for smart people who want to build really cool technology in a start-up environment. For those of you who know me or have heard any of my talks you know that there is a global footprint component to this and there may be some travel involved on the systems side. Thats it for now. Thanks for reading and hope to see you all at the next event! -jason From andy at petdance.com Mon Dec 10 09:34:34 2007 From: andy at petdance.com (Andy Lester) Date: Mon, 10 Dec 2007 11:34:34 -0600 Subject: [Chicago-talk] OT: job(s) posting In-Reply-To: <475D6CEB.5090108@hostedlabs.com> References: <475D6CEB.5090108@hostedlabs.com> Message-ID: <3CE1075E-0B6F-4652-AB52-2DF9CA5FC75C@petdance.com> On Dec 10, 2007, at 10:44 AM, Jason Rexilius wrote: > Hey everyone! > > Forgive the job spam here but its slightly different from a standard > job posting. Please don't. If it's a job posting, it should go on jobs.perl.org. Thank you. Andy -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From jason at hostedlabs.com Mon Dec 10 09:53:54 2007 From: jason at hostedlabs.com (Jason Rexilius) Date: Mon, 10 Dec 2007 11:53:54 -0600 Subject: [Chicago-talk] OT: job(s) posting In-Reply-To: <3CE1075E-0B6F-4652-AB52-2DF9CA5FC75C@petdance.com> References: <475D6CEB.5090108@hostedlabs.com> <3CE1075E-0B6F-4652-AB52-2DF9CA5FC75C@petdance.com> Message-ID: <475D7D32.7030100@hostedlabs.com> Sorry.. would sponsoring of open source projects (sorta contract work) go on this list or both on other? Andy Lester wrote: > On Dec 10, 2007, at 10:44 AM, Jason Rexilius wrote: > >> Hey everyone! >> >> Forgive the job spam here but its slightly different from a standard >> job posting. > > Please don't. If it's a job posting, it should go on jobs.perl.org. > > Thank you. > Andy > > > -- > Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance > > > > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk From frag at ripco.com Tue Dec 11 09:15:06 2007 From: frag at ripco.com (Mike Fragassi) Date: Tue, 11 Dec 2007 11:15:06 -0600 (CST) Subject: [Chicago-talk] Hackathon? Message-ID: I haven't heard much about this recently, although it's this weekend. (Right?) I.e. when on Friday will people start gathering, what will people be working on (more specifically that just "Parrot" and "Net-XPlanner", whatever that is), will it make any sense to participate if you're not a Parrot hacker, etc. -- Mike F. From brian.d.foy at gmail.com Tue Dec 11 09:44:38 2007 From: brian.d.foy at gmail.com (brian d foy) Date: Tue, 11 Dec 2007 11:44:38 -0600 Subject: [Chicago-talk] Hackathon? In-Reply-To: References: Message-ID: <2715accf0712110944j64b72afdm68a5da678afb11fc@mail.gmail.com> On 12/11/07, Mike Fragassi wrote: > I haven't heard much about this recently, although it's this weekend. > (Right?) I.e. when on Friday will people start gathering, what will > people be working on (more specifically that just "Parrot" and > "Net-XPlanner", whatever that is), will it make any sense to participate > if you're not a Parrot hacker, etc. Jon and Josh have been a bit busy preparing their classes (and Jon just finished his Catalyst book, I think). On Friday we have classes all day and night, but people can still hang out at the hostel. There's plenty of space, free wifi, and so on. People can even sign up for Josh's testing class still :) I don't have any plans for what I would work on or know when I'll wake up. Jon and I have a BackPAN project that we might work on (and I had to get a 16 Gb thumb drive to put BackPAN and CPAN on, and they barely fit)! -- brian d foy http://www.pair.com/~comdog/ From joshua.mcadams at gmail.com Wed Dec 12 13:35:14 2007 From: joshua.mcadams at gmail.com (Joshua McAdams) Date: Wed, 12 Dec 2007 15:35:14 -0600 Subject: [Chicago-talk] Reminder: Chicago Perl Hackathon This Weekend Message-ID: <49d805d70712121335m583d023cue79716d1ad7e4f86@mail.gmail.com> This is just a friendly reminder that the Chicago Perl Hackathon 2007 will be this weekend, December 14th-16th, at Hosteling International on 24 E. Congress Pkwy. The event is completely free unless you want to get a room at the hostel. At the hackathon we will have Perl programmers from around the country, including our special guest Dave Rolsky. Dave is responsible for the popular Mason templating system and for the Perl DateTime project. Feel free to stop by the hackathon and spend some time coding with your fellow Perl programmers. Not a Perl programmer? Ruby or Python more your style? Stop by anyway and enjoy the interaction with other talented programmers that you might not normally get the opportunity to work with. Talk sigils. Argue religious points about whitespace. It's all part of the fun. From andy at petdance.com Thu Dec 13 09:46:47 2007 From: andy at petdance.com (Andy Lester) Date: Thu, 13 Dec 2007 11:46:47 -0600 Subject: [Chicago-talk] I need a multi-level heading/footer module Message-ID: <60B31D1C-4BE8-43C1-B2DB-216FA4B74685@petdance.com> I'm reinventing the wheel on some code, and I need to stop. I'm doing a query with year & month & some other stuff (year, month, and then interesting stuff), and my output looks roughly like: 2007 heading January heading January detail January detail January detail February heading February detail 2008 heading etc I'm guessing there's a module out there that will fire triggers when the various heading columns change as I iterate over a dataset. Recommendations? Thanks, Andy -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From e.ellington at gmail.com Thu Dec 13 16:46:26 2007 From: e.ellington at gmail.com (Eric Ellington) Date: Thu, 13 Dec 2007 18:46:26 -0600 Subject: [Chicago-talk] Why does Perl hate my csv file? Message-ID: Using this script: use strict; main(); sub main { open(FILE,"1.csv") || die "COULD NOT OPEN FILE: \n$!\n"; #nix header my $x = ; while () { print $_; } } where 1.csv contains: Header RLANE_02,16,0.6,54,58,16,0,0,0,56.3,55.9,11/1/2007,0:00:00,, RLANE_01,8,0.3,56,59,8,0,0,0,112.5,112.2,11/1/2007,0:00:00,, ELANE_02,60,3.9,56,61,32,28,0,0,15,14.4,11/1/2007,0:00:00,, ELANE_01,23,1.3,60,65,13,10,0,0,39.1,38.6,11/1/2007,0:00:00,, WLANE_01,10,0.3,57,58,9,1,0,0,90,89.7,11/1/2007,0:00:00,, WLANE_02,51,3.2,55,60,32,19,0,0,17.6,17.1,11/1/2007,0:00:00,, ,,,,,,,,,,,,,, I get no output. Change the file name to 1.txt and I get output or if I comment out "my $x = ;" and even then the output is jacked up. Why is that? Does open do something special when it sees a file that ends in .csv? I found nothing at http://perldoc.perl.org/functions/open.html or on ActiveState's website. This is perl, v5.8.8 built for MSWin32-x86-multi-thread on windows XP. -- Eric Ellington e.ellington at gmail.com From andy at petdance.com Thu Dec 13 16:49:19 2007 From: andy at petdance.com (Andy Lester) Date: Thu, 13 Dec 2007 18:49:19 -0600 Subject: [Chicago-talk] Why does Perl hate my csv file? In-Reply-To: References: Message-ID: On Dec 13, 2007, at 6:46 PM, Eric Ellington wrote: > Change the file name to 1.txt and I get output or if I comment out "my > $x = ;" and even then the output is jacked up. Why is that? Does > open do something special when it sees a file that ends in .csv? I > found nothing at http://perldoc.perl.org/functions/open.html or on > ActiveState's website. No, Perl doesn't care at all. There's something else going on that you're not describing. Are the line-endings different for your machine from the machine that you got the file from? You're on Unix and it came from Windows, or vice versa? Also, although "use strict" is a good thing, even more important is "use warnings". Throw that in and see what else happens. And what does "the output is jacked up" mean, anyway? xoox, Andy -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From e.ellington at gmail.com Thu Dec 13 20:07:50 2007 From: e.ellington at gmail.com (Eric Ellington) Date: Thu, 13 Dec 2007 22:07:50 -0600 Subject: [Chicago-talk] Why does Perl hate my csv file? In-Reply-To: References: Message-ID: I am creating everything on a windows system. I checked the line endings and they look OK to me. Like I said the file works with any other extension besides csv. Giving it .123 worked. The output is jacked up in the windows cmd terminal, all of the output is printed on the same line. I can watch it overwrite it self and then I just get some data smashed onto one line. Cut and Pasted: ,,,,,,,,,,,,1,42,44,2,0,0,0,450,449.7,12/1/2007,3:00:0000 This is a scaled down version of something larger. However, I am having the exact same problem with the code I posted and I am just testing with a different file which I attached to this email. If there are any weird characters I am not sure what they are or how they are messing things up. I see nothing but CR's on every line and one LF on the final line. I also turned on use warnings but got no warnings. On Dec 13, 2007 6:49 PM, Andy Lester wrote: > > On Dec 13, 2007, at 6:46 PM, Eric Ellington wrote: > > > Change the file name to 1.txt and I get output or if I comment out "my > > $x = ;" and even then the output is jacked up. Why is that? Does > > open do something special when it sees a file that ends in .csv? I > > found nothing at http://perldoc.perl.org/functions/open.html or on > > ActiveState's website. > > > No, Perl doesn't care at all. There's something else going on that > you're not describing. Are the line-endings different for your > machine from the machine that you got the file from? You're on Unix > and it came from Windows, or vice versa? > > Also, although "use strict" is a good thing, even more important is > "use warnings". > > Throw that in and see what else happens. And what does "the output is > jacked up" mean, anyway? > > xoox, > Andy > > -- > Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance > > > > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -- Eric Ellington e.ellington at gmail.com -------------- next part -------------- A non-text attachment was scrubbed... Name: 1.csv Type: application/vnd.ms-excel Size: 1632 bytes Desc: not available Url : http://mail.pm.org/pipermail/chicago-talk/attachments/20071213/2c40f80d/attachment.xlb From tigerpeng2001 at yahoo.com Thu Dec 13 20:15:35 2007 From: tigerpeng2001 at yahoo.com (tiger peng) Date: Thu, 13 Dec 2007 20:15:35 -0800 (PST) Subject: [Chicago-talk] Why does Perl hate my csv file? Message-ID: <986891.97236.qm@web58702.mail.re1.yahoo.com> It seems that your $x= consumed the whole file. Is there newline character "\n" in your 1.csv file?How did you invoke the script? How did you change the file name? Is the size of file changed after you change the name? ----- Original Message ---- From: Eric Ellington To: Chicago.pm chatter Sent: Thursday, December 13, 2007 6:46:26 PM Subject: [Chicago-talk] Why does Perl hate my csv file? Using this script: use strict; main(); sub main { open(FILE,"1.csv") || die "COULD NOT OPEN FILE: \n$!\n"; #nix header my $x = ; while () { print $_; } } where 1.csv contains: Header RLANE_02,16,0.6,54,58,16,0,0,0,56.3,55.9,11/1/2007,0:00:00,, RLANE_01,8,0.3,56,59,8,0,0,0,112.5,112.2,11/1/2007,0:00:00,, ELANE_02,60,3.9,56,61,32,28,0,0,15,14.4,11/1/2007,0:00:00,, ELANE_01,23,1.3,60,65,13,10,0,0,39.1,38.6,11/1/2007,0:00:00,, WLANE_01,10,0.3,57,58,9,1,0,0,90,89.7,11/1/2007,0:00:00,, WLANE_02,51,3.2,55,60,32,19,0,0,17.6,17.1,11/1/2007,0:00:00,, ,,,,,,,,,,,,,, I get no output. Change the file name to 1.txt and I get output or if I comment out "my $x = ;" and even then the output is jacked up. Why is that? Does open do something special when it sees a file that ends in .csv? I found nothing at http://perldoc.perl.org/functions/open.html or on ActiveState's website. This is perl, v5.8.8 built for MSWin32-x86-multi-thread on windows XP. -- Eric Ellington e.ellington at gmail.com _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/chicago-talk/attachments/20071213/2bff42c6/attachment.html From tigerpeng2001 at yahoo.com Thu Dec 13 20:32:46 2007 From: tigerpeng2001 at yahoo.com (tiger peng) Date: Thu, 13 Dec 2007 20:32:46 -0800 (PST) Subject: [Chicago-talk] Why does Perl hate my csv file? Message-ID: <349153.21503.qm@web58703.mail.re1.yahoo.com> it seems that all line end with carriage return character (ascii octal num 15) only. There is no line feed (newline character in Unix) I made one in Linux and you can see the difference: gpeng at linbay:/home/gpeng/perl -> perl -ne 'print $_' 2.csv WLANE_02,51,3.2,55,60,32,19,0,0,17.6,17.1,11/1/2007,0:00:00,, gpeng at linbay:/home/gpeng/perl -> perl -ne 'print $_,"\n"' 2.csv WLANE_02,51,3.2,55,60,32,19,0,0,17.6,17.1,11/1/2007,0:00:00,, gpeng at linbay:/home/gpeng/perl -> perl -015 -ne 'print $_,"\n"' 2.csv # use carriage character as recorder separator Header RLANE_02,16,0.6,54,58,16,0,0,0,56.3,55.9,11/1/2007,0:00:00,, RLANE_01,8,0.3,56,59,8,0,0,0,112.5,112.2,11/1/2007,0:00:00,, ELANE_02,60,3.9,56,61,32,28,0,0,15,14.4,11/1/2007,0:00:00,, ELANE_01,23,1.3,60,65,13,10,0,0,39.1,38.6,11/1/2007,0:00:00,, WLANE_01,10,0.3,57,58,9,1,0,0,90,89.7,11/1/2007,0:00:00,, WLANE_02,51,3.2,55,60,32,19,0,0,17.6,17.1,11/1/2007,0:00:00,, gpeng at linbay:/home/gpeng/perl ----- Original Message ---- From: Eric Ellington To: Chicago.pm chatter Sent: Thursday, December 13, 2007 10:07:50 PM Subject: Re: [Chicago-talk] Why does Perl hate my csv file? I am creating everything on a windows system. I checked the line endings and they look OK to me. Like I said the file works with any other extension besides csv. Giving it .123 worked. The output is jacked up in the windows cmd terminal, all of the output is printed on the same line. I can watch it overwrite it self and then I just get some data smashed onto one line. Cut and Pasted: ,,,,,,,,,,,,1,42,44,2,0,0,0,450,449.7,12/1/2007,3:00:0000 This is a scaled down version of something larger. However, I am having the exact same problem with the code I posted and I am just testing with a different file which I attached to this email. If there are any weird characters I am not sure what they are or how they are messing things up. I see nothing but CR's on every line and one LF on the final line. I also turned on use warnings but got no warnings. On Dec 13, 2007 6:49 PM, Andy Lester wrote: > > On Dec 13, 2007, at 6:46 PM, Eric Ellington wrote: > > > Change the file name to 1.txt and I get output or if I comment out "my > > $x = ;" and even then the output is jacked up. Why is that? Does > > open do something special when it sees a file that ends in .csv? I > > found nothing at http://perldoc.perl.org/functions/open.html or on > > ActiveState's website. > > > No, Perl doesn't care at all. There's something else going on that > you're not describing. Are the line-endings different for your > machine from the machine that you got the file from? You're on Unix > and it came from Windows, or vice versa? > > Also, although "use strict" is a good thing, even more important is > "use warnings". > > Throw that in and see what else happens. And what does "the output is > jacked up" mean, anyway? > > xoox, > Andy > > -- > Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance > > > > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -- Eric Ellington e.ellington at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/chicago-talk/attachments/20071213/4ba2cecd/attachment-0001.html From shawn.c.carroll at gmail.com Fri Dec 14 05:42:30 2007 From: shawn.c.carroll at gmail.com (Shawn Carroll) Date: Fri, 14 Dec 2007 07:42:30 -0600 Subject: [Chicago-talk] Question of preference Message-ID: What are peoples thoughts on a SCM utility that would not allow you to check in code that failed certain tests? Perl code that cannot compile, code that has alerts in Perl::Critic, etc. Or that the SCM would use perltidy to put the code into the teams style upon checkin? -- shawn.c.carroll at gmail.com Perl Programmer Soccer Referee From chicago.pm at galumph.com Fri Dec 14 06:23:56 2007 From: chicago.pm at galumph.com (Elliot Shank) Date: Fri, 14 Dec 2007 08:23:56 -0600 Subject: [Chicago-talk] Question of preference In-Reply-To: References: Message-ID: <476291FC.9000703@galumph.com> Shawn Carroll wrote: > Or that the SCM would use perltidy to put the code into the teams > style upon checkin? Whatever you do, do not modify code that is being checked in. Why? Because, upon a successful check in, the code in the server has changed, but not your copy. You'll have to refresh the code after the check in. Now, assume that there's a bug in the check in code that actually mangles your code and causes bugs? You've just checked in your good copy and you'll assume that the copy in the SCM server is good and blindly do a refresh of the code. Whoops! You've just lost your only copy of the good version of the code. If you want enforcement of standards, have the server do non-destructive compliance tests. If there's a bug in that and someone runs into problems checking in, you haven't lost code and can go an figure out what's wrong on the server. Perl::Critic has a RequireTidyCode policy, so you could just do a P::C check and it will enforce your formatting standards along with the rest of the policy checks. If you do this, ensure that you create a P::C profile that tells RequireTidyCode where your perltidy configuration is. From andy at petdance.com Fri Dec 14 07:24:35 2007 From: andy at petdance.com (Andy Lester) Date: Fri, 14 Dec 2007 09:24:35 -0600 Subject: [Chicago-talk] Question of preference In-Reply-To: References: Message-ID: On Dec 14, 2007, at 7:42 AM, Shawn Carroll wrote: > What are peoples thoughts on a SCM utility that would not allow you to > check in code that failed certain tests? Perl code that cannot > compile, code that has alerts in Perl::Critic, etc. Or that the SCM > would use perltidy to put the code into the teams style upon checkin? It sounds like a technical solution to what is a social problem, which I'm almost always against. -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From briank at kappacs.com Fri Dec 14 08:12:12 2007 From: briank at kappacs.com (Brian Katzung) Date: Fri, 14 Dec 2007 10:12:12 -0600 Subject: [Chicago-talk] Question of preference In-Reply-To: References: Message-ID: <4762AB5C.9080902@kappacs.com> Shawn, It sounds like something that might be nice as an optional front-end helper, but I wouldn't want it to be "Saint Peter" (or would that be Saint Larry?) at the "Perly Gates". :-) - Brian Shawn Carroll wrote: > What are peoples thoughts on a SCM utility that would not allow you to > check in code that failed certain tests? Perl code that cannot > compile, code that has alerts in Perl::Critic, etc. Or that the SCM > would use perltidy to put the code into the teams style upon checkin? > > -- Brian Katzung, Kappa Computer Solutions, LLC Leveraging UNIX, GNU/Linux, open source, and custom software solutions for business and beyond Phone: 877.367.8837 x1 http://www.kappacs.com From e.ellington at gmail.com Sat Dec 15 09:47:20 2007 From: e.ellington at gmail.com (Eric Ellington) Date: Sat, 15 Dec 2007 11:47:20 -0600 Subject: [Chicago-talk] Why does Perl hate my csv file? In-Reply-To: <349153.21503.qm@web58703.mail.re1.yahoo.com> References: <349153.21503.qm@web58703.mail.re1.yahoo.com> Message-ID: I don't follow. I thought $/ was newline by default and I thought newline was a carriage return. Am I wrong? Why does my problem go away if I name all my files with a .txt extension? On Dec 13, 2007 10:32 PM, tiger peng wrote: > > it seems that all line end with carriage return character (ascii octal num > 15) only. There is no line feed (newline character in Unix) > > I made one in Linux and you can see the difference: > > gpeng at linbay:/home/gpeng/perl > -> perl -ne 'print $_' 2.csv > > WLANE_02,51,3.2,55,60,32,19,0,0,17.6,17.1,11/1/2007,0:00:00,, > gpeng at linbay:/home/gpeng/perl > -> perl -ne 'print $_,"\n"' 2.csv > > WLANE_02,51,3.2,55,60,32,19,0,0,17.6,17.1,11/1/2007,0:00:00,, > > gpeng at linbay:/home/gpeng/perl > -> perl -015 -ne 'print $_,"\n"' 2.csv # use carriage character as > recorder separator > > Header > RLANE_02,16,0.6,54,58,16,0,0,0,56.3,55.9,11/1/2007,0:00:00,, > RLANE_01,8,0.3,56,59,8,0,0,0,112.5,112.2,11/1/2007,0:00:00,, > ELANE_02,60,3.9,56,61,32,28,0,0,15,14.4,11/1/2007,0:00:00,, > ELANE_01,23,1.3,60,65,13,10,0,0,39.1,38.6,11/1/2007,0:00:00,, > WLANE_01,10,0.3,57,58,9,1,0,0,90,89.7,11/1/2007,0:00:00,, > WLANE_02,51,3.2,55,60,32,19,0,0,17.6,17.1,11/1/2007,0:00:00,, > > > gpeng at linbay:/home/gpeng/perl > > > > > > ----- Original Message ---- > From: Eric Ellington > To: Chicago.pm chatter > Sent: Thursday, December 13, 2007 10:07:50 PM > Subject: Re: [Chicago-talk] Why does Perl hate my csv file? > > I am creating everything on a windows system. I checked the line > endings and they look OK to me. Like I said the file works with any > other extension besides csv. Giving it .123 worked. > > The output is jacked up in the windows cmd terminal, all of the output > is printed on the same line. I can watch it overwrite it self and then > I just get some data smashed > onto one line. > > Cut and Pasted: > ,,,,,,,,,,,,1,42,44,2,0,0,0,450,449.7,12/1/2007,3:00:0000 > > This is a scaled down version of something larger. However, I am > having the exact same problem with the code I posted and I am just > testing with a different file which I attached to this email. If there > are any weird characters I am not sure what they are or how they are > messing things up. I see nothing but CR's on every line and one LF on > the final line. > > I also turned on use warnings but got no warnings. > > On Dec 13, 2007 6:49 PM, Andy Lester wrote: > > > > On Dec 13, 2007, at 6:46 PM, Eric Ellington wrote: > > > > > Change the file name to 1.txt and I get output or if I comment out "my > > > $x = ;" and even then the output is jacked up. Why is that? Does > > > open do something special when it sees a file that ends in .csv? I > > > found nothing at http://perldoc.perl.org/functions/open.html or on > > > ActiveState's website. > > > > > > No, Perl doesn't care at all. There's something else going on that > > you're not describing. Are the line-endings different for your > > machine from the machine that you got the file from? You're on Unix > > and it came from Windows, or vice versa? > > > > Also, although "use strict" is a good thing, even more important is > > "use warnings". > > > > Throw that in and see what else happens. And what does "the output is > > > jacked up" mean, anyway? > > > > xoox, > > Andy > > > > -- > > Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance > > > > > > > > > > _______________________________________________ > > Chicago-talk mailing list > > Chicago-talk at pm.org > > http://mail.pm.org/mailman/listinfo/chicago-talk > > > > > > -- > > Eric Ellington > e.ellington at gmail.com > > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -- Eric Ellington e.ellington at gmail.com From joshua.mcadams at gmail.com Sat Dec 15 10:53:16 2007 From: joshua.mcadams at gmail.com (Joshua McAdams) Date: Sat, 15 Dec 2007 12:53:16 -0600 Subject: [Chicago-talk] Hackathon in progress Message-ID: <49d805d70712151053x492d0ba6y2559dfe343b800a8@mail.gmail.com> Just a reminder that the hackathon is in progress over at Hosteling International at the corner of Congress and Wabash. Feel free to stop by. We are on the second floor in a meeting room on the Southwest corner of the hostel. http://perlcast.com/hackchicago2007/index From tigerpeng2001 at yahoo.com Sat Dec 15 17:46:44 2007 From: tigerpeng2001 at yahoo.com (tiger peng) Date: Sat, 15 Dec 2007 17:46:44 -0800 (PST) Subject: [Chicago-talk] Why does Perl hate my csv file? Message-ID: <804153.78746.qm@web58702.mail.re1.yahoo.com> check this: http://en.wikipedia.org/wiki/Newline How did you get .cvs? How did you rename it to .txt? ----- Original Message ---- From: Eric Ellington To: Chicago.pm chatter Sent: Saturday, December 15, 2007 11:47:20 AM Subject: Re: [Chicago-talk] Why does Perl hate my csv file? I don't follow. I thought $/ was newline by default and I thought newline was a carriage return. Am I wrong? Why does my problem go away if I name all my files with a .txt extension? On Dec 13, 2007 10:32 PM, tiger peng wrote: > > it seems that all line end with carriage return character (ascii octal num > 15) only. There is no line feed (newline character in Unix) > > I made one in Linux and you can see the difference: > > gpeng at linbay:/home/gpeng/perl > -> perl -ne 'print $_' 2.csv > > WLANE_02,51,3.2,55,60,32,19,0,0,17.6,17.1,11/1/2007,0:00:00,, > gpeng at linbay:/home/gpeng/perl > -> perl -ne 'print $_,"\n"' 2.csv > > WLANE_02,51,3.2,55,60,32,19,0,0,17.6,17.1,11/1/2007,0:00:00,, > > gpeng at linbay:/home/gpeng/perl > -> perl -015 -ne 'print $_,"\n"' 2.csv # use carriage character as > recorder separator > > Header > RLANE_02,16,0.6,54,58,16,0,0,0,56.3,55.9,11/1/2007,0:00:00,, > RLANE_01,8,0.3,56,59,8,0,0,0,112.5,112.2,11/1/2007,0:00:00,, > ELANE_02,60,3.9,56,61,32,28,0,0,15,14.4,11/1/2007,0:00:00,, > ELANE_01,23,1.3,60,65,13,10,0,0,39.1,38.6,11/1/2007,0:00:00,, > WLANE_01,10,0.3,57,58,9,1,0,0,90,89.7,11/1/2007,0:00:00,, > WLANE_02,51,3.2,55,60,32,19,0,0,17.6,17.1,11/1/2007,0:00:00,, > > > gpeng at linbay:/home/gpeng/perl > > > > > > ----- Original Message ---- > From: Eric Ellington > To: Chicago.pm chatter > Sent: Thursday, December 13, 2007 10:07:50 PM > Subject: Re: [Chicago-talk] Why does Perl hate my csv file? > > I am creating everything on a windows system. I checked the line > endings and they look OK to me. Like I said the file works with any > other extension besides csv. Giving it .123 worked. > > The output is jacked up in the windows cmd terminal, all of the output > is printed on the same line. I can watch it overwrite it self and then > I just get some data smashed > onto one line. > > Cut and Pasted: > ,,,,,,,,,,,,1,42,44,2,0,0,0,450,449.7,12/1/2007,3:00:0000 > > This is a scaled down version of something larger. However, I am > having the exact same problem with the code I posted and I am just > testing with a different file which I attached to this email. If there > are any weird characters I am not sure what they are or how they are > messing things up. I see nothing but CR's on every line and one LF on > the final line. > > I also turned on use warnings but got no warnings. > > On Dec 13, 2007 6:49 PM, Andy Lester wrote: > > > > On Dec 13, 2007, at 6:46 PM, Eric Ellington wrote: > > > > > Change the file name to 1.txt and I get output or if I comment out "my > > > $x = ;" and even then the output is jacked up. Why is that? Does > > > open do something special when it sees a file that ends in .csv? I > > > found nothing at http://perldoc.perl.org/functions/open.html or on > > > ActiveState's website. > > > > > > No, Perl doesn't care at all. There's something else going on that > > you're not describing. Are the line-endings different for your > > machine from the machine that you got the file from? You're on Unix > > and it came from Windows, or vice versa? > > > > Also, although "use strict" is a good thing, even more important is > > "use warnings". > > > > Throw that in and see what else happens. And what does "the output is > > > jacked up" mean, anyway? > > > > xoox, > > Andy > > > > -- > > Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance > > > > > > > > > > _______________________________________________ > > Chicago-talk mailing list > > Chicago-talk at pm.org > > http://mail.pm.org/mailman/listinfo/chicago-talk > > > > > > -- > > Eric Ellington > e.ellington at gmail.com > > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -- Eric Ellington e.ellington at gmail.com _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/chicago-talk/attachments/20071215/44f133c5/attachment.html From joshua.mcadams at gmail.com Sun Dec 16 19:37:19 2007 From: joshua.mcadams at gmail.com (Joshua McAdams) Date: Sun, 16 Dec 2007 21:37:19 -0600 Subject: [Chicago-talk] YAPC::NA 2008 Chicago Message-ID: <49d805d70712161937p2cdcfa49mb2a2931fadf7f682@mail.gmail.com> The Chicago Perl Mongers are excited to officially announce the location, dates, and website for YAPC::NA 2008. The conference will be held June 16th-18th 2008 at the Illinois Institute of Technology in Chicago, IL. We have set up an ACT-based website at http://conferences.mongueurs.net/yn2008/. Thanks to ?ric Cholet for getting that together. We are looking forward to another excellent YAPC::NA and urge you to mark your calendars now for one of North America's premiere perl events. From dave at obtiva.com Mon Dec 17 14:02:47 2007 From: dave at obtiva.com (Dave Hoover) Date: Mon, 17 Dec 2007 16:02:47 -0600 Subject: [Chicago-talk] The JavaScript Renaissance Part I: The Core Language Message-ID: <11c8704e0712171402l36e95bb8j9ac5750074080f32@mail.gmail.com> We're going to shift gears a bit for our January meeting in Wheaton and focus on JavaScript. Fred Polgardy has stepped forward and volunteered to give a series of talks in 2008 on JavaScript and the Renaissance it has enjoyed over the last couple years. When: Tuesday, Jan 8, 2008, 7-9 PM Where: Wheaton, IIT - Rice Campus Who: Frederick Polgardy What: The JavaScript Renaissance Part I: The Core Language What comes to mind when think of JavaScript? Broken web sites, browser incompatibilities, and brittle spaghetti code? It doesn't have to be this way anymore! In this presentation, we'll take a focused look at some of the most powerful and under-appreciated features of the core JavaScript language -- prototype-based inheritance, lexical closures, and metaprogramming. We'll look briefly at what these features actually provide from a language standpoint, and then spend most of our time rolling up our sleeves and digging into real world code. In the process, we'll get acquainted with the Prototype library, and see how it extends the core JavaScript language in fascinating and clever ways. We'll finish up with a brief look at what's coming in JavaScript 2.0. More information and directions can be found at http://chicago.pm.org/meetings/ Let me know if you have ideas for other talks in 2008. Best, Dave Hoover Principal, Practice Leader Obtiva Corp: Agility Applied. Software Delivered. http://obtiva.com From steve at fisharerojo.org Tue Dec 18 11:24:53 2007 From: steve at fisharerojo.org (Steve Peters) Date: Tue, 18 Dec 2007 13:24:53 -0600 Subject: [Chicago-talk] Perl 5.10 Released Message-ID: After years of hard work, its finally here! Its making its way around through the various CPAN mirrors. There are also some torrents available as well if you are so inclined. Please see the thread at http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2007-12/msg00414.html for more information. Enjoy! Steve Peters steve at fisharerojo.org From fasteliteprogrammer at yahoo.com Wed Dec 19 08:32:33 2007 From: fasteliteprogrammer at yahoo.com (Craig Petty) Date: Wed, 19 Dec 2007 08:32:33 -0800 (PST) Subject: [Chicago-talk] perl 5.10.0 Question Message-ID: <378571.89554.qm@web36513.mail.mud.yahoo.com> I got a few question about perl 5.10.0.How can i tell what is in comile in my perl 5.10.0 and how can i update my perl modules in my vim perl-support? Ssomeone told me perl -V would show me what is compile in my perl is this true? What does this all mean? Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=linux, osvers=2.6.23.8-63.fc8, archname=i686-linux uname='linux localhost.localdomain 2.6.23.8-63.fc8 #1 smp wed nov 21 18:51:08 est 2007 i686 i686 i386 gnulinux ' config_args='-de' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='4.1.2 20070925 (Red Hat 4.1.2-33)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.7.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.7' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_LARGE_FILES USE_PERLIO Built under linux Compiled at Dec 19 2007 18:44:04 @INC: /usr/local/lib/perl5/5.10.0/i686-linux /usr/local/lib/perl5/5.10.0 /usr/local/lib/perl5/site_perl/5.10.0/i686-linux /usr/local/lib/perl5/site_perl/5.10.0 ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ From frag at ripco.com Wed Dec 19 12:03:00 2007 From: frag at ripco.com (Mike Fragassi) Date: Wed, 19 Dec 2007 14:03:00 -0600 (CST) Subject: [Chicago-talk] another State of the Onion Message-ID: This author http://www.julieahyzy.com/ is apparently going to be part of a multi-author book reading tonight (Wed. 12/19) at the Book Cellar in Lincoln Square: http://www.bookcellarinc.com/calendar/index.php And her book's name is "State of the Onion". Apparently, it's a murder-mystery involving a White House chef. -- Mike F. From kent at c2group.net Wed Dec 19 15:44:59 2007 From: kent at c2group.net (Kent Cowgill) Date: Wed, 19 Dec 2007 17:44:59 -0600 Subject: [Chicago-talk] Testing talk slides Message-ID: For anyone who was interested, I've gotten the slides for my first talk - Testing Code and Assuring Quality - online now. http://www.slideshare.net/kcowgill/testing-code-and-assuring-quality No cats were harmed in the production of these slides. -Kent Cowgill C2 Group, Inc. kent at c2group.net http://www.c2group.net 312.804.0160 From steve at fisharerojo.org Thu Dec 20 04:25:52 2007 From: steve at fisharerojo.org (Steve Peters) Date: Thu, 20 Dec 2007 06:25:52 -0600 Subject: [Chicago-talk] perl 5.10.0 Question In-Reply-To: <378571.89554.qm@web36513.mail.mud.yahoo.com> References: <378571.89554.qm@web36513.mail.mud.yahoo.com> Message-ID: On Dec 19, 2007 10:32 AM, Craig Petty wrote: > > > I got a few question about perl 5.10.0.How can i tell > what is in comile in my perl 5.10.0 and how can i > update my perl modules in my vim perl-support? > > > Ssomeone told me perl -V would show me what is compile > in my perl is this true? > > > > What does this all mean? > > Summary of my perl5 (revision 5 version 10 subversion > 0) configuration: > Platform: > osname=linux, osvers=2.6.23.8-63.fc8, > archname=i686-linux > uname='linux localhost.localdomain 2.6.23.8-63.fc8 > #1 smp wed nov 21 18:51:08 est 2007 i686 i686 i386 > gnulinux ' > config_args='-de' > hint=recommended, useposix=true, > d_sigaction=define > useithreads=undef, usemultiplicity=undef > useperlio=define, d_sfio=undef, > uselargefiles=define, usesocks=undef > use64bitint=undef, use64bitall=undef, > uselongdouble=undef > usemymalloc=n, bincompat5005=undef > Compiler: > cc='cc', ccflags ='-fno-strict-aliasing -pipe > -I/usr/local/include -D_LARGEFILE_SOURCE > -D_FILE_OFFSET_BITS=64', > optimize='-O2', > cppflags='-fno-strict-aliasing -pipe > -I/usr/local/include' > ccversion='', gccversion='4.1.2 20070925 (Red Hat > 4.1.2-33)', gccosandvers='' > intsize=4, longsize=4, ptrsize=4, doublesize=8, > byteorder=1234 > d_longlong=define, longlongsize=8, > d_longdbl=define, longdblsize=12 > ivtype='long', ivsize=4, nvtype='double', > nvsize=8, Off_t='off_t', lseeksize=8 > alignbytes=4, prototype=define > Linker and Libraries: > ld='cc', ldflags =' -L/usr/local/lib' > libpth=/usr/local/lib /lib /usr/lib > libs=-lnsl -ldl -lm -lcrypt -lutil -lc > perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc > libc=/lib/libc-2.7.so, so=so, useshrplib=false, > libperl=libperl.a > gnulibc_version='2.7' > Dynamic Linking: > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, > ccdlflags='-Wl,-E' > cccdlflags='-fPIC', lddlflags='-shared -O2 > -L/usr/local/lib' > > > Characteristics of this binary (from libperl): > Compile-time options: PERL_DONT_CREATE_GVSV > PERL_MALLOC_WRAP > USE_LARGE_FILES USE_PERLIO > Built under linux > Compiled at Dec 19 2007 18:44:04 > @INC: > /usr/local/lib/perl5/5.10.0/i686-linux > /usr/local/lib/perl5/5.10.0 > /usr/local/lib/perl5/site_perl/5.10.0/i686-linux > /usr/local/lib/perl5/site_perl/5.10.0 Yep, your perl -V says "revision 5 version 10 subversion 0", so yes this is a Perl 5.10. I'm not sure what modules are used in your vim perl-support, or if any are actually used at all. My best suggestion would be to use the cpan script included with Perl (thanks brian!) to install these modules. Steve Peters steve at fisharerojo.org From richard at rushlogistics.com Sun Dec 23 08:31:56 2007 From: richard at rushlogistics.com (Richard Reina) Date: Sun, 23 Dec 2007 08:31:56 -0800 (PST) Subject: [Chicago-talk] filehandles? what am I doing wrong? Message-ID: <302885.50652.qm@web606.biz.mail.mud.yahoo.com> I have written a short script that reads data from a file and attempts to separate the data into separate a file when it sees ####### and !!!!!!! as delimiters. The problem I am having is that the script opens writes and closes the first file with no problem but not additional new files for the rest of the occurrences of ####### and !!!!!!! #!/usr/bin/perl -w # test_file_writer.pl open(DEV, ") { print $_; # show the output) if ($_ =~ /#######/) { #this is the beginning of a new file print "THIS IS THE BEGINNING OF A NEW FILE\n"; $write_file = "y"; open(NEW_FILE, ">NEW_FILE" . $date) || die "CANT OPEN NEW_FILE: $!\n"; } if ($write_file eq "y") { print NEW_FILE $_; } #end of if if ($_ =~ /!!!!!!!/) { print "Closing File\n"; close (NEW_FILE) || die "CAN'T CLOSE NEW_FILE: $!"; $write_file = "n"; } # end of if } # end of while ## END Additionally confusing is that it does not die on open or close like one would think if it were unable to open and close. Here the input file (test_FILEEEEEE): ####### richard at rushlogistics.com this is the body of a file !!!!!!! ####### richard at rushlogistics.com this should be seprate file !!!!!!! ####### richard at rushlogistics.com this should be another serperate file !!!!!!! ####### richard at rushlogistics.com this should be another file !!!!!!! ####### richard at rushlogistics.com and this just another !!!!!!! After the program executes I end up with only 1 new file like NEW_FILE267523122007 when the script should create 5 of them. Any ideas as to where I've gone wrong would be greatly appreciated. Thanks, Richard Your beliefs become your thoughts. Your thoughts become your words. Your words become your actions. Your actions become your habits. Your habits become your values. Your values become your destiny. -- Mahatma Gandhi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/chicago-talk/attachments/20071223/ed4f75c4/attachment.html From don at drakeconsult.com Sun Dec 23 08:40:03 2007 From: don at drakeconsult.com (Don Drake) Date: Sun, 23 Dec 2007 10:40:03 -0600 Subject: [Chicago-talk] filehandles? what am I doing wrong? In-Reply-To: <302885.50652.qm@web606.biz.mail.mud.yahoo.com> References: <302885.50652.qm@web606.biz.mail.mud.yahoo.com> Message-ID: <8DEA1135-2437-4F8D-9F2B-AB92A1D4BA02@drakeconsult.com> The date is setup only once at the beginning of the script, so you only get one file. Put this in the while loop: my ($yr, $mo, $day, $hr, $min, $sec) = (localtime)[5,4,3,2,1,0]; my $date = $sec . $min . $hr . $day . ($mo + 1) . ($yr + 1900); -Don On Dec 23, 2007, at 10:31 AM, Richard Reina wrote: > I have written a short script that reads data from a file and > attempts to separate the data into separate a file when it sees > ####### and !!!!!!! as delimiters. The problem I am having is that > the script opens writes and closes the first file with no problem > but not additional new files for the rest of the occurrences of > ####### and !!!!!!! > > #!/usr/bin/perl -w > # test_file_writer.pl > > open(DEV, " > # get a nice date string for naming an email file > my ($yr, $mo, $day, $hr, $min, $sec) = (localtime)[5,4,3,2,1,0]; > my $date = $sec . $min . $hr . $day . ($mo + 1) . ($yr + 1900); > > while($_ = ) { > > print $_; # show the output) > > if ($_ =~ /#######/) { > > #this is the beginning of a new file > print "THIS IS THE BEGINNING OF A NEW FILE\n"; > $write_file = "y"; > open(NEW_FILE, ">NEW_FILE" . $date) || die "CANT OPEN > NEW_FILE: $!\n"; > > } > > if ($write_file eq "y") { > > print NEW_FILE $_; > > } #end of if > > if ($_ =~ /!!!!!!!/) { > > print "Closing File\n"; > close (NEW_FILE) || die "CAN'T CLOSE NEW_FILE: $!"; > $write_file = "n"; > > } # end of if > > } # end of while > ## END > > Additionally confusing is that it does not die on open or close like > one would think if it were unable to open and close. > > Here the input file (test_FILEEEEEE): > > ####### > richard at rushlogistics.com > this is the body of a file > !!!!!!! > ####### > richard at rushlogistics.com > this should be seprate file > !!!!!!! > ####### > richard at rushlogistics.com > this should be another serperate file > !!!!!!! > ####### > richard at rushlogistics.com > this should be another file > !!!!!!! > ####### > richard at rushlogistics.com > and this just another > !!!!!!! > > After the program executes I end up with only 1 new file like > NEW_FILE267523122007 when the script should create 5 of them. > > Any ideas as to where I've gone wrong would be greatly appreciated. > > Thanks, > > Richard > > > Your beliefs become your thoughts. Your thoughts become your words. > Your words become your actions. Your actions become your habits. > Your habits become your values. Your values become your destiny. -- > Mahatma Gandhi_______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk From richard at rushlogistics.com Sun Dec 23 09:10:35 2007 From: richard at rushlogistics.com (Richard Reina) Date: Sun, 23 Dec 2007 09:10:35 -0800 (PST) Subject: [Chicago-talk] filehandles? what am I doing wrong? In-Reply-To: <8DEA1135-2437-4F8D-9F2B-AB92A1D4BA02@drakeconsult.com> Message-ID: <159391.96503.qm@web615.biz.mail.mud.yahoo.com> humbling! Can't believe I missed that. Thank you very very much Don. Don Drake wrote: The date is setup only once at the beginning of the script, so you only get one file. Put this in the while loop: my ($yr, $mo, $day, $hr, $min, $sec) = (localtime)[5,4,3,2,1,0]; my $date = $sec . $min . $hr . $day . ($mo + 1) . ($yr + 1900); -Don On Dec 23, 2007, at 10:31 AM, Richard Reina wrote: > I have written a short script that reads data from a file and > attempts to separate the data into separate a file when it sees > ####### and !!!!!!! as delimiters. The problem I am having is that > the script opens writes and closes the first file with no problem > but not additional new files for the rest of the occurrences of > ####### and !!!!!!! > > #!/usr/bin/perl -w > # test_file_writer.pl > > open(DEV, " > > # get a nice date string for naming an email file > my ($yr, $mo, $day, $hr, $min, $sec) = (localtime)[5,4,3,2,1,0]; > my $date = $sec . $min . $hr . $day . ($mo + 1) . ($yr + 1900); > > while($_ = ) { > > print $_; # show the output) > > if ($_ =~ /#######/) { > > #this is the beginning of a new file > print "THIS IS THE BEGINNING OF A NEW FILE\n"; > $write_file = "y"; > open(NEW_FILE, ">NEW_FILE" . $date) || die "CANT OPEN > NEW_FILE: $!\n"; > > } > > if ($write_file eq "y") { > > print NEW_FILE $_; > > } #end of if > > if ($_ =~ /!!!!!!!/) { > > print "Closing File\n"; > close (NEW_FILE) || die "CAN'T CLOSE NEW_FILE: $!"; > $write_file = "n"; > > } # end of if > > } # end of while > ## END > > Additionally confusing is that it does not die on open or close like > one would think if it were unable to open and close. > > Here the input file (test_FILEEEEEE): > > ####### > richard at rushlogistics.com > this is the body of a file > !!!!!!! > ####### > richard at rushlogistics.com > this should be seprate file > !!!!!!! > ####### > richard at rushlogistics.com > this should be another serperate file > !!!!!!! > ####### > richard at rushlogistics.com > this should be another file > !!!!!!! > ####### > richard at rushlogistics.com > and this just another > !!!!!!! > > After the program executes I end up with only 1 new file like > NEW_FILE267523122007 when the script should create 5 of them. > > Any ideas as to where I've gone wrong would be greatly appreciated. > > Thanks, > > Richard > > > Your beliefs become your thoughts. Your thoughts become your words. > Your words become your actions. Your actions become your habits. > Your habits become your values. Your values become your destiny. -- > Mahatma Gandhi_______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk Your beliefs become your thoughts. Your thoughts become your words. Your words become your actions. Your actions become your habits. Your habits become your values. Your values become your destiny. -- Mahatma Gandhi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/chicago-talk/attachments/20071223/6bcd0578/attachment.html From briank at kappacs.com Sun Dec 23 15:39:42 2007 From: briank at kappacs.com (Brian Katzung) Date: Sun, 23 Dec 2007 17:39:42 -0600 Subject: [Chicago-talk] filehandles? what am I doing wrong? In-Reply-To: <159391.96503.qm@web615.biz.mail.mud.yahoo.com> References: <159391.96503.qm@web615.biz.mail.mud.yahoo.com> Message-ID: <476EF1BE.9060306@kappacs.com> That will only help if your files are guaranteed to take longer than one second to process. You might want to consider something like File::Temp or an incrementing suffix. - Brian Richard Reina wrote: > humbling! Can't believe I missed that. Thank you very very much Don. > > */Don Drake /* wrote: > > The date is setup only once at the beginning of the script, so you > only get one file. > > Put this in the while loop: > my ($yr, $mo, $day, $hr, $min, $sec) = (localtime)[5,4,3,2,1,0]; > my $date = $sec . $min . $hr . $day . ($mo + 1) . ($yr + 1900); > > -Don > > On Dec 23, 2007, at 10:31 AM, Richard Reina wrote: > > > I have written a short script that reads data from a file and > > attempts to separate the data into separate a file when it sees > > ####### and !!!!!!! as delimiters. The problem I am having is that > > the script opens writes and closes the first file with no problem > > but not additional new files for the rest of the occurrences of > > ####### and !!!!!!! > > > > #!/usr/bin/perl -w > > # test_file_writer.pl > > > > open(DEV, " > > > > # get a nice date string for naming an email file > > my ($yr, $mo, $day, $hr, $min, $sec) = (localtime)[5,4,3,2,1,0]; > > my $date = $sec . $min . $hr . $day . ($mo + 1) . ($yr + 1900); > > > > while($_ = ) { > > > > print $_; # show the output) > > > > if ($_ =~ /#######/) { > > > > #this is the beginning of a new file > > print "THIS IS THE BEGINNING OF A NEW FILE\n"; > > $write_file = "y"; > > open(NEW_FILE, ">NEW_FILE" . $date) || die "CANT OPEN > > NEW_FILE: $!\n"; > > > > } > > > > if ($write_file eq "y") { > > > > print NEW_FILE $_; > > > > } #end of if > > > > if ($_ =~ /!!!!!!!/) { > > > > print "Closing File\n"; > > close (NEW_FILE) || die "CAN'T CLOSE NEW_FILE: $!"; > > $write_file = "n"; > > > > } # end of if > > > > } # end of while > > ## END > > > > Additionally confusing is that it does not die on open or close like > > one would think if it were unable to open and close. > > > > Here the input file (test_FILEEEEEE): > > > > ####### > > richard at rushlogistics.com > > this is the body of a file > > !!!!!!! > > ####### > > richard at rushlogistics.com > > this should be seprate file > > !!!!!!! > > ####### > > richard at rushlogistics.com > > this should be another serperate file > > !!!!!!! > > ####### > > richard at rushlogistics.com > > this should be another file > > !!!!!!! > > ####### > > richard at rushlogistics.com > > and this just another > > !!!!!!! > > > > After the program executes I end up with only 1 new file like > > NEW_FILE267523122007 when the script should create 5 of them. > > > > Any ideas as to where I've gone wrong would be greatly appreciated. > > > > Thanks, > > > > Richard > > > > > > Your beliefs become your thoughts. Your thoughts become your words. > > Your words become your actions. Your actions become your habits. > > Your habits become your values. Your values become your destiny. -- > > Mahatma Gandhi_______________________________________________ > > Chicago-talk mailing list > > Chicago-talk at pm.org > > http://mail.pm.org/mailman/listinfo/chicago-talk > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > > > > > Your beliefs become your thoughts. Your thoughts become your words. Your > words become your actions. Your actions become your habits. Your habits > become your values. Your values become your destiny. -- Mahatma Gandhi > > > ------------------------------------------------------------------------ > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk -- Brian Katzung, Kappa Computer Solutions, LLC Leveraging UNIX, GNU/Linux, open source, and custom software solutions for business and beyond Phone: 877.367.8837 x1 http://www.kappacs.com From andy at petdance.com Mon Dec 24 18:17:25 2007 From: andy at petdance.com (Andy Lester) Date: Mon, 24 Dec 2007 20:17:25 -0600 Subject: [Chicago-talk] [sf-perl] Eric S. Raymond @ BALUG (Jan 15th) In-Reply-To: <003a01c84674$5ebfd500$4301a8c0@Untangle.local> References: <003a01c84674$5ebfd500$4301a8c0@Untangle.local> Message-ID: The San Francisco guys have much less trouble filling speaking slots. > Eric S. Raymond will be kicking off the start of a great 2008 at The > Bay > Area Linux Users Group (BALUG) with a talk on January 15th. If you > > Jan - Eric S. Raymond > Feb - Bruce Perens > March - TBD > April - Eric Allman > May - Jeremy Allison > June - Andrew Morton Jeepers! xoxo, Andy -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From andy at petdance.com Tue Dec 25 13:45:40 2007 From: andy at petdance.com (Andy Lester) Date: Tue, 25 Dec 2007 15:45:40 -0600 Subject: [Chicago-talk] Fwd: Eric S. Raymond @ BALUG (Jan 15th) Message-ID: <20071225214540.GA26386@petdance.com> The San Francisco guys have much less trouble filling speaking slots. > Eric S. Raymond will be kicking off the start of a great 2008 at The > Bay > Area Linux Users Group (BALUG) with a talk on January 15th. If you > > Jan - Eric S. Raymond > Feb - Bruce Perens > March - TBD > April - Eric Allman > May - Jeremy Allison > June - Andrew Morton Jeepers! xoxo, Andy -- Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance From hwigoda at mindspring.com Wed Dec 26 02:45:26 2007 From: hwigoda at mindspring.com (hwigoda at mindspring.com) Date: Wed, 26 Dec 2007 05:45:26 -0500 (EST) Subject: [Chicago-talk] [sf-perl] Eric S. Raymond @ BALUG (Jan 15th) Message-ID: <27785881.1198665927112.JavaMail.root@mswamui-blood.atl.sa.earthlink.net> yes, but only chicago has the incorrigible andy lester. -----Original Message----- >From: Andy Lester >Sent: Dec 24, 2007 9:17 PM >To: San Francisco Perl Mongers User Group >Subject: Re: [Chicago-talk] [sf-perl] Eric S. Raymond @ BALUG (Jan 15th) > >The San Francisco guys have much less trouble filling speaking slots. > >> Eric S. Raymond will be kicking off the start of a great 2008 at The >> Bay >> Area Linux Users Group (BALUG) with a talk on January 15th. If you >> >> Jan - Eric S. Raymond >> Feb - Bruce Perens >> March - TBD >> April - Eric Allman >> May - Jeremy Allison >> June - Andrew Morton > > >Jeepers! > >xoxo, >Andy > >-- >Andy Lester => andy at petdance.com => www.petdance.com => AIM:petdance > > > > >_______________________________________________ >Chicago-talk mailing list >Chicago-talk at pm.org >http://mail.pm.org/mailman/listinfo/chicago-talk From tom at yarrish.com Wed Dec 26 20:06:18 2007 From: tom at yarrish.com (Tom Yarrish) Date: Wed, 26 Dec 2007 22:06:18 -0600 (CST) Subject: [Chicago-talk] Idea for a talk In-Reply-To: <31425624.94891198728263224.JavaMail.root@excelsior.yarrish.com> Message-ID: <417604.94911198728378180.JavaMail.root@excelsior.yarrish.com> Hey all, I was looking over the post in use.perl.org about the micro articles on Perl 5.10. How about a talk about the positive changes that 5.10 bring to the table? Everyone is talking about say, smart matching, etc. How about other things (along with examples) on what's new? Of course I'm no WAY qualified to give that talk, but I thought I would throw it out there if anyone else wanted to :) Tom -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) iD8DBQFHXgrFZWzkfeDiTw4RAozoAKCMRphwyM/wT9AbB+PMX68FUN8nEgCfX7Nu n7B9YcXwARSuuLdfbmznm/k= =5/ey -----END PGP SIGNATURE----- From tom at yarrish.com Thu Dec 27 12:00:13 2007 From: tom at yarrish.com (Tom Yarrish) Date: Thu, 27 Dec 2007 14:00:13 -0600 (CST) Subject: [Chicago-talk] Idea for a talk In-Reply-To: <417604.94911198728378180.JavaMail.root@excelsior.yarrish.com> Message-ID: <31538631.95351198785613531.JavaMail.root@excelsior.yarrish.com> Hey all, I was looking over the post in use.perl.org about the micro articles on Perl 5.10. How about a talk about the positive changes that 5.10 bring to the table? Everyone is talking about say, smart matching, etc. How about other things (along with examples) on what's new? Of course I'm no WAY qualified to give that talk, but I thought I would throw it out there if anyone else wanted to :) Tom -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) iD8DBQFHXgrFZWzkfeDiTw4RAozoAKCMRphwyM/wT9AbB+PMX68FUN8nEgCfX7Nu n7B9YcXwARSuuLdfbmznm/k= =5/ey -----END PGP SIGNATURE----- From richard at rushlogistics.com Fri Dec 28 08:28:55 2007 From: richard at rushlogistics.com (Richard Reina) Date: Fri, 28 Dec 2007 08:28:55 -0800 (PST) Subject: [Chicago-talk] accessing another script's subroutine from w/in a module? Message-ID: <826663.36828.qm@web606.biz.mail.mud.yahoo.com> How can one properly declare another script's subroutine from within a Module. I would like to be able to do this: require "./QuoteJoke.pl"; my $string = &get_quote_joke(); from a my home made perl module Fax.pm without getting: Undefined subroutine &Fax::get_quote_joke called at Fax.pm line 61 I know I am probably breaking some cardinal rule of perl but I can't figure it out. Thanks for any help. Your beliefs become your thoughts. Your thoughts become your words. Your words become your actions. Your actions become your habits. Your habits become your values. Your values become your destiny. -- Mahatma Gandhi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/chicago-talk/attachments/20071228/209819e8/attachment.html From lembark at wrkhors.com Fri Dec 28 08:37:23 2007 From: lembark at wrkhors.com (Steven Lembark) Date: Fri, 28 Dec 2007 11:37:23 -0500 Subject: [Chicago-talk] Question of preference In-Reply-To: References: Message-ID: <47752643.1020706@wrkhors.com> Shawn Carroll wrote: > What are peoples thoughts on a SCM utility that would not allow you to > check in code that failed certain tests? Perl code that cannot > compile, code that has alerts in Perl::Critic, etc. Or that the SCM > would use perltidy to put the code into the teams style upon checkin? SVN supports this via pre-commit checks; problem is that you usually want people checking in code regularly to avoid loss of work. Catch: if you can only check in working code then you cannot make periodic checkins to make sure you don't loose work. Fix: Have people work in separate branches of their own during development and merge the changes for working code to a 'clean' branch. You can use social engineering (or a taser) to ensure that code merged into the more stable branches passes the tests (and that people are given time to write usable tests). -- Steven Lembark +1 888 359 3508 Workhorse Computing 85-09 90th St lembark at wrkhors.com Woodhaven, NY 11421 From tom at yarrish.com Fri Dec 28 12:17:13 2007 From: tom at yarrish.com (Tom Yarrish) Date: Fri, 28 Dec 2007 14:17:13 -0600 (CST) Subject: [Chicago-talk] Idea for a talk In-Reply-To: <31538631.95351198785613531.JavaMail.root@excelsior.yarrish.com> Message-ID: <15147007.96031198873033982.JavaMail.root@excelsior.yarrish.com> Hey all, I was looking over the post in use.perl.org about the micro articles on Perl 5.10. How about a talk about the positive changes that 5.10 bring to the table? Everyone is talking about say, smart matching, etc. How about other things (along with examples) on what's new? Of course I'm no WAY qualified to give that talk, but I thought I would throw it out there if anyone else wanted to :) Tom -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) iD8DBQFHXgrFZWzkfeDiTw4RAozoAKCMRphwyM/wT9AbB+PMX68FUN8nEgCfX7Nu n7B9YcXwARSuuLdfbmznm/k= =5/ey -----END PGP SIGNATURE----- From frag at ripco.com Sat Dec 29 21:21:01 2007 From: frag at ripco.com (Mike Fragassi) Date: Sat, 29 Dec 2007 23:21:01 -0600 (CST) Subject: [Chicago-talk] accessing another script's subroutine from w/in a module? In-Reply-To: <826663.36828.qm@web606.biz.mail.mud.yahoo.com> References: <826663.36828.qm@web606.biz.mail.mud.yahoo.com> Message-ID: On Fri, 28 Dec 2007, Richard Reina wrote: > How can one properly declare another script's subroutine from within a > Module. > > I would like to be able to do this: > > require "./QuoteJoke.pl"; > my $string = &get_quote_joke(); > > from a my home made perl module Fax.pm > > without getting: > > Undefined subroutine &Fax::get_quote_joke called at Fax.pm line 61 Inside Fax.pm, assuming that this module has the line 'package Fax;', then calling any method 'foo' will be interpreted as a call to &Fax::foo. If a file (.pl or .pm) does not have a 'package' declaration, its commands are in the package 'main' by default. If that's the case with QuoteJoke.pl, then inside of Fax.pm, calling '&main::get_quote_joke()' should work. Otherwise, if there's a package, use that instead of 'main'. > I know I am probably breaking some cardinal rule of perl but I can't > figure it out. You're not really breaking anything, or doing anything crazy; you just need to prepend the package name where the method comes from, when you're calling it from inside a different package. -- Mike F. From jason at multiply.org Sat Dec 29 22:14:11 2007 From: jason at multiply.org (jason gessner) Date: Sun, 30 Dec 2007 00:14:11 -0600 Subject: [Chicago-talk] Question of preference In-Reply-To: <47752643.1020706@wrkhors.com> References: <47752643.1020706@wrkhors.com> Message-ID: <4e0c849b0712292214v590f5158i142d70770e8e5572@mail.gmail.com> On Dec 28, 2007 10:37 AM, Steven Lembark wrote: \ > SVN supports this via pre-commit checks; problem > is that you usually want people checking in code > regularly to avoid loss of work. Catch: if you > can only check in working code then you cannot > make periodic checkins to make sure you don't > loose work. you don't want to lose code *that works* not just any random code. SVN != RSYNC for a developer sandbox. :) From lembark at wrkhors.com Sun Dec 30 13:31:40 2007 From: lembark at wrkhors.com (Steven Lembark) Date: Sun, 30 Dec 2007 16:31:40 -0500 Subject: [Chicago-talk] Question of preference In-Reply-To: <4e0c849b0712292214v590f5158i142d70770e8e5572@mail.gmail.com> References: <47752643.1020706@wrkhors.com> <4e0c849b0712292214v590f5158i142d70770e8e5572@mail.gmail.com> Message-ID: <47780E3C.2040603@wrkhors.com> >> SVN supports this via pre-commit checks; problem >> is that you usually want people checking in code >> regularly to avoid loss of work. Catch: if you >> can only check in working code then you cannot >> make periodic checkins to make sure you don't >> loose work. > > you don't want to lose code *that works* not just any random code. > SVN != RSYNC for a developer sandbox. :) So if it takes you three weeks to finish some work you wouldn't want to make any partial commits? You would prefer not to have any option of working on the code at remote locations, or give anyone else working on the project with you any chance at all to see the in-process code? You also would want to be able to try any changes with the option of backing them out later to a sane re-start point if an idea didn't work, I suppose? I've found all of these helpful at various times. You might not want to put the code back into the main production branch the first day, but the ability to commit partially complete projects is a powerful feature of SVN (and CVS). -- Steven Lembark 85-09 90th St. Workhorse Computing Woodhaven, NY, 11421 lembark at wrkhors.com +1 888 359 3508 From joshua.mcadams at gmail.com Sun Dec 30 14:16:46 2007 From: joshua.mcadams at gmail.com (Joshua McAdams) Date: Sun, 30 Dec 2007 16:16:46 -0600 Subject: [Chicago-talk] Idea for a talk In-Reply-To: <15147007.96031198873033982.JavaMail.root@excelsior.yarrish.com> References: <31538631.95351198785613531.JavaMail.root@excelsior.yarrish.com> <15147007.96031198873033982.JavaMail.root@excelsior.yarrish.com> Message-ID: <49d805d70712301416u648c7f8fy11b5aee02042fefa@mail.gmail.com> > I was looking over the post in use.perl.org about the micro articles on Perl 5.10. How about a talk about the positive changes that 5.10 bring to the table? Everyone is talking about say, smart matching, etc. How about other things (along with examples) on what's new? > Of course I'm no WAY qualified to give that talk, but I thought I would throw it out there if anyone else wanted to :) For the downtown meeting, Kent Cowgill will be giving his talk about image processing with Perl. From what I understand, there would still be some time after his talk to cover Perl 5.10. Any volunteers? From richard at rushlogistics.com Sun Dec 30 14:52:59 2007 From: richard at rushlogistics.com (richard at rushlogistics.com) Date: Sun, 30 Dec 2007 22:52:59 +0000 Subject: [Chicago-talk] accessing another script's subroutine from w/ina module? In-Reply-To: References: <826663.36828.qm@web606.biz.mail.mud.yahoo.com> Message-ID: <387277935-1199055211-cardhu_decombobulator_blackberry.rim.net-1581892436-@bxe030.bisx.prod.on.blackberry> Mike, Your suggestion worked. Thank you for your very instructive response. I owe you a beer! Have a great new year! Richard Sent via BlackBerry from T-Mobile -----Original Message----- From: Mike Fragassi Date: Sat, 29 Dec 2007 23:21:01 To:"Chicago.pm chatter" Subject: Re: [Chicago-talk] accessing another script's subroutine from w/in a module? On Fri, 28 Dec 2007, Richard Reina wrote: > How can one properly declare another script's subroutine from within a > Module. > > I would like to be able to do this: > > require "./QuoteJoke.pl"; > my $string = &get_quote_joke(); > > from a my home made perl module Fax.pm > > without getting: > > Undefined subroutine &Fax::get_quote_joke called at Fax.pm line 61 Inside Fax.pm, assuming that this module has the line 'package Fax;', then calling any method 'foo' will be interpreted as a call to &Fax::foo. If a file (.pl or .pm) does not have a 'package' declaration, its commands are in the package 'main' by default. If that's the case with QuoteJoke.pl, then inside of Fax.pm, calling '&main::get_quote_joke()' should work. Otherwise, if there's a package, use that instead of 'main'. > I know I am probably breaking some cardinal rule of perl but I can't > figure it out. You're not really breaking anything, or doing anything crazy; you just need to prepend the package name where the method comes from, when you're calling it from inside a different package. -- Mike F. _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk From dave at obtiva.com Sun Dec 30 20:51:51 2007 From: dave at obtiva.com (Dave Hoover) Date: Sun, 30 Dec 2007 22:51:51 -0600 Subject: [Chicago-talk] Idea for a talk In-Reply-To: <49d805d70712301416u648c7f8fy11b5aee02042fefa@mail.gmail.com> References: <31538631.95351198785613531.JavaMail.root@excelsior.yarrish.com> <15147007.96031198873033982.JavaMail.root@excelsior.yarrish.com> <49d805d70712301416u648c7f8fy11b5aee02042fefa@mail.gmail.com> Message-ID: <11c8704e0712302051v67e8ee96y822a31788aca1abc@mail.gmail.com> On 12/30/07, Joshua McAdams wrote: > For the downtown meeting, Kent Cowgill will be giving his talk about > image processing with Perl. From what I understand, there would still > be some time after his talk to cover Perl 5.10. Any volunteers? Piggybacking on that, if anyone would like to cover this topic in Wheaton at IIT on Feb 12, let me know. --Dave From richard at rushlogistics.com Mon Dec 31 08:47:26 2007 From: richard at rushlogistics.com (Richard Reina) Date: Mon, 31 Dec 2007 08:47:26 -0800 (PST) Subject: [Chicago-talk] accessing another script's subroutine from w/in a module? In-Reply-To: Message-ID: <304972.19084.qm@web609.biz.mail.mud.yahoo.com> Mike, I spoke a bit too soon. Something strange is going on -- or maybe it's not so strange. If Fax.pm is called after require "./QuoteJoke.pl"; has already been called my $string = &main::get_quote_joke(); works like a charm and "&get_quote_joke();" fails with udefined subroutine. If on the other hand if Fax.pm is called from a program when require "./QuoteJoke.pl"; has not been previously called then my $string = &main::get_quote_joke(); fails with undefined subroutine &main::get_quote_joke() and &get_quote_joke(); works. Any idea why this maybe the case? Mike Fragassi wrote: On Fri, 28 Dec 2007, Richard Reina wrote: > How can one properly declare another script's subroutine from within a > Module. > > I would like to be able to do this: > > require "./QuoteJoke.pl"; > my $string = &get_quote_joke(); > > from a my home made perl module Fax.pm > > without getting: > > Undefined subroutine &Fax::get_quote_joke called at Fax.pm line 61 Inside Fax.pm, assuming that this module has the line 'package Fax;', then calling any method 'foo' will be interpreted as a call to &Fax::foo. If a file (.pl or .pm) does not have a 'package' declaration, its commands are in the package 'main' by default. If that's the case with QuoteJoke.pl, then inside of Fax.pm, calling '&main::get_quote_joke()' should work. Otherwise, if there's a package, use that instead of 'main'. > I know I am probably breaking some cardinal rule of perl but I can't > figure it out. You're not really breaking anything, or doing anything crazy; you just need to prepend the package name where the method comes from, when you're calling it from inside a different package. -- Mike F. _______________________________________________ Chicago-talk mailing list Chicago-talk at pm.org http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/chicago-talk/attachments/20071231/f4a67f64/attachment.html