[24687] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 6848 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 9 14:05:47 2004

Date: Mon, 9 Aug 2004 11:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 9 Aug 2004     Volume: 10 Number: 6848

Today's topics:
    Re: [OT] Perl Developers Needed for Open-Source ATC! <thundergnat@hotmail.com>
    Re: Appending two arrays horizontally <bik.mido@tiscalinet.it>
    Re: Appending two arrays horizontally <bik.mido@tiscalinet.it>
        chmod for directories tribeguy_15@hotmail.com
    Re: chmod for directories <nobull@mail.com>
    Re: chmod for directories <tim@vegeta.ath.cx>
    Re: Failing File Tests? <usenet@morrow.me.uk>
    Re: File::Glob - can it recurse? <usenet@morrow.me.uk>
    Re: First position two strings differ <abodeman@yahoo.com>
        get($url) of BETSIE parser. <iss025@bangor.ac.uk>
    Re: get($url) of BETSIE parser. <noreply@gunnar.cc>
    Re: get($url) of BETSIE parser. <iss025@bangor.ac.uk>
    Re: Hash reference question <tadmc@augustmail.com>
    Re: Input from subprocess called using open() buffered? <"g r a e m e b [at] c a d e n c e [dot] c o m">
    Re: Joining 2 strings (Sim)
    Re: Joining 2 strings <jgibson@mail.arc.nasa.gov>
    Re: Newbie problem with perl and rsh <tadmc@augustmail.com>
    Re: Perl 6: language has "local" variables (ie "dynamic <bik.mido@tiscalinet.it>
    Re: perl modules <tadmc@augustmail.com>
        Problems installing DBI module on perl <pabloguaza@hotmail.com>
    Re: Program slows as I run it <dgmiller@u.washington.edu>
    Re: Set ENV on different session <usenet@morrow.me.uk>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 09 Aug 2004 10:29:49 -0400
From: thundergnat <thundergnat@hotmail.com>
Subject: Re: [OT] Perl Developers Needed for Open-Source ATC!
Message-Id: <41178a59$0$5909$61fed72c@news.rcn.com>

Peter Scott wrote:

> 
> We *are* talking about a system for tracking aircraft through
> radar and transponder data and updating multiple distributed
> displays in real time plus handing off data between local and
> regional centers, right?  I think I'd want real time interrupts
> and interrupt priority levels, for a start.  Haven't seen a Perl
> interface for those yet.  
> 
> It appears to me that the current system exceeds 2 million lines of
> Ada, but I could be off; I'm having a hard time finding details.  
> Coming up with a Perl equivalent sounds like... a lengthy project.
> The government has budgeted several $billion for replacing it but
> we can whack off one in our spare time that they'll agree to use?
> 
> Or are we talking about something else?  
> 

As unlikely as it may seem, apparantly there are a few perl ATC systems
being worked on. (No idea if any are in use anywhere.)

http://sourceforge.net/projects/mratc/

http://www.tkzinc.org/index.php/Main/WhatIsZinc


------------------------------

Date: Mon, 09 Aug 2004 19:03:04 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Appending two arrays horizontally
Message-Id: <8jafh099fcp79jpe5vmbjtb36dnm257ud9@4ax.com>

On 07 Aug 2004 04:09:22 -0400, Scott W Gifford <gifford@umich.edu>
wrote:

>    my @arr3 = map { join(" ",$arr1[$_],$arr2[$_]) } (0..$#arr1);

Well, I'm not a big fan of useless quoting, but

     my @arr3 = map "$arr1[$_],$arr2[$_]", 0..$#arr1;

is more clear IMHO.

>Assuming you know in advance they're both the same size:

Also, not difficult to cope with this:

  my @arr3 = do {
      no warnings 'uninitialized';
      map "$arr1[$_] $arr2[$_]", 
        0 .. ($#arr1>$#arr2 ? $#arr1 : $#arr2);
  };

(implicitly assuming C<use warnings;> as it "Should"!)


PS: anser if you like, but then take into account that most probably I
won't be able to read news for one or two weeks or possibly even till
September!


Michele
-- 
$\=q.,.,$_=q.print'  ,\g,,( w,a'c'e'h,,map{$_-=qif/g/;chr
}107..q[..117,q)[map+hex,split//,join' ,2B,, w$ECDF078D3'
F9'5F3014$,$,];];$\.=$/,s,q,32,g,s,g,112,g,y,' , q,,eval;


------------------------------

Date: Mon, 09 Aug 2004 19:03:05 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Appending two arrays horizontally
Message-Id: <ljafh0536t84ah7pd4e1b6eo3tfvppmh4g@4ax.com>

On Sat, 07 Aug 2004 16:00:57 +0800, Edward wijaya
<ewijaya@singnet.com.sg.removethis> wrote:

>@arr1 = qw(3 2 2 1);
>@arr2 = qw(cc dd ff gg);
>
>is there any way I can append this two arrays
>so that it becomes
>
>@arr3 = ["3 cc", "2 dd", "3 ff", "1 gg"];

Isn't the C<zip> operator supposed to handle exactly this kind of
situations? Oh, but were you still talking Perl5?!? ;-)


PS: anser if you like, but then take into account that most probably I
won't be able to read news for one or two weeks or possibly even till
September!


Michele
-- 
# This prints: Just another Perl hacker,
seek DATA,15,0 and  print   q... <DATA>;
__END__


------------------------------

Date: Mon, 09 Aug 2004 13:22:11 -0400
From: tribeguy_15@hotmail.com
Subject: chmod for directories
Message-Id: <73cfh01rp5roq6htbicbc0j9rbftba3iee@4ax.com>

Hi,
	I've searched everywhere but cannot find out how to create a
empty directory with the following permissions: drwx------
I'm using the following perl script:

print"\nEnter username: ";
chop($username = <STDIN>);
mkdir("/home/$username/Maildir/.Spam/new",700) || die "cannot mkdir
new";

	What I end up with is a directory called "new" with
permissions of drw------- (missing the allow directory search bit)

	I've tried using using 1700 upto 7700 but all result in the
same drw------- permissions.

	What am I doing wrong?  
TIA,
Shane


------------------------------

Date: Mon, 09 Aug 2004 18:44:24 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: chmod for directories
Message-Id: <cf8d45$2e8$1@slavica.ukpost.com>



> 	I've searched everywhere but cannot find out how to create a
> empty directory with the following permissions: drwx------
> I'm using the following perl script:
> 
> print"\nEnter username: ";
> chop($username = <STDIN>);
> mkdir("/home/$username/Maildir/.Spam/new",700) || die "cannot mkdir
> new";
> 
> 	What I end up with is a directory called "new" with
> permissions of drw------- (missing the allow directory search bit)
> 
> 	I've tried using using 1700 upto 7700 but all result in the
> same drw------- permissions.

This probably means the umask is set wrong.  Try changing it.

For details:

perldoc -f mkdir
perldoc -f umask



------------------------------

Date: Mon, 09 Aug 2004 17:48:07 -0000
From: Tim Hammerquist <tim@vegeta.ath.cx>
Subject: Re: chmod for directories
Message-Id: <slrnchfds7.hgf.tim@vegeta.saiyix>

tribeguy_15@hotmail.com <tribeguy_15@hotmail.com> wrote:
>  	I've searched everywhere but cannot find out how to create a
>  empty directory with the following permissions: drwx------
>  I'm using the following perl script:
>  
>  print"\nEnter username: ";
>  chop($username = <STDIN>);
>  mkdir("/home/$username/Maildir/.Spam/new",700) || die "cannot mkdir
>  new";
>  
>  	What I end up with is a directory called "new" with
>  permissions of drw------- (missing the allow directory search bit)
>  
>  	I've tried using using 1700 upto 7700 but all result in the
>  same drw------- permissions.

You're passing the permissions in decimal format, not octal. Try:

    mkdir("/home/$username/Maildir/.Spam/new", 0700);

The example snippets in both the chmod and mkdir entries in perlfunc
demonstrate a leading zero (0).  You could also try:

    mkdir("/home/$username/Maildir/.Spam/new", 448);

 ...which has the same value, but it's kind of counterintuitive. ;)

IAC, see `perldoc -q octal` for the cause of your problem.

HTH,
Tim Hammerquist



------------------------------

Date: Fri, 6 Aug 2004 18:26:09 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Failing File Tests?
Message-Id: <hircu1-446.ln1@mauzo.dyndns.org>


Quoth nefarious_6x3@yahoo.co.uk (Jay Sun Ex):
> Paul Lalli <mritty@gmail.com> wrote in message news:<20040805194010.X4433@barbara.cs.rpi.edu>...
> 
> > Are you doing this as a learning experience?  If so, the answer is that
> > readdir returns the filename without the path.  That is, -d is looking for
> > a file named $file within the current working directory, not the directory
> > in which it was found.
> > 
> > If you're trying to do this for an actual practical purpose, stop wasting
> > effort.  It's already been done, in the standard module File::Find.
> > 
> > Paul Lalli
> 
> As I am still very much a beginner and doing this for learning
> purposes, what should I use since readdir is no longer my friend?

readdir is still your friend: you just have either chdir to the
directory you are reading or prepend the name of the directory to the
filename readdir gave you: use the standard module File::Spec for this,
to do it in a protable fashion.

> Also, I have zero experience with modules at this point. I am hesitant
> to use them for two reasons, I like the challenge of solving problems
> with my own code,

This is good to do as a learning exercise; for production code, modules
are in general safer, more stable and often faster than what you would
write. Remember they have been peer-reviewed by people far better at
Perl than you (or me).

> and second, I want my programs to be able to run on
> various systems that may or may not have modules installed. If I use a
> module and want my program to run on some other machine, does that
> machine need the module installed or does my script just know what to
> do?

If you are using 'core' modules (those that come with Perl) then they
should be on any machine with perl. If you are using others, then you
will need to ensure they are present to run the script; but since you
need Perl anyway, an extra module or two is not a big problem. See
PAR.pm (a module...) for a way to package up your program and all (or
all non-core) modules it needs, and possibly a perl interpreter as well
(creating a completely stand-alone executable).

Ben

-- 
perl -e'print map {/.(.)/s} sort unpack "a2"x26, pack "N"x13,
qw/1632265075 1651865445 1685354798 1696626283 1752131169 1769237618
1801808488 1830841936 1886550130 1914728293 1936225377 1969451372
2047502190/'                                                 # ben@morrow.me.uk


------------------------------

Date: Fri, 6 Aug 2004 18:30:49 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: File::Glob - can it recurse?
Message-Id: <9rrcu1-446.ln1@mauzo.dyndns.org>


Quoth rgp@systame.com (Randall Perry):
> I'm guessing not from reading the docs.
> 
> Here's what I can do with 2 lines using system:
>    system("chown -R $user.$http_group www/*");
>    ($? eq 0) || die "Couldn't chown $user.$group www/*\n";
> 
> I'd like to use the perl chown() command so I tried this:
>    @filenames = glob "/admin/new_account_page/*";
>    chown $uid, $gid, @filenames || die;
> 
> But it doesn't recurse through subdirectories. Is there a better way
> to accomplish this than by using system()?

File::Find, as usual...

Ben

-- 
   Although few may originate a policy, we are all able to judge it.
                                             - Pericles of Athens, c.430 B.C.
  ben@morrow.me.uk


------------------------------

Date: Mon, 09 Aug 2004 08:45:57 -0500
From: "Brian Kell" <abodeman@yahoo.com>
Subject: Re: First position two strings differ
Message-Id: <opscgwivz4z772u5@pc0938>

Tassilo v. Parseval wrote:
> You can use the xor-trick: Xor the two strings and look for the first
> character which is different from '\0':

Aha! I knew there was some good reason for the string ^ operator.  
Excellent. Thank you.

Brian


------------------------------

Date: Mon, 09 Aug 2004 17:21:18 +0100
From: "P.R.Brady" <iss025@bangor.ac.uk>
Subject: get($url) of BETSIE parser.
Message-Id: <4117A47E.1090904@bangor.ac.uk>

I am having problems reading a particular web page on our site, 
http://www.bangor.ac.uk/cgi-bin/textonlyparser.pl

If it is referenced with a real browser from another page eg 
http://www.bangor.ac.uk/ by clicking 'text only version' in top right 
corner, it works fine.
If I paste the url into the browser, or access it with LWP::UserAgent 
(See demo code below) it fails 500 Internal Server Error.

The file on the server is a Perl script running the BBC's BETSIE parser 
which takes a standard page and processes it on the fly to make it more 
acceptable for the visually impaired.   The script has references to 
environment variables like $ENV{'SERVER_NAME'} and $ENV{'SCRIPT_NAME'} 
which I infer are used to grab the page to be parsed.  I think they are 
missing when it fails.

I'd appreciate any insight into how those variables get set by the 
browser and how I can emulate it.

Regards
Phil Brady

#---------------------------
use strict;
use warnings;
use LWP::UserAgent;

my $url='http://www.bangor.ac.uk/cgi-bin/textonlyparser.pl';

#open the browser
my $browser = LWP::UserAgent->new;

#try to get the url:

my $response = $browser->get($url);
print 'Response:',$response->is_success,"\n";
print 'Status line:',$response->status_line,"\n";
print 'Content Type:',$response->content_type,"\n";
print 'Base: ',$response->base,"\n";



------------------------------

Date: Mon, 09 Aug 2004 18:48:16 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: get($url) of BETSIE parser.
Message-Id: <2npo6lF315lgU1@uni-berlin.de>

P.R.Brady wrote:
> I am having problems reading a particular web page on our site, 
> http://www.bangor.ac.uk/cgi-bin/textonlyparser.pl
> 
> If it is referenced with a real browser from another page eg 
> http://www.bangor.ac.uk/ by clicking 'text only version' in top
> right corner, it works fine.

> If I paste the url into the browser, or access it with
> LWP::UserAgent (See demo code below) it fails 500 Internal Server
> Error.

So, they are requiring a particular HTTP_REFERER.

> my $response = $browser->get($url);

Try:

     my $response =
       $browser->get($url, Referer => 'http://www.bangor.ac.uk/');

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Mon, 09 Aug 2004 18:02:39 +0100
From: "P.R.Brady" <iss025@bangor.ac.uk>
Subject: Re: get($url) of BETSIE parser.
Message-Id: <4117AE2F.6060807@bangor.ac.uk>

Gunnar Hjalmarsson wrote:
> P.R.Brady wrote:
> 
>> I am having problems reading a particular web page on our site, 
>> http://www.bangor.ac.uk/cgi-bin/textonlyparser.pl
>>
>> If it is referenced with a real browser from another page eg 
>> http://www.bangor.ac.uk/ by clicking 'text only version' in top
>> right corner, it works fine.
> 
> 
>> If I paste the url into the browser, or access it with
>> LWP::UserAgent (See demo code below) it fails 500 Internal Server
>> Error.
> 
> 
> So, they are requiring a particular HTTP_REFERER.
> 
>> my $response = $browser->get($url);
> 
> 
> Try:
> 
>     my $response =
>       $browser->get($url, Referer => 'http://www.bangor.ac.uk/');
> 

Many thanks Gunnar,  that works a treat!

Phil



------------------------------

Date: Mon, 9 Aug 2004 08:05:38 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Hash reference question
Message-Id: <slrnchetl2.7c0.tadmc@magna.augustmail.com>

Kristofer Pettijohn <kristofer@cybernetik.net> wrote:

> I just typed up a short
> un-tested example for my question.


Have you seen the Posting Guidelines that are posted here frequently?

    Do not re-type Perl code
        Use copy/paste or your editor's "import" function rather than
        attempting to type in your code. If you make a typo you will get
        followups about your typos instead of about the question you are
        trying to get answered.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Mon, 09 Aug 2004 18:51:43 +0100
From: "g r a e m e b [at] c a d e n c e [dot] c o m" <"g r a e m e b [at] c a d e n c e [dot] c o m">
Subject: Re: Input from subprocess called using open() buffered?
Message-Id: <4117b9b1@news.cadence.com>

Success! :)

Thanks for all the replies, I managed to get two solutions which do what I 
want, neither of which are probably correct! ;D

The first one, using raw IO::Pty, looks a little like this:

my $pty = new IO::Pty;
my $ttyname = $pty->ttyname();
print "Spawned tty $ttyname\n";
open(COMMAND, "$cmd > $ttyname 2>&1|") || die "Couldn't run command";
while(<$pty>) {
   print ":: $_";
}
close($pty);

I take it that I'm supposed to run the command and direct the IO manually to 
the pty I've opened (eg. "cvs update > /dev/pty56 2>&1")?  This seems to work 
fine, I just want to check I'm using it correctly.

I am a bit baffled as to why I need to have COMMAND as a filehandle - is there 
a better way of doing this?  And do I need to close both $pty and COMMAND? 
Presumably all the output is going to $pty, so I don't even need COMMAND, or do I?


The other method, using Expect, looked a little like this (note that I hacked 
this up BEFORE looking at the Expect docs!):

my $process = Expect->spawn("$cmd 2>&1");
while (<$process>) {
   print "|| $_";
}
close($process);

It's more succinct than the one above, but when I looked at the docs, it didn't 
seem to even mention being able to loop over the filehandle returned (in the 
question about "what if I only want to get output without 'expecting' 
anything?".  Not sure if this works by accident or design!

Any code criticism welcome...

Thanks,
Graeme.

PS.  I was running 'cvs update' (and checkout) - it does indeed have the same 
effect if I do 'cvs update 2>&1 | cat'.  Thanks, I thought this was an obscure 
perl thing, didn't realise other programs actually did different things 
depending upon the output file...


510046470588-0001@t-online.de wrote:
> Brian McCauley <nobull@mail.com> writes:
> 
>>Failing that, I Expect (hint, hint) there's something on CPAN you
>>could use to allow Perl to fool the other process into thinking its
>>output was going to a terminal.
> 
> 
> 
> IO::Pty, which comes with IO::Tty
> 
> Klaus Schilling



------------------------------

Date: 9 Aug 2004 09:07:59 -0700
From: selena_kid@yahoo.com (Sim)
Subject: Re: Joining 2 strings
Message-Id: <82bbfd98.0408090807.694220b2@posting.google.com>

Thanks for the reply. I tried the given solutions and they all work in
a way similar to this:

Raw data from input file:
abcdefghi
jklmno
pqr

Output:

pqrmnoghi

The third line overwrite the second which in turn overwrites the
first. What  I am trying to accomplish instead is to put the 3 lines
on a single line without any overwriting to give this (on a single
line):

abcdefghijklmnopqr

Can this be done?

Reason why I choose arrays is that later on I have to recognize
individual numbers from the input data and filter them based on the
criterion of a minimum value. This is the overall picture.

For example, suppose my input file contains:

"First data is 1
 Second data is 2
 Third data is 3"

My script should be able to read the lines, filter and take away for
example, data that read a data with < 2, and display them on the same
line:

"Second data is 2 Third data is 3" #Note that the entire first line is
filtered

I read that in arrays, I can control each of the elements, so if
"First data is 1" is an array, I can recognize "1" as an element, and
set a criterion that is has to be >2 or else it will not be displayed.

This is my first idea. Please enlighten me if there are better ways to
do it.


------------------------------

Date: Mon, 09 Aug 2004 10:30:08 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Joining 2 strings
Message-Id: <090820041030085065%jgibson@mail.arc.nasa.gov>

In article <82bbfd98.0408090807.694220b2@posting.google.com>, Sim
<selena_kid@yahoo.com> wrote:

> Thanks for the reply. I tried the given solutions and they all work in
> a way similar to this:
> 
> Raw data from input file:
> abcdefghi
> jklmno
> pqr
> 
> Output:
> 
> pqrmnoghi
> 
> The third line overwrite the second which in turn overwrites the
> first. What  I am trying to accomplish instead is to put the 3 lines
> on a single line without any overwriting to give this (on a single

Neither Perl's join nor its concatenate operator (.) will overwrite the
scalars involved in the operation. What you probably have here is
embedded carriage returns in your concatenated or joined string that is
causing some letters to be overwritten when they are printed.

What platform are you using?

Please post a complete program demonstrating your problem, along with
the platform you are using and the perl version, so people may help you
better.


------------------------------

Date: Mon, 9 Aug 2004 08:04:02 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Newbie problem with perl and rsh
Message-Id: <slrncheti2.7c0.tadmc@magna.augustmail.com>

zenshade <zenshade@wowway.com> wrote:
> Brian McCauley <nobull@mail.com> wrote in message news:<cf5rk1$lt9$1@slavica.ukpost.com>...
> 
>> I council you not to use the word "newbie" in subject lines - it tends 
>> to predispose people against you...
> 
>> Your problem has nothing to do with rsh.  Had you tried replacing 'rsh' 
>> with 'echo' you'd have found the problem persisted.  This process is 
>> known as "problem partitioning".  It is an absolutely vital skill in 
>> programming.  If you think your problems lies elsewhere than it does 
>> then you are unlikely to find a solution.
> 
> Let N be the number of lines in your response.  Subtract one.  N - 1
> is the number of unnecessary lines in your post.


Actually, N is the number of unnecessary lines in the post.

It is not necessary that you get _any_ answers at all.


> Your points are well taken and


You seem to have a strange definition of the phrase "well taken"...


> comes a point where I'd much sooner just tell a great lot of people to
> piss off than put up with their snobbery and finicky, nit-picky
> notions of what and how Usenet is to be used. 


So, you have lurked here for some time already, and know
what is expected here?

If so, then why did you not do what is expected?


> Seriously, though, thanks for mentioning the linefeed.  That's exactly
> the type of response I was looking for.


The probability of getting answers to future Perl questions
has been greatly diminished by the content of your followup.

Hope it made you feel better.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Mon, 09 Aug 2004 19:03:03 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Perl 6: language has "local" variables (ie "dynamic" vars)?
Message-Id: <p0afh0d7bthac3fu3n9kc2m5qvgngvpna6@4ax.com>

On Sat, 7 Aug 2004 04:26:52 +0000 (UTC), dkcombs@panix.com (David
Combs) wrote:

>>(pacakge and lexical). What is now C<local> will be C<temp>. 
>
>Great!   So it'll now be called  "temp".
>
>(I would have preferred "dynamic", which is what common-lisp
>calls it, the pre lexical-concept of variable binding used
>in pre-common lisps, and still used in emacs-lisp.)

Don't forget Perl's intrinsic and typical
natural-languages-likeliness... IMHO "dynamic" wouldn't have been just
as intuitive, and by far!


PS: anser if you like, but then take into account that most probably I
won't be able to read news for one or two weeks or possibly even till
September!


Michele
-- 
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
  "perl bug File::Basename and Perl's nature"


------------------------------

Date: Mon, 9 Aug 2004 08:08:30 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: perl modules
Message-Id: <slrnchetqe.7c0.tadmc@magna.augustmail.com>

kums <bckumari@yahoo.com> wrote:

> but i couldn't use it.b'caz i throw the foll.error
> Can't locate /home/kumari/packages/CaseConversion in @INC
> 
> how to define @INC and where i have to define @INC ?


   perldoc -q module

               How do I keep my own module/library directory?


You are expected to check the Perl FAQ *before* posting to
the Perl newsgroup you know.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Mon, 09 Aug 2004 09:40:28 -0400
From: "Pablo-UAM" <pabloguaza@hotmail.com>
Subject: Problems installing DBI module on perl
Message-Id: <e59186ddffcfc694a007418e94565033@localhost.talkaboutprogramming.com>

Hi!
I'm trying to install the DBI-1.13 module on perl 5.005_03. I first
execute

# perl Makefile.PL

And it works alright, but when i execute the 'make' command i get this
error message:
cc -c   -xO3 -xdepend     -DVERSION=\"1.13\"  -DXS_VERSION=\"1.13\" -KPIC
-I/usr/perl5/5.00503/sun4-solaris/CORE -DDBI_NO_THREADS Perl.c
/usr/ucb/cc:  language optional software package not installed
*** Error code 1
make: Fatal error: Command failed for target `Perl.o'

The problem that i've is that i don't want to install the cc compiler
because it's not a freeware tool. I've tried to compile the module whith
gcc (modifying 'Makefile') but the arguments for cc aren't valid for gcc,
so it won't compile.

I'd like to know if the last version of perl (5.8.5) includes the DBI
module. In that case i would solve the problem just reinstalling it.
Anyone could help?

Thanks :)



------------------------------

Date: Mon, 9 Aug 2004 10:57:15 -0700
From: "Daniel Miller" <dgmiller@u.washington.edu>
Subject: Re: Program slows as I run it
Message-Id: <cf8dqo$t10$1@gnus01.u.washington.edu>

Thanks for the input, even with the lack of information I think most of you
guessed correctly. Turns out that as each record was processed I was saving
it in an array and then reitterating over that array with the next record
(to make sure there were no duplicates)  explaining why it was slowing
exponentially as the second array grew in size. Anyway, thanks for you
thoughts. I'll have to get more comfortable with hashes.

Dan
<ctcgag@hotmail.com> wrote in message
news:20040806192522.162$10@newsreader.com...
> "Daniel Miller" <dgmiller@u.washington.edu> wrote:
> > Hi, I wrote a program that basically takes one element at a time from a
> > large file (>one million lines) and searches some arrays etc.
>
> Are the arrays static once initially set, or do they change throughout?
>
> > and spits
> > out data.  Problem is that after I start it, it slowly grinds to a crawl
> > as it runs. I've re-written it several ways so as not to chew up my RAM
> > (windows says over 700MB free!) Any thoughts on how to approach this
> > problem? Is this a CPU cache problem?
>
> It is kind of hard to say when you don't how us any of the progam.
>
> 95.54% chance the problem is you are using arrays when you should use
> hashes.
>
> 2.87% chance the you are making some other poor algorithmic choice.
>
> 1.58% chance that the problem is simply too big for you machine's
> britches. 0.01% chance that the problem lies solely in the CPU cache.
>
> Xho
>
> -- 
> -------------------- http://NewsReader.Com/ --------------------
> Usenet Newsgroup Service                        $9.95/Month 30GB




------------------------------

Date: Fri, 6 Aug 2004 18:28:52 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Set ENV on different session
Message-Id: <knrcu1-446.ln1@mauzo.dyndns.org>


Quoth xmrf@yahoo.de (Matti):
> 
> I need to set an Environment Variable which will be used by a script
> started in a different session (not child process of the script which
> has set the Env). So I need something like "exporting" the environment
> setting I performed in my perl script. Is this somehow possible?

This depends on your system... under Unix systems, you'll need to insert
entries in ~/.profile or ~/.login (or maybe somewhere else) depending on
the user's shell; under WinNT you need to put it in the appropriate
place in the registry (sorry, not sure where this is: set an env var and
have a poke around till you find it); under DOS/Win9x you need to insert
an entry into AUTOEXEC.BAT. I don't know about other systems, but I'd
guess it's usually possible.

Ben

-- 
And if you wanna make sense / Whatcha looking at me for?          (Fiona Apple)
                            * ben@morrow.me.uk *


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 6848
***************************************


home help back first fref pref prev next nref lref last post