[18089] in Perl-Users-Digest
Perl-Users Digest, Issue: 249 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 8 21:05:44 2001
Date: Thu, 8 Feb 2001 18:05:21 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <981684321-v10-i249@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 8 Feb 2001 Volume: 10 Number: 249
Today's topics:
(OFF TOPIC) Re: splitting a string on the / character <godzilla@stomp.stomp.tokyo>
Re: (OFF TOPIC) Re: This is driving me nuts and I need <uri@sysarch.com>
Re: (OFF TOPIC) Re: This is driving me nuts and I need <godzilla@stomp.stomp.tokyo>
Can perl define vars dynamically? michael.cambray@wellpoint.com
Re: Can perl define vars dynamically? (John Joseph Trammell)
Re: Can perl define vars dynamically? <ccx138@coventry.ac.uk>
Re: Can perl define vars dynamically? <ccx138@coventry.ac.uk>
Re: Can perl define vars dynamically? <joe+usenet@sunstarsys.com>
capturing diagnostics <tfiedler@zen.moldsandwich.com>
catching HUP signal <antsyp@my-deja.com>
catching HUP signal <nancy@bigfishmail.com>
changing env vars within a perl program dave_vb@my-deja.com
Re: changing env vars within a perl program egwong@netcom.com
Re: Converting nested hashes to objects <sumus@aut.dk>
Re: dbm hashes : Operation not permitted (Garry Williams)
Re: Devel DProf and " dprofpp " <godzilla@stomp.stomp.tokyo>
Re: flock unavailable on many platforms <ddunham@redwood.taos.com>
Re: help with multiple if statements ? <mischief@velma.motion.net>
Re: help with multiple if statements ? <ccx138@coventry.ac.uk>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 08 Feb 2001 16:13:32 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: (OFF TOPIC) Re: splitting a string on the / character
Message-Id: <3A83362C.C383E508@stomp.stomp.tokyo>
Randal wrote:
> >>>>> Chris wrote:
(lots of snippage)
> GIVE A MAN A FIRE, he's warm for an hour
> SET A MAN ON FIRE, he's warm for the rest of his life
White man build big fire, stand far away.
Indian build small fire, sit close.
Godzilla!
------------------------------
Date: Fri, 09 Feb 2001 01:33:43 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: (OFF TOPIC) Re: This is driving me nuts and I need a guru
Message-Id: <x7g0hood1k.fsf@home.sysarch.com>
>>>>> "G" == Godzilla! <godzilla@stomp.stomp.tokyo> writes:
G> As an example, here in our group, there is one person, a rather
G> mentally and emotionally unstable person, pretending to be,
G> quite literally, hundreds of different people, each 'person'
G> posting pretend problems with an intent of initiating argument,
G> with an intent of ego satiation by responding to himself with
G> solutions and intent to make himself appear intelligent to
G> others, those others fooled by this impotent con game.
this is you. how nice of you to point it out.
and stop calling this 'our' net or 'our' group. no one here has ever
called you a member of good standing here. no one. so you are singular
and can't use the pronoun 'our'. please refrain from such usage
anymore. each time you use it, you just add to the pile of bullshit you
push onto 'the' net. and that isn't 'our' either.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Thu, 08 Feb 2001 17:57:49 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: (OFF TOPIC) Re: This is driving me nuts and I need a guru
Message-Id: <3A834E9D.2639EC4@stomp.stomp.tokyo>
Uri Guttman wrote:
> >>>>> Godzilla! reflects on reality:
> G> As an example, here in our group, there is one person, a rather
> G> mentally and emotionally unstable person, pretending to be,
> G> quite literally, hundreds of different people, each 'person'
> G> posting pretend problems with an intent of initiating argument,
> G> with an intent of ego satiation by responding to himself with
> G> solutions and intent to make himself appear intelligent to
> G> others, those others fooled by this impotent con game.
> this is you. how nice of you to point it out.
> and stop calling this 'our' net or 'our' group. no one here has ever
> called you a member of good standing here. no one. so you are singular
> and can't use the pronoun 'our'. please refrain from such usage
> anymore. each time you use it, you just add to the pile of bullshit you
> push onto 'the' net. and that isn't 'our' either.
You are right Uri. This isn't our newsgroup. This is your
newsgroup, your Good Ol' Boys Club. I stand corrected.
* genuflects and slobbers *
I know my place; the kitchen. I shall head there
now, barefoot and pregnant.
Godzilla!
------------------------------
Date: Thu, 08 Feb 2001 23:10:12 GMT
From: michael.cambray@wellpoint.com
Subject: Can perl define vars dynamically?
Message-Id: <95v90f$jrt$1@nnrp1.deja.com>
Assign variables "on the fly" problem over-simplified below:
for example: $sepf[$i] = $sep_array[$i];
I have an input file like below:
(3 fields between the pipes).
A|B>1|Z
A|B>2>3>Z
A|B>4>5>6|Z
A|B>7>8>9>10|Z
I pull out individual fields from the second field
getting the results I need shown below:
B!1!!!
B!2!3!Z!
B!4!5!6!
B!7!8!9!10
I would like to assign the vars dynamically as in line 36
(commented out below) but get the following error messages.
Global symbol "sepf" requires explicit package name at huh1 line 31 (#1)
(F) You've said "use strict vars", which indicates that all
variables
must either be lexically scoped (using "my"), or explicitly
qualified to
say which package the global variable is in (using "::").
Execution of huh1 aborted due to compilation errors (#2)
(F) The final summary message when a Perl compilation fails.
Uncaught exception from user code:
Execution of huh1 aborted due to compilation errors.
The code below works as shown, but when I un-comment line 36 and
comment out 31 to 35, I get the message above.
IS IT THAT I'M DOING SOMETHING WRONG, OR AM I TRYING TO GET PERL
TO DO SOMETHING IT ISN'T DESIGNED FOR?
ANY HELP IS APPRECIATED.
#!/home/tools/bin/perl
use strict;
use diagnostics;
$[ = 1; # set array base to 1
$, = ' '; # set output field separator
$\ = "\n"; # set output record separator
my ($FS,$Fld1,$Fld2,$Fld3,$sepf1,$sepf2,$sepf3,$sepf4,$sepf5,
$sep_array_size,@sep_array,$i,$sepf);
$FS = '|';
while (<>) {
($Fld1,$Fld2,$Fld3) = split(/[|\n]/, $_, 9999);
$sepf1 = '';
$sepf2 = '';
$sepf3 = '';
$sepf4 = '';
$sepf5 = '';
# Define the array.
$sep_array_size = (@sep_array = split(/>/, $Fld2, 9999));
# Loop through the array and assign values to the variables.
for ($i = 1; $i <= $sep_array_size; ++$i) {
if ($i == 1) { $sepf1 = $sep_array[$i]; } # line 31
if ($i == 2) { $sepf2 = $sep_array[$i]; } # line 32
if ($i == 3) { $sepf3 = $sep_array[$i]; } # line 33
if ($i == 4) { $sepf4 = $sep_array[$i]; } # line 34
if ($i == 5) { $sepf5 = $sep_array[$i]; } # line 35
# $sepf[$i] = $sep_array[$i]; # line 36
}
print $sepf1 . '!' . $sepf2 . '!' . $sepf3 . '!' .
$sepf4 . '!' . $sepf5;
}
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Thu, 08 Feb 2001 23:36:47 GMT
From: trammell@bayazid.hypersloth.net (John Joseph Trammell)
Subject: Re: Can perl define vars dynamically?
Message-Id: <slrn9869bb.pd4.trammell@bayazid.hypersloth.net>
On Thu, 08 Feb 2001 23:10:12 GMT, michael.cambray@wellpoint.com
<michael.cambray@wellpoint.com> wrote:
> Assign variables "on the fly" problem over-simplified below:
[snip]
> I would like to assign the vars dynamically as in line 36
> (commented out below) but get the following error messages.
>
> Global symbol "sepf" requires explicit package name at huh1 line 31 (#1)
> (F) You've said "use strict vars", which indicates that all
> variables
> must either be lexically scoped (using "my"), or explicitly
> qualified to
> say which package the global variable is in (using "::").
> Execution of huh1 aborted due to compilation errors (#2)
> (F) The final summary message when a Perl compilation fails.
> Uncaught exception from user code:
> Execution of huh1 aborted due to compilation errors.
I think you need to re-read this error message. If there's something
you don't understand in the message, just ask about it. Hint: "my".
------------------------------
Date: Thu, 08 Feb 2001 23:27:11 +0000
From: JMT <ccx138@coventry.ac.uk>
Subject: Re: Can perl define vars dynamically?
Message-Id: <3A832B4F.2053763E@coventry.ac.uk>
michael.cambray@wellpoint.com wrote:
> Assign variables "on the fly" problem over-simplified below:
>
> for example: $sepf[$i] = $sep_array[$i];
>
> I have an input file like below:
> (3 fields between the pipes).
>
> A|B>1|Z
> A|B>2>3>Z
> A|B>4>5>6|Z
> A|B>7>8>9>10|Z
>
> I pull out individual fields from the second field
> getting the results I need shown below:
>
> B!1!!!
> B!2!3!Z!
> B!4!5!6!
> B!7!8!9!10
>
[snip]
>
>
> Sent via Deja.com
> http://www.deja.com/
Are you just trying to take the file from the top to the one at the bottom?
or is there some more to this.
I just thing I may have missed something in your question and there maybe an
easier way to do it.
John.
------------------------------
Date: Fri, 09 Feb 2001 00:08:13 +0000
From: JMT <ccx138@coventry.ac.uk>
Subject: Re: Can perl define vars dynamically?
Message-Id: <3A8334ED.D2633125@coventry.ac.uk>
michael.cambray@wellpoint.com wrote:
> Assign variables "on the fly" problem over-simplified below:
>
> for example: $sepf[$i] = $sep_array[$i];
>
> I have an input file like below:
> (3 fields between the pipes).
>
> A|B>1|Z
> A|B>2>3>Z
> A|B>4>5>6|Z
> A|B>7>8>9>10|Z
>
> I pull out individual fields from the second field
> getting the results I need shown below:
>
> B!1!!!
> B!2!3!Z!
> B!4!5!6!
> B!7!8!9!10
>
> [SNIP]
>
> Sent via Deja.com
> http://www.deja.com/
Try this it gives the same results that you were getting, will this do or
are you being paid LOC.
while(<>){
/A\|(.*)\|Z/;
$bit = $1;
($count) = $bit =~ s/>/!/g;
print $bit;
for ($i = $count; $i <= 3; $i++){
print "!";
}
print "\n";
}
John.
------------------------------
Date: 08 Feb 2001 20:31:37 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Can perl define vars dynamically?
Message-Id: <m3k870prpi.fsf@mumonkan.sunstarsys.com>
michael.cambray@wellpoint.com writes:
> Assign variables "on the fly" problem over-simplified below:
That would be symrefs? Yes, but those are bad things that in almost
all cases can be replaced by a hash or an array.
[btw: nice job with this post, you've included all relevant details]
> A|B>1|Z
> A|B>2>3>Z
> A|B>4>5>6|Z
> A|B>7>8>9>10|Z
>
> I pull out individual fields from the second field
> getting the results I need shown below:
>
> B!1!!!
> B!2!3!Z!
> B!4!5!6!
> B!7!8!9!10
>
> I would like to assign the vars dynamically as in line 36
> (commented out below) but get the following error messages.
The message you got here warned about an undeclared variable appearing
on line 36.
> The code below works as shown, but when I un-comment line 36 and
> comment out 31 to 35, I get the message above.
Oh, I see now. So line 36 replaces 31 to 35? Excellent!
> IS IT THAT I'M DOING SOMETHING WRONG, OR AM I TRYING TO GET PERL
> TO DO SOMETHING IT ISN'T DESIGNED FOR?
Yikes! Please don't scream; the sky is not falling.
> #!/home/tools/bin/perl
^^^
enable warnings: -w
> use strict;
> use diagnostics;
very nice.
>
> $[ = 1; # set array base to 1
> $, = ' '; # set output field separator
> $\ = "\n"; # set output record separator
Ack! If you want formatted output, look at the documentation
for Perl's format() and write(). After all, it's a report
language :) Don't monkey with these special variables unless
absolutely necessary (like fixing a horribly broken program
that you didn't write :)
Especially $[. perlvar cautions against doing that, so just
don't. Learn to index from 0 (i.e. think "offsets") in your code.
% man perlvar
...
As of Perl 5, assignment to "$[" is treated as a compiler
directive, and cannot influence the behavior of any other
file. Its use is discouraged.
...
> my ($FS,$Fld1,$Fld2,$Fld3,$sepf1,$sepf2,$sepf3,$sepf4,$sepf5,
> $sep_array_size,@sep_array,$i,$sepf);
^
@
I'd guess that's the source of your problem; which is why it's
a good idea to put your variable declarations near their first
appearance in the code- the added advantage is that your "my"
variables will automatically be scoped to the smallest enclosing
block. I recommend you drop the entire line above.
> $FS = '|';
my $FS = '|'; # (used in a regexp) why is this here?
my @sepf; # desired array (what's it good for?)
> while (<>) {
> ($Fld1,$Fld2,$Fld3) = split(/[|\n]/, $_, 9999);
while (<>) {
chomp; # get rid of potential teminating newline
my (undef, $field) = split /$FS/o, $_, 3; # field 2 into my $field
[...]
> # Define the array.
>
> $sep_array_size = (@sep_array = split(/>/, $Fld2, 9999));
You don't need a special variable for the size of an array; but
it sure doesn't hurt the readability (so long as the array size
doesn't change later on). I'll omit it here, though.
my @sep_array = split />/, $field, 9999; # hates 10000 records
> # Loop through the array and assign values to the variables.
Unnecessary and dangerous, since the values in @sepf persist across
readlines (your while(<>) loop). Lines with longer records will be
retained as part of shorter ones that appear later in your file.
To avoid this, either use an array assignment like
@sepf = @sep_array; # assign record to @sepf for some obscure reason
or do away with @sepf entirely. (What's it good for, anyway?)
[...]
> print $sepf1 . '!' . $sepf2 . '!' . $sepf3 . '!' .
> $sepf4 . '!' . $sepf5;
print join("!", @sepf[0..4]) , "\n"; # why not @sep_array?
> }
HTH
Joe Schaefer
--
$.=$[|3*rand;$_=67014523;END{print@_};*UNIVERSAL::AUTOLOAD=sub{&A;pop->();++
$#;*A};$.++,*[=*]=*\=sub{$].=pop.(--$#%2?q: ::qq::)};*#=sub{split m, (?<=^.{2})
(.{$.}),x,shift};@#=qw[just another Perl hacker];*A=*AUTOLOAD=sub{split"::",$A;
&]};map{splice@#,$_,1,&#($#[$_])}3,1;$_="@{[@#[m$.$g]]}";s;P;,p;;eval;$\.="\n"
------------------------------
Date: Thu, 08 Feb 2001 23:36:04 GMT
From: Ted Fiedler <tfiedler@zen.moldsandwich.com>
Subject: capturing diagnostics
Message-Id: <Pine.BSO.4.32.0102081835070.25950-100000@zen.moldsandwich.com>
how would I capture the output when use diagnostics; is used? It runs
several screen lengths and have tried prog.pl > 1 and prog.pl | less
and others. what am i missing?
------------------------------
Date: Thu, 08 Feb 2001 23:11:34 GMT
From: nancy <antsyp@my-deja.com>
Subject: catching HUP signal
Message-Id: <95v931$jt7$1@nnrp1.deja.com>
I've got a server preforking a number of child procs, communicating via
pipes. The parent process keeps a scoreboard of the various states of
the children - idle, busy, or exit (about to die). I want to be able
to HUP the kiddies to tell them to die gracefully (send an exit status
to the parent and die). I've got code catching the HUP, and it appears
to be executing the handler (I've added prints to see if it actually
hits the handler, it does), but the child proc still terminates
ungracefully, and I'm not sure why. Not sure if this is because of the
method being used to spawn the child procs...Any ideas?
Here are the code snippets:
sub _handle_hup {
$hup = 1; # $hup is a global var, initially set to 0
}
sub _do_preforked_child {
my $self = shift;
my $starttime = time;
$SIG{HUP} = \&_handle_hup;
...
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Thu, 08 Feb 2001 23:26:14 GMT
From: nancy <nancy@bigfishmail.com>
Subject: catching HUP signal
Message-Id: <95v9uf$kno$1@nnrp1.deja.com>
I've got a server preforking a number of child procs, communicating via
pipes. The parent process keeps a scoreboard of the various states of
the children - idle, busy, or exit (about to die). I want to be able
to HUP the kiddies to tell them to die gracefully (send an exit status
to the parent and die). I've got code catching the HUP, and it appears
to be executing the handler (I've added prints to see if it actually
hits the handler, it does), but the child proc still terminates
ungracefully, and I'm not sure why. Not sure if this is because of the
method being used to spawn the child procs...Any ideas?
Here are the code snippets:
sub _handle_hup {
$hup = 1; # $hup is a global var, initially set to 0
}
sub _do_preforked_child {
my $self = shift;
my $starttime = time;
$SIG{HUP} = \&_handle_hup;
...
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Thu, 08 Feb 2001 23:37:02 GMT
From: dave_vb@my-deja.com
Subject: changing env vars within a perl program
Message-Id: <95vaiu$l86$1@nnrp1.deja.com>
Is there any way I can run a ksh script that sets/modifies environment
variables (e.g. PATH) from a perl script and have the changes "stick."
I'd like to be able to do stuff like $foo=`which bar` in my perl script
using the new value for PATH from the script.
The shell script already exists and it's an insane number of variables
to set/change with %ENV.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Fri, 09 Feb 2001 00:47:00 GMT
From: egwong@netcom.com
Subject: Re: changing env vars within a perl program
Message-Id: <86Hg6.1268$y03.140216@news.flash.net>
dave_vb@my-deja.com wrote:
> Is there any way I can run a ksh script that sets/modifies environment
> variables (e.g. PATH) from a perl script and have the changes "stick."
> I'd like to be able to do stuff like $foo=`which bar` in my perl script
> using the new value for PATH from the script.
> The shell script already exists and it's an insane number of variables
> to set/change with %ENV.
See this question in the perlfaq8 manpage:
I {changed directory, modified my environment} in a perl script.
How come the change disappeared when I exited the script? How do I
get my changes to be visible?
------------------------------
Date: 09 Feb 2001 00:49:11 +0100
From: Jakob Schmidt <sumus@aut.dk>
Subject: Re: Converting nested hashes to objects
Message-Id: <u264loqw.fsf@macforce.sumus.dk>
svadakke@cochin.qualcomm.com (Sameer Vadakke-Kuruppath) writes:
> Hello,
>
> I'm trying to come up with a maintainable OO solution for a problem and
> would appreciate some insights.
>
> I've a config. file looking like this:
>
> {
> 'valid' => [ 'a', 'b' ],
> 'a' => {
> 'valid' => [ 'c', 'd' ],
> 'c' => {
> 'valid' => [ 'e', 'f' ],
> 'e' => 'testing e',
> 'f' => 'testing f'
> },
> 'd' => 'testing d',
> }
> 'b' => 'testing b',
> }
>
> During traversals and
> retrievals from the object, each nested hash is 'blessed' into MyConfig,
> in order to access methods.
By altering your file format you could skip the "reblessing". Here's a
snippet to illustrate:
------------------------
#!/usr/bin/perl -w
use strict;
my $config =
bless( {
'valid' => [ 'a', 'b' ],
'a' => bless ( {
'valid' => [ 'c', 'd' ],
'c' => bless ( {
'valid' => [ 'e', 'f' ],
'e' => 'testing e',
'f' => 'testing f'
}, 'MyConfig' ),
'd' => 'testing d',
}, 'MyConfig' ),
'b' => 'testing b',
}, 'MyConfig' );
# test that the blessings are on
$config->huha;
$config->{ a }->huha;
$config->{ a }{ c }->huha;
package MyConfig;
# method for testing
sub huha {
my ( $self ) = @_;
print "Huha: @{ $self->{ valid } }\n";
}
1;
---------------
I admit the format becomes more cumbersome - but the usage becomes
really pretty. You can improve on the format by declaring package MyConfig
in each config file - thus the second argument to bless() can be omitted.
Behold:
#!/usr/bin/perl -w
use strict;
use vars qw( $config );
MyConfig->init;
$config->huha;
$config->{ a }->huha;
$config->{ a }{ c }->huha;
####################
package MyConfig;
sub init {
$main::config =
bless( {
'valid' => [ 'a', 'b' ],
'a' => bless ( {
'valid' => [ 'c', 'd' ],
'c' => bless ( {
'valid' => [ 'e', 'f' ],
'e' => 'testing e',
'f' => 'testing f'
} ),
'd' => 'testing d',
} ),
'b' => 'testing b',
} );
}
sub huha {
my ( $self ) = @_;
print "Huha: @{ $self->{ valid } }\n";
}
1;
-------------------
(I hope you can figure out how to convert these examples to your separate-
files scheme).
> Another solution is to create a hierarchy of classes, one that is a
> 'composite' class, and one that is a 'leaf' class. Via inheritance,
> re-blessing is not needed to access methods.
Maybe I don't understand you correctly - is this a solution that you've
tried? It sounds to me like you're confusing classes and instances.
Inheritance won't bless anything for you.
> Which would be easier to maintain? Performance would be better for the
> first, right?
I think the in-place blessing scheme that I suggested would give optimum
performance. Since I don't quite understand your second idea I can't comment
on it.
BTW this looks like a situation in which my DWH_File module (CPAN has version
0.02 - I hope to upload a bugfix version 0.03 one of these days) could
be used to make a really smooth solution. Unfortunately I haven't yet had
the time to make a full test of DWH_File, so it's not suitable for use
in production code. There's bound to be some bugs. (Thanks for an excuse
for mentioning my baby :-).
--
Jakob Schmidt
http://aut.dk/orqwood
etc.
------------------------------
Date: Thu, 08 Feb 2001 23:55:18 GMT
From: garry@zvolve.com (Garry Williams)
Subject: Re: dbm hashes : Operation not permitted
Message-Id: <GlGg6.720$Ld2.4018@eagle.america.net>
On Thu, 08 Feb 2001 21:01:05 GMT, Mario <m_ario@my-deja.com> wrote:
>I get a 'Operation not permitted' error while trying to modify a key in
>a dbm hash.
>
>The script runs on a brand new NT server (possible config error?).
>All files are set with 777 permission (dbm too),I am wondering if this
>can be a problem.
>
>I also get an 'File not Found' while trying to create a dbm file.I
>tested it by uploading 2 pre-made .dir and .pag files.
Don't know what you mean by the above. You exhibit no code, so it's
hard to guess. But...
Many DBM files are *unmovable*. That's because of hardware
differences or disk information embedded in them, etc. In general,
DBM files should be unloaded into some serialized form (usually simple
ASCII) and then reloaded in their new "home" from the unloaded
version. Don't copy DBM files.
--
Garry Williams
------------------------------
Date: Thu, 08 Feb 2001 17:51:21 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Devel DProf and " dprofpp "
Message-Id: <3A834D19.C6231F01@stomp.stomp.tokyo>
"Godzilla!" wrote:
> I've figured out Devel DProf ok. It runs and
> produces a useless document, tmon.out .. whoopie.
> Documentation indicates to use dprofpp to
> attain useful information from tmon.out file.
> A search of perltoc yields:
> Utility Changes
> dprofpp
> A search of perlpod yields:
> A tool like dprofpp, also supplied with the standard
> Perl distribution, can be used to interpret the
> information in that profile.
(snipped)
I have found a reference for dprofpp. However, typical
of Perl documentation, it is gibberish. Additionally
I have discovered the syntax provided by documentation
for dprofpp, will not compile.
This is the only site I have found during the past week,
which directly addresses dprofpp:
http://www.engelschall.com/ar/perldoc/pages/util/dprofpp.html
Other worthwhile notes, links within Perl docs at all
major Perl sites I visited, these links for dprofpp
go nowhere; they are stereotypically circular. One
link leads to a worthless link, that link leads back
to the original link. Those hyper links for dprofpp
I found, go nowhere, there is no http address, just
a hot link which doesn't work.
Perl documentation indicates to read dprofpp man. There is
no such manual to be found, in my efforts.
My presumption is you boys don't know anything about
dprofpp or are so intimidated by me, you are fearful
to post useful information.
There are times I question why people bother to document
Perl. My experience is far too much of Perl documentation
is gibberish, runs around in pointless and endless circles
or simply doesn't exist when it is claimed to exist.
Come on boys, get your act together and write some decent
documentation for Perl.
Godzilla!
* thinks she will not share her discoveries about dprofpp *
------------------------------
Date: Thu, 08 Feb 2001 23:41:35 GMT
From: Darren Dunham <ddunham@redwood.taos.com>
Subject: Re: flock unavailable on many platforms
Message-Id: <P8Gg6.84855$Wq1.36424001@nnrp5-w.sbc.net>
John Lin <johnlin@chttl.com.tw> wrote:
> According to perlport, flock is available on those platforms.
> Is this a common problem that many people also encountered?
> Or should I ask our system administrator to do something?
> If this problem is caused by he mis-installation, could you
> help us what we should take care if we want to re-install perl?
> open F,'file.lock' or die "please create 'file.lock' first\n";
> flock F,LOCK_EX or die "can't lock\n";
You're asking for an exclusive lock on a file that you haven't opened
with write access. Whether that will work depends on which syscall
perl's flock() is calling (either flock() or fcntl()), and how that
system handles it.
Try to only ask for exclusive locks on files you have opened for
writing.
--
Darren Dunham ddunham@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< Please move on, ...nothing to see here, please disperse >
------------------------------
Date: Thu, 08 Feb 2001 23:16:39 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: help with multiple if statements ?
Message-Id: <t86a6ncm5ehh80@corp.supernews.com>
JMT <ccx138@coventry.ac.uk> wrote:
> Chris Stith wrote:
>>
>> This is the most efficient way to handle this ( O(1) with less
>> overhead than the hash), but it doesn't handle non-numeric values
>> of $name before the assignment, and it doesn't deal well with
>> large gaps between possible numbers (which would cause you to have
>> to build the array some other way anyway). It also doesn't give
>> you the key/value visual cues when maintaining the declaration
>> like a hash does. For some things a hash is worth the overhead
>> compared to and array.
[snipped my .sig]
> Good to see someone talking about big O notaion.
> Using a hash was my first answer but I left it up to the user to work out
> how to populate the hash, especially after the discusion about giving fish
> and teaching how to fish last week.
I consider giving one fish an acceptable way of leading someone into
fishing lessons. I didn't go into specifics of how to populate the
data structures dynamically, and using O notation to illustrate the
point may be another fishing lesson, too. One thing MJD mentioned that
we probably should have is that the OP wasn't making assignments in the
first place.
On a certain level, pointing towards an O(1) solution versus an
O(n) solution is instructive, isn't it?
Chris
--
Christopher E. Stith
It's not the U in UBE that pisses people off. It's the B.
-- Martien Verbruggen in clp.misc
------------------------------
Date: Thu, 08 Feb 2001 23:18:26 +0000
From: JMT <ccx138@coventry.ac.uk>
Subject: Re: help with multiple if statements ?
Message-Id: <3A832942.5CDAC261@coventry.ac.uk>
Chris Stith wrote:
[snip]
> > Good to see someone talking about big O notaion.
> > Using a hash was my first answer but I left it up to the user to work out
> > how to populate the hash, especially after the discusion about giving fish
> > and teaching how to fish last week.
>
> I consider giving one fish an acceptable way of leading someone into
> fishing lessons. I didn't go into specifics of how to populate the
> data structures dynamically, and using O notation to illustrate the
> point may be another fishing lesson, too. One thing MJD mentioned that
> we probably should have is that the OP wasn't making assignments in the
> first place.
>
> On a certain level, pointing towards an O(1) solution versus an
> O(n) solution is instructive, isn't it?
I agree and hopefully it becomes intuitive.
>
>
> Chris
>
> --
> Christopher E. Stith
>
> It's not the U in UBE that pisses people off. It's the B.
> -- Martien Verbruggen in clp.misc
John Tutchings.
------------------------------
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 V10 Issue 249
**************************************