errors

2002-08-02 Thread Kyle Babich

My error log is giving me this:
[Fri Aug  2 07:02:39 2002] [error] [client 63.208.116.140] Premature
end of script headers:
/home/sites/kmb/www/public_html/njindenial/index.pl
syntax error at /home/sites/kmb/www/public_html/njindenial/index.pl
line 20, near my 
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 20.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 26.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 49.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 72.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 95.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 118.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 141.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 164.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 187.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 210.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 233.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 256.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 279.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 302.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 325.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 348.
Missing right curly or square bracket at
/home/sites/kmb/www/public_html/njindenial/index.pl line 386, within
string
  (Might be a runaway multi-line  string starting on line 383)
/home/sites/kmb/www/public_html/njindenial/index.pl has too many
errors.

I never had any of these errors until I added the loggging information
to the top of my (attached) script.  I guess I should add 'my' before
all of those '$con's, but what about the missing bracket?  I can't find
any missing brackets anywhere.  Can someone tell me why I get all of
these errors all of a sudden?

Thank you again,
--
Kyle

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




errors

2002-08-02 Thread Kyle Babich

My error log is giving me this:
[Fri Aug  2 07:02:39 2002] [error] [client 63.208.116.140] Premature
end of script headers:
/home/sites/kmb/www/public_html/njindenial/index.pl
syntax error at /home/sites/kmb/www/public_html/njindenial/index.pl
line 20, near my 
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 20.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 26.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 49.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 72.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 95.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 118.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 141.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 164.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 187.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 210.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 233.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 256.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 279.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 302.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 325.
Global symbol $con requires explicit package name at
/home/sites/kmb/www/public_html/njindenial/index.pl line 348.
Missing right curly or square bracket at
/home/sites/kmb/www/public_html/njindenial/index.pl line 386, within
string
  (Might be a runaway multi-line  string starting on line 383)
/home/sites/kmb/www/public_html/njindenial/index.pl has too many
errors.

I never had any of these errors until I added the loggging information
to the top of my (attached) script.  I guess I should add 'my' before
all of those '$con's, but what about the missing bracket?  I can't find
any missing brackets anywhere.  Can someone tell me why I get all of
these errors all of a sudden?

Thank you again,
--
Kyle

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




get data over ssh

2002-08-02 Thread Rob

Hi, I don't have any relevant code to post but what I would like to do is;
from a server behind a firewall I would like to ssh to an Internet server
and grep a line out of the password file into my script running behind the
firewall.  Any ideas if this is possible or what category on the CPAN that
I should look at?

Thanks

Rob

Good judgement comes from experience, and experience -
well, that comes from poor judgement.




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




Fwd: errors

2002-08-02 Thread Kyle Babich

Sorry, forgot to attach it.

On Fri, 2 Aug 2002 12:18:54 UT, Kyle Babich [EMAIL PROTECTED] said:
 My error log is giving me this:
 [Fri Aug  2 07:02:39 2002] [error] [client 63.208.116.140] Premature
 end of script headers:
 /home/sites/kmb/www/public_html/njindenial/index.pl
 syntax error at /home/sites/kmb/www/public_html/njindenial/index.pl
 line 20, near my 
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 20.
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 26.
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 49.
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 72.
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 95.
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 118.
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 141.
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 164.
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 187.
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 210.
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 233.
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 256.
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 279.
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 302.
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 325.
 Global symbol $con requires explicit package name at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 348.
 Missing right curly or square bracket at
 /home/sites/kmb/www/public_html/njindenial/index.pl line 386, within
 string
   (Might be a runaway multi-line  string starting on line 383)
 /home/sites/kmb/www/public_html/njindenial/index.pl has too many
 errors.
 
 I never had any of these errors until I added the loggging information
 to the top of my (attached) script.  I guess I should add 'my' before
 all of those '$con's, but what about the missing bracket?  I can't find
 any missing brackets anywhere.  Can someone tell me why I get all of
 these errors all of a sudden?
 
 Thank you again,
 --
 Kyle
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

--
Kyle



index.pl
Description: Perl program

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


Re: Fwd: errors

2002-08-02 Thread Felix Geerinckx

on Fri, 02 Aug 2002 12:24:29 GMT, [EMAIL PROTECTED] (Kyle Babich) wrote:

 Sorry, forgot to attach it.

Please don't attach files to your posts. You can always cut and paste 
the relevant code directly into your message body.

Your error is in line 13, where you write:

 [one line wrapped]
 print LOG $ENV{HTTP_USER_AGENT} $ENV{REMOTE_ADDR} 
$ENV{REMOTE_HOST} $ENV{HTTPS } $ENV{REMOTE_PORT}
$ENV{SCRIPT_FILENAME};

You can't have double quotes within double quotes without escaping 
them. But why write $ENV{HTTPS} when $ENV{HTTPS} works as well?

BTW (just curious :-), why are you seeking to the beginning of a file 
just after opening it for read? And why are you assigning the return 
value of the open call to the misleadingly named variable '$content'? 
You do know that the return value of an open call has nothing to do 
with the contents of the file, don't you?

-- 
felix

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




RE: get data over ssh

2002-08-02 Thread Joel Hughes

Hi Rob,
I'm not a 100% sure of the setup your trying to achieve here but if you are
asking can I perform an HTTP request over an SSH connection then I believe
the answer is yes and is achieved via SSH port forwarding which basically
means that you connect to the SSH server on your local machine (which talks
to the the SSH server on the remote machine) and SSH will forward traffic to
the service running on port x of the remote machine (via secure SSH).

Generally this is called SSH PORT FORWARDING - here is a URL but you'll find
plenty others.

http://csociety.ecn.purdue.edu/~sigos/projects/ssh/forwarding/


joel

-Original Message-
From: Rob [mailto:[EMAIL PROTECTED]]
Sent: 02 August 2002 13:29
To: [EMAIL PROTECTED]
Subject: get data over ssh


Hi, I don't have any relevant code to post but what I would like to do is;
from a server behind a firewall I would like to ssh to an Internet server
and grep a line out of the password file into my script running behind the
firewall.  Any ideas if this is possible or what category on the CPAN that
I should look at?

Thanks

Rob

Good judgement comes from experience, and experience -
well, that comes from poor judgement.




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


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




Re: To upload file from client to Appache server (WNNT)

2002-08-02 Thread Bruce Ambraal

Check out the errors I am getting when I run the bruce.html on my
Appache 
(Apache/1.3.26 Server at 165.25.207.246 Port 80) 

my Perl have been install in dir c:/program files/perl/bin.
When I view any Perl program via the web then I get the same errors.

What am I doing wrong.

Please help



error.zip
Description: Zip compressed data

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


Re: flock(); with strict subs

2002-08-02 Thread Steve Grazzini

Kyle Babich [EMAIL PROTECTED] wrote:
 How do I flock(); with strict subs in effect?

flock is a builtin.

  flock($fh, 2);

If you want the symbolic constants, you need to

  use Fcntl qw/:flock/;
  flock($fh, LOCK_EX);

-- 
Steve

perldoc -qa.j | perl -lpe '($_)=m((.*))'

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




Re: To upload file from client to Appache server (WNNT)

2002-08-02 Thread Connie Chan

I didn't read the rest of your code, but I found a very visible 
error You say your perl(perhaps you mean the comipler)
is installed at C:/progra~1/perl/... but your code write it as : 
#!E:/Perl/bin/perl -wT

So I guess everything will going wrong

Rgds,
Connie






- Original Message - 
From: Bruce Ambraal [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, August 02, 2002 10:23 PM
Subject: Re: To upload file from client to Appache server (WNNT)


 Check out the errors I am getting when I run the bruce.html on my
 Appache 
 (Apache/1.3.26 Server at 165.25.207.246 Port 80) 
 
 my Perl have been install in dir c:/program files/perl/bin.
 When I view any Perl program via the web then I get the same errors.
 
 What am I doing wrong.
 
 Please help
 





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


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




newbie syntax error - Perl 4 - Perl 5.6.1

2002-08-02 Thread Robert Larmon

Okay, so I'm a total Perl newbie.  I have an old script (that I 
unfortunately inherited) that I'd like to convert to Perl 5.  I copied 
it over, and I get a syntax error.  I went to perl.org, perl.com, etc., 
but can't find anything that describes the differences between 4 and 5. 
  I feel like I'm shooting in the dark, and conceptually I'm just trying 
to understand the code.  Anyone have a link?  Anyways, here's a snippet 
that doesn't work...

syntax error at appl_request.c line 8, near *,
syntax error at appl_request.c line 20, near char   last


#include stdio.h
#include stdlib.h
#include string.h
#include time.h

int main()
{
   char * fDecodeUrl(char *, char *);

   char   buffer[5000];
   char   apalsa[10] = {0};
   char   blsa[10] = {0};
   char   gllu[10] = {0};
   char   laRaza[10] = {0};
   char   wla[10] = {0};
   char   sba[10] = {0};
   char   prefix[10] = {0};
   char   first[100] = {0};
   char   middle[100] = {0};
   char   last[100] = {0};
   char   addr1[100] = {0};
   char   addr2[100] = {0};


Is there a way to debug this?

Thanks,

Robert


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




Re: Add directories to @INC

2002-08-02 Thread Steve Grazzini

Harry Putnam [EMAIL PROTECTED] wrote:
 Shishir K. Singh [EMAIL PROTECTED] writes:
 
I've been pounding perldoc for a while this morning trying to 
find a clear technique described to add directories to @INC 
(permanently).

I'm sure its described somewhere but I'm not finding it.

I know about the -I switch method but wanted to add certain
directories permanently so perl -V will display them.

 Perhaps you may need to reinstall if you don't want to use -I !!
 
 Sorry Shishir, but I'm a little mystified by your answer.  Are you
 saying there is no way to permanently add directories to @INC, or
 maybe that -I does that?
 
 How will a reinstall help?

The 'permanent' @INC, the one in -V, is in the binary; 
you need to rebuild to change it.

If you haven't already, check perlfaq8: 

  How do I add a directory to my include path at runtime? 

For a few other suggestions.

HTH
-- 
Steve

perldoc -qa.j | perl -lpe '($_)=m((.*))'

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




Re: How to create DBI connection on unix to MS SQL server ?

2002-08-02 Thread Vitaliy Babiy


Learn Perl [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi guys,

 just wondering how to establish a DBI connection from a unix machine to a
 WINNT machine running MS SQL server? do I have to specify an OBDC?

I think you can do it as usually.

For example:
--
my $dbname =aissm;
my $dbhost =localhost;
my $dbuser =root;
my $dbpass =gfhjkm;

my $dbh = DBI-connect(DBI:mysql:$dbname:$dbhost,$dbuser,$dbpass);
--




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




Re: newbie syntax error - Perl 4 - Perl 5.6.1

2002-08-02 Thread Felix Geerinckx

on Thu, 01 Aug 2002 22:10:41 GMT, [EMAIL PROTECTED] (Robert
Larmon) wrote: 

 Okay, so I'm a total Perl newbie.  I have an old script (that I 
 unfortunately inherited) that I'd like to convert to Perl 5.  I
 copied it over, and I get a syntax error.  I went to perl.org,
 perl.com, etc., but can't find anything that describes the
 differences between 4 and 5. 
 [...]
 syntax error at appl_request.c line 8, near *,
 syntax error at appl_request.c line 20, near char   last

 [c-code snipped]


It's a c program, not a Perl 4 script.

-- 
felix

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




RE: newbie syntax error - Perl 4 - Perl 5.6.1

2002-08-02 Thread Timothy Johnson

 
Ummm...Are you sure that isn't C?

-Original Message-
From: Robert Larmon
To: [EMAIL PROTECTED]
Sent: 8/1/02 3:10 PM
Subject: newbie syntax error - Perl 4 - Perl 5.6.1

Okay, so I'm a total Perl newbie.  I have an old script (that I 
unfortunately inherited) that I'd like to convert to Perl 5.  I copied 
it over, and I get a syntax error.  I went to perl.org, perl.com, etc., 
but can't find anything that describes the differences between 4 and 5. 
  I feel like I'm shooting in the dark, and conceptually I'm just trying

to understand the code.  Anyone have a link?  Anyways, here's a snippet 
that doesn't work...

syntax error at appl_request.c line 8, near *,
syntax error at appl_request.c line 20, near char   last


#include stdio.h
#include stdlib.h
#include string.h
#include time.h

int main()
{
   char * fDecodeUrl(char *, char *);

   char   buffer[5000];
   char   apalsa[10] = {0};
   char   blsa[10] = {0};
   char   gllu[10] = {0};
   char   laRaza[10] = {0};
   char   wla[10] = {0};
   char   sba[10] = {0};
   char   prefix[10] = {0};
   char   first[100] = {0};
   char   middle[100] = {0};
   char   last[100] = {0};
   char   addr1[100] = {0};
   char   addr2[100] = {0};


Is there a way to debug this?

Thanks,

Robert


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

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




Complex numbers

2002-08-02 Thread James Campbell

Hi All

Anyone no if there is a way of getting ActiveState's perl to handle complex
numbers?

The ActiveState home page has info on Math::Cephes::Complex but when I use
ppm3 to try and find this

Nothing...

Any other suggestions or work-arounds that others have used?

Cheers
James
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
James Campbell
Research Bioinformatician

Proteome Sciences
Institute of Psychiatry
South Wing Lab
PO BOX P045
16 De Crespigny Park
London SE5 8AF

Tel:+44-(0)207-848-5111
Fax:+44-(0)207-848-5114
Email:  [EMAIL PROTECTED]
Web 1:  www.proteome.co.uk (Corporate site)
Web 2:  www.proteinworks.com (Satellite site - Proteomics facility)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

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




Re: Complex numbers

2002-08-02 Thread Felix Geerinckx

on Fri, 02 Aug 2002 11:20:41 GMT, [EMAIL PROTECTED] (James
Campbell) wrote: 

 Anyone no if there is a way of getting ActiveState's perl to
 handle complex numbers?
 
 The ActiveState home page has info on Math::Cephes::Complex but
 when I use ppm3 to try and find this
 
 Nothing...
 
 Any other suggestions or work-arounds that others have used?


Does the 'Math::Complex' module, which is part of any standard Perl 
distribution and which should already be on your harddisk, not suit 
your needs?

See

perldoc Math::Complex

-- 
felix

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




Re: speed and perl

2002-08-02 Thread drieux


On Thursday, August 1, 2002, at 11:08 , Paul Tremblay wrote:
[..]
 Certainly, a perl script would be easier to maintain and debug.

 Thoughs on how C, java, and perl compare on speed?

I think what you are running into here is that
'c' as is, was not built to do 'regular expression'
work - as 'strings' are not a 'native' data type.

Some folks compile their c programmes using a
perl embedding trick that allows them to access
some of perl's parsing capability.

So one of your first concerns may well be that you
are timing against badly written 'c' code to begin with.
{ a problem that exists through much of the 'open sourced'
code I have seen - where what is out there is what someone
put out as they were learning... }

As for the other comparatives - you started to answer
your own question with the line:

 Certainly, a perl script would be easier to maintain and debug.

assuming that you have done it reasonably well, and
modular enough, so that you essentially validate it
component wise and build it appropriately.

But as some have noticed, the moment that you start
various types of modularizations you wind up with
the 'overhead' of having 'functions' - hence the
need to stash stuff on the stack, make the jump to
the code segment, and return... Which can lead to
what had been a 'really fast' 'linear' script
becoming slower



ciao
drieux

---


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




Re: Add directories to @INC

2002-08-02 Thread Jenda Krynicky

From: Harry Putnam [EMAIL PROTECTED]
 Jenda Krynicky [EMAIL PROTECTED] writes:
 
  I've been pounding perldoc for a while this morning trying to find
  a clear technique described to add directories to @INC
  (permanently).
  
  I'm sure its described somewhere but I'm not finding it.
  
  I know about the -I switch method but wanted to add certain
  directories permanently so perl -V will display them.
 
  What is your operating system?
 
 FreeBSD-4.6 and linux (redhat 7.3) The action I've described is on the
 FreeBSD box but it has come up on linux boxes before too.

I see. Then AFAIK your best bet is to set the PERL5LIB system 
variable to a list of the directories you want to add. 

Jenda
=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
--- me


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




RE: speed and perl

2002-08-02 Thread Nikola Janceski

personally I don't do speed while writing perl. I tend to break many keys.



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


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




Re: speed and perl

2002-08-02 Thread Bryan DeLuca

If you are interested in language benchmarks you might want to check out
the Great Computer Language Shootout:

http://www.bagley.org/~doug/shootout/

It has some surprising results.

Enjoy,

On Fri, 2002-08-02 at 01:08, Paul Tremblay wrote:
 This question may be too vague for a good answer, but my curiosity makes
 me ask it anyway. I thought I read somewhere that perl is actually
 faster than C for certain tasks. The vagueness of the question probably
 lies in exactly what task, who writes the program, the size and type of
 data, and a dozen other factors.
 
 Specifically, I am writing a perl script to convert RTF to XML. I
 downloaded a utility called unrtf, written in C, which converts RTF to
 HTML, a somewhat easier task. I got depressed when I ran unrtf on
 small files and saw that it didn't take *any* time. But when I ran it on
 a big file of 1.8 megabytes, it actually took 6 minutes and 30 seconds.
 My script only took a minute! (Hooray, after all this hard work, that's
 a little encouraging to see!)
 
 When I ran the same file through a java utility called majix, it took
 over a minute. It is hard to say exactly, because majix supplies their
 own timer, and this timer only starts when java starts processing the
 documents, some 20 or 30 seconds after you launch it.
 
 I had actually considered learning C++ to make my little script really
 fast so that people would consider using it. I really doubt I would have
 really gone through all that trouble, but now I am wondering if C++
 would have given that much of a time advantage--if any at all.
 
 Certainly, a perl script would be easier to maintain and debug.
 
 Thoughs on how C, java, and perl compare on speed? 
 
 (I know I did a little test with sed, a python script, and a perl
 script, just changing the word the to teh in a huge file. Sed and
 python took about he same time, while perl was six times faster.)
 
 Paul
 
 
 
 -- 
 
 
 *Paul Tremblay *
 *[EMAIL PROTECTED]*
 
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-- 
Bryan DeLuca
UNIX guy

Public key available at:  ftp://ftp.supakewl.com/pub/bryan_pub.key
This E-mail was scanned by Carnivore.  Get GNUpg http://www.gnupg.org


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




Re: speed and perl

2002-08-02 Thread Jenda Krynicky

From: Paul Tremblay [EMAIL PROTECTED]

 This question may be too vague for a good answer, but my curiosity
 makes me ask it anyway. I thought I read somewhere that perl is
 actually faster than C for certain tasks. The vagueness of the
 question probably lies in exactly what task, who writes the program,
 the size and type of data, and a dozen other factors.

Computing power is cheap, programmers' time is expensive!

 Specifically, I am writing a perl script to convert RTF to XML. I
 downloaded a utility called unrtf, written in C, which converts RTF to
 HTML, a somewhat easier task. I got depressed when I ran unrtf on
 small files and saw that it didn't take *any* time. But when I ran it
 on a big file of 1.8 megabytes, it actually took 6 minutes and 30
 seconds. My script only took a minute! (Hooray, after all this hard
 work, that's a little encouraging to see!)
 
 When I ran the same file through a java utility called majix, it took
 over a minute. It is hard to say exactly, because majix supplies their
 own timer, and this timer only starts when java starts processing the
 documents, some 20 or 30 seconds after you launch it.
 
 I had actually considered learning C++ to make my little script really
 fast so that people would consider using it. I really doubt I would
 have really gone through all that trouble, but now I am wondering if
 C++ would have given that much of a time advantage--if any at all.

You might be able to speed it up a bit, but I doubt it.
I mean text munglig is something Perl has been optimized to do. Keep 
in mind that you spend most of the time in libraries and functions 
implemented in C, heavily optimized.
 
 Certainly, a perl script would be easier to maintain and debug.
 
 Thoughs on how C, java, and perl compare on speed? 

[rem]I don't like Java.[/rem]
Java was always more of a marketing hype then a usefull language. And 
it's strong points were never thought to be text processing. Plus the 
Java runtime is bigger and havier than Perl runtime. I would not even 
consider it.

C COULD be the quickest, but doesn't have to be. Plus to be able to 
do anything you'd have to use some libraries anyway. Then it might be 
almost the same whether you use a C library from C or from Perl.

When considering whether to rewrite some Perl code into C think about 
one thing. How much time does the program spend in your code and how 
much in libraries, regexps, builtins, ...?
And how much time YOU lose while rewriting and maintaining?

Usualy you'll find out it's not worth the effort, or that rewriting a 
tiny piece of code in C and leaving the rest in Perl will be best.

Jenda
=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
--- me


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




RE: How to create DBI connection on unix to MS SQL server ?

2002-08-02 Thread Bob Showalter

 -Original Message-
 From: learn perl [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 5:33 PM
 To: [EMAIL PROTECTED]
 Subject: How to create DBI connection on unix to MS SQL server ?
 
 
 Hi guys,
 
 just wondering how to establish a DBI connection from a unix 
 machine to a
 WINNT machine running MS SQL server? do I have to specify an OBDC?

Hard way: find ODBC client software for your UNIX box and use DBD::ODBC.

Easy way: install Perl and DBI/DBD::ODBC on the NT box and use DBD::Proxy on
the UNIX box.

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




Re: How to create DBI connection on unix to MS SQL server ?

2002-08-02 Thread Jenda Krynicky

From: Vitaliy Babiy [EMAIL PROTECTED]
 Learn Perl [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi guys,   just wondering how to establish a DBI connection from a
 unix machine to a  WINNT machine running MS SQL server? do I have to
 specify an OBDC?
 
 I think you can do it as usually.
 
 For example:
 --
 my $dbname =aissm;
 my $dbhost =localhost;
 my $dbuser =root;
 my $dbpass =gfhjkm;
 
 my $dbh =
 DBI-connect(DBI:mysql:$dbname:$dbhost,$dbuser,$dbpass);
 --

Eric wanted connection with MS SQL, not Mysql!

I believe there are some ODBC drivers available for unix, but I don't 
know if they are free. You should be able to use DBD::Sybase though.

my $dbh 
= DBI-connect(DBI:Sybase:$dbserver,$dbuser,$dbpass);

but I've never tried.

At worst you could use DBD::Proxy and run a Perl service/daemon on 
the Windows computer. Again I never needed this, but DBD::Prozy 
should tell you how.

Jenda

=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
--- me


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




Re: How to create DBI connection on unix to MS SQL server ?

2002-08-02 Thread chris

SQLXML way:
SQLXML (currently at version 3.0) allows you to set up IIS Virtual
Directories that act as 'gateways' to a SQL Server 2000 database using
a given login and password. You can then send queries to the database
in various formats and SQL Server will return the results in XML. 

http://yourMSSQLhost/SQLXMLdir?SQL=SELECT+*+FROM+[mytablename]+FOR+XML+AUTOroot=root


On Fri, 2 Aug 2002 10:32:44 -0400 , [EMAIL PROTECTED] (Bob
Showalter) wrote:

 -Original Message-
 From: learn perl [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 5:33 PM
 To: [EMAIL PROTECTED]
 Subject: How to create DBI connection on unix to MS SQL server ?
 
 
 Hi guys,
 
 just wondering how to establish a DBI connection from a unix 
 machine to a
 WINNT machine running MS SQL server? do I have to specify an OBDC?

Hard way: find ODBC client software for your UNIX box and use DBD::ODBC.

Easy way: install Perl and DBI/DBD::ODBC on the NT box and use DBD::Proxy on
the UNIX box.


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




newbie question about Sys::Hostname and modules in general

2002-08-02 Thread Chad Kellerman

Hello,

   Ok, I made a newbie mistake and I hope I don't have to go back and
change my code.

  I wrote a script that talks to a Mysql database.  I created a table
called hostname.

I created a subroutine to send email messages when that is any errors as
well as log them to the db. 

  Problem is I want to include the hostname of the server in the subject
of the email.

** I always have issues with scope  Can I use Sys::Hostname  just in
the subroutine, or any perl module for that matter?  Or do I have to use
it globally?

$host=hostname; finds that daggone hostname and I have hostname all over
te placemy bad.  :^(.

Thanks for the help.

chad

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




nortel boxe connection?

2002-08-02 Thread P lerenard

is there a possiblity like on a router cisco to connect to a nortel boxe?

Thanks

Pierre




_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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




Re: speed and perl

2002-08-02 Thread Dennis G. Wicks


On Fri, 2 Aug 2002, Jenda Krynicky wrote:


   Computing power is cheap, programmers' time is expensive!


Yes, but the programmer's time is only used once.
CPU cycles are used again and again and again ...

The cost of inefficient programs is cumulative and results
in increasing all the infrastructure costs because of the
requirement for more and more cheap computing power.


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




RE: Complex numbers - D'Oh!

2002-08-02 Thread James Campbell

 Anyone no if there is a way of getting ActiveState's perl to
 handle complex numbers?

Does the 'Math::Complex' module, which is part of any standard Perl 
distribution and which should already be on your harddisk, not suit 
your needs?

--
Shame on me, sometimes I miss things that are right under my nose.
Thanks loads. I've just drawn my first Mandlebrot set - I'm so happy

James ~:o)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
James Campbell
Research Bioinformatician

Proteome Sciences
Institute of Psychiatry
South Wing Lab
PO BOX P045
16 De Crespigny Park
London SE5 8AF

Tel:+44-(0)207-848-5111
Fax:+44-(0)207-848-5114
Email:  [EMAIL PROTECTED]
Web 1:  www.proteome.co.uk (Corporate site)
Web 2:  www.proteinworks.com (Satellite site - Proteomics facility)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

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




grab another param from url

2002-08-02 Thread Larry Steinberg

Hi,

I have a subroutine that grabs a parameter (city) from the url for use in
the script (which produces a report with the value of that parameter). I now
want to grab another parameter (state) and append it to the previous and
have it also appear in the report. Preferably it would look like this:
Boston, MA (without the quotes). Here's the code:

sub parseUrl {

$nPara = $tPara = ;

($nPara) = ( $line =~ /[\?]N=([^\s]+)/i );
if ($nPara ne ) { $nPara = unpack_clean($nPara); }

($tPara) = ( $line =~ /[\?]T=([^\s]+)/i );#gets city parameter
(T=)
if ($tPara ne ) { $tPara = unpack_clean($tPara); }

if ($tPara ne   $err eq cit) {
# print $tPara\n;
 if (exists $userCit{$tPara}) { $userCit{$tPara}++; }
 else { $userCit{$tPara}=1; $countCit++;}
}

How do I add the state parameter (S=)?

Thanks!

-Larry



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




getting rid of box

2002-08-02 Thread Larry Steinberg

I have these coming up when creating a report:

ma, BC: 1
bost, : 1
Montroyal, QC: 1
waltam, MA: 1
Quebec, QC: 1
booger, MA: 1
Franklinxxx, MA: 1
BOSTI, MA: 1

How do I rid the report of these boxes?

--
-Larry



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




Problem with substr

2002-08-02 Thread Pablo Jejcic

Hi, I have the attached problem with a PERL program. I'm trying to read
a cookie from an ASP page.

If anyone have any idea, it will be really appreciated.-

Pablo.-


---BeginMessage---



Use of uninitialized value in index at ./outlook-grabber.pl line 232.
Use of uninitialized value in substr at ./outlook-grabber.pl line 232.


And line 232 looks like:

  for ($cnt=0; $cntlength($txt); $cnt++)
  {
#LINE 232#if(substr($txt,$cnt,1) eq )
{
  $ignore = 1;
}
if ($ignore == 2)
{
  $newtext .= substr($txt,$cnt,1);
}

if(substr($txt,$cnt,1) eq )
{
  $ignore = 2;
}
  }
  return $newtext;
}





---End Message---

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


RE: getting rid of box

2002-08-02 Thread Kipp, James

well you did not supply much information here, but i have seen those 
before, and it usually a chomp or chop in the right place(s) of the routine
that spins the data does the trick

 -Original Message-
 From: Larry Steinberg [mailto:[EMAIL PROTECTED]]
 Sent: Friday, August 02, 2002 11:58 AM
 To: [EMAIL PROTECTED]
 Subject: getting rid of box
 
 
 I have these coming up when creating a report:
 
 ma, BC: 1
 bost, : 1
 Montroyal, QC: 1
 waltam, MA: 1
 Quebec, QC: 1
 booger, MA: 1
 Franklinxxx, MA: 1
 BOSTI, MA: 1
 
 How do I rid the report of these boxes?
 
 --
 -Larry
 
 
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


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




RE: getting rid of box

2002-08-02 Thread Mark Anderson

How are you creating the report?

If you are using some sort of print statement, what does it look like?

Where is the data coming from?

The boxes are non-printing characters of some sort.  If you know that you
are only going to use a small set of printable characters, you could
probably create a regex that would delete all of the other characters from
your strings.


/\/\ark

-Original Message-
From: Larry Steinberg [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 02, 2002 8:58 AM
To: [EMAIL PROTECTED]
Subject: getting rid of box


I have these coming up when creating a report:

ma, BC: 1
bost, : 1
Montroyal, QC: 1
waltam, MA: 1
Quebec, QC: 1
booger, MA: 1
Franklinxxx, MA: 1
BOSTI, MA: 1

How do I rid the report of these boxes?

--
-Larry



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



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




RE: grab another param from url

2002-08-02 Thread Barry Veinotte

 -Original Message-
 From: Larry Steinberg [mailto:[EMAIL PROTECTED]]
 Sent: Friday, August 02, 2002 11:38 AM
 To: [EMAIL PROTECTED]
 Subject: grab another param from url
 
 
 Hi,
 
 I have a subroutine that grabs a parameter (city) from the url for use in
 the script (which produces a report with the value of that 
 parameter). I now
 want to grab another parameter (state) and append it to the previous and
 have it also appear in the report. Preferably it would look like this:
 Boston, MA (without the quotes). Here's the code:
 
 sub parseUrl {
 
 $nPara = $tPara = ;
 
 ($nPara) = ( $line =~ /[\?]N=([^\s]+)/i );
 if ($nPara ne ) { $nPara = unpack_clean($nPara); }
 
 ($tPara) = ( $line =~ /[\?]T=([^\s]+)/i );#gets city parameter
 (T=)
 if ($tPara ne ) { $tPara = unpack_clean($tPara); }
 
 if ($tPara ne   $err eq cit) {
 # print $tPara\n;
  if (exists $userCit{$tPara}) { $userCit{$tPara}++; }
  else { $userCit{$tPara}=1; $countCit++;}
 }
 
 How do I add the state parameter (S=)?
 
 Thanks!
 
 -Larry

How about somthing like this:

if ($ENV{'QUERY_STRING'}) {
my $temp = $ENV{'QUERY_STRING'};
my @pairs = split(/;/, $temp);  # or whatever you have to split on
my %request;

foreach my $in(@pairs)  {
my ($name,$value) = split(/=/,$in);
$value =~ tr/+/ /;
$value =~ s/%(..)/pack(C,hex($1))/ge;
$request{$name} = $value;
}
# Do what you want with each one such as
# if (defined $request{'S'}) ...
}
}

So a URL could come in like so:

http://whatever.com/cgi-bin/script.cgi?a=whatever;b=somthing;c=this

Now you have values for a, b and c...
But I am sure there are a lot of better ways to do it.
CGI.pm can handle parsing of a URL and I believe would be safer
than this type of thing.


Barry
 

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




Re: newbie question about Sys::Hostname and modules in general

2002-08-02 Thread drieux


On Friday, August 2, 2002, at 08:09 , Chad Kellerman wrote:
[..]
 ** I always have issues with scope  Can I use Sys::Hostname  just in
 the subroutine, or any perl module for that matter?  Or do I have to use
 it globally?

 $host=hostname; finds that daggone hostname and I have hostname all over
 te placemy bad.  :^(.
[..]


there are two strategies I hear you are asking about:

a) the difference between 'use v. require'
b) the scoping of variables


plan A:

#!/usr/bin/perl -w
use strict;

use Sys::Hostname

..

sub Freak_Out {

my $msg = shift;
.
my $host = hostname;

}

the 'use' of course is essentially 'require foo  import foo'
so we imported the function there - and might not remember where
we got that function from - especially if we did not annotate
it up at the top of the script.

so you might try
plan B:

#!/usr/bin/perl -w
use strict;

.

sub Freak_Out {

my $msg = shift;
.
require Sys::Hostname;
my $host = Sys::Hostname::hostname();

}

and completely ISOLATE the fact that you are using
the hostname() function there.


Your Third strategy would be something on the order of say


#!/usr/bin/perl -w
use strict;

use Sys::Hostname
my $host = hostname;

..

sub Freak_Out {
my ( $from_host, $msg ) = @_;

}

hence requiring the caller to define it.

What I personally would consider the worst of all possibles
in this is the 'leaking global gag':

#!/usr/bin/perl -w
use strict;

use Sys::Hostname
my $host = hostname;

..

sub Freak_Out {
my ( $msg ) = @_;


Log($host, $msg);
...
}

where you USE the globally defined '$host' without passing
it into the function this type of 'side effect' gets
ugly the first time you try to re-use the function Freak_Out()
somewhere else and forget that you were using a global
variable by indirection.


HTH

ciao
drieux

---


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




Converting dates from seconds since epoch into regular form

2002-08-02 Thread Alan Hogue

Hi,

I know how to take a given date and turn it into the number of seconds
since the epoch, but I can't figure out how to take a date in this form
and turn it back into a human-friendly format. I have looked around the
date::manip and date::calc modules but don't seem to see anything that
specifically does this. Am I missing something?

Alan

=
Do I repeat myself? Very well, I repeat myself; I am repetitive.

__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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




Re: speed and perl

2002-08-02 Thread drieux


On Friday, August 2, 2002, at 08:36 , Dennis G. Wicks wrote:
 On Fri, 2 Aug 2002, Jenda Krynicky wrote:

  Computing power is cheap, programmers' time is expensive!
[..]
 The cost of inefficient programs is cumulative and results
 in increasing all the infrastructure costs because of the
 requirement for more and more cheap computing power.
[..]

but that also means more goods and services as more
manufactured products are release to compensate for
bad coding.

in like manner coding it badly the first time also
means that if and when the project is identified
as 'under-performing' - then of course there is
all sorts of employment opportunity for managers,
designers, and even software developers.

The structural flaw in your argument is that the
decision to use 'perl' was based upon the implicit
efficiencies in it for the task at hand - both at
the run time level, as well as the development cycle.

Which, as we all know, leads to the code being more
efficiently maintained, causing a down draft in the
sales of server, which causes a down draft in the
number of chips sold, and the complete economic
catastrophy of deflationary practices. Not to mention
the unpleasantry that there are fewer jobs for software
developers, as there is less code that needs to be
maintained by highly trained highly paid technical experts.

Hum I think this leads us to why the project should
have been done in C++ and/or Object Oriented Cobol... or

but clearly perl was a very unpatriotic choice to make
in these grim economic times

ciao
drieux

---


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




RE: Converting dates from seconds since epoch into regular form

2002-08-02 Thread Timothy Johnson


perldoc -f localtime

You don't need to install a module, it's built into Perl.

-Original Message-
From: Alan Hogue [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 02, 2002 10:00 AM
To: perl
Subject: Converting dates from seconds since epoch into regular form


Hi,

I know how to take a given date and turn it into the number of seconds
since the epoch, but I can't figure out how to take a date in this form
and turn it back into a human-friendly format. I have looked around the
date::manip and date::calc modules but don't seem to see anything that
specifically does this. Am I missing something?

Alan

=
Do I repeat myself? Very well, I repeat myself; I am repetitive.

__
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com

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

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




RE: getting rid of box

2002-08-02 Thread Timothy Johnson


You should pick up a freeware hex editor (there are a few of them on the
net, I've been using xvi32) and find out what the hex value of the
non-printable characters are, then you can create a regex to strip them out.

-Original Message-
From: Mark Anderson [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 02, 2002 9:06 AM
To: Larry Steinberg; [EMAIL PROTECTED]
Subject: RE: getting rid of box


How are you creating the report?

If you are using some sort of print statement, what does it look like?

Where is the data coming from?

The boxes are non-printing characters of some sort.  If you know that you
are only going to use a small set of printable characters, you could
probably create a regex that would delete all of the other characters from
your strings.


/\/\ark

-Original Message-
From: Larry Steinberg [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 02, 2002 8:58 AM
To: [EMAIL PROTECTED]
Subject: getting rid of box


I have these coming up when creating a report:

ma, BC: 1
bost, : 1
Montroyal, QC: 1
waltam, MA: 1
Quebec, QC: 1
booger, MA: 1
Franklinxxx, MA: 1
BOSTI, MA: 1

How do I rid the report of these boxes?

--
-Larry



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



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

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




Getopt::Std issues

2002-08-02 Thread ccurtis

I'm not sure if this is a problem with Getopt::Std or if it's just me, but
I'm having some issues getting this to cooperate:

use Getopt::Std;
my %OPT = ();
getopt('dhnt:', \%OPT);

and later...

if (exists($OPT{'h'})) {
## print usage and exit...

If I call my script with ./myscript.pl -h, it prints usage fine.  However,
 if I call the script using ./myscript.pl -n -h, the -h flag gets ignored,
and my hash looks like:

  DB1 x %OPT
0  'n'
1  '-h'
  DB2 


What am I missing?

Thanks,

Chris

-- 
[EMAIL PROTECTED]
GnuPG Fingerprint: F96E FB68 5C8F 97CF 70B7  9208 0BF0 7F09 BC1B F0C8

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




RE: speed and perl

2002-08-02 Thread Nikola Janceski

What? you mean maintainable, effective code is ruining the economy? This is
a joke right?
Microsoft follows this idea, but they really are in it just for the money
and nothing else, and that is ruining our economy.

Microsoft idealogy:
1. Write it well enough to be easy to use.
2. get everyone on your software.
3. pass better software (aka enhancements) later with flaws still.
4. force better computers to run the new software (ineffecient code).
5. repeat step 3.

But if you write it well the first time you don't make as much money,
but you gain lots more respect and reliablity, so when you do send out
enhancements, they won't be in quotes *quote motion with fingers*.

the Microsoft idea is good for games and NON-CRITICAL systems.
but you would want reliablity for critical things.

Yeah you can rent the cheap scuba gear, but would you trust it?


 -Original Message-
 From: drieux [mailto:[EMAIL PROTECTED]]
 Sent: Friday, August 02, 2002 1:07 PM
 To: begin begin
 Subject: Re: speed and perl
 
 
 
 On Friday, August 2, 2002, at 08:36 , Dennis G. Wicks wrote:
  On Fri, 2 Aug 2002, Jenda Krynicky wrote:
 
 Computing power is cheap, programmers' time is expensive!
 [..]
  The cost of inefficient programs is cumulative and results
  in increasing all the infrastructure costs because of the
  requirement for more and more cheap computing power.
 [..]
 
 but that also means more goods and services as more
 manufactured products are release to compensate for
 bad coding.
 
 in like manner coding it badly the first time also
 means that if and when the project is identified
 as 'under-performing' - then of course there is
 all sorts of employment opportunity for managers,
 designers, and even software developers.
 
[snip]



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


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




Re: Getopt::Std issues

2002-08-02 Thread ccurtis

On Fri, Aug 02, 2002 at 01:32:52PM -0400, [EMAIL PROTECTED] wrote:
 I'm not sure if this is a problem with Getopt::Std or if it's just me, but
 I'm having some issues getting this to cooperate:
 
 use Getopt::Std;
 my %OPT = ();
 getopt('dhnt:', \%OPT);

Oops, looks like I have to use getopts (with the s) instead of getopt.

Meh!

Regards,

Chris

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




Re: Getopt::Std issues

2002-08-02 Thread George Schlossnagle

you're specifying that -n takes an argument, but then passing it none, 
so it's interpreting the trailing -h as such,


On Friday, August 2, 2002, at 01:32 PM, [EMAIL PROTECTED] wrote:

 I'm not sure if this is a problem with Getopt::Std or if it's just me, 
 but
 I'm having some issues getting this to cooperate:

 use Getopt::Std;
 my %OPT = ();
 getopt('dhnt:', \%OPT);

 and later...

 if (exists($OPT{'h'})) {
   ## print usage and exit...

 If I call my script with ./myscript.pl -h, it prints usage fine.  
 However,
  if I call the script using ./myscript.pl -n -h, the -h flag gets 
 ignored,
 and my hash looks like:

   DB1 x %OPT
 0  'n'
 1  '-h'
   DB2


 What am I missing?

 Thanks,

 Chris

 --
 [EMAIL PROTECTED]
 GnuPG Fingerprint: F96E FB68 5C8F 97CF 70B7  9208 0BF0 7F09 BC1B F0C8

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



// George Schlossnagle
// Principal Consultant
// OmniTI, Inc  http://www.omniti.com
// (c) 240.460.5234   (e) [EMAIL PROTECTED]
// 1024D/1100A5A0  1370 F70A 9365 96C9 2F5E 56C2 B2B9 262F 1100 A5A0


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




module installation cant find dependencies

2002-08-02 Thread RaymondMoran

i've just installed MIMEBase64 in a non-standard directory (vhosted).  The
problem is when I next try to install URI, i get the message:

perl Makefile.PL LIB=~/lib/perl5 PREFIX=~/lib/perl5 INC=~/lib/perl5
Warning: prerequisite MIME::Base64 failed to load: Can't locate
MIME/Base64.pm in @INC (@INC contains:
/usr/pkg/lib/perl5/5.6.1/alpha-netbsd /usr/pkg/lib/perl5/5.6.1
/usr/pkg/lib/perl5/site_perl/5.6.1/alpha-netbsd
/usr/pkg/lib/perl5/site_perl/5.6.1 /usr/pkg/lib/perl5/site_perl .) at
(eval 4) line 3.
Writing Makefile for URI


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




Re: getting rid of box

2002-08-02 Thread Larry Steinberg

Yeah, sorry. Here's the sub.

 #the boxes appear right after the comma after tPara, in the bottom block
(where tPara is the city and sPara is the state).

sub parseUrl {

$nPara = $tPara = ;

($nPara) = ( $line =~ /[\?]N=([^\s]+)/i );
if ($nPara ne ) { $nPara = unpack_clean($nPara); }

($tPara) = ( $line =~ /[\?]T=([^\s]+)/i );
if ($tPara ne ) { $tPara = unpack_clean($tPara); }
 chomp($tPara);

($sPara) = ( $line =~ /[\?]S=([^\s]+)/i );
if ($sPara ne ) { $sPara = unpack_clean($sPara); }

if ($tPara ne   $err eq cit) {
# print $tPara\t$sPara\n;
 if (exists $userCit{$tPara,, $sPara}) { $userCit{$tPara,,
$sPara}++; }
 else { $userCit{$tPara,, $sPara}=1; $countCit++;}
}

James Kipp [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]
...
 well you did not supply much information here, but i have seen those 
 before, and it usually a chomp or chop in the right place(s) of the
routine
 that spins the data does the trick

  -Original Message-
  From: Larry Steinberg [mailto:[EMAIL PROTECTED]]
  Sent: Friday, August 02, 2002 11:58 AM
  To: [EMAIL PROTECTED]
  Subject: getting rid of box
 
 
  I have these coming up when creating a report:
 
  ma, BC: 1
  bost, : 1
  Montroyal, QC: 1
  waltam, MA: 1
  Quebec, QC: 1
  booger, MA: 1
  Franklinxxx, MA: 1
  BOSTI, MA: 1
 
  How do I rid the report of these boxes?
 
  --
  -Larry
 
 
 
  --
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 




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




Re: getting rid of box

2002-08-02 Thread Larry Steinberg

I just looked at the file with vi and the character is a combination
circumflex backslash. I'll give it a shot trying to prevent them with regex.

Timothy Johnson [EMAIL PROTECTED] wrote in message
C0FD5BECE2F0C84EAA97D7300A500D50046DC9E4@SMILEY">news:C0FD5BECE2F0C84EAA97D7300A500D50046DC9E4@SMILEY...

 You should pick up a freeware hex editor (there are a few of them on the
 net, I've been using xvi32) and find out what the hex value of the
 non-printable characters are, then you can create a regex to strip them
out.

 -Original Message-
 From: Mark Anderson [mailto:[EMAIL PROTECTED]]
 Sent: Friday, August 02, 2002 9:06 AM
 To: Larry Steinberg; [EMAIL PROTECTED]
 Subject: RE: getting rid of box


 How are you creating the report?

 If you are using some sort of print statement, what does it look like?

 Where is the data coming from?

 The boxes are non-printing characters of some sort.  If you know that you
 are only going to use a small set of printable characters, you could
 probably create a regex that would delete all of the other characters from
 your strings.


 /\/\ark

 -Original Message-
 From: Larry Steinberg [mailto:[EMAIL PROTECTED]]
 Sent: Friday, August 02, 2002 8:58 AM
 To: [EMAIL PROTECTED]
 Subject: getting rid of box


 I have these coming up when creating a report:

 ma, BC: 1
 bost, : 1
 Montroyal, QC: 1
 waltam, MA: 1
 Quebec, QC: 1
 booger, MA: 1
 Franklinxxx, MA: 1
 BOSTI, MA: 1

 How do I rid the report of these boxes?

 --
 -Larry



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



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



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




Re: module installation cant find dependencies

2002-08-02 Thread RaymondMoran

That was my previous message but i didn't write my question:

how do i include ~/lib/perl to the @INC environment variable?

On Fri, 2 Aug 2002, RaymondMoran wrote:

 Date: Fri, 2 Aug 2002 17:37:58 + (UTC)
 From: RaymondMoran [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: module installation cant find dependencies

 i've just installed MIMEBase64 in a non-standard directory (vhosted).  The
 problem is when I next try to install URI, i get the message:

 perl Makefile.PL LIB=~/lib/perl5 PREFIX=~/lib/perl5 INC=~/lib/perl5
 Warning: prerequisite MIME::Base64 failed to load: Can't locate
 MIME/Base64.pm in @INC (@INC contains:
 /usr/pkg/lib/perl5/5.6.1/alpha-netbsd /usr/pkg/lib/perl5/5.6.1
 /usr/pkg/lib/perl5/site_perl/5.6.1/alpha-netbsd
 /usr/pkg/lib/perl5/site_perl/5.6.1 /usr/pkg/lib/perl5/site_perl .) at
 (eval 4) line 3.
 Writing Makefile for URI


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




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




Re: module installation cant find dependencies

2002-08-02 Thread drieux


On Friday, August 2, 2002, at 10:59 , RaymondMoran wrote:

 That was my previous message but i didn't write my question:

 how do i include ~/lib/perl to the @INC environment variable?

based upon what I just noticed in

perldoc perlrun

you might want to think in terms of

perldoc -I~/lib/perl5 Makefile.PL LIB=.

or you might want to set the PERL5LIB environmental variable


ciao
drieux

---


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




Re: speed and perl

2002-08-02 Thread drieux


On Friday, August 2, 2002, at 10:23 , Nikola Janceski wrote:
[..]
 the Microsoft idea is good for games and NON-CRITICAL systems.
 but you would want reliablity for critical things.
[..]

I presume that you then disapprove of NT based
weapons systems and avionics packages - and
consider the idea of a system reboot as a
corrective mechanism for fighter interceptors
and other 'fly by wire' technologies to be
a sub-optimal survival strategy?

or am I merely reading into your position.

ciao
drieux

---

When You absolutely, Positively, Have to get it RIGHT
the first time.

It may help to work from a solid design on proven
technology that works, not merely that sells well...


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




Re: module installation cant find dependencies

2002-08-02 Thread RaymondMoran


So now I've set the PERL5LIB and the PERLLIB variable.  I include the -I
variable:

perl -I~/lib/perl5 Makefile.PL LIB=~/lib/perl5 PREFIX=~/lib/perl5
Warning: prerequisite MIME::Base64 failed to load: Can't locate
MIME/Base64.pm in @INC (@INC contains:
/usr/pkg/lib/perl5/5.6.1/alpha-netbsd /usr/pkg/lib/perl5/5.6.1
/usr/pkg/lib/perl5/site_perl/5.6.1/alpha-netbsd
/usr/pkg/lib/perl5/site_perl/5.6.1 /usr/pkg/lib/perl5/site_perl .) at
(eval 4) line 3.

my home directory's still not in there.

On Fri, 2 Aug 2002, drieux wrote:

 Date: Fri, 2 Aug 2002 11:18:44 -0700
 From: drieux [EMAIL PROTECTED]
 To: begin begin [EMAIL PROTECTED]
 Subject: Re: module installation cant find dependencies


 On Friday, August 2, 2002, at 10:59 , RaymondMoran wrote:

  That was my previous message but i didn't write my question:
 
  how do i include ~/lib/perl to the @INC environment variable?

 based upon what I just noticed in

   perldoc perlrun

 you might want to think in terms of

   perldoc -I~/lib/perl5 Makefile.PL LIB=.

 or you might want to set the PERL5LIB environmental variable


 ciao
 drieux

 ---


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




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




RE: speed and perl

2002-08-02 Thread Nikola Janceski

correct that I disapprove of NT based weapons systems.
Remember Wargames the movie? They couldn't shutdown 
WOPR in NORAD because the silos would carry out their
final orders.

Incoming bogie, Colonel.
Defcon 1. Ready silos for launch sequence.
Sorry Colonel, my bad, it was just my new WindowsXP cursor.
Take us back down to defcon 5.
Sorry, no can do. GIANTWINDOW [new WOPR] is rebooting.
Oh crap.


 -Original Message-
 From: drieux [mailto:[EMAIL PROTECTED]]
 Sent: Friday, August 02, 2002 2:23 PM
 To: Beginners (E-mail)
 Subject: Re: speed and perl
 
 
 
 On Friday, August 2, 2002, at 10:23 , Nikola Janceski wrote:
 [..]
  the Microsoft idea is good for games and NON-CRITICAL systems.
  but you would want reliablity for critical things.
 [..]
 
 I presume that you then disapprove of NT based
 weapons systems and avionics packages - and
 consider the idea of a system reboot as a
 corrective mechanism for fighter interceptors
 and other 'fly by wire' technologies to be
 a sub-optimal survival strategy?
 
 or am I merely reading into your position.
 
 ciao
 drieux
 
 ---
 
 When You absolutely, Positively, Have to get it RIGHT
   the first time.
 
 It may help to work from a solid design on proven
   technology that works, not merely that sells well...
 
 
 -- 
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


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




Re: module installation cant find dependencies

2002-08-02 Thread drieux


On Friday, August 2, 2002, at 11:27 , RaymondMoran wrote:

 So now I've set the PERL5LIB and the PERLLIB variable.  I include the -I
 variable:

 perl -I~/lib/perl5 Makefile.PL LIB=~/lib/perl5 PREFIX=~/lib/perl5
 Warning: prerequisite MIME::Base64 failed to load: Can't locate
 MIME/Base64.pm in @INC (@INC contains:
 /usr/pkg/lib/perl5/5.6.1/alpha-netbsd /usr/pkg/lib/perl5/5.6.1
 /usr/pkg/lib/perl5/site_perl/5.6.1/alpha-netbsd
 /usr/pkg/lib/perl5/site_perl/5.6.1 /usr/pkg/lib/perl5/site_perl .) at
 (eval 4) line 3.

 my home directory's still not in there.


Assuming that your PERL5LIB were set like:

gax: 81:] setenv PERL5LIB  ~/lib/perl5
gax: 82:] perl *.PL
Writing Makefile for URI
gax: 83:]

on a linux like machine - it appears that the double quotes
are preventing shell expansion hence the process would be

gax: 89:] !78
perl -I ~/lib/perl5 Makefile.PL LIB=~/lib/perl5 PREFIX=~/lib/perl5
Writing Makefile for URI
gax: 90:]

sorry about that...

what you will find useful would be something like:

### #!/usr/bin/perl -w
### use strict;
### #
### #/home/drieux/bin/PerlInstall - you know to install stuff locally
### #
###
### use lib $ENV{HOME}/lib/perl;
###
### $ENV{PERL5LIB} = ($ENV{PERL5LIB}) ? $ENV{HOME}/lib/perl:$ENV{PERL5LIB}

### : $ENV{HOME}/lib/perl;
###
### my $prefix = $ENV{HOME};
### my $lib = $prefix/lib/perl;
###
###
### my $man = $prefix/man;
### my $cmdArgs = PREFIX=$prefix LIB=$lib ;
### $cmdArgs .=  INSTALLMAN3DIR=$man/man3 INSTALLMAN1DIR=$man/man1;
###
### my $cmd = perl Makefile.PL $cmdArgs;
###
### system(make clean);
###
### system($cmd);
### #system(make test);
### #system(make install);
###

this way I have it stuffed in my home 'bin' directory - for
places when I am working with 'local only' install into my
home directory vice into the canonical CPAN space

As you will notice this process of not installing into
where your perl will natively find it has problems.


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




Re: module installation cant find dependencies

2002-08-02 Thread Felix Geerinckx

on Fri, 02 Aug 2002 20:29:46 GMT, Drieux wrote:

 ### #!/usr/bin/perl -w
 ### use strict;
 
 [...some code snipped...]

 ### system($cmd);
 ### #system(make test);
 ### #system(make install);
 ###

But this code doesn't do anything ;-)

-- 
felix

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




Re: getting rid of box

2002-08-02 Thread Janek Schleicher

Larry Steinberg wrote at Fri, 02 Aug 2002 19:12:06 +0200:

 sub parseUrl {

There are modules parsing urls.
E.g.:

use CGI qw/:standard/; 
$q = CGI-new(key=valueblank=%20); 
use Data::Dumper; 
print Dumper(\{$q-Vars})


Cheerio,
Janek


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




Re: getting rid of box

2002-08-02 Thread Larry Steinberg

Thanks. I'll give it a shot - Monday. 8-)

Janek Schleicher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Larry Steinberg wrote at Fri, 02 Aug 2002 19:12:06 +0200:

  sub parseUrl {

 There are modules parsing urls.
 E.g.:

 use CGI qw/:standard/;
 $q = CGI-new(key=valueblank=%20);
 use Data::Dumper;
 print Dumper(\{$q-Vars})


 Cheerio,
 Janek




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




Re: module installation cant find dependencies

2002-08-02 Thread RaymondMoran


thanks for your input.  it works now.

On Fri, 2 Aug 2002, drieux wrote:

 Date: Fri, 2 Aug 2002 13:29:46 -0700
 From: drieux [EMAIL PROTECTED]
 To: begin begin [EMAIL PROTECTED]
 Subject: Re: module installation cant find dependencies


 On Friday, August 2, 2002, at 11:27 , RaymondMoran wrote:

  So now I've set the PERL5LIB and the PERLLIB variable.  I include the -I
  variable:
 
  perl -I~/lib/perl5 Makefile.PL LIB=~/lib/perl5 PREFIX=~/lib/perl5
  Warning: prerequisite MIME::Base64 failed to load: Can't locate
  MIME/Base64.pm in @INC (@INC contains:
  /usr/pkg/lib/perl5/5.6.1/alpha-netbsd /usr/pkg/lib/perl5/5.6.1
  /usr/pkg/lib/perl5/site_perl/5.6.1/alpha-netbsd
  /usr/pkg/lib/perl5/site_perl/5.6.1 /usr/pkg/lib/perl5/site_perl .) at
  (eval 4) line 3.
 
  my home directory's still not in there.


 Assuming that your PERL5LIB were set like:

   gax: 81:] setenv PERL5LIB  ~/lib/perl5
   gax: 82:] perl *.PL
   Writing Makefile for URI
   gax: 83:]

 on a linux like machine - it appears that the double quotes
 are preventing shell expansion hence the process would be

   gax: 89:] !78
   perl -I ~/lib/perl5 Makefile.PL LIB=~/lib/perl5 PREFIX=~/lib/perl5
   Writing Makefile for URI
   gax: 90:]

 sorry about that...

 what you will find useful would be something like:

 ### #!/usr/bin/perl -w
 ### use strict;
 ### #
 ### #/home/drieux/bin/PerlInstall - you know to install stuff locally
 ### #
 ###
 ### use lib $ENV{HOME}/lib/perl;
 ###
 ### $ENV{PERL5LIB} = ($ENV{PERL5LIB}) ? $ENV{HOME}/lib/perl:$ENV{PERL5LIB}
 
 ### : $ENV{HOME}/lib/perl;
 ###
 ### my $prefix = $ENV{HOME};
 ### my $lib = $prefix/lib/perl;
 ###
 ###
 ### my $man = $prefix/man;
 ### my $cmdArgs = PREFIX=$prefix LIB=$lib ;
 ### $cmdArgs .=  INSTALLMAN3DIR=$man/man3 INSTALLMAN1DIR=$man/man1;
 ###
 ### my $cmd = perl Makefile.PL $cmdArgs;
 ###
 ### system(make clean);
 ###
 ### system($cmd);
 ### #system(make test);
 ### #system(make install);
 ###

 this way I have it stuffed in my home 'bin' directory - for
 places when I am working with 'local only' install into my
 home directory vice into the canonical CPAN space

 As you will notice this process of not installing into
 where your perl will natively find it has problems.


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




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




Upgraded to 5.8 problems

2002-08-02 Thread Gene McCullough

Hi.

My Redhat 7.2 installation had perl 5.6 installed by default,
/usr/lib/perl5/5.6.0

While in CPAN, installing a module, it went into the perl5.8.0
installation, and everything seemed well.

# perl -v
This is perl, v5.8.0 built for i686-linux

Copyright 1987-2002, Larry Wall
..
..
..

I've since CPAN installed Time::HiRes on the system.

Now, when running a script, I get this message:

Can't locate loadable object for module Time::HiRes in @INC (@INC
contains: /usr/l
ib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0
/usr/lib/perl5/site_perl/5.6.0/i386
-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl) at ...

I don't know how to get the @INC updated to include the proper
libraries.

Thanks in advance for any assistance
gene 

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




RE: Upgraded to 5.8 problems

2002-08-02 Thread Timothy Johnson


It sounds like you need to reinstall Perl 5.8.0

-Original Message-
From: Gene McCullough [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 02, 2002 2:57 PM
To: [EMAIL PROTECTED]
Subject: Upgraded to 5.8 problems


Hi.

My Redhat 7.2 installation had perl 5.6 installed by default,
/usr/lib/perl5/5.6.0

While in CPAN, installing a module, it went into the perl5.8.0
installation, and everything seemed well.

# perl -v
This is perl, v5.8.0 built for i686-linux

Copyright 1987-2002, Larry Wall
...
...
...

I've since CPAN installed Time::HiRes on the system.

Now, when running a script, I get this message:

Can't locate loadable object for module Time::HiRes in @INC (@INC
contains: /usr/l
ib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0
/usr/lib/perl5/site_perl/5.6.0/i386
-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl) at ...

I don't know how to get the @INC updated to include the proper
libraries.

Thanks in advance for any assistance
gene 

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

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




Technical Argument, Holy War, of the Evil of Perl

2002-08-02 Thread drieux


Second, if one is on contract, Perl can be Very useful
for earning money.  Read the report program below and
keep in mind that 'cad.passwd' is 11,000 lines of text
and 'simplex.passwd' is more than 300.

#! /usr/local/bin/perl
open (CAD, cad.passwd);
while (CAD) {
 chomp;
 @cad = split /:/;
 open (SIMPLEX, simplex.passwd);
 while (SIMPLEX) {
chomp;
@simplex = split /:/;
if ( $cad[0] eq $simplex[0] ) {
if ($cad[2] ne $simplex[2]) {
print C: @cad\n;
print S: @simplex\n\n;
 }
}
 }
 close SIMPLEX;
}
close CAD;


and I of course felt MORALLY compelled to argue against
the loop through the SIMPLEX file for each entry in
the CAD file and proposed

p1: you dinna mind a recommendation on your script:

#! /usr/local/bin/perl -w
use strict;
#
# our two files - modify as needed
#
my ( $sim_file, $cad_file) = qw(simplex.passwd cad.passwd);

my %simplix_hash;
 open (SIMPLEX,$sim_file) or die unable to open $sim_file :$!\n;

 #
 # read in our simplex file first to fill the hash for subsequent
 # look ups...
 while (SIMPLEX) {
 chomp;
 my @sim = split /:/;
 $simplix_hash{$sim[0]} = \@sim;
}
 close SIMPLEX;

open (CAD, $cad_file) or die unable to open $cad_file :$!\n;
while (CAD) {
 chomp;
 my @cad = split /:/;
 if ( exists($simplix_hash{$cad[0]}) ) {

print C: @cad\nS: @{$simplix_hash{$cad[0]}\n\n;
unless ($cad[2] eq @{$simplix_hash{$cad[0]}}[2]) ;
 }
}
close CAD;

since it appeared the Moral Imperative to read it but once
and then use a bit of dereferencing of the hashed data.

but doesn't this lead to the core problem that we are
now putting all of those people out of work? Including
the Project Manager who felt that this problem would
take a mythical man month

ciao
drieux

---

ps: is this when I fess up to having read the
learning perl book this morning and decided that
beginner's either should read it and heed it -
or that it should be banned for reasons of national security?


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




Perl Features in order of Importance

2002-08-02 Thread drieux



volks,

here's a really DUMB question

but I consider perl's hash to be one of
the two or three critical features - the
other one is clearly the RegEx stuff that
allow you the power of sed/awk but without
having to fork the child to do that...

the question then of course is whether the
ability to gin up packages is the next most
important - or closure - with regards to
a well reasoned variable scoping solution


ciao
drieux

---


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




Re: Upgraded to 5.8 problems

2002-08-02 Thread drieux


On Friday, August 2, 2002, at 02:57 , Gene McCullough wrote:
[..]
 # perl -v
 This is perl, v5.8.0 built for i686-linux

 Copyright 1987-2002, Larry Wall
[..]

did you check to make sure you did not
install one version in /usr/local/bin
and the other in /usr/bin

we've played that game before

hence the version of perl you invoked
with the perl -v and the version that
is at /usr/bin/perl need to be the same

eg:

vladimir: 52:] ls -li /usr/bin/perl /usr/local/bin/perl
 558805 -rwxr-xr-x   3 root other1175680 Mar 19 15:31 /usr/bin/
perl
 558805 -rwxr-xr-x   3 root other1175680 Mar 19 15:31 
/usr/local/bin/perl
vladimir: 53:]

or

xanana: 53:] ls -li /usr/bin/perl /usr/local/bin/perl
  308368 -rwxr-xr-x2 root root   797972 Feb 20 12:07 
/usr/bin/perl
  355148 lrwxrwxrwx1 root root   13 Jan 17  2002 /usr/local/
bin/perl - /usr/bin/perl
xanana: 54:]



ciao
drieux

---


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




Re: speed and perl

2002-08-02 Thread Jenda Krynicky

From: Dennis G. Wicks [EMAIL PROTECTED]
 On Fri, 2 Aug 2002, Jenda Krynicky wrote:
 
  Computing power is cheap, programmers' time is expensive!
 
 
 Yes, but the programmer's time is only used once.
 CPU cycles are used again and again and again ...

So you have to find the right proportion.

Besides ... who told you your time is only used once? What about 
maintenance?

 The cost of inefficient programs is cumulative and results
 in increasing all the infrastructure costs because of the
 requirement for more and more cheap computing power.

While I understand your sentiment (OH how I wish I could get rid of 
that [censored] Merant PVCS.) quite often you do not create things 
that deserve that much attention. Quite often it doesn't matter if a 
task takes one minute or two, but whether the users can start using 
it this week or in half a year.

Of course we should try to design and code efficient programs. But 
this demand should not stop us from having them done in time and 
should not force us to devote to the programs 200% of our life.

Jenda
=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
--- me


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




Re: grab another param from url

2002-08-02 Thread Jenda Krynicky

From: Larry Steinberg [EMAIL PROTECTED]
 I have a subroutine that grabs a parameter (city) from the url for use
 in the script (which produces a report with the value of that
 parameter). I now want to grab another parameter (state) and append it
 to the previous and have it also appear in the report. Preferably it
 would look like this: Boston, MA (without the quotes). Here's the
 code:
 
 sub parseUrl {
 
 $nPara = $tPara = ;

I don't see any my there ...
my ($nPara, $tPara) = (,);

You don't wanna overwrite someone else's variables do you?

 
 ($nPara) = ( $line =~ /[\?]N=([^\s]+)/i );

Where exactly did you get the $line from?
This is supposeed to be a function, it should get the data as it's 
parameters, not reading some global variables!


 if ($nPara ne ) { $nPara = unpack_clean($nPara); }
 
 ($tPara) = ( $line =~ /[\?]T=([^\s]+)/i );#gets city
 parameter
 (T=)
 if ($tPara ne ) { $tPara = unpack_clean($tPara); }
 
 if ($tPara ne   $err eq cit) {
 # print $tPara\n;
  if (exists $userCit{$tPara}) { $userCit{$tPara}++; }
  else { $userCit{$tPara}=1; $countCit++;}
 }

Yeah, fiddling with several global variables, not returning anything 
 why exactly did you put the code into sub whatever {...}?


 How do I add the state parameter (S=)?

Step 1: get rid of the code
Step 2: get a decent programming introduction book
Step 3: read it

And when you come back do not forget that all Perl scripts should 
start with
#!/usr/bin/perl -w
use strict;
and the CGIs with
#!/usr/bin/perl -w
use strict;
use CGI;


Jenda

P.S.: Sorry if I sound harsh, but it's better to get the basics 
right. You might be able to finish what are you doing right now even 
without them, but everything is harder that way.

P.P.S.: I probably should not press [Send] now, but I will anyway. 
=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
--- me


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




Re: Perl Features in order of Importance

2002-08-02 Thread Jenda Krynicky

From: drieux [EMAIL PROTECTED]
 here's a really DUMB question
 
 but I consider perl's hash to be one of
 the two or three critical features - the
 other one is clearly the RegEx stuff that
 allow you the power of sed/awk but without
 having to fork the child to do that...
 
 the question then of course is whether the
 ability to gin up packages is the next most
 important - or closure - with regards to
 a well reasoned variable scoping solution

I don't think such top-tens are good for anything, but this is mine:

1. the comunity
2. the comunity

then for a very log time nothing
and then

3. the comunity

;-)

Jenda

P.S.: I think flat namespace is simply stup... too simplistic.
=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
--- me


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




$0 and path

2002-08-02 Thread Chip Place

When I try to use the value from $0, I get the full path to the script or a leading ./ 
depending on how the script is invoked.  If I want my log file to have a line similar 
to:

# GENERATED BY myperlscript

how can I do this without the extra info:

# GENERATED BY ./myperlscript
or
# GENERATED BY /home/cplace/bin/myperlscript

Thanks in advance for any help

Chip Place

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




RE: $0 and path

2002-08-02 Thread Timothy Johnson


Check out the File::Basename module that comes standard.  You can use it to
get just the filename.

-Original Message-
From: Chip Place [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 02, 2002 4:29 PM
To: [EMAIL PROTECTED]
Subject: $0 and path


When I try to use the value from $0, I get the full path to the script or a
leading ./ depending on how the script is invoked.  If I want my log file to
have a line similar to:

# GENERATED BY myperlscript

how can I do this without the extra info:

# GENERATED BY ./myperlscript
or
# GENERATED BY /home/cplace/bin/myperlscript

Thanks in advance for any help

Chip Place

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

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




Re: $0 and path

2002-08-02 Thread John W. Krahn

Chip Place wrote:
 
 When I try to use the value from $0, I get the full path
 to the script or a leading ./ depending on how the script
 is invoked.  If I want my log file to have a line similar
 to:
 
 # GENERATED BY myperlscript
 
 how can I do this without the extra info:
 
 # GENERATED BY ./myperlscript
 or
 # GENERATED BY /home/cplace/bin/myperlscript


( my $prog = $0 ) =~ s!^.*/!!;

print # GENERATED BY $prog\n;



John
-- 
use Perl;
program
fulfillment

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