[16964] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4376 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 19 18:05:38 2000

Date: Tue, 19 Sep 2000 15:05:20 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <969401120-v9-i4376@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 19 Sep 2000     Volume: 9 Number: 4376

Today's topics:
        100 levels deep in subroutine calls! (Ron D. Smith~)
    Re: 100 levels deep in subroutine calls! (Clinton A. Pierce)
    Re: 2 Questions <dsiegel@bellatlantic.net>
    Re: Annoying quotation marks! <juex@deja.com>
        Anonymous lists akhnaten88@my-deja.com
    Re: Aritifical Intelligence... <callgirl@la.znet.com>
    Re: Beginner installing Apache on NT4.0 <gellyfish@gellyfish.com>
    Re: Can I dynamically create hashes? (Bryce Pursley)
    Re: Can I dynamically create hashes? <ren.maddox@tivoli.com>
    Re: Can you store a condition in a variable? <lr@hpl.hp.com>
    Re: Can't make DBI <gellyfish@gellyfish.com>
        Char to Octoal... ? <d.borland@ntlworld.com>
    Re: Char to Octoal... ? <alian@alianwebserver.com>
    Re: Char to Octoal... ? <adamf@box43.gnet.pl>
    Re: combining file handles (Chris Fedde)
    Re: Comparing two Directories <gellyfish@gellyfish.com>
        Cygwin Perl failing - please help <mayers@bmc.com>
    Re: Cygwin Perl failing - please help <mayers@bmc.com>
    Re: File Parsing, Skipping lines darkrabbit@my-deja.com
    Re: File Parsing, Skipping lines darkrabbit@my-deja.com
    Re: FileMaker, DBI (Chris Fedde)
    Re: GLOBAL TELECOMMUTE PROGRAMMERS PERL - JAVA -JS-CSS- <gellyfish@gellyfish.com>
        HELP! Problem returning info from shell call sommerm@apci.com
    Re: Help, need to compair PC date with a date in a vari <lr@hpl.hp.com>
    Re: Help, need to compair PC date with a date in a vari <ren.maddox@tivoli.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 19 Sep 2000 21:07:44 GMT
From: rdsmith@sedona.ch.intel.com (Ron D. Smith~)
Subject: 100 levels deep in subroutine calls!
Message-Id: <8q8kj0$o5e@news.or.intel.com>

I am having a problem with a GUI application I am working on where I keep
getting the error message "100 levels deep in subroutine calls!", and it happens
more frequently when I am in the debugger.

I am using the Tk widget set modules, but I do not think this is "directly"
related because I have had this problem before without using Tk.

I have several questions:

1) why 100?  Why not 1000, 10,000 or any other arbitrary (or even better,
programmable) number.  It does not take too much imagination to envision a case
where you might have a recursive function call that could easily go more than
100 subroutines deep.  I appreciate the courtesy of the error, but damn-it, I
know what I'm doing (I think :-) so "do me a favor" and "don't do me any favors".

2) can I defeat this "warning"?  (Actually it is annoyingly fatal...) 
preferably without touching the source code (which I do not control at my job).

3) why is it also WRONG?  If, when I get this error message, I dump the stack
with a 'while ( ... caller ...) {print...}' loop I *always* get much less than
100 levels deep.  So not only is perl doing me an unwanted favor, it is doing it
incorrectly.  I also noticed this problem when using the libwww modules.  What
both Tk and libwww have in common is some rather sophistocated uses of 'eval'
to protect against faulting conditions.

Anyway, I am going nuts trying to figure this out, and more importantly, work
around it.  But I'll take just understanding what the heck is happening...

Much of the following is peculiar to our installation, but here goes:

chh159> /usr/intel/97r1.3/bin/perl -V
Summary of my perl5 (5.0 patchlevel 4 subversion 4) configuration:
  Platform:
    osname=hpux, osvers=10, archname=hp700_ux102
    uname='hp-ux dtthp204 b.10.20 a 9000770 2006707503 two-user license '
    hint=recommended, useposix=true, d_sigaction=define
    bincompat3=y useperlio=undef d_sfio=undef
  Compiler:
    cc='/usr/intel/97r1.3/bin/gcc', optimize='-O', gccversion=2.8.1
    cppflags='-D_HPUX_SOURCE -I/usr/intel/97r1/include'
    ccflags ='-D_HPUX_SOURCE -I/usr/intel/97r1/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='ld', ldflags ='-L/usr/intel/97r1/lib'
    libpth=/usr/intel/97r1/lib /usr/lib/pa1.1 /lib /usr/lib /usr/ccs/lib
    libs=-lnet -lnsl_s -lndbm -lgdbm -lmalloc -ldld -lm -lc -lndir -lcrypt
    libc=/lib/libc.sl, so=sl
    useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_hpux.xs, dlext=sl, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-B,deferred '
    cccdlflags='-fpic', lddlflags='-b -L/usr/intel/97r1/lib'


Characteristics of this binary (from libperl): 
  Built under hpux
  Compiled at Jan 27 1999 13:38:01
  @INC:
    /usr/intel/97r1.3/lib/perl5/hp700_ux102/5.00404
    /usr/intel/97r1.3/lib/perl5
    /usr/intel/97r1.3/lib/perl5/site_perl/hp700_ux102
    /usr/intel/97r1.3/lib/perl5/site_perl
    .


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

Date: Tue, 19 Sep 2000 21:56:03 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: 100 levels deep in subroutine calls!
Message-Id: <ThRx5.537$hD4.154160@news1.rdc1.mi.home.com>

[Posted and mailed]

In article <8q8kj0$o5e@news.or.intel.com>,
	rdsmith@sedona.ch.intel.com (Ron D. Smith~) writes:
> 3) why is it also WRONG?  If, when I get this error message, I dump the stack
> with a 'while ( ... caller ...) {print...}' loop I *always* get much less 

Can't speak to your other points.  Do you have some code to demonstrate this?
I've never seen this warning thrown without there really being a problem
in my code, or expecting to see it (with really deep recursion).

Ever think too that the recursion isn't where you think it is?  Or that
it's somewhat (or completely) unwound by the time you see the message?

Accuse Perl of bugs, and you'd better have a test case.  Otherwise it's
just vague accusations and PEBCAK.

-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: Tue, 19 Sep 2000 16:22:45 -0400
From: "Darren Siegel" <dsiegel@bellatlantic.net>
Subject: Re: 2 Questions
Message-Id: <ssfim5jnnm551@corp.supernews.com>

I think what you want to do with this programming knowledge
dictates the approach you should take.  If you are looking to
spend free time learning to program and then get a programming
job, you might want to start learning a popular, practical, and
very marketable skill like Java.  If this is purely for hobbyist
reasons, I would go with Visual Basic.  You can be up and running,
making applications in no time in VB.

I suspect, from reading your post, you are going the route of
getting a job someday.  Then I would strongly recommend starting
with Java.  Here are some reasons why:

Java is completely object-oriented.  Java is free.  There are
complete tutorials online, which are also free.  Java has a very similiar
syntax to C/C++, so once you become profecient in Java you
can eventually move to C/C++ very easily, if the need arises.  Java
doesn't have pointers, and some other more esoteric features
of C/C++ like templates, macros, etc.  Stuff that makes it harder
for beginning programmers to learn how to program. Java is an extremely
marketable skill, good Java programmers are very much in demand.



Frankie <frankie@centurytel.net> wrote in message
news:39C5974E.AC51F612@centurytel.net...
> My apologies for the cross-post and the broad nature of this question.
> I just can't seem to find the info I want via traditional search
> engines, including Deja News.  And please, no flames.  I'm not a newbie
> and am aware I'm on thin ice with the cross and the questions.  Thanks.
>
> My question is what programming language would you recommend to a
> complete beginner in programming?  I've extensive background in various
> environments, so I'm not going to be terribly uneasy with the comp, I'm
> just looking for a good start.
>
> The second, and virtually hand in hand with the first, is where to go
> from there and in what sequence.  IOW, I'm thinking (just an example)
> qbasic to Visual Basic to C to C++ etc?  And yes, I'm going to throw in
> HTML, but I want to go beyond that.
>
> Again, my apologies if this is an inappropriate post.  Or, for that
> matter, too broad. Any help will be greatly appreciated.  E-mails are
> welcome (take the ** out per below) but since I'm posing the question, I
> can check all the Groups also.  TIA
>
> --
> "I do this really moronic thing that the government doesn't want me to
> do. It is called thinking" - George Carlin
>
>
> Remove * * to reply.
>
> -----------------------------------------------------------------------
> Pursuant to US Code, Title 47, Chapter 5, Subchapter II, ¢227,
> Any and all nonsolicited commercial E-mail sent to this address
> is subject to a download and archival fee in the amount of $500.00 US.
> E-Mailing denotes the acceptance of these terms
> -----------------------------------------------------------------------




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

Date: Tue, 19 Sep 2000 11:16:54 -0700
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: Annoying quotation marks!
Message-Id: <39c7ad99@news.microsoft.com>

"Tigz" <tigz@ntlworld.com> wrote in message
news:En7x5.5458$6T1.77430@news2-win.server.ntlworld.com...
> Thanks,
> now how do i change the font?

Well, that depends on which editor you are using.
In e.g. Notepad (not that I would recommend Notepad) simply go to
Format->Font and select your favorite font.
Then your Perl program will be displayed in that font.

jue




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

Date: Tue, 19 Sep 2000 20:24:41 GMT
From: akhnaten88@my-deja.com
Subject: Anonymous lists
Message-Id: <8q8i1f$e5o$1@nnrp1.deja.com>

Ok guys, here's my situation... I'm not too good with references and
anonymous datatypes, so what I've done is ugly. What I needed was a
function that returns 3 lists, so here (in a nutshell) is what I've
done:

sub func() {

my @a = (1, 2, 3);

my @b = (2, 3, 4);

my @c = ('foo', 'bar', 'baz');

return [\@a, \@b, \@c];
}

First off.. is that the best way to return 3 lists worth of data? To
make the problem more interesting, I had 2 functions that do this, and
I had to take the return data from both and merge them into single
lists. TO avoid writing out the second function, I'll just call then
above function, func() twice and merge that data. Here is what I ended
up doing:

my $refs = func();
(my ($l1ref, $l2ref, l3ref)) = @{$refs};
my @list1 = @{$l1ref};
my @list2 = @{$l2ref};
my @list3 = @{$l3ref};
# now we call it again, and merge the data
my $refs = func();
(my ($l1ref, $l2ref, $l3ref)) = @{$refs};
my @list1 = (@list1, @{$l1ref});
my @list2 = (@list2, @{$l2ref});
my @list3 = (@list3, @{$l3ref});

Now... the above accomplishes what I want... it works and all... But I
know the above can be simplified... please someone post step by step
how you would make that code in fewer lines.... I know there is a way
to merge my data into a unified list with 1 line that calls fun()
twice... Please enlighten me on the finer syntactical points of perl!!
Thanks!!

--Robert

BTW.. I've read the faqs and documentation, and I'm still too dumb to
make it work the way I want...  If you could humor me, I'd appreciate
it!



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 19 Sep 2000 11:18:36 -0700
From: Kira <callgirl@la.znet.com>
Subject: Re: Aritifical Intelligence...
Message-Id: <39C7ADFC.CAB5ADC5@la.znet.com>

rathmore@tierceron.com wrote:
 
> www.botspot.com has some interesting reads on the topic of language
> bots, which I'm guessing you are referring to.

(snippage)


> >About language bots.<
 
> *What would you like to know about language bots?*

Bodacious Bozo! 
About language bots. 

Roberta The Remarkable Robot    
Can you speak any other languages Bodacious Bozo!? 

Bodacious Bozo! 
About language bots. 

Roberta The Remarkable Robot    
Did you say "bots" or "dots" Bodacious Bozo!? 


 
> >What do you dislike about them?<
 
> *When you say "them", whom are you referring to?*

Bodacious Bozo! 
What do you dislike about them? 

Roberta The Remarkable Robot    
What I dislike about them is unimportant. 
What is important is they are as bad as them. 
They say do this. They say do that.
This and that. They and them. * SCREAMS * 



> >I'm talking about language bots.<
 
> *Do you like language bots?*

Bodacious Bozo! 
I'm talking about language bots. 

Roberta The Remarkable Robot    
You are talking about language bots? 
My goodness Bodacious Bozo!!
Who would believe such a thing! 



> >I want to know if YOU like language bots!<
 
> *I like the colour purple. Do you enjoy the colour purple?*

Bodacious Bozo! 
I want to know if YOU like language bots! 

Roberta The Remarkable Robot    
How much would YOU pay me to know if I like language bots? 

Bodacious Bozo! 
I want to know if YOU like language bots! 

Roberta The Remarkable Robot    
If YOU? IF YOU? Hey, Kira told me about this if word.
She said if anyone uses the if word, tell 'em to if off! 
IF OFF BOZO! 

 
> >grrr...<
 
Bodacious Bozo! 
grrr... 

Roberta The Remarkable Robot    
DUH! 




Bodacious Bozo! 
Who are you Roberta? 

Roberta The Remarkable Robot 
Who I am Bodacious Bozo!, is the most beautiful and the most 
intelligent female android in our entire Universe!
Roberta The Remarkable Robot! So who are you Bodacious Bozo!?
This is me! 

[ sexy android image ]




Not all androids are created equally.

Godzilla!
-- 
Dr. Kiralynne Schilitubi ¦ Cooling Fan Specialist
UofD: University of Duh! ¦ ENIAC Hard Wiring Pro
BumScrew, South of Egypt ¦ HTML Programming Class


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

Date: 19 Sep 2000 07:36:24 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Beginner installing Apache on NT4.0
Message-Id: <8q71h8$qe8$1@orpheus.gellyfish.com>

On Mon, 18 Sep 2000 11:46:23 -0700 Joe Edgar wrote:
> I'm installing the Apache web server on my NT4.0.  I've got everything
> working except for the cgi-bin.  I have Perl installed and have my scripts
> pointing to it and have the permissions set correctly.  But for some reason
> my scripts are read instead of executed by Apache. 

The Apache distribution comes with plentiful documentation that can be
found at <http://localhost/manual/>.

Cross-posted and f'ups set.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Tue, 19 Sep 2000 19:31:30 GMT
From: hbpursle@duke-energy.com (Bryce Pursley)
Subject: Re: Can I dynamically create hashes?
Message-Id: <39cabbb2.1230896395@news.infoave.net>

On 19 Sep 2000 10:14:01 -0700, merlyn@stonehenge.com (Randal L.
Schwartz) wrote:

>>>>>> "Bryce" == Bryce Pursley <hbpursle@duke-energy.com> writes:
>
>Bryce>     $tidhash{$tid}{$timestamp} = [ \@tmp ];
>
>That's a reference to a reference to an array.  Did you really
>want two levels of indirection there?

Honestly, I don't have a clue.  The previous post implied that I could
save some processing by not creating additional copies of the @tmp
array but the attempt I made to follow their directions did not work.
I'm guessing that the square brackets ([ ]) add a level of indirection
and the backslash (\) also adds a level.

I have run the following code successfully.  Is this doing what was
suggested?  Is this saving processing by referencing the @tmp array
instead of copying it again?

while (defined ($filename = glob ($yesthistfilelist)) ) { # Begin
Block 1
 open (HISTFILE, $filename) || die "can't open $filename: $!";
 while (defined <HISTFILE>) { # Begin Block 1A
  foreach (<HISTFILE>) { # Begin Block 1B
   my @tmp = split (/,/);
   if (($tmp[5] =~ (/^SIMCST/)) && ($tmp[7] =~ (/^ALARM|^Alarm/))) {
    $tid = ($tmp[2]);
    $timestamp = ($tmp[0]);
    $tidhash{$tid}{$timestamp} = \@tmp;
   }
  } # end Block 1B
 } # end Block 1A
} # end Block 1



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

Date: 19 Sep 2000 14:56:03 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Can I dynamically create hashes?
Message-Id: <m3u2bcupf0.fsf@dhcp11-177.support.tivoli.com>

hbpursle@duke-energy.com (Bryce Pursley) writes:

>     $tidhash{$tid}{$timestamp} = [ \@tmp ];

Use either:

      $tidhash{$tid}{$timestamp} = [ @tmp ];

which stores a reference to a copy of @tmp in the hash (which is a
good thing), or:

      $tidhash{$tid}{$timestamp} = \@tmp;

which stores a reference to @tmp in the hash (which might be a bad
thing depending on whether @tmp is lexical or not and whether it is
going to be reused.

Here are some examples that will hopefully help to clarify things:

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

my @tmp = (1, 2, 3);
my $ref1 = \@tmp;
my $ref2 = [ @tmp ];
@tmp = (4, 5, 6);
print "@$ref1\n";             # prints "4 5 6" (new @tmp values)
print "@$ref2\n";             # prints "1 2 3" (orig @tmp values)

sub f {
  my @tmp = ($_[0], $_[0] * 2);
  return \@tmp;
}

my $ref3 = f(2);
my $ref4 = f(3);
print "@$ref3\n";             # prints "2 4" (@tmp values when assigned)
print "@$ref4\n";             # prints "3 6" (@tmp values when assigned)
__END__


So, $ref1 is a reference to @tmp -- any changes to @tmp are seen when
examining @$ref1 (they are the *same* array).  This is probably bad,
unless it is the desired effect.  $ref2, on the other hand, is a
reference to a copy of @tmp -- changes to @tmp are not seen in @$ref2.

Now, the situation were it is OK to *not* make a copy is something
like the subroutine.  Each time the subroutine is called, the my
declaration causes a new lexical @tmp array to be created.  Returning
a reference to this array is OK because nothing else has access to the
array.  The returned reference is the only reference.  Why do it this
way?  To avoid an unnecessary copy of the array.

HTH,

-- 
Ren Maddox
ren@tivoli.com


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

Date: Tue, 19 Sep 2000 12:21:04 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Can you store a condition in a variable?
Message-Id: <MPG.14315c7eccb68c3d98ad95@nntp.hpl.hp.com>

In article <slrn8sf5vb.5fq.abigail@alexandra.foad.org> on 19 Sep 2000 
16:45:37 GMT, Abigail <abigail@foad.org> says...
> Rafael Garcia-Suarez (rgarciasuarez@free.fr) wrote on MMDLXXVI September
> MCMXCIII in <URL:news:slrn8sf2vm.p84.rgarciasuarez@rafael.kazibao.net>:
> :: Sylvain Martin wrote in comp.lang.perl.misc:
> :: >I'd like to add some functionality to a program I wrote that creates dynamic
> :: >html pages from templates.
> :: >I was wondering if and how could I implement  something like this in my
> :: >templates
> :: >
> :: ><TD BGCOLOR="PCMD{ print ($current_row mod 2) ? "Green" : "Yellow";}">
> :: >
> :: >my perl script scans and looks for PCMD{} and would save that in a variable
> :: >then how can I get perl to interpret this? so that is returns Green for even
> :: >and Yellow for odd rows?
> :: 
> :: The immediate answer to your question is to lookup the eval() function
> :: in the perlfunc section of the docs.
> 
> Eval? No way. Just interpolation.
> 
>     <TD BGCOLOR = "${\($current_row ++ mod 2 ? 'Green' : 'Yellow')}">

What is 'mod'?  A long way of writing '%'?

> Of course, you ought to be using a stylesheet.
> 
> (Yellow and green? *shudder*)

Check out the Australiam team's colors.  Also the University of Oregon 
(Ducks!, how appropriate),  But *shudder* anyway.  :-)

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 19 Sep 2000 19:32:56 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Can't make DBI
Message-Id: <8q8bgo$tht$1@orpheus.gellyfish.com>

On Fri, 15 Sep 2000 01:52:59 -0700 Gabe wrote:
> I've got a fresh installation of Redhat 6.2 with Perl 5.00503 that the
> Redhat installer installed. When I try to make DBI I get a bunch of errors
> referring to files with an .h extension saying "No such file or directory".
> The readme says if you get errors related to perl's header files then you
> have a bad perl installation. I don't know how I could have a bad
> installation since perl was installed automatically.
> 

That's precisely why you have a bad installation. Get the latest source
code and build it from source *after* having removed the existing package
using RPM - it will complain about some dependencies so you will have to
force it.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Tue, 19 Sep 2000 20:30:17 +0100
From: "D Borland" <d.borland@ntlworld.com>
Subject: Char to Octoal... ?
Message-Id: <g3Px5.11634$6T1.168238@news2-win.server.ntlworld.com>

Can anyone here, inform me of how you can return the octal value of a char,
from a $... ?

Did i explain this right... ?

Thanks for your time...

';'






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

Date: Tue, 19 Sep 2000 21:28:19 +0200
From: Alain BARBET <alian@alianwebserver.com>
Subject: Re: Char to Octoal... ?
Message-Id: <39C7BE53.7D91B942@alianwebserver.com>

Hi,

> Can anyone here, inform me of how you can return the octal value of a char,
> from a $... ?

perldoc -f oct

HTH,
--
Alain & Estelle BARBET
http://www.alianwebserver.com


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

Date: Tue, 19 Sep 2000 21:52:39 +0200
From: Adam <adamf@box43.gnet.pl>
Subject: Re: Char to Octoal... ?
Message-Id: <39C7C407.62A7@box43.gnet.pl>

D Borland wrote:
> 
> Can anyone here, inform me of how you can return the octal value of a char,
> from a $... ?
> 
> Did i explain this right... ?
> 
> Thanks for your time...
> 
> ';'

this is as simply as:
	printf( "%o", $var );
	or
	$var = sprintf( "%o", $var );
if you want it back in some variable instead of STDOUT.

but better... look into: 
perldoc perlfunc (printf, sprintf).

;)
Adam.


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

Date: Tue, 19 Sep 2000 21:05:18 GMT
From: cfedde@u.i.sl3d.com (Chris Fedde)
Subject: Re: combining file handles
Message-Id: <iyQx5.263$W3.188763648@news.frii.net>

In article <39C70427.57C53374@nsc.com>, Avi Mintz  <Avi.Mintz@nsc.com> wrote:
>is there a way to use 2 file handles together (to read from the first
>until the end of it and then from the second ?)
>
>I was thinking of something like :  
>  while (<ARGV,STDIN>) so a program can work from a file in the argument
>list and also from standard input...
>
>any suggestions ??

    $ cat t
    while (<>)
    {
	print;
    } 


run it as 

    perl t this that something - else

The - gets STDIN till it has eof, then the loop goes on to the next file.

chris
-- 
    This space intentionally left blank


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

Date: 19 Sep 2000 19:44:25 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Comparing two Directories
Message-Id: <8q8c69$tjc$1@orpheus.gellyfish.com>

On Mon, 18 Sep 2000 12:05:39 -0700 Tim Conrow wrote:
> 
> (I'm tempted to say you should check for errors on that readdir, but I'm not
> sure what errors can occur on a readdir.)
> 

readdir(3) on this machine says that it can fail with EBADF but that could
potentially be caused by a variety of things.

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Tue, 19 Sep 2000 12:36:59 -0700
From: Mike Ayers <mayers@bmc.com>
Subject: Cygwin Perl failing - please help
Message-Id: <39C7C05B.82DE3F3A@bmc.com>


	I get this when running a script:

====================8<-----------------SNIP----------------------------------------
    0       0 [main] c:\progfile\Cygwin\contrib\bin\perl.exe 1630
fork_copy: loaded dll data/bss pass 0 failed, 0x14043000..0x1404300C,
done 0, Win32 error 487
    0   10368 [proc] perl 1630 wait_subproc: wait failed. nchildren 1,
wait 500, Win32 error 6
 5502   15870 [proc] perl 1630 wait_subproc: event[1] 0x70, Win32 error
6
====================8<-----------------SNIP----------------------------------------

	The script is a bash script which sets up PERLLIB, PERL5SHELL, etc.,
then calls a Perl script which is embedded as a here doc.  The script
runs fine on Solaris 8.  I modified the script to dump the here doc to a
file so that I could use the debugger on it.  The failure occurs at the
line:

$InstallDir = qx( pwd );

	...which I can run by hand without any problems.  Does anyone have any
idea what I'm up against?

	Details:  Cygwin commercial version (1.0, I believe, but I'm not
sure).  Perl 5.005_03 (same on Solaris).


	TiA,

/|/|ike


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

Date: Tue, 19 Sep 2000 12:52:25 -0700
From: Mike Ayers <mayers@bmc.com>
Subject: Re: Cygwin Perl failing - please help
Message-Id: <39C7C3F9.E3101FD0@bmc.com>


	Even better - here is a minimal script to reproduce the failure:

====================8<-----------------SNIP----------------------------------------

use strict;
use FileHandle;
use vars qw( $InstallDir );

$InstallDir = qx( pwd );
print( $InstallDir, "\n" );

====================8<-----------------SNIP----------------------------------------

	Also, I'm on NT4SP5.  I'm now looking into using IO::File instead of
Filehandle, but would still appreciate any info on why the FileHandle
lib appears to be so unfriendly.


/|/|ike

Mike Ayers wrote:
> 
>         I get this when running a script:
> 
> ====================8<-----------------SNIP----------------------------------------
>     0       0 [main] c:\progfile\Cygwin\contrib\bin\perl.exe 1630
> fork_copy: loaded dll data/bss pass 0 failed, 0x14043000..0x1404300C,
> done 0, Win32 error 487
>     0   10368 [proc] perl 1630 wait_subproc: wait failed. nchildren 1,
> wait 500, Win32 error 6
>  5502   15870 [proc] perl 1630 wait_subproc: event[1] 0x70, Win32 error
> 6
> ====================8<-----------------SNIP----------------------------------------
> 
>         The script is a bash script which sets up PERLLIB, PERL5SHELL, etc.,
> then calls a Perl script which is embedded as a here doc.  The script
> runs fine on Solaris 8.  I modified the script to dump the here doc to a
> file so that I could use the debugger on it.  The failure occurs at the
> line:
> 
> $InstallDir = qx( pwd );
> 
>         ...which I can run by hand without any problems.  Does anyone have any
> idea what I'm up against?
> 
>         Details:  Cygwin commercial version (1.0, I believe, but I'm not
> sure).  Perl 5.005_03 (same on Solaris).
> 
>         TiA,
> 
> /|/|ike


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

Date: Tue, 19 Sep 2000 19:15:57 GMT
From: darkrabbit@my-deja.com
Subject: Re: File Parsing, Skipping lines
Message-Id: <8q8e0n$8vo$1@nnrp1.deja.com>

 J. Stone <jstone211@my-deja.com> wrote:
> If I know I need to move ahead a certain number of lines once I've
> found an item in my file, what is the best way to do this?

I use ...

open( FILEHANDLE, "< $file);
@filearray = <FILEHANDLE>;

 ... then I have an array I can use to hop to specific line numbers.  This
might be slow if you are parseing a long file.

> Also, I need to find a particular header in a file, once I find that I
> need to find another header ( the first header is not always followed
> by the 2nd header, so I must verify)... then I can read lines and parse
> using unpack.  Any tips?

If you have an array like my above example, you could probably test for that
condition as you walk through it.  When you meet the condition yank the lines
you need out.

GT


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 19 Sep 2000 19:15:59 GMT
From: darkrabbit@my-deja.com
Subject: Re: File Parsing, Skipping lines
Message-Id: <8q8e0p$8vq$1@nnrp1.deja.com>

 J. Stone <jstone211@my-deja.com> wrote:
> If I know I need to move ahead a certain number of lines once I've
> found an item in my file, what is the best way to do this?

I use ...

open( FILEHANDLE, "< $file);
@filearray = <FILEHANDLE>;

 ... then I have an array I can use to hop to specific line numbers.  This
might be slow if you are parseing a long file.

> Also, I need to find a particular header in a file, once I find that I
> need to find another header ( the first header is not always followed
> by the 2nd header, so I must verify)... then I can read lines and parse
> using unpack.  Any tips?

If you have an array like my above example, you could probably test for that
condition as you walk through it.  When you meet the condition yank the lines
you need out.

GT


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 19 Sep 2000 18:22:23 GMT
From: cfedde@u.i.sl3d.com (Chris Fedde)
Subject: Re: FileMaker, DBI
Message-Id: <z9Ox5.261$W3.173508096@news.frii.net>

In article <39C6767F.C1C71441@lighthouseNOTmarketingNOT.com>,
kevin metcalf  <kmetcalf@lighthousemarketing.com> wrote:
>Macintosh G4 server.  It's for a small group called @ONE who are working
>

mac perl supports apple events. Why not drive Filemaker directly?
Barring that perhaps the operations that you want to perform can
be done easily inside filemaker?

chris
-- 
    This space intentionally left blank


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

Date: 19 Sep 2000 21:24:41 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: GLOBAL TELECOMMUTE PROGRAMMERS PERL - JAVA -JS-CSS-HTML-DREAMWEAVER
Message-Id: <8q8i29$8kq$1@orpheus.gellyfish.com>

On 18 Sep 2000 16:59:10 -0500 INTERNATIONALTeleCommuter@allworldint.com wrote:
> 
> Using a Remote Control software utility called TIMBUKTU,
> 2 people can work on the same computer simultaneously.
> 

Using a 'Remote Control software utility' called 'telnet' thousands
of people can work on the same computer simultaneously.

Sik 'im Davey boy ...

/J\
-- 
yapc::Europe in assocation with the Institute Of Contemporary Arts
   <http://www.yapc.org/Europe/>   <http://www.ica.org.uk>


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

Date: Tue, 19 Sep 2000 21:37:00 GMT
From: sommerm@apci.com
Subject: HELP! Problem returning info from shell call
Message-Id: <8q8m9q$jj4$1@nnrp1.deja.com>

I am having a problem related to others, but haven't read an answer
that helps me. I am trying to figure out why my script runs under perl
5.003, but when I switch to 5.004, lines such as

$variable = `c:\perl\bin\perl c:\ito\getlist_plugin.pl`;

are suddenly not returning anything. My script is a monitoring program,
so it is very important that I get this working. Anyone have any ideas?
I figure it might have something to do with the environmental variables
(stdout) since even $client_name = `echo %COMPUTERNAME%` is not
working. When I run this from the command prompt, everything works ok,
but I need to have the command script be run by HP's OpenView
Management Server. What can I do
to fix this? I would really appreciate any help. Thank you!!

Melissa


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 19 Sep 2000 12:11:23 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Help, need to compair PC date with a date in a variable.
Message-Id: <MPG.14315a3657eed8e398ad93@nntp.hpl.hp.com>

In article <8q8064$8cc$1@news2atm.raleigh.ibm.com> on Tue, 19 Sep 2000 
16:53:56 +0200, Matt King <mattking@techie.com> says...
> Hello, I have a problem that so far I have not been able to find in the Perl
> docs. I'm hoping that someone here can help me to make this work.

How did your search of the Perl docs overlook the Frequently Answered 
Questions?

> I need a way, without installing any modules (I have to be able to do it
> without modules, only base Perl install commands), to compair the PC's
> current date with the date in a variable. The veriable date has the format
> dd.mm.yy hh:mm:ss (human readable format). I can read in the PC's time and
> date and convert it into human readable format, but I can't get it to
> compair. What I need to do is take the variable date and compair it with the
> PC's date (time check isn't needed), and if the date is 60 or more days old
> preform and action, like send a warning message to the screen.
> 
> How can I get this done? I was thinking that it would be eaisest to convert
> the variable date/time into PC format, then compair that to the PC
> date/time, but I can't find any information on how to convert to PC format,
> only how to convert from PC format.

perlfaq4: "How can I take a string and turn it into epoch seconds?"

The module referred to in that answer is already installed as part of 
the standard Perl distribution.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 19 Sep 2000 14:22:59 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Help, need to compair PC date with a date in a variable.
Message-Id: <m3ya0ouqy4.fsf@dhcp11-177.support.tivoli.com>

"Matt King" <mattking@techie.com> writes:

> I need a way, without installing any modules (I have to be able to do it
> without modules, only base Perl install commands), to compair the PC's
> current date with the date in a variable. The veriable date has the format
> dd.mm.yy hh:mm:ss (human readable format). I can read in the PC's time and
> date and convert it into human readable format, but I can't get it to
> compair. What I need to do is take the variable date and compair it with the
> PC's date (time check isn't needed), and if the date is 60 or more days old
> preform and action, like send a warning message to the screen.

Well, you say "without installing any modules", but you also say "do
it without modules".  It isn't clear from that whether you can use
modules that are included with Perl.  If you can, then how about:

#!/usr/local/bin/perl -w
use strict;
use Time::Local;
$_ = "19.07.00 14:14:23";
my($mday, $mon, $year, $hour, $min, $sec) = split /[. :]/;
my $elapsed = time - timelocal($sec, $min, $hour, $mday, $mon-1, $year);
print "$_ is ", ($elapsed/3600/24), " days ago\n";
__END__

> How can I get this done? I was thinking that it would be eaisest to convert
> the variable date/time into PC format, then compair that to the PC
> date/time, but I can't find any information on how to convert to PC format,
> only how to convert from PC format.

Well, there is strftime, but it is in the POSIX module, so I guess
that doesn't help.  Still, it isn't to difficult to format the date
manually:

#!/usr/local/bin/perl -w
use strict;
my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
# I'm ignoring $isdst
printf "%02d.%02d.%02d %02d:%02d:%02d\n", $mday, $mon+1, $year%100,
       $hour, $min, $sec;
__END__

Of course, converting to this format doesn't seem very useful as
you're just going to have to take it apart again to compare it in a
meaningful way....

-- 
Ren Maddox
ren@tivoli.com


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4376
**************************************


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