Re: Creating and Using Libraries

2002-12-03 Thread james lundeen
thank you for posting this detailed question.  i too need to know exactly how to do 
this.  anyone
out there that can help us, it would be much appreciated!-jim


--- Will [EMAIL PROTECTED] wrote:
 Greets Folks,
 
 I usually lurk on this list, but I came across an
 issue which I could really use some help with.  This
 will be half rant, half question, but I think I got it
 figured out.  What I am asking here is for someone to
 either: a.) correct me if I am wrong, or b.) tell me
 if I am right.
 
 That said, here it goes.
 
 In many of the books and manuals I have, it seems
 every author has a different opinion on where a perl
 library should go, and often authors seem to assume
 that the programmer has root access for module
 installs.  My host is pretty supportive when it comes
 to installing modules, but sometimes I wish I could do
 it myself, and this would include both self-made
 modules as well as pure perl modules off of CPAN
 (because not-pure-perl modules would require root
 access).
 
 My questions have been - 1.) How do I create the
 library?, and 2.) How do I use the library? 3.)
 How do I install pure perl CPAN modules in the
 library?  
 
 Here are my solutions, and this is where I am hoping
 to have someone tell me if I am correct or not.
 
 #1.) I guess the answer to question one is simply to
 create a directory somewhere within my user
 access/document tree, and then give it the proper
 access permissions.
 
 #2.) Then to list the path to the library in the
 module calls, like this:
 
 use lib '/user/public_html/cgi-bin/library';
 
 BUT, if I understand this correctly that is not enough
 because...  in addition... I also need to explicitly
 state what modules to use from the library in other
 module calls... So that, for instance, if I had
 installed something like HTML::Template along with a
 module I created called DBLogin under that same path
 I just listed, then I would use it by saying:
 
 use lib '/user/public_html/cgi-bin/library';
 
 #PLUS,
 
 use HTML::Template;
 use DBLogin;
 
 and so on...
 
 #3.) The third thing is that I am still unclear on how
 to put CPAN modules into the library.  I guess one
 just
 downloads them from CPAN and then uploads them to the
 library (using ASCII and proper access permissions),
 but, still, if I unzipped a CPAN module on my Windows
 system before uploadingit, then would it cause any
 problems when I ftp-ed it to the server?  Or, should I
 unzip them on Unix only?
 
 I think that about sums up my concern.  I hope I
 havent gone on too terribly long, but this concept is
 important to me, and yet it has been a bit frustrating
 trying to comprehend it.
 
 Any good help much appreciated.
 Thanks,
 
 Will
 
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: 5.005_03 vs. 5.8

2002-12-03 Thread fliptop
On Mon, 2 Dec 2002 at 21:28, Scot Robnett opined:

SR:I am working with a university on a web project which entails setting up a
SR:new server. We're going with Red Hat Linux on Dell hardware (RAID 5
SR:configuration), but I am not sure which version of Perl to recommend. I am
SR:very used to 5.005_03, but 5.8 is the current release.
SR:
SR:Do I have a large learning curve associated with going the 5.8 route as
SR:opposed to 5.005_03?
SR:
SR:If I want to port scripts, will they need to be rewritten?
SR:
SR:Are there significant benefits to using 5.8?
SR:
SR:On one hand, I want to keep up with the Joneses and take advantage of the
SR:most available power, but on the other hand, I'm used to one flavor and you
SR:know what they say about fixing things that ain't broke.
SR:
SR:Opinions, comments, suggestions?

if you're using redhat linux, i'd recommend using whatever rpm they have.  
for rh7.3, the current perl is 5.6.1.  for rh8, it's 5.8.0.

i've been using rh7.3 with the stock rpm's for perl, mod_perl and apache 
for some time now without any problems.  and the mod_perl is compiled in 
as a dso, something that was problematic before.

a good place to learn about the new features of the latest perl release is 
on perl.com:

http://www.perl.com/pub/a/language/info/software.html


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: 5.005_03 vs. 5.8

2002-12-03 Thread wiggins


On Mon, 2 Dec 2002 21:28:49 -0600, Scot Robnett [EMAIL PROTECTED] wrote:

 I am working with a university on a web project which entails setting up a
 new server. We're going with Red Hat Linux on Dell hardware (RAID 5
 configuration), but I am not sure which version of Perl to recommend. I am
 very used to 5.005_03, but 5.8 is the current release.
 

Nice choice. I would suggest you use the latest release so that you can have all the 
new features if you want them, but Perl is remarkably backwards compatible so little 
if anything should have to change in the old scripts.

 Do I have a large learning curve associated with going the 5.8 route as
 opposed to 5.005_03?
 

The learning curve is really as steep as you want it to be, many perlers still write 
what is basically perl 4 code in perl 5, that is very procedural, little scoping, etc. 
Others write everything in OOP with all the trimmings. Really comes down to how 
important effeciency on both sides aka the process itself and the design/development 
is to your project. If you can afford the little bit of time up front to design it 
more cleanly modular, etc. or whether it needs to be done yesterday may determine 
how many of the new features you can learn/use.

 If I want to port scripts, will they need to be rewritten?
 

Doubtful, possibly a few lines of code here and there.

 Are there significant benefits to using 5.8?
 

I defer to the internals gurus on this one, having some of the modules that are now 
standard is a big enough benefit to me, and knowing that if I ask for help and get an 
answer that was derived in 5.8 I don't have to be concerned about whether it will work 
in my version, etc.

 On one hand, I want to keep up with the Joneses and take advantage of the
 most available power, but on the other hand, I'm used to one flavor and you
 know what they say about fixing things that ain't broke.
 

Yep. Really a situational question, but I would say you at least want to be running at 
5.6.1 if for no other reason than to keep your own personal skills up to the current 
trends.  Definitely have a look at the history (see perldoc perl) for the changes. You 
might also try installing perl 5.8 in a different location on the system, installing 
your app(s) and seeing if they run with that perl, then you can be sure.

 Opinions, comments, suggestions?
 

Good luck.

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: 5.005_03 vs. 5.8

2002-12-03 Thread Scot Robnett
Thanks to all for your input on this.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Checking for existance for data in a column

2002-12-03 Thread T. Murlidharan Nair
Hi!!
I have a CGI that looks up data from a mysql data base and
does a bunch of calculations.  I only want to do calculations
on the columns which contains any data.  What I mean is for
some colums there is no data available at all.  So I don't want to do
any calculations on them obviously.  How do I check whether
the column contains data, once I have retrived all the  data
using fetchrow_hashref().
Thanks and Cheers alway!!
Murli



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Creating and Using Libraries

2002-12-03 Thread drieux

On Monday, Dec 2, 2002, at 14:34 US/Pacific, james lundeen wrote:
[..]

i too need to know exactly how to do this.  anyone
out there that can help us, it would be much appreciated!-jim

--- Will [EMAIL PROTECTED] wrote:

[..]

My questions have been - 1.) How do I create the
library?, and 2.) How do I use the library?

[..]

I should first start by saying I am an 'h2xs' bigot
and religiously believe in starting any new perl module,
especially 'pure perl modules' with

	h2xs -AX -n FOO::BAR

my General ranting on this is at:

	http://www.wetware.com/drieux/CS/lang/Perl/PM/

If you follow the 'just show me a case study' to

	http://www.wetware.com/drieux/CS/Proj/PID/

I try to walk through the basic process of starting out
with a silly Idea and creating a perl module.

The Other 'hot button' topic of course is whether or not one
should 'use lib' or require using the PERL5LIB environmental
variable... I once had an opinion, I have since violated all of them.

	cf: http://www.wetware.com/drieux/CS/lang/Perl/PM/useLibHack.html

Somewhere in all of this you will run into the usual problems
about whether or not you should make it 'oo' or should resolve
the name-space-management issues. Good Luck, there are opinions.

May I recommend that the principle advantage of starting with
the h2xs approach, in the *nix environment, is that one can build
a CPAN style approach that can EITHER be installed where ever it
is that the perl built for that host knows where site_perl resides,
or you can over-ride that with installing it into your home directory,
or the 3rd path of installing them into 'other places' such as

	/usr/local/lib/MyProjectHere

so that everyone has to have that in the @INC by what ever means.

HTH.


ciao
drieux

---


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: 5.005_03 vs. 5.8

2002-12-03 Thread Scot Robnett
Thanks again everyone. Based on your input, reading the docs, and doing some
evaluation of our own needs, we decided on Red Hat 8.0, which comes with
Perl 5.8.0, Apache 2.0, and with the mod_perl package. It all goes on a Dell
PowerEdge 2600 144 GB (108 usable) RAID 5 with a 512 MB Xeon. Sweeet.

New toys! As they might say in California, like, I'm so stoked!

Scot R.
inSite




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Checking for existance for data in a column

2002-12-03 Thread fliptop
On Tue, 3 Dec 2002 at 09:36, T. Murlidharan Nair opined:

TMN:any calculations on them obviously.  How do I check whether
TMN:the column contains data, once I have retrived all the  data
TMN:using fetchrow_hashref().

you probably should ask on a dbi list.

http://www.isc.org/services/public/lists/dbi-lists.html


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Checking for existance for data in a column

2002-12-03 Thread Jason Purdy
You can most likely preclude empty/invalid data with SQL.  Let's say your
field/column name is 'name'.  Then with your DBI prepare() call, you can
preclude records where name is blank, null, or whatever you'd like.

$sth = $dbh-prepare( 'SELECT * FROM table WHERE name IS NOT NULL' );
$sth-execute;

# Proceed with your fetchrow_hashref()'s, etc

HTH  Have Fun!

Jason

T. Murlidharan Nair [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi!!
 I have a CGI that looks up data from a mysql data base and
 does a bunch of calculations.  I only want to do calculations
 on the columns which contains any data.  What I mean is for
 some colums there is no data available at all.  So I don't want to do
 any calculations on them obviously.  How do I check whether
 the column contains data, once I have retrived all the  data
 using fetchrow_hashref().
 Thanks and Cheers alway!!
 Murli





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]