From ian at remmler.org Wed Oct 4 12:01:52 2006 From: ian at remmler.org (Ian Remmler) Date: Wed, 4 Oct 2006 14:01:52 -0500 Subject: APM: Location, location, location Message-ID: <20061004190152.GA27269@localhost> Hi, It appears that ARL is getting much stricter about outside groups meeting here. According to a notice on the CACTUS officer list, ARL will no longer provide projectors or other resources to external groups. I'm not sure what all that entails. They pretty much have to do it, though, to be compliant with certain rules. Although they will still let us meet, I get the feeling that ARL is a bit edgy about doing so. I'm wondering if it might just be easier to find a different location where we don't have to walk on eggshells. What do y'all think? Would gNumber or ServerGraph be willing to host meetings again? Any other location suggestions? - Ian. -- "A shark on whiskey is mighty risky. A shark on beer is a beer engineer." -- Dr. Worm From dbii at interaction.net Wed Oct 4 12:08:08 2006 From: dbii at interaction.net (David Bluestein II) Date: Wed, 4 Oct 2006 14:08:08 -0500 Subject: APM: Location, location, location In-Reply-To: <20061004190152.GA27269@localhost> References: <20061004190152.GA27269@localhost> Message-ID: <036282d9f7adbcb70f932b4fa6bf3307@interaction.net> Downside to gNumber/Servergraph is locked front door, and needing someone to monitor it. That's disappointing about ARL, weird too. Are you thinking we'll still meet there next week though? David On Oct 4, 2006, at 2:01 PM, Ian Remmler wrote: > Hi, > > It appears that ARL is getting much stricter about outside > groups meeting here. According to a notice on the CACTUS > officer list, ARL will no longer provide projectors or other > resources to external groups. I'm not sure what all that > entails. They pretty much have to do it, though, to be > compliant with certain rules. > > Although they will still let us meet, I get the feeling that ARL > is a bit edgy about doing so. I'm wondering if it might just be > easier to find a different location where we don't have to walk > on eggshells. > > What do y'all think? Would gNumber or ServerGraph be willing to > host meetings again? Any other location suggestions? > > - Ian. > > -- > "A shark on whiskey is mighty risky. > A shark on beer is a beer engineer." > -- Dr. Worm > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin > ----------------------------------------------------------------------- David H. Bluestein II President & Lead Developer dbii at interaction.net ii, inc. http://www.interaction.net -- Specializing in Interactive, Database Driven Websites -- From parkerm at pobox.com Wed Oct 4 12:16:35 2006 From: parkerm at pobox.com (Michael Parker) Date: Wed, 04 Oct 2006 12:16:35 -0700 Subject: APM: ApacheCon US 2006 -- Austin, Texas Message-ID: <45240893.8020702@pobox.com> Howdy, For those who aren't aware, ApacheCon (http://www.us.apachecon.com/) is being held in Austin this year. Oct 9th - 13th. I'm going to be giving a couple of SpamAssassin related talks if anyone is interested. I hear that there is an Austin Geek discount: http://geekaustin.org/article.pl?sid=06/09/19/1749248&mode=thread There are only a few Apache projects that are perl related (mod_perl and SpamAssassin being the main ones) but if you're interested in interacting with other open source folks then that is the place. Michael From ian at remmler.org Wed Oct 4 12:31:10 2006 From: ian at remmler.org (Ian Remmler) Date: Wed, 4 Oct 2006 14:31:10 -0500 Subject: APM: Location, location, location In-Reply-To: <036282d9f7adbcb70f932b4fa6bf3307@interaction.net> References: <20061004190152.GA27269@localhost> <036282d9f7adbcb70f932b4fa6bf3307@interaction.net> Message-ID: <20061004193110.GA27374@localhost> On Wed, Oct 04, 2006 at 02:08:08PM -0500, David Bluestein II wrote: > Downside to gNumber/Servergraph is locked front door, and needing > someone to monitor it. Well, I think ARL will also require me to escort people to the restroom now, so there will be annoyances either way. And someone will need to bring a projector, etc. > That's disappointing about ARL, weird too. Are you thinking we'll still > meet there next week though? It's because they are technically supposed to charge for external groups to use the facilities, unless it is for state business. They've really been a bit too lax about it until now. If we want to keep meeting there, I need to justify in writing how our meetings are benificial to the state. And since I'm the only person from ARL who goes to the meetings, it's a bit of a hard sell. :) That's why I'm hesitant to continue meeting there; I don't want to put ARL on a slippery slope. If we end up moving, it would be easier to go ahead and do it this month so I don't have to generate red tape for just one meeting. I do like hosting at ARL, but I'm just not sure if it's worth it with the new restrictions. It is a sucky situation. - Ian. -- "A shark on whiskey is mighty risky. A shark on beer is a beer engineer." -- Dr. Worm From dbii at interaction.net Wed Oct 4 12:46:25 2006 From: dbii at interaction.net (David Bluestein II) Date: Wed, 4 Oct 2006 14:46:25 -0500 Subject: APM: Location, location, location In-Reply-To: <20061004193110.GA27374@localhost> References: <20061004190152.GA27269@localhost> <036282d9f7adbcb70f932b4fa6bf3307@interaction.net> <20061004193110.GA27374@localhost> Message-ID: Ahhh, I see. I live in the state and going to meetings makes me happy. Do I need to fax you a memo stating that? :) Guess we need to shop around this week so we're ready for next week. David On Oct 4, 2006, at 2:31 PM, Ian Remmler wrote: > On Wed, Oct 04, 2006 at 02:08:08PM -0500, David Bluestein II wrote: >> Downside to gNumber/Servergraph is locked front door, and needing >> someone to monitor it. > > Well, I think ARL will also require me to escort people to the > restroom now, so there will be annoyances either way. And > someone will need to bring a projector, etc. > >> That's disappointing about ARL, weird too. Are you thinking we'll >> still >> meet there next week though? > > It's because they are technically supposed to charge for > external groups to use the facilities, unless it is for state > business. They've really been a bit too lax about it until now. > If we want to keep meeting there, I need to justify in writing > how our meetings are benificial to the state. And since I'm the > only person from ARL who goes to the meetings, it's a bit of a > hard sell. :) That's why I'm hesitant to continue meeting > there; I don't want to put ARL on a slippery slope. > > If we end up moving, it would be easier to go ahead and do it > this month so I don't have to generate red tape for just one > meeting. I do like hosting at ARL, but I'm just not sure if > it's worth it with the new restrictions. It is a sucky > situation. > > - Ian. > > -- > "A shark on whiskey is mighty risky. > A shark on beer is a beer engineer." > -- Dr. Worm > ----------------------------------------------------------------------- David H. Bluestein II President & Lead Developer dbii at interaction.net ii, inc. http://www.interaction.net -- Specializing in Interactive, Database Driven Websites -- From wwalker at bybent.com Wed Oct 4 12:55:32 2006 From: wwalker at bybent.com (Wayne Walker) Date: Wed, 4 Oct 2006 14:55:32 -0500 Subject: APM: Location, location, location In-Reply-To: <20061004190152.GA27269@localhost> References: <20061004190152.GA27269@localhost> Message-ID: <20061004195532.GA16019@bybent.com> I can host this month's meeting if we don't find anything else. But if they are putting pressure on ARL then the same rules probably apply to me but I can push back longer as I'm already an external entity in a UT bldg. Wayne On Wed, Oct 04, 2006 at 02:01:52PM -0500, Ian Remmler wrote: > Hi, > > It appears that ARL is getting much stricter about outside > groups meeting here. According to a notice on the CACTUS > officer list, ARL will no longer provide projectors or other > resources to external groups. I'm not sure what all that > entails. They pretty much have to do it, though, to be > compliant with certain rules. > > Although they will still let us meet, I get the feeling that ARL > is a bit edgy about doing so. I'm wondering if it might just be > easier to find a different location where we don't have to walk > on eggshells. > > What do y'all think? Would gNumber or ServerGraph be willing to > host meetings again? Any other location suggestions? > > - Ian. > > -- > "A shark on whiskey is mighty risky. > A shark on beer is a beer engineer." > -- Dr. Worm > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker www.unwiredbuyer.com - when you just can't be by the computer wwalker at bybent.com Do you use Linux?! http://www.bybent.com Get Counted! http://counter.li.org/ Perl - http://www.perl.org/ Perl User Groups - http://www.pm.org/ Jabber: wwalker at jabber.gnumber.com AIM: lwwalkerbybent IRC: wwalker on freenode.net From mark at marklehmann.com Wed Oct 4 13:39:52 2006 From: mark at marklehmann.com (Mark Lehmann) Date: Wed, 4 Oct 2006 15:39:52 -0500 (CDT) Subject: APM: Location, location, location In-Reply-To: <20061004195532.GA16019@bybent.com> References: <20061004190152.GA27269@localhost> <20061004195532.GA16019@bybent.com> Message-ID: <61334.137.134.216.5.1159994392.squirrel@lehmbrain.net> I'll ask Servergraph about it. They actually went to lengths to setup a network for us last year. I'll see what I can do. -- Mark Lehmann On Wed, October 4, 2006 14:55, Wayne Walker wrote: > I can host this month's meeting if we don't find anything else. > > But if they are putting pressure on ARL then the same rules probably > apply to me but I can push back longer as I'm already an external entity > in a UT bldg. > > Wayne > > On Wed, Oct 04, 2006 at 02:01:52PM -0500, Ian Remmler wrote: >> Hi, >> >> It appears that ARL is getting much stricter about outside >> groups meeting here. According to a notice on the CACTUS >> officer list, ARL will no longer provide projectors or other >> resources to external groups. I'm not sure what all that >> entails. They pretty much have to do it, though, to be >> compliant with certain rules. >> >> Although they will still let us meet, I get the feeling that ARL >> is a bit edgy about doing so. I'm wondering if it might just be >> easier to find a different location where we don't have to walk >> on eggshells. >> >> What do y'all think? Would gNumber or ServerGraph be willing to >> host meetings again? Any other location suggestions? >> >> - Ian. >> >> -- >> "A shark on whiskey is mighty risky. >> A shark on beer is a beer engineer." >> -- Dr. Worm >> _______________________________________________ >> Austin mailing list >> Austin at pm.org >> http://mail.pm.org/mailman/listinfo/austin > > -- > > Wayne Walker > > www.unwiredbuyer.com - when you just can't be by the computer > > wwalker at bybent.com Do you use Linux?! > http://www.bybent.com Get Counted! http://counter.li.org/ > Perl - http://www.perl.org/ Perl User Groups - > http://www.pm.org/ > Jabber: wwalker at jabber.gnumber.com AIM: lwwalkerbybent > IRC: wwalker on freenode.net > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin > From michalk at awpi.com Wed Oct 4 14:24:23 2006 From: michalk at awpi.com (michalk) Date: Wed, 04 Oct 2006 16:24:23 -0500 Subject: APM: Location, location, location In-Reply-To: <20061004195532.GA16019@bybent.com> References: <20061004190152.GA27269@localhost> <20061004195532.GA16019@bybent.com> Message-ID: <45242687.3080104@awpi.com> What about a pizza place? My workgroup used to go to a Gatti's on MOPAC near Parmer. They had a meeting room big enough for twenty or so people. Buy some Pizza, the room might be free. I don't know if they have internet access. Wayne Walker wrote: > I can host this month's meeting if we don't find anything else. > > But if they are putting pressure on ARL then the same rules probably > apply to me but I can push back longer as I'm already an external entity > in a UT bldg. > > Wayne > > On Wed, Oct 04, 2006 at 02:01:52PM -0500, Ian Remmler wrote: > >>Hi, >> >>It appears that ARL is getting much stricter about outside >>groups meeting here. According to a notice on the CACTUS >>officer list, ARL will no longer provide projectors or other >>resources to external groups. I'm not sure what all that >>entails. They pretty much have to do it, though, to be >>compliant with certain rules. >> >>Although they will still let us meet, I get the feeling that ARL >>is a bit edgy about doing so. I'm wondering if it might just be >>easier to find a different location where we don't have to walk >>on eggshells. >> >>What do y'all think? Would gNumber or ServerGraph be willing to >>host meetings again? Any other location suggestions? >> >> - Ian. >> >>-- >>"A shark on whiskey is mighty risky. >> A shark on beer is a beer engineer." >> -- Dr. Worm >>_______________________________________________ >>Austin mailing list >>Austin at pm.org >>http://mail.pm.org/mailman/listinfo/austin > > From jchristy1 at austin.rr.com Thu Oct 5 14:17:17 2006 From: jchristy1 at austin.rr.com (jchristy1) Date: Thu, 05 Oct 2006 16:17:17 -0500 Subject: APM: Location, location, location In-Reply-To: <20061004193110.GA27374@localhost> References: <20061004190152.GA27269@localhost> <036282d9f7adbcb70f932b4fa6bf3307@interaction.net> <20061004193110.GA27374@localhost> Message-ID: <4525765D.6060302@austin.rr.com> I like the ARL meeting place. It is quiet, centrally located, secure and clean. Maybe a simple justification to the state would work...? It could be beneficial to the State to encourage sharing of technical information among a pool of IT professionals that might someday be called on to provide for IT staffing requirements. Ian Remmler wrote: > On Wed, Oct 04, 2006 at 02:08:08PM -0500, David Bluestein II wrote: >> Downside to gNumber/Servergraph is locked front door, and needing >> someone to monitor it. > > Well, I think ARL will also require me to escort people to the > restroom now, so there will be annoyances either way. And > someone will need to bring a projector, etc. > >> That's disappointing about ARL, weird too. Are you thinking we'll still >> meet there next week though? > > It's because they are technically supposed to charge for > external groups to use the facilities, unless it is for state > business. They've really been a bit too lax about it until now. > If we want to keep meeting there, I need to justify in writing > how our meetings are benificial to the state. And since I'm the > only person from ARL who goes to the meetings, it's a bit of a > hard sell. :) That's why I'm hesitant to continue meeting > there; I don't want to put ARL on a slippery slope. > > If we end up moving, it would be easier to go ahead and do it > this month so I don't have to generate red tape for just one > meeting. I do like hosting at ARL, but I'm just not sure if > it's worth it with the new restrictions. It is a sucky > situation. > > - Ian. > From ian at remmler.org Tue Oct 10 17:01:55 2006 From: ian at remmler.org (Ian Remmler) Date: Tue, 10 Oct 2006 19:01:55 -0500 Subject: APM: Meeting tomorrow Message-ID: <20061011000154.GA23022@localhost> Hi, The October meeting will be tomorrow night at 7:00 PM at the office of gNumber (where Wayne works). David Bluestein will talk about HTML::Template and show how he uses it in some projects. If you ordered a tee shirt, they are in, and you can pick it up at the meeting. Thanks to Wayne for hosting the meeting at gNumber on short notice. gNumber's office is in the MCC building at 3925 W. Braker Ln., which is at the southwest corner of MoPac and Braker. Call Wayne's cell (633-8076) from your cell, or dial 9-633-8076 from the phone by the back door (gray box to the right on the wall center of the north side of the building). There are detailed directions at http://www.ctlug.org/directions_to_gnumber.html. Let's do dinner at 5:45 at Pok-E-Jo's since we did Double Dave's last time. If anyone ever wants to eat somewhere else, feel free to post a suggestion to the list. See you at the meeting, - Ian. -- "A shark on whiskey is mighty risky. A shark on beer is a beer engineer." -- Dr. Worm From ian at remmler.org Wed Oct 11 12:14:38 2006 From: ian at remmler.org (Ian Remmler) Date: Wed, 11 Oct 2006 14:14:38 -0500 Subject: APM: Meeting tomorrow (October *11th*) In-Reply-To: <20061011000154.GA23022@localhost> References: <20061011000154.GA23022@localhost> Message-ID: <20061011191438.GB26054@localhost> On Tue, Oct 10, 2006 at 07:01:55PM -0500, Ian Remmler wrote: > The October meeting will be tomorrow night at 7:00 PM at the > office of gNumber (where Wayne works). David Bluestein will > talk about HTML::Template and show how he uses it in some > projects. Sam noticed that the web page said Wednesday, October 12th. That should of course be the 11th, as the page now correctly states. - Ian. -- "A shark on whiskey is mighty risky. A shark on beer is a beer engineer." -- Dr. Worm From tmcd at panix.com Wed Oct 11 14:52:14 2006 From: tmcd at panix.com (Tim McDaniel) Date: Wed, 11 Oct 2006 16:52:14 -0500 (CDT) Subject: APM: Meeting tomorrow In-Reply-To: <20061011000154.GA23022@localhost> References: <20061011000154.GA23022@localhost> Message-ID: On Tue, 10 Oct 2006, Ian Remmler wrote: > Let's do dinner at 5:45 at Pok-E-Jo's It's been a while for me: north of Great Hills across from the Arboretum, right? (As opposed to on Parmer, a little further away.) -- Tim McDaniel, tmcd at panix.com From wwalker at bybent.com Wed Oct 11 15:01:09 2006 From: wwalker at bybent.com (Wayne Walker) Date: Wed, 11 Oct 2006 17:01:09 -0500 Subject: APM: Meeting tomorrow In-Reply-To: References: <20061011000154.GA23022@localhost> Message-ID: <20061011220109.GH4128@bybent.com> Yes On Wed, Oct 11, 2006 at 04:52:14PM -0500, Tim McDaniel wrote: > On Tue, 10 Oct 2006, Ian Remmler wrote: > > Let's do dinner at 5:45 at Pok-E-Jo's > > It's been a while for me: north of Great Hills across from the > Arboretum, right? (As opposed to on Parmer, a little further away.) > > > -- > Tim McDaniel, tmcd at panix.com > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker www.unwiredbuyer.com - when you just can't be by the computer wwalker at bybent.com Do you use Linux?! http://www.bybent.com Get Counted! http://counter.li.org/ Perl - http://www.perl.org/ Perl User Groups - http://www.pm.org/ Jabber: wwalker at jabber.gnumber.com AIM: lwwalkerbybent IRC: wwalker on freenode.net From mdknauss at yahoo.com Thu Oct 12 09:03:01 2006 From: mdknauss at yahoo.com (Martie Knauss) Date: Thu, 12 Oct 2006 09:03:01 -0700 (PDT) Subject: APM: PERL dbase connect to Teradata Message-ID: <20061012160301.91443.qmail@web51007.mail.yahoo.com> All, I'm new to dbase connections and need a little help. I'm wondering if anyone has had any success connecting to a Teradata dbase on a LINUX (uname -a Linux any.old.net 2.6.15-1.2054_FC5smp #1 SMP Tue Mar 14 16:05:46 EST 2006 i686 i686 i386 GNU/Linux). I've used cpan to pull down ODBC::Teradata and install without issue. However, when I try to connect the script dies with no error message. I've been working on this for a couple of days and have tried several things (even reading the README, carefully!). I'd be glad to share my experiences so far but, even happier to find a solution. Thanks in advance. Martie __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From montgomery.conner at gmail.com Thu Oct 12 20:49:32 2006 From: montgomery.conner at gmail.com (Montgomery Conner) Date: Thu, 12 Oct 2006 22:49:32 -0500 Subject: APM: PERL dbase connect to Teradata In-Reply-To: <20061012160301.91443.qmail@web51007.mail.yahoo.com> References: <20061012160301.91443.qmail@web51007.mail.yahoo.com> Message-ID: I'll preface my comments by admitting that I know nothing about Teradata DBs in particular... but why not do it the perly way and use Perl's database independent module (DBI) with an appropriate driver? Here's a links to the DBD::Teradata driver homepage: http://www.presicient.com/tdatdbd/ And here's a link to the module doumentation on CPAN: http://search.cpan.org/~darnold/DBD-Teradata-1.20/Teradata.pm "The DBI is the standard database interface module for Perl. It defines a set of methods, variables and conventions that provide a consistent database interface independent of the actual database being used." -- Tim Bunce More information on DBI, or to join a mail-list to discuss issues ( dbi-users at perl.org ), can be found here: http://dbi.perl.org Good Luck! mc On 10/12/06, Martie Knauss wrote: > > All, > I'm new to dbase connections and need a little help. > I'm wondering if anyone has had any success connecting > to a Teradata dbase on a LINUX (uname -a Linux > any.old.net 2.6.15-1.2054_FC5smp #1 SMP Tue Mar 14 > 16:05:46 EST 2006 i686 i686 i386 GNU/Linux). I've > used cpan to pull down ODBC::Teradata and install > without issue. However, when I try to connect the > script dies with no error message. I've been working > on this for a couple of days and have tried several > things (even reading the README, carefully!). I'd be > glad to share my experiences so far but, even happier > to find a solution. Thanks in advance. > > Martie > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061012/d4022cfe/attachment.html From CaptNemo at Austin.rr.com Tue Oct 17 13:01:44 2006 From: CaptNemo at Austin.rr.com (CaptNemo) Date: Tue, 17 Oct 2006 15:01:44 -0500 Subject: APM: Running a perl prog from a perl prog? In-Reply-To: <20061011220109.GH4128@bybent.com> References: <20061011000154.GA23022@localhost> <20061011220109.GH4128@bybent.com> Message-ID: <6.1.2.0.2.20061017145550.021cd3d8@pop-server.austin.rr.com> I want to write some perl programs to do various jobs... 1) Access a database and return a query 2) Access a database and insert data 3) Access a database and delete data 4) Access two databased (linked) and return a query I'd like to be able to run these programs from another perl program. MEANING: A perl/CGI master program that runs the applicable perl/database program and get the returned data (if any) for web display. These aren't subroutines... They are not threads... What's this called so I can look up how to do it? Any suggestion on the perl command to run another perl program? From CaptNemo at Austin.rr.com Tue Oct 17 14:51:42 2006 From: CaptNemo at Austin.rr.com (CaptNemo) Date: Tue, 17 Oct 2006 16:51:42 -0500 Subject: APM: Next dumb Q: IF NULL???? Message-ID: <6.1.2.0.2.20061017164651.0204a2e0@pop-server.austin.rr.com> Why is it so hard to check for null values in perl!?!?! Two situations: 1) checking is a variable is empty: IF ($product eq "")... IF ($product <> "")... IF ($product ne "")... IF ($product != "")... IF ($product eq NULL)... IF ($product <> NULL)... IF ($product ne NULL)... IF ($product != NULL)... 2) checking to see if command line args were present: IF ($ARGV[0] eq "")... IF ($ARGV[0] <> "")... IF ($ARGV[0] ne "")... IF ($ARGV[0] != "")... IF ($ARGV[0] eq NULL)... IF ($ARGV[0] <> NULL)... IF ($ARGV[0] ne NULL)... IF ($ARGV[0] != NULL)... ...none seem to work. HOW do you check for NULL values!?!? From havoc at boldo.com Tue Oct 17 14:56:25 2006 From: havoc at boldo.com (Pat Ludwig) Date: Tue, 17 Oct 2006 16:56:25 -0500 Subject: APM: Next dumb Q: IF NULL???? In-Reply-To: <6.1.2.0.2.20061017164651.0204a2e0@pop-server.austin.rr.com> References: <6.1.2.0.2.20061017164651.0204a2e0@pop-server.austin.rr.com> Message-ID: <1fe8332f0610171456q206784dw420eb52514ee6ab0@mail.gmail.com> 'defined' would be the keyword you are looking for.... if (defined $product) ... if (defined $ARGV[0]) ... On 10/17/06, CaptNemo wrote: > > Why is it so hard to check for null values in perl!?!?! > > > Two situations: > > > 1) checking is a variable is empty: > > IF ($product eq "")... > IF ($product <> "")... > IF ($product ne "")... > IF ($product != "")... > IF ($product eq NULL)... > IF ($product <> NULL)... > IF ($product ne NULL)... > IF ($product != NULL)... > > > 2) checking to see if command line args were present: > > IF ($ARGV[0] eq "")... > IF ($ARGV[0] <> "")... > IF ($ARGV[0] ne "")... > IF ($ARGV[0] != "")... > IF ($ARGV[0] eq NULL)... > IF ($ARGV[0] <> NULL)... > IF ($ARGV[0] ne NULL)... > IF ($ARGV[0] != NULL)... > > ...none seem to work. HOW do you check for NULL values!?!? > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin > -- Pat Ludwig AIM: HaVoCPaT "Whoever fights monsters should see to it that in the process he does not become a monster. And when you look long into an abyss, the abyss also looks into you." Friedrich Nietzsche, Beyond Good and Evil 89 (Walter Kaufmann trans., Vintage Books 1966) (1886). -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061017/8d72841a/attachment.html From dean.brockhausen at gmail.com Tue Oct 17 15:07:19 2006 From: dean.brockhausen at gmail.com (Dean Brockhausen) Date: Tue, 17 Oct 2006 17:07:19 -0500 Subject: APM: Next dumb Q: IF NULL???? In-Reply-To: <1fe8332f0610171456q206784dw420eb52514ee6ab0@mail.gmail.com> References: <6.1.2.0.2.20061017164651.0204a2e0@pop-server.austin.rr.com> <1fe8332f0610171456q206784dw420eb52514ee6ab0@mail.gmail.com> Message-ID: <15fba1780610171507h2d2ec9c9m1b40c3cad16b3ab3@mail.gmail.com> On the same note if you are not familar with getopt you should look at http://search.cpan.org/~nwclark/perl-5.8.8/lib/Getopt/Std.pm as it will simplify command line argument processing a great deal. Dean On 10/17/06, Pat Ludwig wrote: > 'defined' would be the keyword you are looking for.... > > if (defined $product) ... > if (defined $ARGV[0]) ... > > > On 10/17/06, CaptNemo < CaptNemo at austin.rr.com> wrote: > > Why is it so hard to check for null values in perl!?!?! > > > > > > Two situations: > > > > > > 1) checking is a variable is empty: > > > > IF ($product eq "")... > > IF ($product <> "")... > > IF ($product ne "")... > > IF ($product != "")... > > IF ($product eq NULL)... > > IF ($product <> NULL)... > > IF ($product ne NULL)... > > IF ($product != NULL)... > > > > > > 2) checking to see if command line args were present: > > > > IF ($ARGV[0] eq "")... > > IF ($ARGV[0] <> "")... > > IF ($ARGV[0] ne "")... > > IF ($ARGV[0] != "")... > > IF ($ARGV[0] eq NULL)... > > IF ($ARGV[0] <> NULL)... > > IF ($ARGV[0] ne NULL)... > > IF ($ARGV[0] != NULL)... > > > > ...none seem to work. HOW do you check for NULL values!?!? > > > > _______________________________________________ > > Austin mailing list > > Austin at pm.org > > http://mail.pm.org/mailman/listinfo/austin > > > > > > -- > Pat Ludwig < havoc at boldo.com> > AIM: HaVoCPaT > > "Whoever fights monsters should see to it that in the process he does not > become a monster. And when you look long into an abyss, the abyss also looks > into you." > Friedrich Nietzsche, Beyond Good and Evil 89 (Walter Kaufmann > trans., Vintage Books 1966) (1886). > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin > > From CaptNemo at Austin.rr.com Tue Oct 17 15:51:00 2006 From: CaptNemo at Austin.rr.com (CaptNemo) Date: Tue, 17 Oct 2006 17:51:00 -0500 Subject: APM: Next dumb Q: IF NULL???? Message-ID: <6.1.2.0.2.20061017175054.0274c000@pop-server.austin.rr.com> Couldn't get if (defined $ARGV[0]) to work... ...but, if ($#ARGV >=5) works great! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061017/4c418c4a/attachment.html From michalk at awpi.com Tue Oct 17 16:04:06 2006 From: michalk at awpi.com (michalk) Date: Tue, 17 Oct 2006 18:04:06 -0500 Subject: APM: Running a perl prog from a perl prog? In-Reply-To: <6.1.2.0.2.20061017145550.021cd3d8@pop-server.austin.rr.com> References: <20061011000154.GA23022@localhost> <20061011220109.GH4128@bybent.com> <6.1.2.0.2.20061017145550.021cd3d8@pop-server.austin.rr.com> Message-ID: <45356166.2080005@awpi.com> exec or system $variable = `otherprogram.pl`; also does the trick. Note the backticks. This will kill peformance though. Perl has a lot of initializing to do each time you call it. CaptNemo wrote: > I want to write some perl programs to do various jobs... > > 1) Access a database and return a query > 2) Access a database and insert data > 3) Access a database and delete data > 4) Access two databased (linked) and return a query > > I'd like to be able to run these programs from another perl program. > > MEANING: A perl/CGI master program that runs the applicable perl/database > program and get the returned data (if any) for web display. > > > These aren't subroutines... They are not threads... What's this called so > I can look up how to do it? > > > > Any suggestion on the perl command to run another perl program? > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin From CaptNemo at Austin.rr.com Tue Oct 17 16:26:24 2006 From: CaptNemo at Austin.rr.com (CaptNemo) Date: Tue, 17 Oct 2006 18:26:24 -0500 Subject: APM: Running a perl prog from a perl prog? In-Reply-To: References: <20061011000154.GA23022@localhost> <20061011220109.GH4128@bybent.com> <6.1.2.0.2.20061017145550.021cd3d8@pop-server.austin.rr.com> Message-ID: <6.1.2.0.2.20061017181944.027e0da8@pop-server.austin.rr.com> What I'm trying to do is write a web prog so that people can search a database and easily pull the info. I HATE dealing with DBI so I wanted to make the database stuff modular. I want the main prog to handle the cgi stuff and call smaller progs to do the database stuff. That way I can re-use the modules to make more progs. HERE'S MY FIRST MODULE: dbquery.pl -------------------------------------------------------------------------------- #!/usr/bin/perl -wT use DBI; use strict; my $dbdriver = $ARGV[0]; my $db = $ARGV[1]; my $dbuser = $ARGV[2]; my $dbpasswd = $ARGV[3]; my $dbtable = $ARGV[4]; my $condition = $ARGV[5]; my @row_array; if ( $#ARGV ==5 ) { my $dbh = DBI->connect( "DBI:$dbdriver:$db",$dbuser,$dbpasswd,) || die "Database connection not made: $DBI::errstr"; my $sth = $dbh->prepare("SELECT * FROM $dbtable WHERE $condition") or die $dbh->errstr; $sth->execute() or die $dbh->errstr; while (my @row_array = $sth->fetchrow_array) { print "$row_array[0], $row_array[1], $row_array[2] \n"; } $dbh->disconnect(); } elsif ( $#ARGV <= 4 ) { print "\n-----------------------------ERROR------------------------------\n"; print "NOT ENOUGH ARGUMENTS\n"; print "dbquery.pl usage: dbquery.pl DBDRIVER DB DBUSER DBPASSWORD DBTABLE \"CONDITION\"\n"; print "NOTE: DBDIVER is usually \"mysql\" but it can be other things like \"oracle\".\n"; print " EXAMPLE: dbquery.pl mysql databas...\n"; print "NOTE: The total CONDITION must be in quotes with the matching data in single quotes. \n"; print " EXAMPLE: \"product LIKE 'bicycle'\"\n"; print "---------------------------END ERROR----------------------------\n\n"; } else { print "\n-----------------------------ERROR------------------------------\n"; print "TOO MANY ARGUMENTS\n"; print "dbquery.pl usage: dbquery.pl DBDRIVER DB DBUSER DBPASSWORD DBTABLE \"CONDITION\"\n"; print "NOTE: DBDIVER is usually \"mysql\" but it can be other things like \"oracle\".\n"; print " EXAMPLE: dbquery.pl mysql databas...\n"; print "NOTE: The total CONDITION must be in quotes with the matching data in single quotes. \n"; print " EXAMPLE: \"product LIKE 'bicycle'\"\n"; print "---------------------------END ERROR----------------------------\n\n"; } It queries a database and returns the first 3 records of matches. From wwalker at bybent.com Tue Oct 17 16:57:21 2006 From: wwalker at bybent.com (Wayne Walker) Date: Tue, 17 Oct 2006 18:57:21 -0500 Subject: APM: Next dumb Q: IF NULL???? In-Reply-To: <6.1.2.0.2.20061017164651.0204a2e0@pop-server.austin.rr.com> References: <6.1.2.0.2.20061017164651.0204a2e0@pop-server.austin.rr.com> Message-ID: <20061017235720.GA2791@bybent.com> if is lower case. if ( (! defined $product) || ($product == undef)) On Tue, Oct 17, 2006 at 04:51:42PM -0500, CaptNemo wrote: > Why is it so hard to check for null values in perl!?!?! > > > Two situations: > > > 1) checking is a variable is empty: > > IF ($product eq "")... > IF ($product <> "")... > IF ($product ne "")... > IF ($product != "")... > IF ($product eq NULL)... > IF ($product <> NULL)... > IF ($product ne NULL)... > IF ($product != NULL)... > > > 2) checking to see if command line args were present: > > IF ($ARGV[0] eq "")... > IF ($ARGV[0] <> "")... > IF ($ARGV[0] ne "")... > IF ($ARGV[0] != "")... > IF ($ARGV[0] eq NULL)... > IF ($ARGV[0] <> NULL)... > IF ($ARGV[0] ne NULL)... > IF ($ARGV[0] != NULL)... > > ...none seem to work. HOW do you check for NULL values!?!? > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker www.unwiredbuyer.com - when you just can't be by the computer wwalker at bybent.com Do you use Linux?! http://www.bybent.com Get Counted! http://counter.li.org/ Perl - http://www.perl.org/ Perl User Groups - http://www.pm.org/ Jabber: wwalker at jabber.gnumber.com AIM: lwwalkerbybent IRC: wwalker on freenode.net From wwalker at bybent.com Tue Oct 17 17:14:14 2006 From: wwalker at bybent.com (Wayne Walker) Date: Tue, 17 Oct 2006 19:14:14 -0500 Subject: APM: Running a perl prog from a perl prog? In-Reply-To: <6.1.2.0.2.20061017181944.027e0da8@pop-server.austin.rr.com> References: <20061011000154.GA23022@localhost> <20061011220109.GH4128@bybent.com> <6.1.2.0.2.20061017145550.021cd3d8@pop-server.austin.rr.com> <6.1.2.0.2.20061017181944.027e0da8@pop-server.austin.rr.com> Message-ID: <20061018001414.GB2791@bybent.com> http://www.bybent.com/cn.tar.gz contains 3 files. Yours, a slightly revised version of yours, and a more revised version of yours. I think they will simplify your use of DBI and perl. Wayne (Also attaching to here, but not sure if the list allows attachments. On Tue, Oct 17, 2006 at 06:26:24PM -0500, CaptNemo wrote: > What I'm trying to do is write a web prog so that people can search a > database and easily pull the info. > > I HATE dealing with DBI so I wanted to make the database stuff modular. I > want the main prog to handle the cgi stuff and call smaller progs to do the > database stuff. That way I can re-use the modules to make more progs. > > HERE'S MY FIRST MODULE: > > dbquery.pl > -------------------------------------------------------------------------------- > #!/usr/bin/perl -wT > use DBI; > use strict; > > my $dbdriver = $ARGV[0]; > my $db = $ARGV[1]; > my $dbuser = $ARGV[2]; > my $dbpasswd = $ARGV[3]; > my $dbtable = $ARGV[4]; > my $condition = $ARGV[5]; > > my @row_array; > > if ( $#ARGV ==5 ) { > > my $dbh = DBI->connect( "DBI:$dbdriver:$db",$dbuser,$dbpasswd,) > || die "Database connection not made: $DBI::errstr"; > > my $sth = $dbh->prepare("SELECT * FROM $dbtable WHERE $condition") > or die $dbh->errstr; > $sth->execute() or die $dbh->errstr; > > while (my @row_array = $sth->fetchrow_array) { > print "$row_array[0], $row_array[1], $row_array[2] \n"; > } > $dbh->disconnect(); > } > elsif ( $#ARGV <= 4 ) { > print "\n-----------------------------ERROR------------------------------\n"; > print "NOT ENOUGH ARGUMENTS\n"; > print "dbquery.pl usage: dbquery.pl DBDRIVER DB DBUSER DBPASSWORD DBTABLE > \"CONDITION\"\n"; > print "NOTE: DBDIVER is usually \"mysql\" but it can be other things like > \"oracle\".\n"; > print " EXAMPLE: dbquery.pl mysql databas...\n"; > print "NOTE: The total CONDITION must be in quotes with the matching data > in single quotes. \n"; > print " EXAMPLE: \"product LIKE 'bicycle'\"\n"; > print "---------------------------END ERROR----------------------------\n\n"; > } > else { > print "\n-----------------------------ERROR------------------------------\n"; > print "TOO MANY ARGUMENTS\n"; > print "dbquery.pl usage: dbquery.pl DBDRIVER DB DBUSER DBPASSWORD DBTABLE > \"CONDITION\"\n"; > print "NOTE: DBDIVER is usually \"mysql\" but it can be other things like > \"oracle\".\n"; > print " EXAMPLE: dbquery.pl mysql databas...\n"; > print "NOTE: The total CONDITION must be in quotes with the matching data > in single quotes. \n"; > print " EXAMPLE: \"product LIKE 'bicycle'\"\n"; > print "---------------------------END ERROR----------------------------\n\n"; > } > > > It queries a database and returns the first 3 records of matches. > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker www.unwiredbuyer.com - when you just can't be by the computer wwalker at bybent.com Do you use Linux?! http://www.bybent.com Get Counted! http://counter.li.org/ Perl - http://www.perl.org/ Perl User Groups - http://www.pm.org/ Jabber: wwalker at jabber.gnumber.com AIM: lwwalkerbybent IRC: wwalker on freenode.net -------------- next part -------------- A non-text attachment was scrubbed... Name: cn.tar.gz Type: application/x-tar-gz Size: 1083 bytes Desc: not available Url : http://mail.pm.org/pipermail/austin/attachments/20061017/2b0c010f/attachment.bin From brentlavelle at yahoo.com Tue Oct 17 19:06:36 2006 From: brentlavelle at yahoo.com (Brent LaVelle) Date: Tue, 17 Oct 2006 19:06:36 -0700 (PDT) Subject: APM: Running a perl prog from a perl prog? Message-ID: <20061018020636.19911.qmail@web32503.mail.mud.yahoo.com> Not using DBI is generally a bad idea. Look at Mason, you can content wrap files with sql in them and the wrappers will execute the sql and format the results. Look at http://www.masonbook.com/book/chapter-5.mhtml and search for "An Advanced Inheritance Example" I left the world of Perl/CGI for SW test before I even used Mason for a real project so I cannot endorse it but it may be what you are looking for. I was sold on content wrapping after reading the O'Reilly book on Mason. ----- Original Message ---- From: CaptNemo To: austin at pm.org Sent: Tuesday, October 17, 2006 6:26:24 PM Subject: Re: APM: Running a perl prog from a perl prog? What I'm trying to do is write a web prog so that people can search a database and easily pull the info. I HATE dealing with DBI so I wanted to make the database stuff modular. I want the main prog to handle the cgi stuff and call smaller progs to do the database stuff. That way I can re-use the modules to make more progs. HERE'S MY FIRST MODULE: dbquery.pl -------------------------------------------------------------------------------- #!/usr/bin/perl -wT use DBI; use strict; my $dbdriver = $ARGV[0]; my $db = $ARGV[1]; my $dbuser = $ARGV[2]; my $dbpasswd = $ARGV[3]; my $dbtable = $ARGV[4]; my $condition = $ARGV[5]; my @row_array; if ( $#ARGV ==5 ) { my $dbh = DBI->connect( "DBI:$dbdriver:$db",$dbuser,$dbpasswd,) || die "Database connection not made: $DBI::errstr"; my $sth = $dbh->prepare("SELECT * FROM $dbtable WHERE $condition") or die $dbh->errstr; $sth->execute() or die $dbh->errstr; while (my @row_array = $sth->fetchrow_array) { print "$row_array[0], $row_array[1], $row_array[2] \n"; } $dbh->disconnect(); } elsif ( $#ARGV <= 4 ) { print "\n-----------------------------ERROR------------------------------\n"; print "NOT ENOUGH ARGUMENTS\n"; print "dbquery.pl usage: dbquery.pl DBDRIVER DB DBUSER DBPASSWORD DBTABLE \"CONDITION\"\n"; print "NOTE: DBDIVER is usually \"mysql\" but it can be other things like \"oracle\".\n"; print " EXAMPLE: dbquery.pl mysql databas...\n"; print "NOTE: The total CONDITION must be in quotes with the matching data in single quotes. \n"; print " EXAMPLE: \"product LIKE 'bicycle'\"\n"; print "---------------------------END ERROR----------------------------\n\n"; } else { print "\n-----------------------------ERROR------------------------------\n"; print "TOO MANY ARGUMENTS\n"; print "dbquery.pl usage: dbquery.pl DBDRIVER DB DBUSER DBPASSWORD DBTABLE \"CONDITION\"\n"; print "NOTE: DBDIVER is usually \"mysql\" but it can be other things like \"oracle\".\n"; print " EXAMPLE: dbquery.pl mysql databas...\n"; print "NOTE: The total CONDITION must be in quotes with the matching data in single quotes. \n"; print " EXAMPLE: \"product LIKE 'bicycle'\"\n"; print "---------------------------END ERROR----------------------------\n\n"; } It queries a database and returns the first 3 records of matches. _______________________________________________ Austin mailing list Austin at pm.org http://mail.pm.org/mailman/listinfo/austin From apthorpe+pm at cynistar.net Tue Oct 17 19:37:23 2006 From: apthorpe+pm at cynistar.net (Bob Apthorpe) Date: Tue, 17 Oct 2006 21:37:23 -0500 Subject: APM: Next dumb Q: IF NULL???? In-Reply-To: <6.1.2.0.2.20061017164651.0204a2e0@pop-server.austin.rr.com> References: <6.1.2.0.2.20061017164651.0204a2e0@pop-server.austin.rr.com> Message-ID: <45359363.9070304@cynistar.net> Hi, CaptNemo wrote: > Why is it so hard to check for null values in perl!?!?! One issue is that perl doesn't have a prominent NULL value as do C or SQL, so it doesn't have the same tests for NULLness. As people have pointed out, perl does have the notion of defined()ness which is probably what you want. Also, this is complicated by the notion of existence when dealing with associative arrays (hashes) - does a certain key exist within a hash, and (if so) is the value associated with that key defined? Add to this the 'truthiness' of values in conditionals: perl -e 'print "True!\n" if ("");' perl -e 'print "True!\n" if (0);' perl -e 'print "True!\n" if ();' perl -e 'print "True!\n" if ("0");' all print nothing which may or may not be what you want. However, perl -e 'print "True!\n" if (NULL);' will print "True!" since NULL is considered a (bareword) string literal. The -w flag or "use warnings;" will grumble about that syntax which is one reason to enable warnings unless you have a really good reason not to. Perl also has a bunch of conditional operators that also may not be doing what you expect. > 1) checking is a variable is empty: > > IF ($product eq "")... # String comparison > IF ($product <> "")... # <> is the null filehandle - this really isn't what you want! > IF ($product ne "")... # String comparison > IF ($product != "")... # Numerical comparison > [...] All of these are reasonable tries, especially if you have experience in multiple languages. Still, if you find yourself "fumbling with your keys" (one of these *has* to work!), that might be a sign you need to step back and read the docs closely, though you do get points for both experimentation *and* asking for help. :) BTW, <> is really useful but not as a conditional operator. > 2) checking to see if command line args were present: This fragment may help: ---- use strict; use warnings; use Getopt::Long; my %options = (); my @optlst = qw( debug verbose help usage owner version ); ### map options to variables for my $kk (@optlst) { my ($nkk, $junk) = split(/[=!]/, $kk, 2); $options{$nkk} = '' if ($nkk); } GetOptions(\%options, @optlst); ---- This puts option values in the %options hash. For example, you'd check if --debug was set by checking: if ($option{'debug'}) { debug_something(); } It takes a while to find and understand time-saving modules like Getopt::Std or Getopt::Long and to get used to perl's idioms for defined()ness or NULLness. The larger-picture question may be "what command-line options have been set?", rather than "what's in ARGV?" Or maybe not. It helps to read other people's code whether you're just learning or have been using a language for a while. For example, you can tell when someone is trying to code C in Perl (using low-level constructs and a lot of code to do something fairly simple, especially reading from a file.) It's hard to break habits that work successfully in other languages so when I'm trying to sort out how to do something in PHP or Ruby, I have to keep reminding myself to look at the language I'm using, not the language I'm used to. hth, -- Bob From tshinnic at io.com Tue Oct 17 20:29:16 2006 From: tshinnic at io.com (Thomas L. Shinnick) Date: Tue, 17 Oct 2006 22:29:16 -0500 Subject: APM: Next dumb Q: IF NULL???? In-Reply-To: <6.1.2.0.2.20061017164651.0204a2e0@pop-server.austin.rr.com > References: <6.1.2.0.2.20061017164651.0204a2e0@pop-server.austin.rr.com> Message-ID: <6.2.5.6.2.20061017215925.03b0b870@io.com> At 04:51 PM 10/17/2006, CaptNemo wrote: >Why is it so hard to check for null values in perl!?!?! I confess to wanting the smallest set of things to remember: exists - test whether array or hash element is 'present' if ( exists $lotto{23_31_07_42_18_05} ) { die "rich"; } defined - is the value 'something' or the unique value undef if ( ! defined $systolic_reading ) { warn "dial 911"; } length - is the value 'empty'? if ( length $speech ) { print "They said '$speech'\n"; } 'truth' - various shades of yes, a couple ways to say no if ( $answer ) { print "Some kinda yes ('$answer'); } else { print "Some kinda no ('$answer'); } It easily gets more complicated from there (Scalar::Util::looks_like_number() anyone?) but these are the four tests to start with. Once you've looked these up in perlfunc (especially see the discussion of exists) and the discussion "Scalar values" in perldata you will no longer (cough) be (hack) mystified... (gack) >Two situations: >1) checking is a variable is empty: [snip] >2) checking to see if command line args were present: [snip] -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061017/01af1b38/attachment.html From apthorpe+pm at cynistar.net Tue Oct 17 20:32:26 2006 From: apthorpe+pm at cynistar.net (Bob Apthorpe) Date: Tue, 17 Oct 2006 22:32:26 -0500 Subject: APM: Next dumb Q: IF NULL???? In-Reply-To: <200610172142.41771.leeh@softwarejanitor.com> References: <6.1.2.0.2.20061017164651.0204a2e0@pop-server.austin.rr.com> <45359363.9070304@cynistar.net> <200610172142.41771.leeh@softwarejanitor.com> Message-ID: <4535A04A.2070507@cynistar.net> Hi, Leeland Heins wrote: > One small nit... I think you mean: > > if ($options{'debug'}) { > > in your example above... Right; I pulled that fragment out of a routine that used a reference for the option hash and I didn't want to muddle the issue with hash references and gory bits like that. One problem at a time. FWIW, I've been getting a lot of mileage out of Perl::Tidy and Perl::Critic recently, trying to conform my existing scripts to best practices. Perl::Critic gets a bit pedantic at times but overall I think it helps. I end up manually turning it off for a half-dozen statements where the 'unnecessary' parens clarify what's really going on. Between 'strict', 'warnings', Perl::Critic, and Perl::Tidy, there's very little reason for stereotypically crappy perl code. Starting off, they can help build good practices by keeping one's code legible and flagging problematic statements. Thanks for keeping me honest, -- Bob From tmcd at panix.com Tue Oct 17 21:39:10 2006 From: tmcd at panix.com (tmcd at panix.com) Date: Tue, 17 Oct 2006 23:39:10 -0500 (CDT) Subject: APM: Next dumb Q: IF NULL???? In-Reply-To: <6.1.2.0.2.20061017175054.0274c000@pop-server.austin.rr.com> References: <6.1.2.0.2.20061017175054.0274c000@pop-server.austin.rr.com> Message-ID: On Tue, 17 Oct 2006, CaptNemo wrote: > Couldn't get if (defined $ARGV[0]) to work... It works fine for me. > ...but, if ($#ARGV >=5) works great! I prefer to use @array, the number of elements, rather than $#array, the maximum subscript. (@array - 1) == $#array, unless you muck about with $[, which I consider a really stupid idea in general. I think it's the visual appeal of one less special character. Also, "@array == 0" seems more natural to express the concept of an empty list than "$#array == -1". -- Tim McDaniel; Reply-To: tmcd at panix.com From tmcd at panix.com Tue Oct 17 21:47:32 2006 From: tmcd at panix.com (tmcd at panix.com) Date: Tue, 17 Oct 2006 23:47:32 -0500 (CDT) Subject: APM: Running a perl prog from a perl prog? In-Reply-To: <45356166.2080005@awpi.com> References: <20061011000154.GA23022@localhost> <20061011220109.GH4128@bybent.com> <6.1.2.0.2.20061017145550.021cd3d8@pop-server.austin.rr.com> <45356166.2080005@awpi.com> Message-ID: On Tue, 17 Oct 2006, michalk wrote: > exec Destroys the current process, so you can't use it alone to have one Perl program call another. If you call fork() first, then one of the processes, usually the child, can call exec() to do the second process. fork-and-exec is the way to get the most sophisticated effects and maximum control. > system Runs an arbitrary program (so whether it's Perl or not is irrelevant). The standard output and standard input remain the caller's, so the caller doesn't get to look at the command's output. Of course, that's sometimes exactly what you want. > $variable = `otherprogram.pl`; > also does the trick. Note the backticks. > This will kill peformance though. Perl has a lot of initializing to > do each time you call it. If you're not doing many calls, the slowness isn't a problem, but the problem as stated by Captain Nemo does seem to indicate that he expects a lot of calls. Using backticks means that the caller will wait until the child is done and then it will get all its output at once. Of course, that's sometimes exactly what you want. There's also open(FH, "command line here |") to run the command and route its standard output to FH for the caller to read (assuming the operating system allows it, as it certainly does on Linux). Similarly open(FH, "| command line here") when the caller wants to feed input to the command. And similar constructs with various I/O modules. Then the input/output can be record by record; depending on the appication, it can be more efficient (as opposed to one massive buffer in `...`). Of course, that's sometimes exactly what you want. This also allows feeding input into the command, which `...` doesn't allow (except by $x = `echo hello world | cat`; ). -- Tim McDaniel; Reply-To: tmcd at panix.com From tmcd at panix.com Tue Oct 17 21:58:17 2006 From: tmcd at panix.com (tmcd at panix.com) Date: Tue, 17 Oct 2006 23:58:17 -0500 (CDT) Subject: APM: Running a perl prog from a perl prog? In-Reply-To: <6.1.2.0.2.20061017181944.027e0da8@pop-server.austin.rr.com> References: <20061011000154.GA23022@localhost> <20061011220109.GH4128@bybent.com> <6.1.2.0.2.20061017145550.021cd3d8@pop-server.austin.rr.com> <6.1.2.0.2.20061017181944.027e0da8@pop-server.austin.rr.com> Message-ID: On Tue, 17 Oct 2006, CaptNemo wrote: > elsif ( $#ARGV <= 4 ) { > print "\n-----------------------------ERROR------------------------------\n"; > print "NOT ENOUGH ARGUMENTS\n"; > print "dbquery.pl usage: dbquery.pl DBDRIVER DB DBUSER DBPASSWORD DBTABLE > \"CONDITION\"\n"; > print "NOTE: DBDIVER is usually \"mysql\" but it can be other things like > \"oracle\".\n"; > print " EXAMPLE: dbquery.pl mysql databas...\n"; > print "NOTE: The total CONDITION must be in quotes with the matching data > in single quotes. \n"; > print " EXAMPLE: \"product LIKE 'bicycle'\"\n"; > print "---------------------------END ERROR----------------------------\n\n"; In the "several ways to skin a cat" motif of Perl, I'll mention that I like "here documents" for this. I'd express the above as elsif ( @ARGV < 6 ) { print <<'SOMETAG'; -----------------------------ERROR------------------------------ NOT ENOUGH ARGUMENTS dbquery.pl usage: dbquery.pl DBDRIVER DB DBUSER DBPASSWORD DBTABLE "CONDITION" NOTE: DBDIVER is usually "mysql" but it can be other things like "oracle". EXAMPLE: dbquery.pl mysql database... NOTE: The total CONDITION must be in quotes with the matching data in single quotes. EXAMPLE: "product LIKE 'bicycle'" ---------------------------END ERROR---------------------------- SOMETAG } The single quotes in <<'WHATEVER' means that Perl metacharacters ($, `, @) won't be interpreted. If it's just < References: <6.1.2.0.2.20061017164651.0204a2e0@pop-server.austin.rr.com> <20061017235720.GA2791@bybent.com> Message-ID: On Tue, 17 Oct 2006, Wayne Walker wrote: > if ( (! defined $product) || ($product == undef)) The second one has several problems. - If you use "perl -w", and you should, it makes sure that undefined values don't get used. So the above leads to Use of uninitialized value in numeric eq (==) at ... - Since "==" is a numeric comparison, undef is converted to 0. So $product == undef is exactly identical to $product == 0 I use @array to find the number of elements (hence whether $ARGV[EXPR] was provided or not), defined($var) to find whether a variable is undef or not, and exists($table{KEY}) to find whether an element of a table is defined. As I mentioned, you shouldn't use a variable in a value context ($i + 3) unless you know that it's defined. -- Tim McDaniel; Reply-To: tmcd at panix.com From austin.pm at sam-i-am.com Wed Oct 18 07:25:18 2006 From: austin.pm at sam-i-am.com (Sam Foster) Date: Wed, 18 Oct 2006 09:25:18 -0500 Subject: APM: parsing javascript Message-ID: <4536394E.6070605@sam-i-am.com> hi all, I'm looking for a way to parse - but not execute - some javascript. I'm building up a dependency chain - my javascripts use a pair of functions "provides" and "requires" to ensure pre-requisites are loaded (these is using the dojo toolkit fwiw). I want to have perl follow this chain, and in this case build a custom js library that concatenates all the right files in the right order. I'm looking at the JavaScript.pm module, which I think uses the SpiderMonkey interpreter. Mark I think mentioned a way to use jars from within a perl program - that might let me use the Rhino interpreter - what was that Mark? As I'm not trying to parse all possible javascript but just a couple statements, I could just do this myself I suppose. Does this kind of thing exist elsewhere though. Seems like it might. thanks, Sam From austin.pm at sam-i-am.com Wed Oct 18 09:31:04 2006 From: austin.pm at sam-i-am.com (Sam Foster) Date: Wed, 18 Oct 2006 11:31:04 -0500 Subject: APM: parsing javascript In-Reply-To: <45363A4F.1090509@awpi.com> References: <4536394E.6070605@sam-i-am.com> <45363A4F.1090509@awpi.com> Message-ID: <453656C8.2060801@sam-i-am.com> michalk wrote: > Is it possible to parse Java in Perl and have Perl execute Java? > I would be interested in this for mathematical implementations in > common libraries. It's statistics, no graphics. Data in, answer out. > I was just looking at the Java module: http://search.cpan.org/~metzzo/Java-4.7/Java.pm It seems to be what you're looking for, and /might/ be of use to me, I'm not sure yet. Ideally I'd like to be able to register callbacks as the javascript was parsed - like HTML::Parser - so I could do something with function objects. Is javascript is similar in syntax to C, perhaps there's something there I can leverage. Or maybe a generic parser framework for this kind of task that I can build on top of? Sam > Sam Foster wrote: > >> hi all, >> I'm looking for a way to parse - but not execute - some javascript. > From CaptNemo at Austin.rr.com Wed Oct 18 15:56:21 2006 From: CaptNemo at Austin.rr.com (CaptNemo) Date: Wed, 18 Oct 2006 17:56:21 -0500 Subject: APM: Dumb program acting funny... In-Reply-To: <20061018001414.GB2791@bybent.com> References: <20061011000154.GA23022@localhost> <20061011220109.GH4128@bybent.com> <6.1.2.0.2.20061017145550.021cd3d8@pop-server.austin.rr.com> <6.1.2.0.2.20061017181944.027e0da8@pop-server.austin.rr.com> <20061018001414.GB2791@bybent.com> Message-ID: <6.1.2.0.2.20061018174736.01f2da68@pop-server.austin.rr.com> Okay, instead of just returning the first 3 records, I modified it to print the whole line of records but now it acts up.... My database is 36 records wide and when I run it, I get: [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA, [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA, Etc. Why am I getting [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. ... and then correct data!?!?! HERE's the Proggy -------------------------------------------------- #!/usr/bin/perl -wT use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use DBI; use strict; my $dbdriver = $ARGV[0]; my $db = $ARGV[1]; my $dbuser = $ARGV[2]; my $dbpasswd = $ARGV[3]; my $dbtable = $ARGV[4]; my $condition = $ARGV[5]; my @row_array; my $row; if ( $#ARGV ==5 ) { my $dbh = DBI->connect( "DBI:$dbdriver:$db",$dbuser,$dbpasswd,) || die "Database connection not made: $DBI::errstr"; my $sth = $dbh->prepare("SELECT * FROM $dbtable WHERE $condition") or die $dbh->errstr; $sth->execute() or die $dbh->errstr; while (@row_array = $sth->fetchrow_array) { foreach $row (@row_array) { print "$row,"; # <------ THIS IS LINE 34 } print "\n"; } $dbh->disconnect(); } elsif ( $#ARGV <= 4 ) { print "\n-----------------------------ERROR------------------------------\n"; print "NOT ENOUGH ARGUMENTS\n"; print "dbquery.pl usage: dbquery.pl DBDRIVER DB DBUSER DBPASSWORD DBTABLE \"CONDITION\"\n"; print "NOTE: DBDIVER is usually \"mysql\" but it can be other things like \"oracle\".\n"; print " EXAMPLE: dbquery.pl mysql databas...\n"; print "NOTE: The total CONDITION must be in quotes with the matching data in single quotes. \n"; print " EXAMPLE: \"product LIKE 'bicycle'\"\n"; print "---------------------------END ERROR----------------------------\n\n"; } else { print "\n-----------------------------ERROR------------------------------\n"; print "TOO MANY ARGUMENTS\n"; print "dbquery.pl usage: dbquery.pl DBDRIVER DB DBUSER DBPASSWORD DBTABLE \"CONDITION\"\n"; print "NOTE: DBDIVER is usually \"mysql\" but it can be other things like \"oracle\".\n"; print " EXAMPLE: dbquery.pl mysql databas...\n"; print "NOTE: The total CONDITION must be in quotes with the matching data in single quotes. \n"; print " EXAMPLE: \"product LIKE 'bicycle'\"\n"; print "---------------------------END ERROR----------------------------\n\n"; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061018/bc17ce4f/attachment.html From Barron.Snyder at wholefoods.com Wed Oct 18 17:30:25 2006 From: Barron.Snyder at wholefoods.com (Barron Snyder (CE CEN)) Date: Wed, 18 Oct 2006 19:30:25 -0500 Subject: APM: Dumb program acting funny... In-Reply-To: <6.1.2.0.2.20061018174736.01f2da68@pop-server.austin.rr.com> Message-ID: <21667FF13918174E801E7CDBD81C4CAC28917F@wfm-exchprd5.wfm.pvt> From: austin-bounces+barron.snyder=wholefoods.com at pm.org [mailto:austin-bounces+barron.snyder=wholefoods.com at pm.org] On Behalf Of CaptNemo Sent: Wednesday, October 18, 2006 5:56 PM To: austin at pm.org Subject: APM: Dumb program acting funny... Okay, instead of just returning the first 3 records, I modified it to print the whole line of records but now it acts up.... My database is 36 records wide and when I run it, I get: [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA, [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. ... Why am I getting [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. ... and then correct data!?!?! ----- 8< SNIP 8< ---------------------- I'm fairly new to Perl but I've come across this myself. It's just a warning. As I understand it, you're query is returning records that may have NULL values in them that you're then adding these NULL values to an array. The reason you're seeing the warnings interspersed with your output is that everthing is being directed to the same place (the program output/STDOUT and STDERR). Someone please correct me if I'm way offbase on this. -Barron ________________________________ From: austin-bounces+barron.snyder=wholefoods.com at pm.org [mailto:austin-bounces+barron.snyder=wholefoods.com at pm.org] On Behalf Of CaptNemo Sent: Wednesday, October 18, 2006 5:56 PM To: austin at pm.org Subject: APM: Dumb program acting funny... Okay, instead of just returning the first 3 records, I modified it to print the whole line of records but now it acts up.... My database is 36 records wide and when I run it, I get: [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA, [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA,VALID DATA, Etc. Why am I getting [Wed Oct 18 18:52:56 2006] dbquery.pl: Use of uninitialized value in concatenation (.) or string at ./dbquery.pl line 34. ... and then correct data!?!?! HERE's the Proggy -------------------------------------------------- #!/usr/bin/perl -wT use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use DBI; use strict; my $dbdriver = $ARGV[0]; my $db = $ARGV[1]; my $dbuser = $ARGV[2]; my $dbpasswd = $ARGV[3]; my $dbtable = $ARGV[4]; my $condition = $ARGV[5]; my @row_array; my $row; if ( $#ARGV ==5 ) { my $dbh = DBI->connect( "DBI:$dbdriver:$db",$dbuser,$dbpasswd,) || die "Database connection not made: $DBI::errstr"; my $sth = $dbh->prepare("SELECT * FROM $dbtable WHERE $condition") or die $dbh->errstr; $sth->execute() or die $dbh->errstr; while (@row_array = $sth->fetchrow_array) { foreach $row (@row_array) { print "$row,"; # <------ THIS IS LINE 34 } print "\n"; } $dbh->disconnect(); } elsif ( $#ARGV <= 4 ) { print "\n-----------------------------ERROR------------------------------\n"; print "NOT ENOUGH ARGUMENTS\n"; print "dbquery.pl usage: dbquery.pl DBDRIVER DB DBUSER DBPASSWORD DBTABLE \"CONDITION\"\n"; print "NOTE: DBDIVER is usually \"mysql\" but it can be other things like \"oracle\".\n"; print " EXAMPLE: dbquery.pl mysql databas...\n"; print "NOTE: The total CONDITION must be in quotes with the matching data in single quotes. \n"; print " EXAMPLE: \"product LIKE 'bicycle'\"\n"; print "---------------------------END ERROR----------------------------\n\n"; } else { print "\n-----------------------------ERROR------------------------------\n"; print "TOO MANY ARGUMENTS\n"; print "dbquery.pl usage: dbquery.pl DBDRIVER DB DBUSER DBPASSWORD DBTABLE \"CONDITION\"\n"; print "NOTE: DBDIVER is usually \"mysql\" but it can be other things like \"oracle\".\n"; print " EXAMPLE: dbquery.pl mysql databas...\n"; print "NOTE: The total CONDITION must be in quotes with the matching data in single quotes. \n"; print " EXAMPLE: \"product LIKE 'bicycle'\"\n"; print "---------------------------END ERROR----------------------------\n\n"; } -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061018/8d825ca8/attachment-0001.html From bill.raty at gmail.com Wed Oct 18 22:14:40 2006 From: bill.raty at gmail.com (Bill Raty) Date: Thu, 19 Oct 2006 00:14:40 -0500 Subject: APM: Dumb program acting funny... In-Reply-To: <21667FF13918174E801E7CDBD81C4CAC28917F@wfm-exchprd5.wfm.pvt> References: <6.1.2.0.2.20061018174736.01f2da68@pop-server.austin.rr.com> <21667FF13918174E801E7CDBD81C4CAC28917F@wfm-exchprd5.wfm.pvt> Message-ID: <3be6deac0610182214q6b2754e8u4bf5a91479c9bbce@mail.gmail.com> You have warnings enabled 'the -w switch on shebang'. With warnings enabled perl will output a message whenever it detects an undefined value in a join or string interpolation. To demonstrate: use warnings; use strict; my $empty = undef; print "Perl will warn about this $empty string.\n"; I rarely use warnings in production code. It is better to locally scope warnings in code sections where you are certain you must always have data that is not null. Regards, -Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061019/3bfdd146/attachment.html From mike at stok.co.uk Thu Oct 19 03:30:07 2006 From: mike at stok.co.uk (Mike Stok) Date: Thu, 19 Oct 2006 06:30:07 -0400 Subject: APM: Dumb program acting funny... In-Reply-To: <3be6deac0610182214q6b2754e8u4bf5a91479c9bbce@mail.gmail.com> References: <6.1.2.0.2.20061018174736.01f2da68@pop-server.austin.rr.com> <21667FF13918174E801E7CDBD81C4CAC28917F@wfm-exchprd5.wfm.pvt> <3be6deac0610182214q6b2754e8u4bf5a91479c9bbce@mail.gmail.com> Message-ID: On 19-Oct-06, at 1:14 AM, Bill Raty wrote: > You have warnings enabled 'the -w switch on shebang'. > > With warnings enabled perl will output a message whenever it > detects an undefined value in a join or string interpolation. To > demonstrate: > > use warnings; > use strict; > > my $empty = undef; > print "Perl will warn about this $empty string.\n"; > > I rarely use warnings in production code. It is better to locally > scope warnings in code sections where you are certain you must > always have data that is not null. > I usually work the other way around, using warnings everywhere, and then using no warnings as tightly scoped as possible to mark where I know uninitialized variables and perl's treatment of them are OK use strict; use warnings; my $empty = undef; { no warnings 'uninitialized'; print "Perl will not warn about this $empty string.\n"; } (Let's not notice that $empty is initialized in this code, so the warning is misleading.) The same goes for using "no strict 'refs';" around code where I might be using strings to manipulate the symbol table. The lexical relaxation reminds me later that I was doing something "odd" in this chunk of code. Mike -- Mike Stok http://www.stok.ca/~mike/ The "`Stok' disclaimers" apply. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061019/d7802c48/attachment.html From bill.raty at gmail.com Thu Oct 19 04:27:38 2006 From: bill.raty at gmail.com (Bill Raty) Date: Thu, 19 Oct 2006 06:27:38 -0500 Subject: APM: Dumb program acting funny... In-Reply-To: References: <6.1.2.0.2.20061018174736.01f2da68@pop-server.austin.rr.com> <21667FF13918174E801E7CDBD81C4CAC28917F@wfm-exchprd5.wfm.pvt> <3be6deac0610182214q6b2754e8u4bf5a91479c9bbce@mail.gmail.com> Message-ID: <3be6deac0610190427x760a925ci1ec4da48e1513399@mail.gmail.com> I've ceased using "no strict 'refs'", and instead use the excellent Symbol module to manipulate the symbol table. Instead of: use strict; { no strict 'refs'; my ($pkg, $subname) = qw( Foo bar ); *{"${pkg}::${subname}"} = sub { print "Howdy!\n" }; } I use: use strict; use Symbol; my ($pkg, $subname) = qw( Foo bar ); *{Symbol::qualify_to_ref( $subname, $pkg )} = sub { print "Howdy!\n" }; On 10/19/06, Mike Stok wrote: > > > On 19-Oct-06, at 1:14 AM, Bill Raty wrote: > > You have warnings enabled 'the -w switch on shebang'. > > With warnings enabled perl will output a message whenever it detects an > undefined value in a join or string interpolation. To demonstrate: > > use warnings; > use strict; > > my $empty = undef; > print "Perl will warn about this $empty string.\n"; > > I rarely use warnings in production code. It is better to locally scope > warnings in code sections where you are certain you must always have data > that is not null. > > > I usually work the other way around, using warnings everywhere, and then > using no warnings as tightly scoped as possible to mark where I know > uninitialized variables and perl's treatment of them are OK > > use strict; > use warnings; > > my $empty = undef; > { > no warnings 'uninitialized'; > print "Perl will not warn about this $empty string.\n"; > } > > (Let's not notice that $empty is initialized in this code, so the warning > is misleading.) > > The same goes for using "no strict 'refs';" around code where I might be > using strings to manipulate the symbol table. > > The lexical relaxation reminds me later that I was doing something "odd" > in this chunk of code. > > > Mike > > -- > > Mike Stok > http://www.stok.ca/~mike/ > > The "`Stok' disclaimers" apply. > > > > > -- For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061019/002ef6fa/attachment.html From tmcd at panix.com Thu Oct 19 06:32:43 2006 From: tmcd at panix.com (tmcd at panix.com) Date: Thu, 19 Oct 2006 08:32:43 -0500 (CDT) Subject: APM: Dumb program acting funny... In-Reply-To: References: <6.1.2.0.2.20061018174736.01f2da68@pop-server.austin.rr.com> <21667FF13918174E801E7CDBD81C4CAC28917F@wfm-exchprd5.wfm.pvt> <3be6deac0610182214q6b2754e8u4bf5a91479c9bbce@mail.gmail.com> Message-ID: On Thu, 19 Oct 2006, Mike Stok wrote: > I usually work the other way around, using warnings everywhere, and > then using no warnings as tightly scoped as possible to mark where I > know uninitialized variables and perl's treatment of them are OK I enable warnings everywhere. I simply don't use undef values: I used defined() and exists() to prevent their use (and assign a value to a display variable explicitly if I need to). To reply to another note, I've never had to fiddle with the package symbol table. The most I've had to do is use package variables -- for Getopt, perhaps? -- and then I just do $::var or whatever. -- Tim McDaniel; Reply-To: tmcd at panix.com From CaptNemo at Austin.rr.com Thu Oct 19 08:23:14 2006 From: CaptNemo at Austin.rr.com (CaptNemo) Date: Thu, 19 Oct 2006 10:23:14 -0500 Subject: APM: Dumb program acting funny... In-Reply-To: <21667FF13918174E801E7CDBD81C4CAC28917F@wfm-exchprd5.wfm.pv t> References: <6.1.2.0.2.20061018174736.01f2da68@pop-server.austin.rr.com> <21667FF13918174E801E7CDBD81C4CAC28917F@wfm-exchprd5.wfm.pvt> Message-ID: <6.1.2.0.2.20061019101433.020b2470@pop-server.austin.rr.com> You guys are so smart! I/we figured it out last night at the GWLUG meeting. NULL values in variables are what gave the warnings. I left the w parameter but added: if ($row){ print "$row,"; } else { print ","; } and it worked fine. Thanks for the continuing help. One other question... Recently for some reason when I start my programs with: #! /usr/bin/perl They don't work any more (on the latest versions of Slackware (perl 5.8.x)) but, when I use: #! /usr/bin/perl -wT ...they work fine. I say recently because on older Slackware machines, the first example works fine still. Anyone have an idea why this is? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061019/4e7f08d8/attachment.html From CaptNemo at Austin.rr.com Thu Oct 19 08:30:12 2006 From: CaptNemo at Austin.rr.com (CaptNemo) Date: Thu, 19 Oct 2006 10:30:12 -0500 Subject: APM: #! /usr/bin/perl -wT MORE DETAILS Message-ID: <6.1.2.0.2.20061019102628.020aeaa8@pop-server.austin.rr.com> RECAP: One other question... Recently for some reason when I start my programs with: #! /usr/bin/perl They don't work any more (on the latest versions of Slackware (perl 5.8.x)) but, when I use: #! /usr/bin/perl -wT ...they work fine. I say recently because on older Slackware machines, the first example works fine still. Anyone have an idea why this is? Here's the behavior- When I use #! /usr/bin/perl -wT ...it works fine. When I use #! /usr/bin/perl ...bash returns: ": No such file or directory ...and does not execute the program. What is going on??? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061019/e473f1bb/attachment-0001.html From wwalker at bybent.com Thu Oct 19 09:17:11 2006 From: wwalker at bybent.com (Wayne Walker) Date: Thu, 19 Oct 2006 11:17:11 -0500 Subject: APM: #! /usr/bin/perl -wT MORE DETAILS In-Reply-To: <6.1.2.0.2.20061019102628.020aeaa8@pop-server.austin.rr.com> References: <6.1.2.0.2.20061019102628.020aeaa8@pop-server.austin.rr.com> Message-ID: <20061019161710.GB2967@bybent.com> I assume you are editing files on windows? run this on a program that fails: head -n 1 /my/broke_program | od -cx And send the output here. (Do it for both programs). I'm suspecting trailing funny characters in the file that fails On Thu, Oct 19, 2006 at 10:30:12AM -0500, CaptNemo wrote: > RECAP: > One other question... > > Recently for some reason when I start my programs with: > > #! /usr/bin/perl > > They don't work any more (on the latest versions of Slackware (perl 5.8.x)) > but, when I use: > > #! /usr/bin/perl -wT > > ...they work fine. I say recently because on older Slackware machines, > the first example works fine still. Anyone have an idea why this is? > > > Here's the behavior- > > When I use > > #! /usr/bin/perl -wT > > ...it works fine. > > When I use > > #! /usr/bin/perl > > ...bash returns: > > ": No such file or directory > > ...and does not execute the program. > > What is going on??? > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin -- Wayne Walker www.unwiredbuyer.com - when you just can't be by the computer wwalker at bybent.com Do you use Linux?! http://www.bybent.com Get Counted! http://counter.li.org/ Perl - http://www.perl.org/ Perl User Groups - http://www.pm.org/ Jabber: wwalker at jabber.gnumber.com AIM: lwwalkerbybent IRC: wwalker on freenode.net From rick at ttys0.us Thu Oct 19 09:39:50 2006 From: rick at ttys0.us (rick) Date: Thu, 19 Oct 2006 11:39:50 -0500 (CDT) Subject: APM: #! /usr/bin/perl -wT MORE DETAILS In-Reply-To: <20061019161710.GB2967@bybent.com> References: <6.1.2.0.2.20061019102628.020aeaa8@pop-server.austin.rr.com> <20061019161710.GB2967@bybent.com> Message-ID: Looks like you have a space in #!/usr/bin/perl between the #! and /. Could that be your problem? Rick Richardson :On Thu, Oct 19, 2006 at 10:30:12AM -0500, CaptNemo wrote: :> RECAP: :> One other question... :> :> Recently for some reason when I start my programs with: :> :> #! /usr/bin/perl :> :> They don't work any more (on the latest versions of Slackware (perl 5.8.x)) :> but, when I use: :> :> #! /usr/bin/perl -wT :> :> ...they work fine. I say recently because on older Slackware machines, :> the first example works fine still. Anyone have an idea why this is? :> :> :> Here's the behavior- :> :> When I use :> :> #! /usr/bin/perl -wT :> :> ...it works fine. :> :> When I use :> :> #! /usr/bin/perl :> :> ...bash returns: :> :> ": No such file or directory :> :> ...and does not execute the program. :> :> What is going on??? : :> _______________________________________________ :> Austin mailing list :> Austin at pm.org :> http://mail.pm.org/mailman/listinfo/austin : : From CaptNemo at Austin.rr.com Thu Oct 19 09:54:45 2006 From: CaptNemo at Austin.rr.com (CaptNemo) Date: Thu, 19 Oct 2006 11:54:45 -0500 Subject: APM: #! /usr/bin/perl -wT MORE DETAILS In-Reply-To: <20061019161710.GB2967@bybent.com> References: <6.1.2.0.2.20061019102628.020aeaa8@pop-server.austin.rr.com> <20061019161710.GB2967@bybent.com> Message-ID: <6.1.2.0.2.20061019115000.020bbff8@pop-server.austin.rr.com> Broken version: user at www:~/public_html/cgi-bin$ head -n 1 dbquery.pl | od -cx 0000000 # ! / u s r / b i n / p e r l 2123 2f20 7375 2f72 6962 2f6e 6570 6c72 0000020 \r \n 0a0d 0000022 Working version: user at www:~/public_html/cgi-bin$ head -n 1 dbquery.pl | od -cx 0000000 # ! / u s r / b i n / p e r l 2123 2f20 7375 2f72 6962 2f6e 6570 6c72 0000020 - w T \r \n 2d20 5477 0a0d 0000026 >I assume you are editing files on windows? I am using windows AND Vi on linux From tmcd at panix.com Thu Oct 19 11:02:58 2006 From: tmcd at panix.com (Tim McDaniel) Date: Thu, 19 Oct 2006 13:02:58 -0500 (CDT) Subject: APM: Dumb program acting funny... In-Reply-To: <6.1.2.0.2.20061019101433.020b2470@pop-server.austin.rr.com> References: <6.1.2.0.2.20061018174736.01f2da68@pop-server.austin.rr.com> <21667FF13918174E801E7CDBD81C4CAC28917F@wfm-exchprd5.wfm.pvt> <6.1.2.0.2.20061019101433.020b2470@pop-server.austin.rr.com> Message-ID: On Thu, 19 Oct 2006, CaptNemo wrote: > NULL values in variables are what gave the warnings. I think someone mentioned that as a possibility. > I left the w parameter but added: > if ($row){ > print "$row,"; > } > else { > print ","; > } > and it worked fine. Is there a chance that $row will be present but 0 or ''? That would also cause it to be not printed, which I suspect is not what you want. I'd suggest if (defined $row) for that reason. Actually, I'd likely start with $row = '' if ! defined $row; (if it's OK to clobber the variable), or print (defined $row ? $row : ''), ","; (otherwise). -- Tim McDaniel, tmcd at panix.com From tmcd at panix.com Thu Oct 19 11:04:12 2006 From: tmcd at panix.com (Tim McDaniel) Date: Thu, 19 Oct 2006 13:04:12 -0500 (CDT) Subject: APM: #! /usr/bin/perl -wT MORE DETAILS In-Reply-To: References: <6.1.2.0.2.20061019102628.020aeaa8@pop-server.austin.rr.com> <20061019161710.GB2967@bybent.com> Message-ID: On Thu, 19 Oct 2006, rick wrote: > Looks like you have a space in > #!/usr/bin/perl between the #! and /. > Could that be your problem? No. On UNIXy systems, #! must be the first two characters of the script, but they can be followed by whitespace if you like. -- Tim McDaniel, tmcd at panix.com From tmcd at panix.com Thu Oct 19 11:47:06 2006 From: tmcd at panix.com (Tim McDaniel) Date: Thu, 19 Oct 2006 13:47:06 -0500 (CDT) Subject: APM: #! /usr/bin/perl -wT MORE DETAILS In-Reply-To: <6.1.2.0.2.20061019115000.020bbff8@pop-server.austin.rr.com> References: <6.1.2.0.2.20061019102628.020aeaa8@pop-server.austin.rr.com> <20061019161710.GB2967@bybent.com> <6.1.2.0.2.20061019115000.020bbff8@pop-server.austin.rr.com> Message-ID: On Thu, 19 Oct 2006, CaptNemo wrote: >> I assume you are editing files on windows? > > I am using windows AND Vi on linux ... > Broken version: > > user at www:~/public_html/cgi-bin$ head -n 1 dbquery.pl | od -cx > 0000000 # ! / u s r / b i n / p e r l > 2123 2f20 7375 2f72 6962 2f6e 6570 6c72 > 0000020 \r \n > 0a0d > 0000022 ... > ...bash returns: > ": No such file or directory It's the trailing carriage return that's the problem. Linux is not recognizing it as line-ending. On the NetBSD system I'm on, messages are a little different: #! /usr/local/bin/perl^M (^M represents the carriage return) results in -bash: local/test/005.pl: /usr/local/bin/perl^M: bad interpreter: No such file or directory (which is actually bash passing on a kernel error status) while #! /usr/local/bin/perl ^M results in Can't open perl script "^M": No such file or directory (which is perl reporting a file-no-found error). The base problem is the same: \r (^M) is not seen by the kernel as a whitespace character. The reason that #! /usr/local/bin/perl -w ^M works is because the kernel allows only one command-line argument on a "#!" line -- so "-w" takes that place. The main solution, IF you're not trying to keep scripts in synch on Windows and Linux, is to strip trailing carriage returns on lines on the Linux side. If you can't do that, see below. If you really want perl to have no arguments and have DOS-format file, try #! /usr/local/bin/perl -- ^M "--" ends the options on a Perl command line, so it's harmless; space ends the "--"; the control-M then is shuffled off into invisibility. Apparently Perl then ignores the line-ending carriage returns in the rest of the script. -- Tim McDaniel, tmcd at panix.com From CaptNemo at Austin.rr.com Fri Oct 20 13:08:12 2006 From: CaptNemo at Austin.rr.com (CaptNemo) Date: Fri, 20 Oct 2006 15:08:12 -0500 Subject: APM: Asking again because I'm dense... Running a prog from a prog? Message-ID: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> Sorry to ask this again but, I just can't grasp system() and get it to work.... I have written a program named gettables.pl which reads all the tables in a database and prints them out. The program is run with this line: gettables.pl mysql database user password It in turn prints out a list of the tables in the database- EXAMPLE: products inventory porn_collection accounts I need to execute this FROM my web page generator program and have the print result returned so I can make a table. I have tried: $dbtable = `gettables.pl mysql database user password`; my $command = "gettables.pl mysql database user password4"; $dbtable = `$command`; $dbtable = system(gettables.pl mysql database user password); my $command = "gettables.pl mysql database user password"; $dbtable = system($command); @dbtable = system(gettables.pl mysql database user password); my $command = "gettables.pl mysql database user password"; @dbtable = system($command); How can I do this without having to write a file and read the results? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061020/3dc822d8/attachment.html From jdwoody at gmail.com Fri Oct 20 13:37:05 2006 From: jdwoody at gmail.com (Jim Woodgate) Date: Fri, 20 Oct 2006 15:37:05 -0500 Subject: APM: Asking again because I'm dense... Running a prog from a prog? In-Reply-To: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> References: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> Message-ID: The first two should have worked, system returns the return code. @dbtables = qx(gettables.pl mysql database user password); is a bit nicer since you would get an array of tables. Like someone else already mentioned however you are making things a lot more difficult on yourself by following this paradigm. It may not be working because of path problems, you might have other errors you aren't seeing, it is very insecure, won't work if you are forced to use taintperl, it's harder to debug and uses more system resources with the forking. The first thing I would check is your error log. On 10/20/06, CaptNemo wrote: > > Sorry to ask this again but, I just can't grasp system() and get it to > work.... > > I have written a program named gettables.pl which reads all the tables in > a database and prints them out. The program is run with this line: > > gettables.pl mysql database user password > > It in turn prints out a list of the tables in the database- > EXAMPLE: > products > inventory > porn_collection > accounts > > > I need to execute this FROM my web page generator program and have the > print result returned so I can make a table. > > I have tried: > > $dbtable = `gettables.pl mysql database user password`; > > > my $command = "gettables.pl mysql database user password4"; > $dbtable = `$command`; > > > $dbtable = system(gettables.pl mysql database user password); > > > my $command = "gettables.pl mysql database user password"; > $dbtable = system($command); > > > @dbtable = system(gettables.pl mysql database user password); > > > my $command = "gettables.pl mysql database user password"; > @dbtable = system($command); > > > How can I do this without having to write a file and read the results? > > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin > > -- Jim Woodgate jdwoody at gmail.com From hcoyote at ghostar.ath.cx Fri Oct 20 18:02:54 2006 From: hcoyote at ghostar.ath.cx (Travis) Date: Fri, 20 Oct 2006 20:02:54 -0500 Subject: APM: Asking again because I'm dense... Running a prog from a prog? In-Reply-To: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> References: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> Message-ID: <20061021010254.GB82538@malkavian.ghostar.ath.cx> On Fri, Oct 20, 2006 at 03:08:12PM -0500, CaptNemo wrote: > Sorry to ask this again but, I just can't grasp system() and get it to > work.... > > I have written a program named gettables.pl which reads all the tables in > a database and prints them out. The program is run with this line: > > my $command = "gettables.pl mysql database user password"; > @dbtable = system($command); You can't use system() that way. It's used to just run a command. Think of it as shelling out of your program for a moment. If you want to capture the output, you need to use backticks, qx(), or open(). Completely untested, , but I'd do it this way: my $command = "gettables.pl mysql database user password"; open(my $fh, "$command |"); if (defined $fh) { while (my $output = <$fh>) { do_something($output); } } else { print_polite_web_failure(); } Or, if the output isn't large (or you need all the data before you can do anything with it), you could just read it all into an array like: if (defined $fh) { @data = <$fh>; print_table(@data); } else { print_polite_web_failure(); } Travis -- Travis Campbell hcoyote at ghostar.ath.cx From dbii at interaction.net Mon Oct 23 11:10:11 2006 From: dbii at interaction.net (David Bluestein II) Date: Mon, 23 Oct 2006 13:10:11 -0500 Subject: APM: Perl Job Position from Recruiter In-Reply-To: <20061011000154.GA23022@localhost> References: <20061011000154.GA23022@localhost> Message-ID: Here is what I know about it, this is from the old company that used to host us. See below for details, she said that java was optional for a good perl guy. Job is around 360 and 2222, is a permanent position, and they are "flexible on salary". The recruiter information is: Harlan Ross TECHNICAL RECRUITER 12331 RIATA TRACE PKWY, SUITE A200 AUSTIN, TX 78727 888.598.5877 T 512.249.4977 F 512.249.4991 M 512.964.4669 Perl Developer Job Description: Our client is looking for a full-time, direct hire Perl developer. Our client helps automotive leaders design and implements successful business initiatives that solve problems caused by the diversity, complexity, and disparity of their business systems. Working together seamlessly, the InfoIQSM Solutions provide complete information management capabilities to market-leading OEMs, portals, retail marketing operators, and major dealer groups. Available through an application service provider (ASP) model, InfoIQ Solutions collect and transform automotive industry data designed expressly to increase the sale of new and used vehicles, service and parts. Description The position is a mid level development position that works primarily in design, coding, testing, and supporting software products and related materials to meet customer requirements. The job will include up to 60% development in Perl, with 20-25% in Java. Qualifications Qualified candidates will have: Perl experience is a must. Java experience is preferred. Experience tuning database queries is a must. Oracle experience and PL/SQL experience is a plus. Ability to troubleshoot technical problems and demonstrate problem solving skills and resourcefulness in obtaining information. Ability to communicate effectively both verbally and in writing. Ability to work as a team member with limited supervision. Required Skills: ? PERL ? JSP ? JAVA * MOD_PERL ----------------------------------------------------------------------- David H. Bluestein II President & Lead Developer dbii at interaction.net ii, inc. http://www.interaction.net -- Specializing in Interactive, Database Driven Web Applications -- From tim at toolman.org Mon Oct 23 12:39:57 2006 From: tim at toolman.org (Tim Peoples) Date: Mon, 23 Oct 2006 14:39:57 -0500 Subject: APM: Perl Job Position from Recruiter In-Reply-To: References: <20061011000154.GA23022@localhost> Message-ID: <453D1A8D.5000809@toolman.org> Interestingly enough, this job is actually for my team (and no... there is no JSP requirement). What I'm really looking for is someone who is a fairly good OOP Perl programmer who (over time) wants to also become a really good Java programmer as well. Tim. David Bluestein II wrote: > Here is what I know about it, this is from the old company that used to > host us. See below for details, she said that java was optional for a > good perl guy. Job is around 360 and 2222, is a permanent position, and > they are "flexible on salary". > > The recruiter information is: > > Harlan Ross TECHNICAL RECRUITER > 12331 RIATA TRACE PKWY, SUITE A200 AUSTIN, TX 78727 > 888.598.5877 T 512.249.4977 > F 512.249.4991 M 512.964.4669 > > Perl Developer Job Description: > > Our client is looking for a full-time, direct hire Perl developer. > > Our client helps automotive leaders design and implements successful > business initiatives that solve problems caused by the diversity, > complexity, and disparity of their business systems. Working together > seamlessly, the InfoIQSM Solutions provide complete information > management capabilities to market-leading OEMs, portals, retail > marketing operators, and major dealer groups. Available through an > application service provider (ASP) model, InfoIQ Solutions collect and > transform automotive industry data designed expressly to increase the > sale of new and used vehicles, service and parts. > > Description > The position is a mid level development position that works primarily > in design, coding, testing, and supporting software products and > related materials to meet customer requirements. The job will include > up to 60% development in Perl, with 20-25% in Java. > > Qualifications > Qualified candidates will have: > > Perl experience is a must. > Java experience is preferred. > Experience tuning database queries is a must. > Oracle experience and PL/SQL experience is a plus. > Ability to troubleshoot technical problems and demonstrate problem > solving skills and resourcefulness in obtaining information. > Ability to communicate effectively both verbally and in writing. > Ability to work as a team member with limited supervision. > > Required Skills: > > ? PERL > ? JSP > ? JAVA > * MOD_PERL > > ----------------------------------------------------------------------- > David H. Bluestein II > President & Lead Developer dbii at interaction.net > ii, inc. > http://www.interaction.net > -- Specializing in Interactive, Database Driven Web Applications -- > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin > > This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. From leeh at softwarejanitor.com Mon Oct 23 17:09:38 2006 From: leeh at softwarejanitor.com (Leeland Heins) Date: Mon, 23 Oct 2006 19:09:38 -0500 Subject: APM: Perl Job Position from Recruiter Message-ID: <200610231909.38933.leeh@softwarejanitor.com> On Monday 23 October 2006 02:39 pm, Tim Peoples wrote: > Interestingly enough, this job is actually for my team (and no... there > is no JSP requirement). > > What I'm really looking for is someone who is a fairly good OOP Perl > programmer who (over time) wants to also become a really good Java > programmer as well. That is interesting. I declined an offer through a recruiter to interview at DMi/ADP because it was described to me as being around 25% Java/JSP/J2EE development and only ~60% Perl with the remainder a mixture of other things like C#. It was also represented to me that most of the new development would be in Java and mostly only maintenance in Perl. After hearing that, I wasn't very interested. I'm probably cynical, but I've been disappointed too many times over the past few years by what was described to me as "Perl Developer" positions that turned out at interview time to be Java Developer positions plus maintaining a few Perl scripts someone wrote a few years ago or maintaining some Perl code while replacing it all with Java or while someone else is. -- Leeland Heins, leeh at softwarejanitor.com From mark at marklehmann.com Mon Oct 23 21:51:08 2006 From: mark at marklehmann.com (Mark Lehmann) Date: Mon, 23 Oct 2006 23:51:08 -0500 (CDT) Subject: APM: Perl Job Position from Recruiter In-Reply-To: <200610231909.38933.leeh@softwarejanitor.com> References: <200610231909.38933.leeh@softwarejanitor.com> Message-ID: <49724.192.168.15.1.1161665468.squirrel@lehmbrain.net> I had that position in that department and I mostly did Perl before Tim was running it. Some Java work was combing in, but I was primarily focused on Perl and a little PL/SQL. Tim has a great team of people. I'd still be there if a friend of mine had not offered me a really cool opportunity to be "The Database Guy" at a small startup that continues to be in business. Tim Peoples is one of the top ten perl developers in Texas and is an awesome mentor. And Tim has been able to find ways to make Java useable. -- Mark Lehmann On Mon, October 23, 2006 19:09, Leeland Heins wrote: > On Monday 23 October 2006 02:39 pm, Tim Peoples wrote: >> Interestingly enough, this job is actually for my team (and no... there >> is no JSP requirement). >> >> What I'm really looking for is someone who is a fairly good OOP Perl >> programmer who (over time) wants to also become a really good Java >> programmer as well. > > That is interesting. I declined an offer through a recruiter to interview > at > DMi/ADP because it was described to me as being around 25% > Java/JSP/J2EE development and only ~60% Perl with the remainder a > mixture of other things like C#. It was also represented to me that most > of the new development would be in Java and mostly only maintenance > in Perl. After hearing that, I wasn't very interested. I'm probably > cynical, > but I've been disappointed too many times over the past few years by > what was described to me as "Perl Developer" positions that turned out > at interview time to be Java Developer positions plus maintaining a few > Perl scripts someone wrote a few years ago or maintaining some Perl > code while replacing it all with Java or while someone else is. > > -- > Leeland Heins, leeh at softwarejanitor.com > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin > From CaptNemo at Austin.rr.com Tue Oct 24 07:52:48 2006 From: CaptNemo at Austin.rr.com (CaptNemo) Date: Tue, 24 Oct 2006 09:52:48 -0500 Subject: APM: How to psudo-array: $a$b ??? In-Reply-To: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com > References: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> Message-ID: <6.1.2.0.2.20061024094352.02160298@pop-server.austin.rr.com> Anyone know if it's possible (and how) to make a psudo-array? Meaning, is there a way to make an array WITHOUT using an array variable: I wanted three sets of 5 variables: $a1 $b1 $c1 $a2 $b2 $c2 $a3 $b3 $c3 $a4 $b4 $c4 $a5 $b5 $c5 ...but I really didn't want to use an @array variable (I'm having trouble with param() with array variables). I'd like to use a FOR loop to handle these variables but, perl doesn't like: for ($count..... { $a$count = par.... $b$count =.... $c$count... } (I think perl sees these as two variables) Any of you guys know how I can do this (without an @array)? From tmcd at panix.com Tue Oct 24 08:21:44 2006 From: tmcd at panix.com (Tim McDaniel) Date: Tue, 24 Oct 2006 10:21:44 -0500 (CDT) Subject: APM: How to psudo-array: $a$b ??? In-Reply-To: <6.1.2.0.2.20061024094352.02160298@pop-server.austin.rr.com> References: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> <6.1.2.0.2.20061024094352.02160298@pop-server.austin.rr.com> Message-ID: On Tue, 24 Oct 2006, CaptNemo wrote: > Meaning, is there a way to make an array WITHOUT using an array > variable: You could kludge together a method with "eval", but it would be so clumsy and hard to read that I think it would be fairly painful. Further, arrays are so easy to use that I don't see any pont. > ...but I really didn't want to use an @array variable (I'm > having trouble with param() with array variables). What's "param()"? perldoc -f param does not show that Perl has a built-in function named "param". I suggest you describe in detail what your troubles are, perhaps with a code fragment that you've edited down and run to demonstrate it. That way, you can understand the built-in language features and do it the convenient way. If you're having problems passing multiple arrays as sub parameters: it's a common problem and we can help. -- Tim McDaniel, tmcd at panix.com From CaptNemo at Austin.rr.com Tue Oct 24 08:45:52 2006 From: CaptNemo at Austin.rr.com (CaptNemo) Date: Tue, 24 Oct 2006 10:45:52 -0500 Subject: APM: param() WAS: How to psudo-array: $a$b ??? In-Reply-To: References: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> <6.1.2.0.2.20061024094352.02160298@pop-server.austin.rr.com> Message-ID: <6.1.2.0.2.20061024104159.020baef8@pop-server.austin.rr.com> param() is the perl/cgi command to receive data from an HTML form HTML FORM: sends data to ----> Perl program: $day = param ('dayofweek'); $day will then have FRIDAY as it's value. >What's "param()"? > perldoc -f param >does not show that Perl has a built-in function named "param". From taylor at codecafe.com Tue Oct 24 08:47:06 2006 From: taylor at codecafe.com (Taylor Carpenter) Date: Tue, 24 Oct 2006 10:47:06 -0500 Subject: APM: How to psudo-array: $a$b ??? In-Reply-To: References: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> <6.1.2.0.2.20061024094352.02160298@pop-server.austin.rr.com> Message-ID: <1161704826.16028.274101353@webmail.messagingengine.com> On Tue, 24 Oct 2006 10:21:44 -0500 (CDT), "Tim McDaniel" said: > On Tue, 24 Oct 2006, CaptNemo wrote: > > ...but I really didn't want to use an @array variable (I'm > > having trouble with param() with array variables). > > What's "param()"? > perldoc -f param > does not show that Perl has a built-in function named "param". > probably CGI.pm param(). From tmcd at panix.com Tue Oct 24 08:56:16 2006 From: tmcd at panix.com (Tim McDaniel) Date: Tue, 24 Oct 2006 10:56:16 -0500 (CDT) Subject: APM: param() WAS: How to psudo-array: $a$b ??? In-Reply-To: <6.1.2.0.2.20061024104159.020baef8@pop-server.austin.rr.com> References: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> <6.1.2.0.2.20061024094352.02160298@pop-server.austin.rr.com> <6.1.2.0.2.20061024104159.020baef8@pop-server.austin.rr.com> Message-ID: On Tue, 24 Oct 2006, CaptNemo wrote: > param() is the perl/cgi command to receive data from an HTML form Thanks (CGI::param, then). What's the exact problem you're having? -- Tim McDaniel, tmcd at panix.com From CaptNemo at Austin.rr.com Tue Oct 24 09:01:19 2006 From: CaptNemo at Austin.rr.com (CaptNemo) Date: Tue, 24 Oct 2006 11:01:19 -0500 Subject: APM: The situation- Re: How to psudo-array: $a$b ??? In-Reply-To: <6.1.2.0.2.20061024094352.02160298@pop-server.austin.rr.com > References: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> <6.1.2.0.2.20061024094352.02160298@pop-server.austin.rr.com> Message-ID: <6.1.2.0.2.20061024104601.02065ec0@pop-server.austin.rr.com> I'm trying to build a FORM page that will make a nice easy interface for my dumb co-workers to use to query MYSQL. The HTML page generates a FORMS page which consists of 5 lines of PULL-DOWN PULL-DOWN TEXT-BOX: _TABLE_COL_HEADERS_ _>_<_=_!=_ _TEXT_BOX_FOR_OPERATOR_INPUT_ _TABLE_COL_HEADERS_ _>_<_=_!=_ _TEXT_BOX_FOR_OPERATOR_INPUT_ _TABLE_COL_HEADERS_ _>_<_=_!=_ _TEXT_BOX_FOR_OPERATOR_INPUT_ _TABLE_COL_HEADERS_ _>_<_=_!=_ _TEXT_BOX_FOR_OPERATOR_INPUT_ _TABLE_COL_HEADERS_ _>_<_=_!=_ _TEXT_BOX_FOR_OPERATOR_INPUT_ These are assigned the names of: qa0, qb0, qc0 qa1, qb1, qc1 qa2, qb2, qc2 qa3, qb3, qc3 qa4, qb4, qc4 ...which are POSTed to the next script. For some reason, when I : my @qa; my @qb; my @qc; for ($count=0; $count<=4; $count++) { $qa[$count] = param ('qa$count'); $qb[$count] = param ('qb$count'); $qc[$count] = param ('qc$count'); } I don't get any of the values. The @qa, @qb & @qc variables are empty. BUT, when I use: my $qa0 = param ( 'qa0' ); my $qb0 = param ( 'qb0' ); my $qc0 = param ( 'qc0' ); my $qa1 = param ( 'qa1' ); my $qb1 = param ( 'qb1' ); my $qc1 = param ( 'qc1' ); my $qa2 = param ( 'qa2' ); my $qb2 = param ( 'qb2' ); my $qc2 = param ( 'qc2' ); my $qa3 = param ( 'qa3' ); my $qb3 = param ( 'qb3' ); my $qc3 = param ( 'qc3' ); my $qa4 = param ( 'qa4' ); my $qb4 = param ( 'qb4' ); my $qc4 = param ( 'qc4' ); my $qa5 = param ( 'qa5' ); my $qb5 = param ( 'qb5' ); my $qc5 = param ( 'qc5' ); my $qa6 = param ( 'qa6' ); my $qb6 = param ( 'qb6' ); my $qc6 = param ( 'qc6' ); The values are returned fine... I'm stumped (AGAIN) >Anyone know if it's possible (and how) to make a psudo-array? > >Meaning, is there a way to make an array WITHOUT using an array variable: > >I wanted three sets of 5 variables: > $a1 $b1 $c1 > $a2 $b2 $c2 > $a3 $b3 $c3 > $a4 $b4 $c4 > $a5 $b5 $c5 > > ...but I really didn't want to use an @array variable (I'm having > trouble >with param() with array variables). >I'd like to use a FOR loop to handle these variables but, perl doesn't like: > >for ($count..... > { > $a$count = par.... > $b$count =.... > $c$count... > } > >(I think perl sees these as two variables) >Any of you guys know how I can do this (without an @array)? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061024/4b882ee2/attachment-0001.html From zvonler at gmail.com Tue Oct 24 09:04:02 2006 From: zvonler at gmail.com (Zach Vonler) Date: Tue, 24 Oct 2006 11:04:02 -0500 Subject: APM: The situation- Re: How to psudo-array: $a$b ??? In-Reply-To: <6.1.2.0.2.20061024104601.02065ec0@pop-server.austin.rr.com> References: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> <6.1.2.0.2.20061024094352.02160298@pop-server.austin.rr.com> <6.1.2.0.2.20061024104601.02065ec0@pop-server.austin.rr.com> Message-ID: <1d0b0a8f0610240904q3f9b2684u2be9869195cacda@mail.gmail.com> On 10/24/06, CaptNemo wrote: > $qa[$count] = param ('qa$count'); Variables are not interpreted in single-quoted strings. Try "". Later, Zach From CaptNemo at Austin.rr.com Tue Oct 24 09:13:43 2006 From: CaptNemo at Austin.rr.com (CaptNemo) Date: Tue, 24 Oct 2006 11:13:43 -0500 Subject: APM: The situation- Re: How to psudo-array: $a$b ??? In-Reply-To: <1d0b0a8f0610240904q3f9b2684u2be9869195cacda@mail.gmail.com > References: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> <6.1.2.0.2.20061024094352.02160298@pop-server.austin.rr.com> <6.1.2.0.2.20061024104601.02065ec0@pop-server.austin.rr.com> <1d0b0a8f0610240904q3f9b2684u2be9869195cacda@mail.gmail.com> Message-ID: <6.1.2.0.2.20061024111138.02084760@pop-server.austin.rr.com> >> $qa[$count] = param ('qa$count'); > >Variables are not interpreted in single-quoted strings. Try "". GAH! That worked!!!! WHY IN THE HELL DOES SINGLE-QUOTES WORK WITH $qa BUT NOT WITH $qa[1] !?!?!?!?!?!?! That makes no sense. From zvonler at gmail.com Tue Oct 24 09:18:19 2006 From: zvonler at gmail.com (Zach Vonler) Date: Tue, 24 Oct 2006 11:18:19 -0500 Subject: APM: The situation- Re: How to psudo-array: $a$b ??? In-Reply-To: <6.1.2.0.2.20061024111138.02084760@pop-server.austin.rr.com> References: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> <6.1.2.0.2.20061024094352.02160298@pop-server.austin.rr.com> <6.1.2.0.2.20061024104601.02065ec0@pop-server.austin.rr.com> <1d0b0a8f0610240904q3f9b2684u2be9869195cacda@mail.gmail.com> <6.1.2.0.2.20061024111138.02084760@pop-server.austin.rr.com> Message-ID: <1d0b0a8f0610240918t136aa3c2t6eb96012a1efae37@mail.gmail.com> On 10/24/06, CaptNemo wrote: > WHY IN THE HELL DOES SINGLE-QUOTES WORK WITH $qa BUT NOT WITH $qa[1] > !?!?!?!?!?!?! I guess you're asking what the difference between $qa[$count] = param ('qa$count'); and my $qa0 = param ( 'qa0' ); is, when $count == 0. The difference is that in the first case, the argument to param is 'qa$count' and in the second the argument is 'qa0'. When you replaced the single quotes with double, the argument to param in the first case became 'qa0', identical to the second case. What you're assigning to ($qa0 vs. $qa[0]) has no effect here. Later, Zach From CaptNemo at Austin.rr.com Tue Oct 24 13:53:02 2006 From: CaptNemo at Austin.rr.com (CaptNemo) Date: Tue, 24 Oct 2006 15:53:02 -0500 Subject: APM: Last question (for today) In-Reply-To: <6.1.2.0.2.20061024111138.02084760@pop-server.austin.rr.com > References: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> <6.1.2.0.2.20061024094352.02160298@pop-server.austin.rr.com> <6.1.2.0.2.20061024104601.02065ec0@pop-server.austin.rr.com> <1d0b0a8f0610240904q3f9b2684u2be9869195cacda@mail.gmail.com> <6.1.2.0.2.20061024111138.02084760@pop-server.austin.rr.com> Message-ID: <6.1.2.0.2.20061024154709.02016ec0@pop-server.austin.rr.com> Okay, I have got everything working the database queries ok and returns data (into a variable)- $dbdata = `bdquery.pl`; Now, I'm worried about someone doing a wildcard query on our table with over 200K entries and overflowing something. Is there a way to limit variable size in perl? IF SO, What would be a reasonable upper limit (keeping in mind that some queries may be a large but necessary)? From mark at marklehmann.com Tue Oct 24 13:57:52 2006 From: mark at marklehmann.com (Mark Lehmann) Date: Tue, 24 Oct 2006 15:57:52 -0500 (CDT) Subject: APM: Last question (for today) In-Reply-To: <6.1.2.0.2.20061024154709.02016ec0@pop-server.austin.rr.com> References: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> <6.1.2.0.2.20061024094352.02160298@pop-server.austin.rr.com> <6.1.2.0.2.20061024104601.02065ec0@pop-server.austin.rr.com> <1d0b0a8f0610240904q3f9b2684u2be9869195cacda@mail.gmail.com> <6.1.2.0.2.20061024111138.02084760@pop-server.austin.rr.com> <6.1.2.0.2.20061024154709.02016ec0@pop-server.austin.rr.com> Message-ID: <63441.137.134.216.5.1161723472.squirrel@lehmbrain.net> Use your databases limit feature. Often the word "LIMIT" followed by a number at the end of the statement. example: SELECT * FROM dual LIMIT 1; -- Mark Lehmann On Tue, October 24, 2006 15:53, CaptNemo wrote: > Okay, I have got everything working the database queries ok and returns > data (into a variable)- > > $dbdata = `bdquery.pl`; > > Now, I'm worried about someone doing a wildcard query on our table with > over 200K entries and overflowing something. Is there a way to limit > variable size in perl? > > > > IF SO, > What would be a reasonable upper limit (keeping in mind that some queries > may be a large but necessary)? > > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin > From CaptNemo at Austin.rr.com Tue Oct 24 14:22:32 2006 From: CaptNemo at Austin.rr.com (CaptNemo) Date: Tue, 24 Oct 2006 16:22:32 -0500 Subject: APM: Last question (for today) In-Reply-To: <63441.137.134.216.5.1161723472.squirrel@lehmbrain.net> References: <6.1.2.0.2.20061020145532.01fe5288@pop-server.austin.rr.com> <6.1.2.0.2.20061024094352.02160298@pop-server.austin.rr.com> <6.1.2.0.2.20061024104601.02065ec0@pop-server.austin.rr.com> <1d0b0a8f0610240904q3f9b2684u2be9869195cacda@mail.gmail.com> <6.1.2.0.2.20061024111138.02084760@pop-server.austin.rr.com> <6.1.2.0.2.20061024154709.02016ec0@pop-server.austin.rr.com> <63441.137.134.216.5.1161723472.squirrel@lehmbrain.net> Message-ID: <6.1.2.0.2.20061024161935.020d5ec0@pop-server.austin.rr.com> DOH, limit the SQL query. /me feels dumb. I was so caught up in the joy that my pages are working, I'm not thinking straight. >Use your databases limit feature. Often the word "LIMIT" followed by a >number at the end of the statement. > >example: > >SELECT * > FROM dual > LIMIT 1; From jeff_sumner at hotmail.com Tue Oct 24 14:37:42 2006 From: jeff_sumner at hotmail.com (Jeff Sumner) Date: Tue, 24 Oct 2006 21:37:42 +0000 Subject: APM: Last question (for today) Message-ID: Don't know if it is relevant to you, but I use Oracle and I've gotten burned by the limit a couple of times.If you write something like:select * from taxonomy where rownum < 10 order by tax_id You do not get the first 10 rows, but a seemingly random 10 rows.The first 10 requires a subquery, otherwise oracle sorts the rows after taking the first 10 rows, not before.select * from (select * from taxonomy order by tax_id ) where rownum < 10 > Date: Tue, 24 Oct 2006 16:22:32 -0500> To: austin at pm.org> From: CaptNemo at Austin.rr.com> Subject: Re: APM: Last question (for today)> > DOH, limit the SQL query.> > /me feels dumb.> > I was so caught up in the joy that my pages are working, I'm not thinking > straight.> > > > >Use your databases limit feature. Often the word "LIMIT" followed by a> >number at the end of the statement.> >> >example:> >> >SELECT *> > FROM dual> > LIMIT 1;> > _______________________________________________> Austin mailing list> Austin at pm.org> http://mail.pm.org/mailman/listinfo/austin _________________________________________________________________ Personalize your Live.com homepage with the news, weather, and photos you care about. Try it. http://www.live.com/getstarted.aspx -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061024/571b775b/attachment.html From perlpilot at gmail.com Tue Oct 24 15:00:13 2006 From: perlpilot at gmail.com (Jonathan Scott Duff) Date: Tue, 24 Oct 2006 17:00:13 -0500 Subject: APM: Greetings! In-Reply-To: References: Message-ID: Hello there! I'm a long-time perl programmer and I'm going to be moving to the Austin area in December. I just wanted to say "Hi" and that I'll be coming to the meetings whenever I get a chance. What does Austion PM typically do? Anything interesting or fun going on? Is there a topic for the next meeting? BTW, in the "About Us" section of the web site it says that the meetings are every 3rd Wednesday, but in the "Location" section it says every 2nd Wednesday. I assume from the date of the last meeting that it's the 2nd Wednesday that is correct. -Scott P.S. If anyone knows of any good deals on houses or apartments in the south-west-ish part of Austin, let me know! Thanks. -- Jonathan Scott Duff perlpilot at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061024/5d34e1f2/attachment.html From dbii at interaction.net Tue Oct 24 15:04:49 2006 From: dbii at interaction.net (David Bluestein II) Date: Tue, 24 Oct 2006 17:04:49 -0500 Subject: APM: Greetings! In-Reply-To: References: Message-ID: <2d0df955d3dc0174f82a046ac337200d@interaction.net> Scott- We used to be 3d Wed, now are 2d Wed. We look forward to seeing you at the meetings. Nov/Dec are slow times, usually Dec is Xmas Dinner only. Are you moving for a perl job? If so, who are you working for? David On Oct 24, 2006, at 5:00 PM, Jonathan Scott Duff wrote: > Hello? there!? I'm a long-time perl programmer and I'm going to be > moving to the Austin area in December. I just wanted to say "Hi" and > that I'll be coming to the meetings whenever I get a chance.? What > does Austion PM typically do?? Anything interesting or fun going on?? > Is there a topic for the next meeting? > > BTW, in the "About Us" section of the web site it says that the > meetings are every 3rd Wednesday, but in the "Location" section it > says every 2nd Wednesday.? I assume from the date of the last meeting > that it's the 2nd Wednesday that is correct. > > -Scott > > P.S. If anyone knows of any good deals on houses or apartments in the > south-west-ish part of Austin, let me know! Thanks. > > -- > Jonathan Scott Duff > perlpilot at gmail.com > _______________________________________________ > Austin mailing list > Austin at pm.org > http://mail.pm.org/mailman/listinfo/austin ----------------------------------------------------------------------- David H. Bluestein II President & Lead Developer dbii at interaction.net ii, inc. http://www.interaction.net -- Specializing in Interactive, Database Driven Web Applications -- From ian at remmler.org Tue Oct 24 17:16:06 2006 From: ian at remmler.org (Ian Remmler) Date: Tue, 24 Oct 2006 19:16:06 -0500 Subject: APM: Greetings! In-Reply-To: References: Message-ID: <20061025001606.GA4937@localhost> Hi Scott, Welcome to Austin in advance. I recognized your name from the Perl 6 lists. Perhaps at some point you could be persuaded to tell us your thoughts on Perl 6? On Tue, Oct 24, 2006 at 05:00:13PM -0500, Jonathan Scott Duff wrote: > Hello there! I'm a long-time perl programmer and I'm going to be moving to > the Austin area in December. I just wanted to say "Hi" and that I'll be > coming to the meetings whenever I get a chance. What does Austion PM > typically do? Anything interesting or fun going on? Is there a topic for > the next meeting? We usually eat dinner somewhere, then move on to the meeting. There is usually a presentation, but we occasionally do a group problem solving session-type-thing. Sometimes we go out for drinks and milkshakes after the meeting. > BTW, in the "About Us" section of the web site it says that the meetings are > every 3rd Wednesday, but in the "Location" section it says every 2nd > Wednesday. I assume from the date of the last meeting that it's the 2nd > Wednesday that is correct. Yep, 2nd. I forgot to change the about page. Hope to see you at the meetings. - Ian. -- "A shark on whiskey is mighty risky. A shark on beer is a beer engineer." -- Dr. Worm From wwalker at bybent.com Tue Oct 24 17:29:40 2006 From: wwalker at bybent.com (Wayne Walker) Date: Tue, 24 Oct 2006 19:29:40 -0500 Subject: APM: Greetings! In-Reply-To: References: Message-ID: <20061025002940.GC3015@bybent.com> On Tue, Oct 24, 2006 at 05:00:13PM -0500, Jonathan Scott Duff wrote: > Hello there! I'm a long-time perl programmer and I'm going to be moving to > the Austin area in December. I just wanted to say "Hi" and that I'll be > coming to the meetings whenever I get a chance. What does Austion PM > typically do? Anything interesting or fun going on? Is there a topic for > the next meeting? Welcome. See you soon. We usually have meetings with a talk given by one of the members. We usually have a dinner beforehand (optional.) and often desert/beer afterwards (optional). -- Wayne Walker www.unwiredbuyer.com - when you just can't be by the computer wwalker at bybent.com Do you use Linux?! http://www.bybent.com Get Counted! http://counter.li.org/ Perl - http://www.perl.org/ Perl User Groups - http://www.pm.org/ Jabber: wwalker at jabber.gnumber.com AIM: lwwalkerbybent IRC: wwalker on freenode.net From perlpilot at gmail.com Tue Oct 24 20:40:04 2006 From: perlpilot at gmail.com (Jonathan Scott Duff) Date: Tue, 24 Oct 2006 22:40:04 -0500 Subject: APM: Greetings! In-Reply-To: <20061025001606.GA4937@localhost> References: <20061025001606.GA4937@localhost> Message-ID: On 10/24/06, Ian Remmler wrote: > > Hi Scott, > > Welcome to Austin in advance. Thanks. I recognized your name from the > Perl 6 lists. Perhaps at some point you could be persuaded to > tell us your thoughts on Perl 6? Sure, perhaps. -Scott -- Jonathan Scott Duff perlpilot at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/pipermail/austin/attachments/20061024/21a6f26c/attachment-0001.html From austin.pm at sam-i-am.com Wed Oct 25 20:25:05 2006 From: austin.pm at sam-i-am.com (Sam Foster) Date: Wed, 25 Oct 2006 22:25:05 -0500 Subject: APM: parsing javascript In-Reply-To: <4536394E.6070605@sam-i-am.com> References: <4536394E.6070605@sam-i-am.com> Message-ID: <45402A91.8070208@sam-i-am.com> quick update on this, apologies in advance as this became off topic as I researched it and found better non-perl solutions. I found the code I needed - written in javascript and run via Rhino - it was already written and working in the dojo toolkit build system. (the same system I was trying to extend in the first place. doh) http://archive.dojotoolkit.org/nightly/buildscripts/buildUtil.js For a more general case, Narcissus seemed like what I would need: http://lxr.mozilla.org/mozilla/source/js/narcissus/ Its a javascript parser (lexer) written in javascript - but I never got to trying it out. Rhino and the javascript shell ( http://www.mozilla.org/rhino/shell.html ) turn out to provide a preeety nice combo. I get all the good bits of java when I need them - I can just create a java class instance any time using e.g: var al = new java.util.ArrayList() .. but a dynamic language (that I happen to know pretty well already) for all the glue. This could spell trouble for the perl career I've not had yet. Had I wanted to pursue the perl angle, I would probably have ported Narcissus over (its written by the same guy that wrote javascript/ecmascript.. so I figure he knows what he's doing), and maybe used the HOP::Lexer module (discussed/demonstrated in this article: http://www.perl.com/pub/a/2006/01/05/parsing.html?page=1) to simplify things a little. Sam -- Sam Foster wrote: >hi all, >I'm looking for a way to parse - but not execute - some javascript. >I'm building up a dependency chain - my javascripts use a pair of >functions "provides" and "requires" to ensure pre-requisites are loaded >(these is using the dojo toolkit fwiw). I want to have perl follow this >chain, and in this case build a custom js library that concatenates all >the right files in the right order. >I'm looking at the JavaScript.pm module, which I think uses the >SpiderMonkey interpreter. Mark I think mentioned a way to use jars from >within a perl program - that might let me use the Rhino interpreter - >what was that Mark? > >As I'm not trying to parse all possible javascript but just a couple >statements, I could just do this myself I suppose. Does this kind of >thing exist elsewhere though. Seems like it might. > >thanks, >Sam > From mhc at texas.net Tue Oct 31 07:23:46 2006 From: mhc at texas.net (Mark Cunningham) Date: Tue, 31 Oct 2006 09:23:46 -0600 Subject: APM: Very cool Perl work available References: <13e12140ee305921c2d0a2115a66df48@interaction.net> <4252A0AE.1080600@sam-i-am.com> Message-ID: <006401c6fd00$8f4db660$6601a8c0@CUNNINGHAM> To whom it may concern: This is Mark Cunningham and I'm an independent technical recruiter here in Austin. I saw the thread from last week where there was some discussion on the continued encroachment of Java on to what used to be Perl work? Excuse my technical ignorance but I believe it was something to that effect. Anyways, I just got off the phone with a friend of mine who owns a small consulting firm. He told me that he desperately needs a strong Perl programmer to help out on some work that he just secured. It's a very long term project and I asked him the following, "Hey, is this long-term Perl work and really cool stuff?" He said that it's all web-based Perl development and will be so for a long time. So, if you any of you out there are looking for some challenging development using Perl, shoot me a resume and I'll get you an interview. This is a contract assignment but it's a long term project (close to 12 months and then probably extended beyond that) so you would be able to lock in for a while. Thanks, Mark Cunningham Technical Recruiter 512-527-0408 work 512-699-5719 cell mhc at texas.net