From william at knowmad.com Thu Mar 3 06:11:22 2005 From: william at knowmad.com (William McKee) Date: Thu Mar 3 06:11:36 2005 Subject: [Charlotte.PM] Fwd: [Perl Jobs] mod_perl programmer for publishing company (onsite), United States, NC, Charlotte Message-ID: <20050303141122.GF1122@knowmad.com> Anyone looking for a job? ----- Forwarded message from Perl Jobs ----- > To: jobs@perl.org > From: Perl Jobs > Date: Tue, 1 Mar 2005 13:32:58 -0800 > Subject: [Perl Jobs] mod_perl programmer for publishing company (onsite), United States, NC, Charlotte > > Online URL for this job: http://jobs.perl.org/job/2318 > > To subscribe to this list, send mail to jobs-subscribe@perl.org. > To unsubscribe, send mail to jobs-unsubscribe@perl.org. > > Posted: March 1, 2005 > > Job title: > mod_perl programmer for publishing company > > Company name: bizjournals.com > > Location: United States, NC, Charlotte > > Travel: 0% > > Terms of employment: Salaried employee > > Hours: Full time > > Onsite: yes > > Description: > bizjournals.com is the web presence for 41 weekly business newspapers > around the country. Candidiate will write/debug/support existing > perl/mod_perl/DBI code and participate in new projects as well. > > Please... local applicants only. > > Required skills: > Perl, mod_perl, Apache, MySQL, Linux (redhat) > > Desired skills: Qmail, XML > > Contact information: > Email Dan Richman at drichman@bizjournals.com > > > ----- End forwarded message ----- -- Knowmad Services Inc. http://www.knowmad.com From william at knowmad.com Sun Mar 13 09:29:17 2005 From: william at knowmad.com (William McKee) Date: Sun Mar 13 09:29:29 2005 Subject: [Charlotte.PM] March Perl Mongers Meeting - Thursday, March 17th at 7pm Message-ID: <20050313172917.GI20987@knowmad.com> Charlotte Perl Mongers A recent thread on the CharLUG mailing list lamented the lack of Perl discussions taking place in the community. I concur with the poster and challenge everyone signed up to the mailing list to post an interesting story, a clever piece of code or even a list of their favorite modules in the upcoming month. Let's get the discussion rolling! At our meeting this month, we'll be looking at the incredible world of RSS. News aggregators have become an important piece of software for many people in order to manage the influx of information coming from their favorite websites. I'll be showing off some of these tools as well as demonstrating how I generated the shiny, new RSS event feed that's available on our website[1]. We'll also take a look at the tools available in Perl for parsing RSS which opens up many new possiblities for managing these growing information resources. See you at the meeting, William McKee [1] http://charlotte.pm.org/CharPM.rdf Meeting Topic: Generating & Parsing RSS feeds with Perl Meeting Date and Times: >> Thursday, March 17th * General Meeting - 7:00 PM to 8:30 PM * Discussion/Networking - 8:30 PM til Meeting Location: Jackson's Java, University Blvd. near UNCC see the link at http://charlotte.pm.org for a map Next Meeting: Thursday, April 21st ~ Field trip to CharJUG to hear Andrew Hunt of The Pragmatic Programmers, LLC (meet at Jackson's Java at 6:00pm to carpool or see http://www.cornetdesign.com/charjug/ for directions) -- Knowmad Services Inc. http://www.knowmad.com From phma at phma.hn.org Thu Mar 17 20:55:12 2005 From: phma at phma.hn.org (Pierre Abbat) Date: Thu Mar 17 20:55:29 2005 Subject: [Charlotte.PM] More hand coded Postscript Message-ID: <200503172355.12766.phma@phma.hn.org> This is for my speech on Monday about the metric system. phma -- Now I need a magnifier to find my eyeglasses! -Les Perles de la m?decine -------------- next part -------------- A non-text attachment was scrubbed... Name: ISO A Paper sizes.ps Type: application/postscript Size: 6061 bytes Desc: not available Url : http://mail.pm.org/pipermail/charlotte/attachments/20050317/b972c638/ISOAPapersizes.ps From glim at mycybernet.net Sat Mar 19 12:12:00 2005 From: glim at mycybernet.net (glim@mycybernet.net) Date: Sat Mar 19 12:39:24 2005 Subject: [Charlotte.PM] Yet Another Perl Conference, North America, 2005 Registration now open Message-ID: ----------> Yet Another Perl Conference, North America, 2005 Registration now open. Conference dates: Monday - Wednesday 27 - 29 June 2005 Location: 89 Chestnut Street http://89chestnut.com/ University of Toronto Toronto, Ontario, Canada Info at: http://yapc.org/America Direct registration: http://donate.perlfoundation.org/index.pl?node=registrant%20info&conference_id=423 Full registration fee $85 (USD) Book now for great deals on accommodations and ensure a space for yourself. Speaking slots are still open. If you would like to present at YAPC::NA 2005, see: http://yapc.org/America/cfp-2005.shtml Details of this announcement: http://yapc.org/America/registration-announcement-2005.txt <---------- More Details ============ Registration for YAPC::NA (Yet Another Perl Conference, North America) 2005 in Toronto, Ontario, Canada is now open. The conference registration price is USD$85. This price includes admission to all aspects of the conference, respectable amounts of catering, several activities and a few conference goodies. The YAPC North America 2005 conference features... * Fantastic speakers + most are the core creators of the technology on which they present + many are professional IT authors, trainers and conference speakers * An excellent learning opportunity * A chance to meet Perl professionals from all over North America and the world + YAPC attendees tend to be very involved in Perl and so are another great way to learn more about what the language has to offer beyond just what the speakers have to say * Extra-curricular / after hours activities * A great location in downtown Toronto All this, and the price is more than an order of magnitude cheaper than what commercial conferences can offer. This is because YAPC is a 100% volunteer effort, both from its organizers and its speakers. Quality is *not* sacrificed to achieve this stunning level of affordability. YAPC provides the best value-for-dollar in IT conferences. And it's a ton of fun, too. The dates of the conference are Monday - Wednesday 27-29 June 2005. The location is 89 Chestnut Street in downtown Toronto, Ontario, Canada. (Note that a different date block was previously announced; we moved the conference date to accommodate venue availability.) http://89chestnut.com/ -- a facility within the University of Toronto If you are at all interested in attending the conference... Book now! Book now! Book now! We have room for about 400 attendees and we hope to sell out well in advance of the late June conference date. However, the critical matter is that of hotels. The YAPC::NA 2005 organizers have made group arrangements with several facilities around the city to provide _excellent_ quality accommodations in _very_ convenient locations at _terrific_ prices for the _full_ capacity of conference attendees (around 400 people). (Finding, booking and paying accommodations is the responsibility of the attendees, but we will provide you with a list of the hotels and university dorms to try first based on our group arrangement with them when you register for the conference. Also, see the web site at http://yapc.org/America/accommodations-2005.shtml. More details will be up shortly. The dorm option will be approx. C$55/night, the hotel options will be more like C$90/night, and for slightly different prices there will be options for putting more than 1 person in a room. Exact details and how to book will be emailed directly to people who have registered for the conference as soon as they become available.) *The catch is -- book now!!* The group reservations will expire in early May, at which point in time the group rates will mostly still apply, but the rooms will be given out on an "availability basis". Which means that someone else outside of the YAPC group can book the rooms as well. Make no mistake -- the rooms *will* be sold. Toronto is a very active conference city in the summer and there will be _no_ guarantee of vacancies either at the facilities we made arrangements with or anywhere else in the city if you leave it to within 6 weeks of the conference date. So, if you want to save yourself the likely-fruitless headache of scrambling around looking for accommodations at the last minute, Book now! Book now! Book now! Have any questions? Email na-help@yapc.org for more details. Additionally, we are still welcoming submissions for proposals via: http://yapc.org/America/cfp-2005.shtml The close of the call-for-papers is April 18, 2005 at 11:59 pm (Toronto time). If you have any questions regarding the call-for-papers or speaking at YAPC::NA 2005 please email na-author@yapc.org We would love to hear from potential sponsors. Please contact the organizers at na-sponsor@yapc.org to learn about the benefits of sponsorship. From diona at studio12a.com Tue Mar 22 07:02:46 2005 From: diona at studio12a.com (diona kidd) Date: Tue Mar 22 07:00:57 2005 Subject: [Charlotte.PM] find index of array element In-Reply-To: <200503172355.12766.phma@phma.hn.org> References: <200503172355.12766.phma@phma.hn.org> Message-ID: <1111503766.3732.97.camel@localhost.localdomain> Ok, I thought I'd start a discussion here before posting this to perlmonks. I have a little perl task that I often do and just as often forget how to do. I seem to recall doing it before with grep, map, or some combination. dunno....when I find out again, I'm going to post it on my site for reference. say you have an array and you want to find the index of a particular element by string comparison. You can do a foreach loop but I know there's a cleaner way... my @array = qw( item1 item2 item3 item4 ); find the index of item3. anyone? From drewhead at drewhead.org Tue Mar 22 07:38:37 2005 From: drewhead at drewhead.org (drewhead@drewhead.org) Date: Tue Mar 22 07:38:46 2005 Subject: [Charlotte.PM] find index of array element In-Reply-To: <1111503766.3732.97.camel@localhost.localdomain> Message-ID: <200503221538.j2MFcbG4006621@keep.drewhead.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > my @array = qw( item1 item2 item3 item4 ); > find the index of item3. The knock on grep is that it is pretty much looping though every element, like map would, which essientailly makes them the same as a foreach loop. Those things don't tend to scale well. Why do you need to know an array index? Can you control the structure of the array? If so makeing this a hash when you build the data structure where your keys are the element values of the array and the hash key value would be a count scalar incremented with each assignment. Then you could get the index, or more appropriately stated the ordinal position of an element at assignment, simply by refrencing it's hash value. my %hash = { 'item1' => 1, 'item2' => 2, 'item3' => 3, 'item4' => 4, }; my $index = $hash{'item3'}; This assumes your array elements are unique. I know this isn't really what you asked, but depending on your application it and how many times you need to lookup an index value it may be worth it to build this structure even if you don't have control of the array itself. I find I only use arrays when I know I'm never going to care about the index of the elements and I know I'll never have need to look up a specfic value. Otherwise I type % without even thinking about it. :) - -- Drew Dowling Drewhead http://www.drewhead.org drewhead@drewhead.org | | WWW / \ Alpha Phi Omega Concord, North Carolina | | Nimat / \ Gamma Lambda CLEMSON UNIVERSITY ALUMNI | | Apatschin /_____\ TIGER BAND! | VGAP4 Hosting at http://vgap.drewhead.org -----BEGIN PGP SIGNATURE----- Comment: Public key available at http://www.drewhead.org iD8DBQFCQDv18J7U7yHE638RApGQAKC3Sz4pFPyEw2/H3m+PQkYTxYUjFwCeOMy5 uWO0eBT5R1D6NSR+gB+BgMM= =f23b -----END PGP SIGNATURE----- From dale at lancaster.hm Tue Mar 22 07:53:26 2005 From: dale at lancaster.hm (Dale Lancaster) Date: Tue Mar 22 07:53:46 2005 Subject: [Charlotte.PM] find index of array element References: <200503172355.12766.phma@phma.hn.org> <1111503766.3732.97.camel@localhost.localdomain> Message-ID: <00c501c52ef7$497e2210$8dda19ac@na.choicepoint.net> Good challenge and one I need to do every now and then. Too bad grep doesn't return an index as an option. The best I could come up with on short notice: # Find first occurence of the number 3 in the list my @input=(1,2,3,4,3,2,1) ; my ($j, $i) ; grep { $i++ ; $j=$i-1 if $_ =~ /3/ and !$j ; } @input ; print $j ; when run, produces "2", which would be correct. dale ----- Original Message ----- From: "diona kidd" To: "Charlotte.PM" Sent: Tuesday, March 22, 2005 10:02 AM Subject: [Charlotte.PM] find index of array element > Ok, I thought I'd start a discussion here before posting this to > perlmonks. I have a little perl task that I often do and just as often > forget how to do. I seem to recall doing it before with grep, map, or > some combination. dunno....when I find out again, I'm going to post it > on my site for reference. > > say you have an array and you want to find the index of a particular > element by string comparison. You can do a foreach loop but I know > there's a cleaner way... > > my @array = qw( item1 item2 item3 item4 ); > > find the index of item3. > > anyone? > > _______________________________________________ > charlotte mailing list > charlotte@pm.org > http://mail.pm.org/mailman/listinfo/charlotte > From diona at studio12a.com Tue Mar 22 08:01:46 2005 From: diona at studio12a.com (diona kidd) Date: Tue Mar 22 07:59:52 2005 Subject: [Charlotte.PM] find index of array element In-Reply-To: <200503221538.j2MFcbG4006621@keep.drewhead.org> References: <200503221538.j2MFcbG4006621@keep.drewhead.org> Message-ID: <1111507306.3732.109.camel@localhost.localdomain> just realized this didn't go to the list... ------------------------------------------------ Drew, Thanks for the reply. This is generally a pretty quiet list so I wasn't sure how long it would be... I guess I could do it that way, but it seems to make it more complex than it probably should be. The bonus of arrays are that they are quicker although that may be negligible here. I also have the same habit of typing '%' before even thinking about it. :) I'm creating a wizard that has a next button (in Mason). Each element of the array is the next tab in the interface and is used to create the href for the 'Next' button. I do have a hash that looks like so: my %tab = ( summary => 'summary.html', description => 'description.html', contact => 'contact.html', venue => 'venue.html', price => 'price.html', schedule => 'schedule.html', sale => 'sale.html', access => 'access.html', hold => 'hold.html', commission => 'commission.html' ); It's used to determine which component to call next and create an href in the Mason code... # figure out which component to call next my $component = undef; if( ! $r->param('tab') ) { $component = 'summary.html'; } elsif($tab{$r->param('tab')}) { $component = $tab{$r->param('tab')}; } else { # do something here? } Then I need to find the next tab to call in the 'next' href... my @next = qw(summary description contact venue price schedule sale hold commission); # there's got to be an easier way, maybe with grep? my $cnt = 0; my $next = undef; # name of next tab foreach(@next) { if($_ eq $r->param('tab') ) { $next = $next[$cnt+1]; } else { $next = $next[0]; } $cnt++; } I guess the question is, which is cleaner? On Tue, 2005-03-22 at 10:38 -0500, drewhead@drewhead.org wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > > > my @array = qw( item1 item2 item3 item4 ); > > > find the index of item3. > > The knock on grep is that it is pretty much looping though every element, > like map would, which essientailly makes them the same as a foreach loop. > Those things don't tend to scale well. > > Why do you need to know an array index? Can you control the structure of the array? > If so makeing this a hash when you build the data structure where your > keys are the element values of the array and the hash key value would be a > count scalar incremented with each assignment. Then you could get the > index, or more appropriately stated the ordinal position of an element at > assignment, simply by refrencing it's hash value. > > my %hash = { > 'item1' => 1, > 'item2' => 2, > 'item3' => 3, > 'item4' => 4, > }; > > my $index = $hash{'item3'}; > > This assumes your array elements are unique. > > I know this isn't really what you asked, but depending on your application > it and how many times you need to lookup an index value it may be worth it > to build this structure even if you don't have control of the array > itself. > > I find I only use arrays when I know I'm never going to care about the > index of the elements and I know I'll never have need to look up a specfic > value. Otherwise I type % without even thinking about it. :) > > - -- > Drew Dowling Drewhead http://www.drewhead.org > drewhead@drewhead.org | | WWW / \ Alpha Phi Omega > Concord, North Carolina | | Nimat / \ Gamma Lambda > CLEMSON UNIVERSITY ALUMNI | | Apatschin /_____\ > TIGER BAND! | VGAP4 Hosting at http://vgap.drewhead.org > -----BEGIN PGP SIGNATURE----- > Comment: Public key available at http://www.drewhead.org > > iD8DBQFCQDv18J7U7yHE638RApGQAKC3Sz4pFPyEw2/H3m+PQkYTxYUjFwCeOMy5 > uWO0eBT5R1D6NSR+gB+BgMM= > =f23b > -----END PGP SIGNATURE----- From diona at studio12a.com Tue Mar 22 08:08:46 2005 From: diona at studio12a.com (diona kidd) Date: Tue Mar 22 08:06:52 2005 Subject: [Charlotte.PM] find index of array element In-Reply-To: <00c501c52ef7$497e2210$8dda19ac@na.choicepoint.net> References: <200503172355.12766.phma@phma.hn.org> <1111503766.3732.97.camel@localhost.localdomain> <00c501c52ef7$497e2210$8dda19ac@na.choicepoint.net> Message-ID: <1111507726.3732.112.camel@localhost.localdomain> I like that. More of what I was looking for and in just a very few lines. Thanks Dale! On Tue, 2005-03-22 at 10:53 -0500, Dale Lancaster wrote: > my @input=(1,2,3,4,3,2,1) ; > my ($j, $i) ; > grep { $i++ ; $j=$i-1 if $_ =~ /3/ and !$j ; } @input ; > print $j ; From william at knowmad.com Wed Mar 23 03:27:08 2005 From: william at knowmad.com (William McKee) Date: Wed Mar 23 03:27:23 2005 Subject: [Charlotte.PM] find index of array element In-Reply-To: <00c501c52ef7$497e2210$8dda19ac@na.choicepoint.net> References: <200503172355.12766.phma@phma.hn.org> <1111503766.3732.97.camel@localhost.localdomain> <00c501c52ef7$497e2210$8dda19ac@na.choicepoint.net> Message-ID: <20050323112706.GA1021@knowmad.com> On Tue, Mar 22, 2005 at 10:53:26AM -0500, Dale Lancaster wrote: > Good challenge and one I need to do every now and then. Too bad grep > doesn't return an index as an option. > The best I could come up with on short notice: Interesting approach. The form that I think Diona was recalling is in the Cookbook as Recipe 4.13. To put it into your context, it would look like the following: @matching = grep { /3/ } @input; To get the first element, it would be: print $matching[0] - 1; Though Drew's point about scalability is good to remember, I hardly think you're going to have any issues with scalability until your arrays get over 100 elements. Until then, grepping through an array may be faster than using a hash. Anyone care to write up that benchmark? William PS - Diona, thanks for the challenge! -- Knowmad Services Inc. http://www.knowmad.com From william at knowmad.com Wed Mar 23 03:40:30 2005 From: william at knowmad.com (William McKee) Date: Wed Mar 23 03:40:44 2005 Subject: [Charlotte.PM] April meeting Message-ID: <20050323114030.GC1021@knowmad.com> Hi Mongers, As announced at the last meeting, we're going to be joining CharJUG (Charlotte Java User's Group) next month for a lecture by Andrew Hunt of Pragmatic Programmers. The meeting location has been moved to the CPCC central campus. Also, my plans to come up to the University have changed. If anyone needs a ride from the University area, let me know and I'll try to arrange something. I'll provide parking information once I find out where the meeting will be held. William ----- Forwarded message from Cory Foy ----- > To: charjug@yahoogroups.com > From: Cory Foy > Date: Tue, 22 Mar 2005 10:22:19 -0500 > Subject: [charjug] Call For Speakers > > > Howdy all, > > I am always looking for new speakers for the group. Last week we had a > great presentation on IBM Database technologies, the month before a > great presentation on J2ME. > > So, what can you all contribute? Do you have good war stories, tips and > tricks, custom written tools, or a topic you are passionate about? We'd > love to have you speak at the meeting. > > Currently I am looking for summer speakers, so if you are available to > speak anytime from June on please get a hold of me so we can talk. > > Also, next month's meeting will be on Agile Techniques by Andy Hunt > (http://www.toolshed.com/blog). The meeting is being sponsored by the > ACM student chapter at CPCC and will be held at their downtown campus as > I've already received a lot of interest in the presentation. It will > still be on April 21st at 6:30 pm, and parking will be free. I'll send > out more information later on that. > > Thanks for all of your support in growing and spreading the word about > the CharJUG! > > Cory > > > > > Yahoo! Groups Links > > <*> To visit your group on the web, go to: > http://groups.yahoo.com/group/charjug/ > > <*> To unsubscribe from this group, send an email to: > charjug-unsubscribe@yahoogroups.com > > <*> Your use of Yahoo! Groups is subject to: > http://docs.yahoo.com/info/terms/ > > > ----- End forwarded message ----- -- Knowmad Services Inc. http://www.knowmad.com From diona at studio12a.com Wed Mar 23 07:37:41 2005 From: diona at studio12a.com (diona kidd) Date: Wed Mar 23 07:35:44 2005 Subject: [Charlotte.PM] April meeting In-Reply-To: <20050323114030.GC1021@knowmad.com> References: <20050323114030.GC1021@knowmad.com> Message-ID: <1111592262.3732.135.camel@localhost.localdomain> Will, Do you have a link for information on the lecture? I looked around but didn't see anything. On Wed, 2005-03-23 at 06:40 -0500, William McKee wrote: > Hi Mongers, > > As announced at the last meeting, we're going to be joining CharJUG > (Charlotte Java User's Group) next month for a lecture by Andrew Hunt of > Pragmatic Programmers. The meeting location has been moved to the CPCC > central campus. > > Also, my plans to come up to the University have changed. If anyone > needs a ride from the University area, let me know and I'll try to > arrange something. I'll provide parking information once I find out > where the meeting will be held. > > > William > > ----- Forwarded message from Cory Foy ----- > > > To: charjug@yahoogroups.com > > From: Cory Foy > > Date: Tue, 22 Mar 2005 10:22:19 -0500 > > Subject: [charjug] Call For Speakers > > > > > > Howdy all, > > > > I am always looking for new speakers for the group. Last week we had a > > great presentation on IBM Database technologies, the month before a > > great presentation on J2ME. > > > > So, what can you all contribute? Do you have good war stories, tips and > > tricks, custom written tools, or a topic you are passionate about? We'd > > love to have you speak at the meeting. > > > > Currently I am looking for summer speakers, so if you are available to > > speak anytime from June on please get a hold of me so we can talk. > > > > Also, next month's meeting will be on Agile Techniques by Andy Hunt > > (http://www.toolshed.com/blog). The meeting is being sponsored by the > > ACM student chapter at CPCC and will be held at their downtown campus as > > I've already received a lot of interest in the presentation. It will > > still be on April 21st at 6:30 pm, and parking will be free. I'll send > > out more information later on that. > > > > Thanks for all of your support in growing and spreading the word about > > the CharJUG! > > > > Cory > > > > > > > > > > Yahoo! Groups Links > > > > <*> To visit your group on the web, go to: > > http://groups.yahoo.com/group/charjug/ > > > > <*> To unsubscribe from this group, send an email to: > > charjug-unsubscribe@yahoogroups.com > > > > <*> Your use of Yahoo! Groups is subject to: > > http://docs.yahoo.com/info/terms/ > > > > > > > > ----- End forwarded message ----- > From diona at studio12a.com Wed Mar 23 08:04:49 2005 From: diona at studio12a.com (diona kidd) Date: Wed Mar 23 08:02:46 2005 Subject: [Charlotte.PM] Perl Bookshelf Message-ID: <1111593889.3732.144.camel@localhost.localdomain> Hey, I just ran across this. If you don't already have the books or don't have them handy, it's a good link. Perl Cookbook, Programming Perl and Advanced Perl Programming books online. http://www.unix.org.ua/orelly/perl/ diona From dale at lancaster.hm Wed Mar 23 09:45:24 2005 From: dale at lancaster.hm (Dale Lancaster) Date: Wed Mar 23 09:46:00 2005 Subject: [Charlotte.PM] find index of array element References: <200503172355.12766.phma@phma.hn.org><1111503766.3732.97.camel@localhost.localdomain><00c501c52ef7$497e2210$8dda19ac@na.choicepoint.net> <20050323112706.GA1021@knowmad.com> Message-ID: <01bb01c52fd0$18904be0$8dda19ac@na.choicepoint.net> I think the original requirement was to return the index in the original list of the matching element, not the actual element. I don't believe the below accomplishes that. Funny, that your example would actually produce the same answer in my test code, but only because perl is subtracting 1 from the value of the element in the matching array. > Interesting approach. The form that I think Diona was recalling is in > the Cookbook as Recipe 4.13. To put it into your context, it would look > like the following: > > @matching = grep { /3/ } @input; > > To get the first element, it would be: > > print $matching[0] - 1; > Adding another element (0) to the list creates two different answers. Your's is still "2", mine is "3" which would be the correct element index number. If Diona needed just the element contents, then yes, yours is definitely the way to go and is very clean and readable. my @input=(0,1,2,3,4,3) ; my $index ; my ($j, $i) ; my @matching = grep { /3/ } @input; print $matching[0] - 1; grep { $i++ ; $j=$i-1 if $_ =~ /3/ && !$j ; } @input ; print $j ; exit 1 ; > Though Drew's point about scalability is good to remember, I hardly > think you're going to have any issues with scalability until your arrays > get over 100 elements. Until then, grepping through an array may be > faster than using a hash. Anyone care to write up that benchmark? > With fast computers and virtually unlimited memory, I think the array would have to be in the several hundred or low thousands to be noticeably slow. I do agree though that parsing the whole list in general is not the best approach. I tried "exiting" the grep process in the logic above, but there isn't a way to do it, so it will parse the whole list. My preferered approach is to restructure the code to be readable, vs compact. The general rule of thumb being that if I have a hard time reading it, the Perl interpreter might have just as hard a time. Compact code does not equal faster code all the time. So I would have done: for ($i=0; $i < $input ; $i++) { last if $input[$i] =~ /3/ ; } print $i ; This is probably as fast or faster than my original code and of course doesn't parse the whole array and is much more readable and maintainable (and extensible). :-) dale From drewhead at drewhead.org Wed Mar 23 10:22:59 2005 From: drewhead at drewhead.org (drewhead@drewhead.org) Date: Wed Mar 23 10:23:13 2005 Subject: [Charlotte.PM] find index of array element In-Reply-To: <01bb01c52fd0$18904be0$8dda19ac@na.choicepoint.net> Message-ID: <200503231822.j2NIMxGg023676@keep.drewhead.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > > Though Drew's point about scalability is good to remember, I hardly > > think you're going to have any issues with scalability until your arrays > > get over 100 elements. Until then, grepping through an array may be > > faster than using a hash. Anyone care to write up that benchmark? > > > With fast computers and virtually unlimited memory, I think the array would > have to be in the several hundred or low thousands to be noticeably slow. I > do agree though that parsing the whole list in general is not the best > approach. I tried "exiting" the grep process in the logic above, but there > isn't a way to do it, so it will parse the whole list. I find that I get into trouble not with how big the list is, but by how many times I end up processing it. It's easy to do this when you try to build modularily. :) Grepping through even a large list once probally still leaves your bottleneck at the interperter. - -- Drew Dowling Drewhead http://www.drewhead.org drewhead@drewhead.org | | WWW / \ Alpha Phi Omega Concord, North Carolina | | Nimat / \ Gamma Lambda CLEMSON UNIVERSITY ALUMNI | | Apatschin /_____\ TIGER BAND! | VGAP4 Hosting at http://vgap.drewhead.org -----BEGIN PGP SIGNATURE----- Comment: Public key available at http://www.drewhead.org iD8DBQFCQbP48J7U7yHE638RAoOuAJ9By/7FaDEo4/kZ7UgQea8b2E5iLACfSnYJ XBuBdP+iZueqqhYUnb+Cbro= =wAkn -----END PGP SIGNATURE----- From stigliz at gmail.com Wed Mar 23 15:11:54 2005 From: stigliz at gmail.com (Amedeo Guffanti) Date: Wed Mar 23 15:12:00 2005 Subject: [Charlotte.PM] Reseach on Open Source Developers Message-ID: Hi, I'm Amedeo Guffanti, a 22 years old Italian student at Bocconi university in Milan, I' m doing a research to write a work about Open Source Movement, in particular, about the developers. I try to collect the opinions of developers like you. My little poll is at this page : http://www.alberocavo.com/OSSprojects.asp It takes less then 4 minutes. I hope the Open Source Communities will give me a help for my research. I apologize for taking your time and for my English that I hope it's understandable ^^ Sincerly, Amedeo Guffanti From william at knowmad.com Thu Mar 24 03:02:16 2005 From: william at knowmad.com (William McKee) Date: Thu Mar 24 03:02:35 2005 Subject: [Charlotte.PM] April meeting In-Reply-To: <1111592262.3732.135.camel@localhost.localdomain> References: <20050323114030.GC1021@knowmad.com> <1111592262.3732.135.camel@localhost.localdomain> Message-ID: <20050324110216.GA14783@knowmad.com> > Do you have a link for information on the lecture? I looked around but > didn't see anything. Here's the CharJUG site[1]. William [1] http://www.cornetdesign.com/charjug/ -- Knowmad Services Inc. http://www.knowmad.com From william at knowmad.com Thu Mar 24 03:03:07 2005 From: william at knowmad.com (William McKee) Date: Thu Mar 24 03:03:25 2005 Subject: [Charlotte.PM] Perl Bookshelf In-Reply-To: <1111593889.3732.144.camel@localhost.localdomain> References: <1111593889.3732.144.camel@localhost.localdomain> Message-ID: <20050324110307.GB14783@knowmad.com> On Wed, Mar 23, 2005 at 11:04:49AM -0500, diona kidd wrote: > Hey, I just ran across this. If you don't already have the books or > don't have them handy, it's a good link. Perl Cookbook, Programming Perl > and Advanced Perl Programming books online. If you'd like to review them, I can order a review copy from O'Reilly for our library. Same goes for any of the other O'Reilly titles. William -- Knowmad Services Inc. http://www.knowmad.com From william at knowmad.com Thu Mar 24 03:09:59 2005 From: william at knowmad.com (William McKee) Date: Thu Mar 24 03:10:19 2005 Subject: [Charlotte.PM] find index of array element In-Reply-To: <01bb01c52fd0$18904be0$8dda19ac@na.choicepoint.net> References: <20050323112706.GA1021@knowmad.com> <01bb01c52fd0$18904be0$8dda19ac@na.choicepoint.net> Message-ID: <20050324110959.GC14783@knowmad.com> On Wed, Mar 23, 2005 at 12:45:24PM -0500, Dale Lancaster wrote: > I think the original requirement was to return the index in the original > list of the matching element, not the actual element. I don't believe the > below accomplishes that. You're right, it doesn't match the requirements. I was thinking form (she used the keywords grep and array) over function. > Funny, that your example would actually produce the same answer in my > test code, but only because perl is subtracting 1 from the value of > the element in the matching array. Yeah, that's sheer coincidence. Substituting chars for numbers makes it very clear. > This is probably as fast or faster than my original code and of course > doesn't parse the whole array and is much more readable and maintainable > (and extensible). Although map and grep are very cool techniques, it's interesting to find ways in which they are not as efficient as just writing it out the long way (like I used to do before I understood these functions). Your point reminds me of a recent article I was reading by ESR[1] while looking at the various F/OSS CMS products available. One of the benefits that he tauts when comparing Python to Python is the compactness of the Python language. I can see where there is some benefit to having to remember fewer commands to get your work done. At some point though, you're going to hit the limitations of the language. Sure, it's hard to fit all of Perl's functions much less the growing mass of modules on CPAN into your head. All-in-all, I'd prefer the richer language to the compact language. I presume most folks on this mailing list are of the same opinion; anyone care to proffer a counter-argument (even if you're not beholden to it, it might make for an interesting discussion). William [1] http://www.linuxjournal.com/article/3882 -- Knowmad Services Inc. http://www.knowmad.com From dale at lancaster.hm Thu Mar 24 05:49:26 2005 From: dale at lancaster.hm (Dale Lancaster) Date: Thu Mar 24 07:33:32 2005 Subject: [Charlotte.PM] find index of array element References: <20050323112706.GA1021@knowmad.com> <01bb01c52fd0$18904be0$8dda19ac@na.choicepoint.net> <20050324110959.GC14783@knowmad.com> Message-ID: <000201c53086$c9a2fca0$8dda19ac@na.choicepoint.net> The ultimate "compact language" is Forth and that was just way too wierd to use as a serious lanuage. I am in agreement, more compact does not mean more useful. I do believe that the most commonly used features should be optimized and made as easy to use as possible. I think the grep() function is a good example, but much like a Craftsman tool screwdriver, you could use it for the wrong things, but fortunately not void your warranty :-). Dale ----- Original Message ----- From: "William McKee" To: "Dale Lancaster" Cc: Sent: Thursday, March 24, 2005 6:09 AM Subject: Re: [Charlotte.PM] find index of array element > On Wed, Mar 23, 2005 at 12:45:24PM -0500, Dale Lancaster wrote: >> I think the original requirement was to return the index in the original >> list of the matching element, not the actual element. I don't believe >> the >> below accomplishes that. > > You're right, it doesn't match the requirements. I was thinking form > (she used the keywords grep and array) over function. > > >> Funny, that your example would actually produce the same answer in my >> test code, but only because perl is subtracting 1 from the value of >> the element in the matching array. > > Yeah, that's sheer coincidence. Substituting chars for numbers makes it > very clear. > > >> This is probably as fast or faster than my original code and of course >> doesn't parse the whole array and is much more readable and maintainable >> (and extensible). > > Although map and grep are very cool techniques, it's interesting to find > ways in which they are not as efficient as just writing it out the long > way (like I used to do before I understood these functions). > > Your point reminds me of a recent article I was reading by ESR[1] while > looking at the various F/OSS CMS products available. One of the benefits > that he tauts when comparing Python to Python is the compactness of the > Python language. > > I can see where there is some benefit to having to remember fewer > commands to get your work done. At some point though, you're going to > hit the limitations of the language. Sure, it's hard to fit all of > Perl's functions much less the growing mass of modules on CPAN into > your head. All-in-all, I'd prefer the richer language to the compact > language. I presume most folks on this mailing list are of the same > opinion; anyone care to proffer a counter-argument (even if you're not > beholden to it, it might make for an interesting discussion). > > > William > > [1] http://www.linuxjournal.com/article/3882 > > -- > Knowmad Services Inc. > http://www.knowmad.com > From william at knowmad.com Thu Mar 24 08:07:47 2005 From: william at knowmad.com (William McKee) Date: Thu Mar 24 08:08:01 2005 Subject: [Charlotte.PM] find index of array element In-Reply-To: <000201c53086$c9a2fca0$8dda19ac@na.choicepoint.net> References: <20050323112706.GA1021@knowmad.com> <01bb01c52fd0$18904be0$8dda19ac@na.choicepoint.net> <20050324110959.GC14783@knowmad.com> <000201c53086$c9a2fca0$8dda19ac@na.choicepoint.net> Message-ID: <20050324160747.GL1021@knowmad.com> On Thu, Mar 24, 2005 at 08:49:26AM -0500, Dale Lancaster wrote: > I think the grep() function is a good example, but much like a > Craftsman tool screwdriver, you could use it for the wrong things, but > fortunately not void your warranty :-). LOL! You've gotta love open source. You break it, you get to keep both pieces. William -- Knowmad Services Inc. http://www.knowmad.com From diona at studio12a.com Thu Mar 24 08:22:35 2005 From: diona at studio12a.com (diona kidd) Date: Thu Mar 24 08:20:40 2005 Subject: tools of the trade ( was Re: [Charlotte.PM] find index of array element) In-Reply-To: <000201c53086$c9a2fca0$8dda19ac@na.choicepoint.net> References: <20050323112706.GA1021@knowmad.com> <01bb01c52fd0$18904be0$8dda19ac@na.choicepoint.net> <20050324110959.GC14783@knowmad.com> <000201c53086$c9a2fca0$8dda19ac@na.choicepoint.net> Message-ID: <1111681355.3732.234.camel@localhost.localdomain> I definitely agree that compactness isn't always advantageous. I really value cleanliness and clever shortcuts. Seems like everyone has their growing bag of coding tricks. In any project, it's easy to use the wrong tool. I like all the options a richer language offers, even if it does increase the learning curve. Between SQL, XHTML, CSS, Perl, Templating systems, CPAN, etc...it's impossible to keep everything in your head. Plus, there's life too. :) - diona On Thu, 2005-03-24 at 08:49 -0500, Dale Lancaster wrote: > The ultimate "compact language" is Forth and that was just way too wierd to > use as a serious lanuage. I am in agreement, more compact does not mean > more useful. I do believe that the most commonly used features should be > optimized and made as easy to use as possible. I think the grep() function > is a good example, but much like a Craftsman tool screwdriver, you could use > it for the wrong things, but fortunately not void your warranty :-). > > Dale > > ----- Original Message ----- > From: "William McKee" > To: "Dale Lancaster" > Cc: > Sent: Thursday, March 24, 2005 6:09 AM > Subject: Re: [Charlotte.PM] find index of array element > > > > On Wed, Mar 23, 2005 at 12:45:24PM -0500, Dale Lancaster wrote: > >> I think the original requirement was to return the index in the original > >> list of the matching element, not the actual element. I don't believe > >> the > >> below accomplishes that. > > > > You're right, it doesn't match the requirements. I was thinking form > > (she used the keywords grep and array) over function. > > > > > >> Funny, that your example would actually produce the same answer in my > >> test code, but only because perl is subtracting 1 from the value of > >> the element in the matching array. > > > > Yeah, that's sheer coincidence. Substituting chars for numbers makes it > > very clear. > > > > > >> This is probably as fast or faster than my original code and of course > >> doesn't parse the whole array and is much more readable and maintainable > >> (and extensible). > > > > Although map and grep are very cool techniques, it's interesting to find > > ways in which they are not as efficient as just writing it out the long > > way (like I used to do before I understood these functions). > > > > Your point reminds me of a recent article I was reading by ESR[1] while > > looking at the various F/OSS CMS products available. One of the benefits > > that he tauts when comparing Python to Python is the compactness of the > > Python language. > > > > I can see where there is some benefit to having to remember fewer > > commands to get your work done. At some point though, you're going to > > hit the limitations of the language. Sure, it's hard to fit all of > > Perl's functions much less the growing mass of modules on CPAN into > > your head. All-in-all, I'd prefer the richer language to the compact > > language. I presume most folks on this mailing list are of the same > > opinion; anyone care to proffer a counter-argument (even if you're not > > beholden to it, it might make for an interesting discussion). > > > > > > William > > > > [1] http://www.linuxjournal.com/article/3882 > > > > -- > > Knowmad Services Inc. > > http://www.knowmad.com > > > > _______________________________________________ > charlotte mailing list > charlotte@pm.org > http://mail.pm.org/mailman/listinfo/charlotte From dale at lancaster.hm Thu Mar 24 09:00:28 2005 From: dale at lancaster.hm (Dale Lancaster) Date: Thu Mar 24 09:00:51 2005 Subject: tools of the trade ( was Re: [Charlotte.PM] find index of arrayelement) References: <20050323112706.GA1021@knowmad.com> <01bb01c52fd0$18904be0$8dda19ac@na.choicepoint.net> <20050324110959.GC14783@knowmad.com> <000201c53086$c9a2fca0$8dda19ac@na.choicepoint.net> <1111681355.3732.234.camel@localhost.localdomain> Message-ID: <007b01c53092$fc006550$8dda19ac@na.choicepoint.net> I am definitely in favor of a 1500 piece craftsman professional tool set vs the 20 piece "all you will ever need" screwdriver, pliers, socket set approach. I do have one (possibly more if I think about it) pet peeve with Perl and it's that Larry Wall decided that it was not necessary to have a switch/case construct because "there are so many other ways to do the same thing in Perl". Well, for us programmers coming from C (and possibly javascript), switch/case is very elegant looking and useful. dale ----- Original Message ----- From: "diona kidd" To: "Dale Lancaster" Cc: "William McKee" ; Sent: Thursday, March 24, 2005 11:22 AM Subject: tools of the trade ( was Re: [Charlotte.PM] find index of arrayelement) >I definitely agree that compactness isn't always advantageous. I really > value cleanliness and clever shortcuts. Seems like everyone has their > growing bag of coding tricks. In any project, it's easy to use the wrong > tool. I like all the options a richer language offers, even if it does > increase the learning curve. > > Between SQL, XHTML, CSS, Perl, Templating systems, CPAN, etc...it's > impossible to keep everything in your head. Plus, there's life too. :) > > - diona > > > > > On Thu, 2005-03-24 at 08:49 -0500, Dale Lancaster wrote: >> The ultimate "compact language" is Forth and that was just way too wierd >> to >> use as a serious lanuage. I am in agreement, more compact does not mean >> more useful. I do believe that the most commonly used features should be >> optimized and made as easy to use as possible. I think the grep() >> function >> is a good example, but much like a Craftsman tool screwdriver, you could >> use >> it for the wrong things, but fortunately not void your warranty :-). >> >> Dale >> >> ----- Original Message ----- >> From: "William McKee" >> To: "Dale Lancaster" >> Cc: >> Sent: Thursday, March 24, 2005 6:09 AM >> Subject: Re: [Charlotte.PM] find index of array element >> >> >> > On Wed, Mar 23, 2005 at 12:45:24PM -0500, Dale Lancaster wrote: >> >> I think the original requirement was to return the index in the >> >> original >> >> list of the matching element, not the actual element. I don't believe >> >> the >> >> below accomplishes that. >> > >> > You're right, it doesn't match the requirements. I was thinking form >> > (she used the keywords grep and array) over function. >> > >> > >> >> Funny, that your example would actually produce the same answer in my >> >> test code, but only because perl is subtracting 1 from the value of >> >> the element in the matching array. >> > >> > Yeah, that's sheer coincidence. Substituting chars for numbers makes it >> > very clear. >> > >> > >> >> This is probably as fast or faster than my original code and of course >> >> doesn't parse the whole array and is much more readable and >> >> maintainable >> >> (and extensible). >> > >> > Although map and grep are very cool techniques, it's interesting to >> > find >> > ways in which they are not as efficient as just writing it out the long >> > way (like I used to do before I understood these functions). >> > >> > Your point reminds me of a recent article I was reading by ESR[1] while >> > looking at the various F/OSS CMS products available. One of the >> > benefits >> > that he tauts when comparing Python to Python is the compactness of the >> > Python language. >> > >> > I can see where there is some benefit to having to remember fewer >> > commands to get your work done. At some point though, you're going to >> > hit the limitations of the language. Sure, it's hard to fit all of >> > Perl's functions much less the growing mass of modules on CPAN into >> > your head. All-in-all, I'd prefer the richer language to the compact >> > language. I presume most folks on this mailing list are of the same >> > opinion; anyone care to proffer a counter-argument (even if you're not >> > beholden to it, it might make for an interesting discussion). >> > >> > >> > William >> > >> > [1] http://www.linuxjournal.com/article/3882 >> > >> > -- >> > Knowmad Services Inc. >> > http://www.knowmad.com >> > >> >> _______________________________________________ >> charlotte mailing list >> charlotte@pm.org >> http://mail.pm.org/mailman/listinfo/charlotte > From william at knowmad.com Thu Mar 24 11:06:34 2005 From: william at knowmad.com (William McKee) Date: Thu Mar 24 11:06:51 2005 Subject: tools of the trade ( was Re: [Charlotte.PM] find index of arrayelement) In-Reply-To: <007b01c53092$fc006550$8dda19ac@na.choicepoint.net> References: <20050323112706.GA1021@knowmad.com> <01bb01c52fd0$18904be0$8dda19ac@na.choicepoint.net> <20050324110959.GC14783@knowmad.com> <000201c53086$c9a2fca0$8dda19ac@na.choicepoint.net> <1111681355.3732.234.camel@localhost.localdomain> <007b01c53092$fc006550$8dda19ac@na.choicepoint.net> Message-ID: <20050324190634.GP1021@knowmad.com> On Thu, Mar 24, 2005 at 12:00:28PM -0500, Dale Lancaster wrote: > I am definitely in favor of a 1500 piece craftsman professional tool set vs > the 20 piece "all you will ever need" screwdriver, pliers, socket set > approach. (grunting sound fx from Home Improvement plays in the background) > I do have one (possibly more if I think about it) pet peeve with > Perl and it's that Larry Wall decided that it was not necessary to have a > switch/case construct because "there are so many other ways to do the same > thing in Perl". You're not the only one, and he's changed his mind (or had it changed by the community) because it will be part of Perl6. In fact, you can get a Perl5 implementation along with lots of other Perl6 goodies by downloading Bundle::Perl6 from CPAN. Cheers! William -- Knowmad Services Inc. http://www.knowmad.com From dale at lancaster.hm Thu Mar 24 13:23:13 2005 From: dale at lancaster.hm (Dale Lancaster) Date: Thu Mar 24 13:23:46 2005 Subject: tools of the trade ( was Re: [Charlotte.PM] find index of arrayelement) References: <20050323112706.GA1021@knowmad.com> <01bb01c52fd0$18904be0$8dda19ac@na.choicepoint.net> <20050324110959.GC14783@knowmad.com> <000201c53086$c9a2fca0$8dda19ac@na.choicepoint.net> <1111681355.3732.234.camel@localhost.localdomain> <007b01c53092$fc006550$8dda19ac@na.choicepoint.net> <20050324190634.GP1021@knowmad.com> Message-ID: <029301c530b7$b1b7ac40$8dda19ac@na.choicepoint.net> That's great to hear on the next release having the switch/case. I am a little concerned about install Bundle::Perl6, I'll need to look at how that works. Thanks for the tip. dale ----- Original Message ----- From: "William McKee" To: "Dale Lancaster" Cc: ; Sent: Thursday, March 24, 2005 2:06 PM Subject: Re: tools of the trade ( was Re: [Charlotte.PM] find index of arrayelement) > On Thu, Mar 24, 2005 at 12:00:28PM -0500, Dale Lancaster wrote: >> I am definitely in favor of a 1500 piece craftsman professional tool set >> vs >> the 20 piece "all you will ever need" screwdriver, pliers, socket set >> approach. > > (grunting sound fx from Home Improvement plays in the background) > > >> I do have one (possibly more if I think about it) pet peeve with >> Perl and it's that Larry Wall decided that it was not necessary to have a >> switch/case construct because "there are so many other ways to do the >> same >> thing in Perl". > > You're not the only one, and he's changed his mind (or had it changed by > the community) because it will be part of Perl6. In fact, you can get a > Perl5 implementation along with lots of other Perl6 goodies by > downloading Bundle::Perl6 from CPAN. > > > Cheers! > William > > -- > Knowmad Services Inc. > http://www.knowmad.com > From william at knowmad.com Fri Mar 25 06:34:07 2005 From: william at knowmad.com (William McKee) Date: Fri Mar 25 06:34:33 2005 Subject: [Charlotte.PM] Fwd: [charlug] Press Release Message-ID: <20050325143406.GR1021@knowmad.com> The Charlotte Linux User's Group is reorganizing and will be meeting monthly on Saturdays starting in April. See the press release for more details. Hope to see some of you there. William > FOR IMMEDIATE RELEASE: > > Contact: > Cory Foy > Charlotte Linux User's Group > (704) 813-1193 > charlug@cornetdesign.com > http://www.charlug.org > > Charlotte, NC, 3/22/2005 ? The Charlotte Linux User's Group (CharLUG) > will be holding a presentation on the benefits of switching to and using > the Linux Operating System and Open Source software Saturday, April 9th > 11:00am at the Central Piedmont Community College's (CPCC) central campus. > > The presentation, entitled "Why Linux?" will cover the benefits both > home users and corporations can receive by switching to the Linux > Operating System and by using and contributing to Open Source software. > It is being presented by Grant Johnson, a software developer with nearly > 30 years experience on a variety of computer systems and platforms. > > This presentation is free of charge and is being sponsored by the > Association for Computing Machinery (ACM) Student Chapter of CPCC. It > will be held on the 2nd floor of the CPCC IT Building at the corner of > Elizabeth Avenue and Independence near downtown Charlotte. Directions > and more information can be found on the CharLUG web site > (http://www.charlug.org). > > Originally started as a hobby system by Linus Torvalds, Linux has grown > to be a viable Unix replacement, and is increasingly viewed as a > replacement for the Windows operating system. A recent CNN article > (http://www.cnn.com/2004/BUSINESS/03/14/go.open.source/index.html) > mentioned the prevalence of Linux, reporting that high-profile companies > and large governments alike are researching switching to the open-source > operating system. > > _______________________________________________ > discuss mailing list > discuss@charlug.org > http://lists.charlug.org/mailman/listinfo/discuss ----- End forwarded message ----- -- Knowmad Services Inc. http://www.knowmad.com From diona at studio12a.com Fri Mar 25 07:51:43 2005 From: diona at studio12a.com (diona kidd) Date: Fri Mar 25 07:49:29 2005 Subject: [Charlotte.PM] storing arrays in a hash In-Reply-To: <20050325143406.GR1021@knowmad.com> References: <20050325143406.GR1021@knowmad.com> Message-ID: <1111765903.3732.258.camel@localhost.localdomain> Hey guys, I've got another one for you. I liked the last conversation, so why not start another? I've been working on a script lately (usually pretty late in the evening ;) where I'm storing arrays in a hash while going through a loop. Once I'm out of the loop, I iterate over the hash, acting on the key/value pairs. Odd thing is, when I try to pull the array back out of the hash...it's not an array anymore. If I ref the value of the hash key, nothing is printed out...I would expect to see ARRAY. Has anyone else ran across this? Is there something I'm not aware of, like maybe I need to make the array a ref before storing it in the hash? I've already done the traditional google search. Thanks, Diona From kbear at carolina.rr.com Fri Mar 25 08:07:11 2005 From: kbear at carolina.rr.com (Michael Kondratovich) Date: Fri Mar 25 08:07:22 2005 Subject: [Charlotte.PM] storing arrays in a hash In-Reply-To: <1111765903.3732.258.camel@localhost.localdomain> References: <20050325143406.GR1021@knowmad.com> <1111765903.3732.258.camel@localhost.localdomain> Message-ID: Diona, Try @array = @{ $hash{ $key } }; MK On Mar 25, 2005, at 10:51 AM, diona kidd wrote: > Hey guys, > > I've got another one for you. I liked the last conversation, so why not > start another? > > I've been working on a script lately (usually pretty late in the > evening ;) where I'm storing arrays in a hash while going through a > loop. Once I'm out of the loop, I iterate over the hash, acting on the > key/value pairs. Odd thing is, when I try to pull the array back out of > the hash...it's not an array anymore. If I ref the value of the hash > key, nothing is printed out...I would expect to see ARRAY. > > Has anyone else ran across this? Is there something I'm not aware of, > like maybe I need to make the array a ref before storing it in the > hash? > I've already done the traditional google search. > > Thanks, > > Diona > > _______________________________________________ > charlotte mailing list > charlotte@pm.org > http://mail.pm.org/mailman/listinfo/charlotte > From drewhead at drewhead.org Fri Mar 25 08:28:42 2005 From: drewhead at drewhead.org (drewhead@drewhead.org) Date: Fri Mar 25 08:28:50 2005 Subject: [Charlotte.PM] storing arrays in a hash In-Reply-To: <1111765903.3732.258.camel@localhost.localdomain> Message-ID: <200503251628.j2PGSgYf019883@keep.drewhead.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > I've been working on a script lately (usually pretty late in the > evening ;) where I'm storing arrays in a hash while going through a > loop. Once I'm out of the loop, I iterate over the hash, acting on the > key/value pairs. Odd thing is, when I try to pull the array back out of > the hash...it's not an array anymore. If I ref the value of the hash > key, nothing is printed out...I would expect to see ARRAY. I'm not sure I understand. Can you provide an example of your hash assignment, and then the looped deref? Plus what you are seeing and what you had expecte to see? - -- Drew Dowling Drewhead http://www.drewhead.org drewhead@drewhead.org | | WWW / \ Alpha Phi Omega Concord, North Carolina | | Nimat / \ Gamma Lambda CLEMSON UNIVERSITY ALUMNI | | Apatschin /_____\ TIGER BAND! | VGAP4 Hosting at http://vgap.drewhead.org -----BEGIN PGP SIGNATURE----- Comment: Public key available at http://www.drewhead.org iD8DBQFCRDwy8J7U7yHE638RAtSMAJwKnBt6kzp/o900aCB5Ksre+jmJqQCgl6li /k23swcKGdOR+rOEmDAMb44= =/Bf5 -----END PGP SIGNATURE----- From diona at studio12a.com Fri Mar 25 15:42:28 2005 From: diona at studio12a.com (diona kidd) Date: Fri Mar 25 15:40:11 2005 Subject: [Charlotte.PM] storing arrays in a hash In-Reply-To: <200503251628.j2PGSgYf019883@keep.drewhead.org> References: <200503251628.j2PGSgYf019883@keep.drewhead.org> Message-ID: <1111794148.3732.313.camel@localhost.localdomain> Sorry, it's been a hectic day. I'll catch up with you guys next week. On Fri, 2005-03-25 at 11:28 -0500, drewhead@drewhead.org wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > > I've been working on a script lately (usually pretty late in the > > evening ;) where I'm storing arrays in a hash while going through a > > loop. Once I'm out of the loop, I iterate over the hash, acting on the > > key/value pairs. Odd thing is, when I try to pull the array back out of > > the hash...it's not an array anymore. If I ref the value of the hash > > key, nothing is printed out...I would expect to see ARRAY. > > I'm not sure I understand. Can you provide an example of your hash > assignment, and then the looped deref? Plus what you are seeing and what > you had expecte to see? > - -- > Drew Dowling Drewhead http://www.drewhead.org > drewhead@drewhead.org | | WWW / \ Alpha Phi Omega > Concord, North Carolina | | Nimat / \ Gamma Lambda > CLEMSON UNIVERSITY ALUMNI | | Apatschin /_____\ > TIGER BAND! | VGAP4 Hosting at http://vgap.drewhead.org > -----BEGIN PGP SIGNATURE----- > Comment: Public key available at http://www.drewhead.org > > iD8DBQFCRDwy8J7U7yHE638RAtSMAJwKnBt6kzp/o900aCB5Ksre+jmJqQCgl6li > /k23swcKGdOR+rOEmDAMb44= > =/Bf5 > -----END PGP SIGNATURE----- From william at knowmad.com Tue Mar 29 21:35:15 2005 From: william at knowmad.com (William McKee) Date: Tue Mar 29 21:36:44 2005 Subject: [Charlotte.PM] Fwd: [charlug] Detailed CPCC Directions Message-ID: <20050330053515.GG1021@knowmad.com> More details about next month's event at CPCC. William ----- Forwarded message from Matt Williams ----- > To: discuss@charlug.org > From: Matt Williams > Date: Sat, 26 Mar 2005 19:20:34 -0500 > Subject: [charlug] Detailed CPCC Directions > > On Wed. March 23rd, 2005, 20:49:58 -0500, Krissy Fisher wrote: > > > Maybe someone has already thought of this - but I personally would > > like to see better directions on the website. A link to Google Maps > > is all well and good... but I want to know what to do when I get there > > too!! > > > This might be because I'm not from around Charlotte, but I want to > > know where to park, what building to go into in the campus, how to > > find the room, etc. Maps covering a smaller area, with just a few > > main roads and relevant buildings are wonderful for this sort of > > thing. > > I put up some directions on my webdrive at CPCC. A detailed > explanation of meeting times, where to go, how to find the room, etc. > can be found at http://lamp.cpcc.edu/~rmw5954a/charlug/ > > >From this page, I have linked Google driving directions as well as a > satellite map of the area. The map can be viewed at > http://lamp.cpcc.edu/~rmw5954a/charlug/map/ > > Please let me know if anyone has other questions about the meetings, > space, etc. Thanks. > > Matt Williams > _______________________________________________ > discuss mailing list > discuss@charlug.org > http://lists.charlug.org/mailman/listinfo/discuss ----- End forwarded message ----- -- Knowmad Services Inc. http://www.knowmad.com From william at knowmad.com Wed Mar 30 10:30:57 2005 From: william at knowmad.com (William McKee) Date: Wed Mar 30 10:31:40 2005 Subject: [Charlotte.PM] P-Languages article Message-ID: <20050330183057.GK1021@knowmad.com> Has anyone read the article on Internet News[1] about the P languages? I just heard about it but haven't read it yet. William [1] http://internetnews.com/dev-news/article.php/3492771 -- Knowmad Services Inc. http://www.knowmad.com From diona at studio12a.com Wed Mar 30 10:54:52 2005 From: diona at studio12a.com (diona kidd) Date: Wed Mar 30 10:52:11 2005 Subject: [Charlotte.PM] Ming & Perl In-Reply-To: <20050330183057.GK1021@knowmad.com> References: <20050330183057.GK1021@knowmad.com> Message-ID: <1112208892.3341.80.camel@localhost.localdomain> Have any of you guys seen Ming? I've been reading about it today. Apparently it's used to create graphics, including SWF files via Perl although it looks as if it was originally developed for PHP. interesting but looks a bit tedious. http://www.oreilly.com/catalog/perlgp/chapter/ From william at knowmad.com Thu Mar 31 05:47:30 2005 From: william at knowmad.com (William McKee) Date: Thu Mar 31 05:47:45 2005 Subject: [Charlotte.PM] Ming & Perl In-Reply-To: <1112208892.3341.80.camel@localhost.localdomain> References: <20050330183057.GK1021@knowmad.com> <1112208892.3341.80.camel@localhost.localdomain> Message-ID: <20050331134729.GR1021@knowmad.com> On Wed, Mar 30, 2005 at 01:54:52PM -0500, diona kidd wrote: > Have any of you guys seen Ming? I've been reading about it today. > Apparently it's used to create graphics, including SWF files via Perl > although it looks as if it was originally developed for PHP. I played with it a couple years ago without much luck. I was trying to generate a slideshow. Ended up doing it in JavaScript. If you are able to create anything with it, bring a sample to the meeting in May. I'd love to see if you get it working. > interesting but looks a bit tedious. Yes. I do remember that aspect of it. > http://www.oreilly.com/catalog/perlgp/chapter/ Would you like to review this book? I can request copy for our library? William -- Knowmad Services Inc. http://www.knowmad.com From diona at studio12a.com Thu Mar 31 07:09:49 2005 From: diona at studio12a.com (diona kidd) Date: Thu Mar 31 07:07:06 2005 Subject: [Charlotte.PM] Ming & Perl In-Reply-To: <20050331134729.GR1021@knowmad.com> References: <20050330183057.GK1021@knowmad.com> <1112208892.3341.80.camel@localhost.localdomain> <20050331134729.GR1021@knowmad.com> Message-ID: <1112281789.3341.96.camel@localhost.localdomain> I'm not sure how much effort I'll put into Ming. I was just doing some research on combining Perl and Flash for a project. It would be really interesting to check out that book though. Where will the library be kept? On Thu, 2005-03-31 at 08:47 -0500, William McKee wrote: > On Wed, Mar 30, 2005 at 01:54:52PM -0500, diona kidd wrote: > > Have any of you guys seen Ming? I've been reading about it today. > > Apparently it's used to create graphics, including SWF files via Perl > > although it looks as if it was originally developed for PHP. > > I played with it a couple years ago without much luck. I was trying to > generate a slideshow. Ended up doing it in JavaScript. If you are able > to create anything with it, bring a sample to the meeting in May. I'd > love to see if you get it working. > > > > interesting but looks a bit tedious. > > Yes. I do remember that aspect of it. > > > > http://www.oreilly.com/catalog/perlgp/chapter/ > > Would you like to review this book? I can request copy for our library? > > > William > From william at knowmad.com Thu Mar 31 07:47:34 2005 From: william at knowmad.com (William McKee) Date: Thu Mar 31 07:47:51 2005 Subject: [Charlotte.PM] Ming & Perl In-Reply-To: <1112281789.3341.96.camel@localhost.localdomain> References: <20050330183057.GK1021@knowmad.com> <1112208892.3341.80.camel@localhost.localdomain> <20050331134729.GR1021@knowmad.com> <1112281789.3341.96.camel@localhost.localdomain> Message-ID: <20050331154734.GU1021@knowmad.com> On Thu, Mar 31, 2005 at 10:09:49AM -0500, diona kidd wrote: > I'm not sure how much effort I'll put into Ming. I was just doing some > research on combining Perl and Flash for a project. That's about where I left it as well. > It would be really interesting to check out that book though. Where > will the library be kept? I have it in a box at the house at the moment. The list of books is on our wiki[1] (this is a temporary address and a beta website). If you see something that you'd like to review, let me know and I'll bring it to the next meeting. William [1] http://test.knowmad.com/~charlott/kwiki/index.cgi?Library -- Knowmad Services Inc. http://www.knowmad.com From diona at studio12a.com Thu Mar 31 08:38:22 2005 From: diona at studio12a.com (diona kidd) Date: Thu Mar 31 08:35:33 2005 Subject: [Charlotte.PM] Ming & Perl In-Reply-To: <1112282886-ityndall-445.smmsdV2.0.3@localhost> References: <1112282886-ityndall-445.smmsdV2.0.3@localhost> Message-ID: <1112287102.3341.100.camel@localhost.localdomain> Yes, I came across that briefly yesterday but haven't digested it yet. >From what I gathered, it seems to be a module that gives access and/or extends a LibSWF C library. Might be a bit easier, not sure... Thanks for the link. On Thu, 2005-03-31 at 10:28 -0500, ityndall@ctc.net wrote: > >I'm not sure how much effort I'll put into Ming. I was just doing >some research on combining Perl and Flash for a project. > > Have you heard of Perl::Flash? I don't know if this would be any easier than Ming, but it is another route to go. > Check it out: > http://thegestalt.org/flash/index.html > > Ian > Ian Tyndall > IT Specialist > NCI Inc. > >