[8827] in Perl-Users-Digest
Perl-Users Digest, Issue: 2444 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 28 16:17:24 1998
Date: Tue, 28 Apr 98 13:01:41 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 28 Apr 1998 Volume: 8 Number: 2444
Today's topics:
Need Help with hash of complex records that point to ea chuckk@monmouth.com
Re: New Index maker on your web site! <rootbeer@teleport.com>
Re: New Index maker on your web site! (brian d foy)
Not crying when dying? (Petr Prikryl)
Perl Editor?? <aqumsieh@matrox.com>
Re: Perl Editor?? <brianm@kodak.com>
Re: Perl experts!! help me!! jon@amxdigital.com
Re: Permutations in hashes make Perl hurt (Tom Rokicki)
Re: Print Currency <jkry3025@comenius.ms.mff.cuni.cz>
Problem(?) with sort operator in scalar context (Earl Hood)
Re: Problem(?) with sort operator in scalar context <rootbeer@teleport.com>
Re: rename funciton (was: Re: Dummie question) (Abigail)
Re: Signal Trapping .. (Charles DeRykus)
Suggestion for Module Please <chad@NOSPAMumr.edu>
Sys::syslog not working? (Marc Haber)
test post <james_leigh@vapower.com>
Re: Text file transfers between OS's (Jean Liddle)
Re: unrecognizable switch <rootbeer@teleport.com>
Re: unrecognizable switch <quentin@shaddam.amd.com>
Re: where are the examples in the newer (blue) camel bo (Stefaan A Eeckels)
Re: While Loop Gets Skipped <rootbeer@teleport.com>
Re: Win32 Perl - Drag and Drop? <brianm@kodak.com>
Re: Win32 Perl - Drag and Drop? <jkry3025@comenius.ms.mff.cuni.cz>
Re: writing a format to a scalar. <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 28 Apr 1998 14:19:58 -0600
From: chuckk@monmouth.com
Subject: Need Help with hash of complex records that point to each other!
Message-Id: <6i5a4u$515$1@nnrp1.dejanews.com>
All,I've written a perl program which takes as input a file containing
source code for which I want to generate reports on.
I create a hash which
contains complex data structures: I need to be able to recurse through the
array CALLED_ROUTINES to print a tree of SUBROUTINE CALLS and
generate a
call tree.
Key:
SubroutineA
NAME SubroutineA
LINENUM 100
CALLED_ROUTINES (Array) SubroutineB SubroutineC .... CALLED_ROUTINESLINENUM
(array) 101 102 ....
SubroutineB
NAME SubroutineB
LINENUM 200
CALLED_ROUTINES (Array) SubroutineD SubroutineE ... CALLED_ROUTINESLINENUM
(Array) 202 205
etc.....
foreach $loopvar
(@{myhash{SubroutineA}{CALLED_ROUTINES}})#gets the name of each subroutine
from the array.
Now for each $loopvar (which contains the name of
subroutine)I need to recurse through the arrays in the subroutine, and the
arrays in thesubroutine's subroutines etc.......
What would be the best
approach for this??????????
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Tue, 28 Apr 1998 19:01:48 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: igor <laberov@macs.biu.ac.il>
Subject: Re: New Index maker on your web site!
Message-Id: <Pine.GSO.3.96.980428113722.15049X-100000@user2.teleport.com>
On Tue, 28 Apr 1998, igor wrote:
> Do you have huge web site with lot of pages on different levels?
> Do you want make alphabetic index of pages on your Web server?
I've taken a quick look at your program, but I stopped when I had seen
just one subroutine.
> Please send any comments.
Okay. Here is that subroutine, with my comments.
> #****** This function replace . with \. and * with .* *********/
Hmmm... It seems that you've been to the K&R school of comments. :-)
> sub ReplDot
> {
> $#tlist = 0;
> $#result = 0;
To empty out an array, you should set it to the empty list or undef it.
This code does not empty those arrays. Also, it's generally better for
subroutines to avoid using global variables. (If you must use some, you
should document which ones.)
> @tlist = split(//,$_[0]);
>
> for($i = 0; $i<=$#tlist;$i++)
Another benefit of the K&R school. :-) This kind of for loop is generally
written in Perl as a for(each) loop, when you know that the upper bound is
not unreasonably large.
foreach $i (0..$#tlist) { ... }
> {
> if($tlist[$i] eq ".")
> {
> push(@result,"\\.");
> }
> elsif($tlist[$i] eq "/")
> {
> push(@result,"\/");
> }
Hmmm... Did you know that that backslash isn't doing anything? (In fact,
looking ahead at the else clause, this entire clause isn't doing
anything.)
> elsif($tlist[$i] eq "*")
> {
> push(@result,".*");
> }
> else
> {
> push(@result,$tlist[$i]);
> }
> }
> $res = join("",@result);
>
> }
Wouldn't all that have been easier to do with a couple of substitutions?
Maybe this is all you need.
sub ReplDot {
# changes . to \. and * to .* , returning the modified string.
local($_) = @_; # Can't use my() on $_
s/\./\\./g;
s/\*/.*/g;
$_;
}
Of course, this doesn't have the side effects (or bugs :-) that your
code did.
It may be that what you wrote could be simplified (and, perhaps, made
more portable?) if you use the File::Find module. Also, if you're reading
the actual HTML, there are modules to help with that and make it more
reliable. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 28 Apr 1998 15:53:19 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: New Index maker on your web site!
Message-Id: <comdog-ya02408000R2804981553190001@news.panix.com>
Keywords: from just another new york perl hacker
In article <Pine.GSO.3.96.980428113722.15049X-100000@user2.teleport.com>, Tom Phoenix <rootbeer@teleport.com> posted:
>On Tue, 28 Apr 1998, igor wrote:
>> for($i = 0; $i<=$#tlist;$i++)
>
>Another benefit of the K&R school. :-) This kind of for loop is generally
>written in Perl as a for(each) loop, when you know that the upper bound is
>not unreasonably large.
>
> foreach $i (0..$#tlist) { ... }
>
>> {
i think i would opt for a while() there to avoid the creation of a
possibly large array:
my $index = 0;
while( $index++ <= $#tlist ) { ... }
maybe it's just me, but it makes a lot more sense than making up
something over which to iterate. but then, that seems to be what
for() does :)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>
------------------------------
Date: 28 Apr 1998 19:25:45 GMT
From: prikryl@dcse.fee.vutbr.cz (Petr Prikryl)
Subject: Not crying when dying?
Message-Id: <6i5afp$h4a$1@boco.fee.vutbr.cz>
(Was: How to load the module with calculated name?)
When trying to use the module which name and path were calculated
during run-time, I have observed strange behaviour -- "die" command
did not write anything -- died silently. Why?
The module which name and path were calculated was stored in
'p:/tmp/modules/task2.pm'. Its content was:
task2.pm
-------------------------------------------------------
package task2;
require 5.004;
use strict;
sub analyze {
print "This is task2::analyze function just before going to die...\n";
die "I am also crying when dying! (or not?)";
print "...and this should not be displayed.\n";
return 0;
}
1;
-------------------------------------------------------
The above function analyze() was invoked from another
module's function:
MyModule.pm
-------------------------------------------------------
package MyModule;
require 5.004;
use strict;
sub start1 {
print "This is MyModule::start1 function\n";
my $dir = "p:/tmp/modules";
my $task = 'task2';
eval "require '$dir/$task.pm'" or
die "Unsuccessful require '$dir/$task.pm: $@";
eval "${task}::analyze();";
return 0;
}
sub start2 {
print "This is MyModule::start2 function\n";
die "I am crying when dying!";
return 0;
}
1;
-------------------------------------------------------
The start1() function requires the earlier task2 module
and calls the function task2::analyze(). The start2()
function is called from test.pl
-------------------------------------------------------
require 5.004;
use strict;
use MyModule;
{
MyModule::start1();
MyModule::start2();
}
-------------------------------------------------------
The script displays when executed (perl -w test.pl):
-------------------------------------------------------
This is MyModule::start1 function
This is task2::analyze function just before going to die...
This is MyModule::start2 function
I am crying when dying! at MyModule.pm line 19.
-------------------------------------------------------
I expected that the process will die before MyModule::start2,
but it did not. Why?
I also tried to call task2::analyze() directly -- not through
another module: test2.pl
-------------------------------------------------------
require 5.004;
use strict;
use lib 'p:/tmp/modules';
use task2;
{
task2::analyze();
}
-------------------------------------------------------
The result was expected:
-------------------------------------------------------
This is task2::analyze function just before going to die...
I am also crying when dying! (or not?) at p:/tmp/modules/task2.pm line 8.
-------------------------------------------------------
I use Ilya Zakharevich port of Perl 5.004_01 in Windows 95.
Thank for the explanation.
Petr
--
Petr Prikryl (prikryl@dcse.fee.vutbr.cz) http://www.fee.vutbr.cz/~prikryl/
TU of Brno, Dept. of Computer Sci. & Engineering; tel. +420-(0)5-7275 218
------------------------------
Date: Tue, 28 Apr 1998 13:42:48 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Perl Editor??
Message-Id: <35461518.75043C21@matrox.com>
Does anybody know of any good Perl editors on unix platform? Or perhaps
a "perl-mode" emacs script? I am sure such a thing exists .. but I need
directions :-)
ThanX,
--
Ala Qumsieh
ASIC Design and Validation Engineer
Physical Design Group
Matrox Graphics Inc.
1055 Saint-Regis
Dorval, Quebec
H9P 2T4
Tel : (514) 685-7230 ext. 7581
------------------------------
Date: Tue, 28 Apr 1998 15:24:15 -0400
From: Brian Mathis <brianm@kodak.com>
To: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Perl Editor??
Message-Id: <35462CDF.345C0FB3@kodak.com>
Ala Qumsieh wrote:
>
> Does anybody know of any good Perl editors on unix platform? Or perhaps
> a "perl-mode" emacs script? I am sure such a thing exists .. but I need
> directions :-)
>
> ThanX,
> --
> Ala Qumsieh
If you go to www.perl.com and scroll down a little, search for 'emacs'.
There's a few things in there..
Brian Mathis
------------------------------
Date: Tue, 28 Apr 1998 12:57:48 -0600
From: jon@amxdigital.com
To: thee@usa.net
Subject: Re: Perl experts!! help me!!
Message-Id: <6i55ar$u2v$1@nnrp1.dejanews.com>
In article <35435742.8608410@usenet.kornet.nm.kr>,
thee@pcrc.hongik.ac.kr (Tau Kim) wrote:
>
> Hi, I'm a student studying computer science. And I've got in trouble
> with this!
>
> I'm writing a program which mesures the performance of the compiler.
> Underlying source is C source. I'm trying covert this source to java,
> perl, cobol & etc
> But in other languages except C, I don't know how to mesure the time
> during the loop is performed.
Find a machine with Perl 5.004 installed and try 'perldoc Benchmark'. There is
a benchmarking module (called Benchmark.pm!!) that will do this for you very
nicely.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 28 Apr 1998 12:44:30 -0700
From: rokicki@cello.hpl.hp.com (Tom Rokicki)
Subject: Re: Permutations in hashes make Perl hurt
Message-Id: <6i5biu$l9q@cello.hpl.hp.com>
Keywords: algae ducat moribund replete
> I <rokicki@cello.hpl.hp.com> wrote:
> > Actually, it's something like
> > hash = strlen(s) ;
> > while (*s) hash = hash * 33 + *s ;
> I believe you are mistaken. Here's the #define:
Yep, I'm wrong, you're right. It's as you described. And I forgot to advance
the pointer.
> > hash = strlen(s) ;
> > while (*s) hash = *s - hash * 33 ;
> >might also work much better.
> But that is the same as before! (And you forgot the pointer again.)
Is it? To me it looks like the coefficients applied to the characters,
of the string, from the end back, for the original are:
1, 33, 1089, 35937, 1185921, ...
which mod 32 are
1, 1, 1, 1, 1 ...
whereas for the new function it is
1, -33, 1089, -35937, 1185921, ...
which mod 32 are
1, -1, 1, -1, 1, ...
which still isn't great, but is probably better; certainly it helps
the permutation issue.
In any case, remember that the truncation to the vector range is done
with `and', so the ability to say
set_hash_modulo %a 33
would require that `and' to be transformed to a full modulo function.
Anyway, I'm still working on this.
-tom
------------------------------
Date: Tue, 28 Apr 1998 20:59:53 -0700
From: Jan Krynicky <jkry3025@comenius.ms.mff.cuni.cz>
Subject: Re: Print Currency
Message-Id: <3546A5B9.551@comenius.ms.mff.cuni.cz>
John Porter wrote:
>
> M-J, I had an idea (in my sleep, I think), that you ought to
> include predefineds for many of the perl intrinsic functions,
> like length() and ref(). I find myself trying to print those
> all the time.
>
> John Porter
What's wrong with
use Interpolation 'eval' => 'eval';
print "The lenght of '$string' is $eval{length $string}";
?
Or if you realy want to have $length{...}
use Interpolation 'length' => sub {length $_[0]};
I don't think such easily definable functions should be
predefined. IMHO, M-J should predefine only
tricky and more elaborate functions.
Jenda
BTW: Does any of the "Real Gurus"(tm) know why
$fun = \&length doesn't work? Or even better how to make it work?
( apart from $fun = sub {length $_[0]}; )
------------------------------
Date: 28 Apr 1998 18:44:45 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Problem(?) with sort operator in scalar context
Message-Id: <6i582t$4gr@news.service.uci.edu>
I would not be surprised if I am completely overlooking something, but
take the following example program:
$a = sort ("a", "b", "c", "d");
($a2) = sort ("a", "b", "c", "d");
print "sort(): a=$a, a2=$a2\n";
When executed, outputs:
sort(): a=, a2=a
What has me stumped is why $a does not get set (-w states it is
uninitialized). Since the sort operator always returns a list
(according to the docs) I'd expect $a to get set to 4 (the size of the
returned list).
The following works as expected:
sub array (@) {
@_;
}
$a = array ("a", "b", "c", "d");
($a2) = array ("a", "b", "c", "d");
print "array(): a=$a, a2=$a2\n";
Output:
array(): a=4, a2=a
Perl v5.004_04 built for sun4-solaris.
--ewh
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
Date: Tue, 28 Apr 1998 19:24:23 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Earl Hood <ehood@medusa.acs.uci.edu>
Subject: Re: Problem(?) with sort operator in scalar context
Message-Id: <Pine.GSO.3.96.980428121709.15049d-100000@user2.teleport.com>
On 28 Apr 1998, Earl Hood wrote:
> Subject: Problem(?) with sort operator in scalar context
sort in a scalar context isn't listed in the Perl docs. That's a sign that
there's no promise that it does anything in particular. Perhaps it dumps
core, perhaps it's a nop. Perhaps it searches your system to unlink any
files with names matching /java/. Without looking at the perl source, you
simply can't tell, and guessing is pointless.
> Since the sort operator always returns a list (according to the docs)
> I'd expect $a to get set to 4 (the size of the returned list).
It is rare for a perl list operation to return the length of the list when
called in a scalar context. Only a few operations do that; they're the
exceptions, not the rule. (And why would you sort a list only to find out
its length? Do permutations have random lengths in your universe? :-)
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 28 Apr 1998 19:30:27 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: rename funciton (was: Re: Dummie question)
Message-Id: <6i5aoj$d5c$2@client2.news.psi.net>
Tom Phoenix (rootbeer@teleport.com) wrote on MDCCI September MCMXCIII in
<URL: news:Pine.GSO.3.96.980428101400.15049J-100000@user2.teleport.com>:
++ On Mon, 27 Apr 1998, yary h. wrote:
++
++ > It always bothered me that Perl comes with "rename", but not "copy".
++
++ Give us a system call which does "copy", and we'll make a Perl built-in
++ which does so. :-)
Could you point out the "grep" system call from me?
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Tue, 28 Apr 1998 18:53:16 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Signal Trapping ..
Message-Id: <Es50Gs.Hov@news.boeing.com>
In article <3545FCC9.B3D01964@matrox.com>,
Anonymous <anonymous@matrox.com> wrote:
> Hi .. I started learning Perl less than 3 weeks ago .. and I need some
> help.
>
> I am trying to trap a signale (SIGINT to be specific) and cause that to
> exist the current subroutine I am in (call it ¤t_subroutine). I
> use something like
>
> $SIG{INT} = \&another_subroutine;
>
> This conveniently traps the Ctrl-C signal and invokes
> another_subroutine(). But once that is over, current_subroutine()
> continues executing. How can I cause the Ctrl-C signal to exit the
> current_subroutine()?
>
> NB. The current_subroutine is called from the main body of the program
> .. that is where I want the execution to continue.
>
If your subroutine doesn't do anything bizarre with inner
block evals or redefine $SIG{INT}, you could do something
like this.
# main body
...
...
eval {
local $SIG{INT} = sub { die "interrupted" };
local $SIG{__DIE__} = 'DEFAULT';
¤t_subroutine;
};
if ($@ =~ /^interrupted/) {
....
} elsif ($@) {
die $@;
}
...
perldoc -f eval or man perlipc (or look at Chapter 6 in the
blue Camel) for complete explantions.
HTH,
--
Charles DeRykus
------------------------------
Date: Tue, 28 Apr 1998 18:48:11 GMT
From: "Chad Peterson" <chad@NOSPAMumr.edu>
Subject: Suggestion for Module Please
Message-Id: <01bd72d6$2dd5dc40$86a72682@P1207393.MDC.COM>
I'm wondering, what is the recommended module for developing sysadmin
applications under linux? For example, if i want to write my own user
managment program, which is best?
Thanks in advance, and I'm sure you guys (and gals) will point me in the
right direction!
Chad Peterson
------------------------------
Date: Tue, 28 Apr 1998 17:57:14 GMT
From: Marc.Haber-usenet@gmx.de (Marc Haber)
Subject: Sys::syslog not working?
Message-Id: <6i55bi$cgh$3@nz12.rz.uni-karlsruhe.de>
Hi!
I am trying to have a perl script log something on the syslog on a
Linux box. I am using the example from the Camel book. That program
does: nothing. There is nothing being logged to syslog. syslog.ph is
present on the system.
perl -v output and the test script follows.
mh@palandt:/home/mh > /usr/bin/perl -v
This is perl, version 5.004_04 built for i686-linux
Copyright 1987-1997, Larry Wall
Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5.0 source
kit.
mh@palandt:/home/mh > cat syslogtest
#!/usr/bin/perl
use Sys::Syslog;
openlog('syslogtest','cons, pid', 'user' );
syslog('info', 'this is a test' );
closelog();
mh@palandt:/home/mh >
What am I doing wrong?
Any hints will be appreciated.
Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29
------------------------------
Date: Tue, 28 Apr 1998 15:00:57 -0400
From: Leigh <james_leigh@vapower.com>
Subject: test post
Message-Id: <35462769.29EF@vapower.com>
just a test of posting
------------------------------
Date: 28 Apr 1998 19:08:49 GMT
From: jean@kcco.com (Jean Liddle)
Subject: Re: Text file transfers between OS's
Message-Id: <6i59g1$l15$2@hirame.wwa.com>
This is the classic ^M (hidden) issue -- DOS and Windoze like to throw
in a ^M at the end of each line. The way to add them back in is to
either (a) ftp the files from the Linux box to MS DOG or Windoze using
the "ascii" (not binary!) mode, or run unix2dos on the linux box
against each script/file before transfering it.
Good luck, and my condolences on your employer's lack of vision.
jean.
====== Copyright (c) 1998 by Jean Liddle; All rights reserved. ======
Jean Liddle | DISCLAIMER: "It is unlikely that
email: jean kcco dot com | anyone shares the opinions expressed
http://jean.nu/ | here, much less my employer."
------------------------------+---------------------------------------
Dual: 26.7 hours
PIC: 1.5 hours
------------------------------
Date: Tue, 28 Apr 1998 18:01:28 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Jeff <jeffmcc@mindspring.com>
Subject: Re: unrecognizable switch
Message-Id: <Pine.GSO.3.96.980428105802.15049R-100000@user2.teleport.com>
On Tue, 28 Apr 1998, Jeff wrote:
> The script was written on NT and it runs fine there, but when I
> try to run it on UNIX, my system admin says that it's returning
> "unrecognizable switch".
Ask the sysadmin to give you the actual error text. All Perl diagnostic
messages are listed in the perldiag manpage, along with some helpful
information about what that error might happen. You should also be aware
that the two machines may have different versions of Perl. Hope this
helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 28 Apr 1998 13:54:55 -0500
From: Quentin Fennessy <quentin@shaddam.amd.com>
Subject: Re: unrecognizable switch
Message-Id: <xim7m49vksg.fsf@shaddam.amd.com>
>>>>> "Jeff" == Jeff <jeffmcc@mindspring.com> writes:
[...]
Jeff> and it runs fine there, but when I try to run it on UNIX, my
Jeff> system admin says that it's returning "unrecognizable
Jeff> switch". I've compiled it on the UNIX box and it returns
[...]
Jeff, I've seen this under SunOS 4 if you invoke perl with an initial
line like this:
#!/usr/bin/perl -w<SPACE>
Note the trailing <SPACE> after -w? It is hard to see! On SunOS4 I
get:
Unrecognized switch: - (-h will show valid options).
I do not get this error message under SunOS5 or HP-UX 10.20.
Running that error message through splain(1) helps a little too:
(F) You specified an illegal option to Perl. Don't do that.
(If you think you didn't do that, check the #! line to see if it's
supplying the bad switch on your behalf.)
--
Quentin Fennessy AMD, Austin Texas
Secret hacker rule #11 - hackers read manuals
------------------------------
Date: 28 Apr 1998 16:17:49 GMT
From: Stefaan.Eeckels@ecc.lu (Stefaan A Eeckels)
Subject: Re: where are the examples in the newer (blue) camel book?
Message-Id: <6i4vfd$kfh$1@justus.ecc.lu>
In article <6i4onq$l8f$2@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> writes:
> Randal expounds:
>
>:I was *lead* writer on the project. I did very little writing,
>:focussing my attention on project administration and herding the rest
>:of you.
>
> BWAHAHAHAHA!
>
> [Original set to Scott Adams for its obviously future inclusion
> in a Dilbert strip.]
Meseems Perl leads to rancour, backstabbing and bad manners ;-)
Luckily most of this will go with c.l.p.moderated - or will it?
--
Stefaan
--
PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)
___________________________________________________________________
"Don't worry about people stealing your ideas. If your ideas
are any good, you'll have to ram them down people's throats."
-- Howard Aiken
------------------------------
Date: Tue, 28 Apr 1998 19:07:21 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Ryan Rucker <rxruck2@uswest.com>
Subject: Re: While Loop Gets Skipped
Message-Id: <Pine.GSO.3.96.980428120338.15049Z-100000@user2.teleport.com>
On Tue, 28 Apr 1998, Ryan Rucker wrote:
> Attached is a (large) snippet of code that I have a question about.
> This snippet is part of a much larger script.
Thanks for cutting it down before posting. Could you cut it down any
further? The chance that someone will look through your code for you is
roughly inversely proportional to the length of the posted code.
> When I follow this with the debugger, the first
> while loop gets skipped, even though all the conditions are true.
Are you sure? You could evaluate that expression "by hand" in the debugger
to see whether it is actually true. Or you could put a test into your
code, storing the result that expression into a variable, then printing
it, for example. It may be that your expression isn't returning what you
think it is, perhaps due to a mistake involving precedence.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 28 Apr 1998 15:16:42 -0400
From: Brian Mathis <brianm@kodak.com>
To: Pamela Culpepper <culpep@bcm.tmc.edu>
Subject: Re: Win32 Perl - Drag and Drop?
Message-Id: <35462B1A.A511A9B0@kodak.com>
Pamela Culpepper wrote:
>
> Using MacPerl, I can drag whatever file I want to
> process over the MacPerl camel icon and start Perl
> using that file.
>
> Can I do the same thing using Perl on Win32?
>
> Thanks,
> Pam
> --
I dunno about drag and drop (I don't have perl installed on windows),
but you can associate an extension (.pl for example) with the perl
executable, then you can just double click on that file, no need to
drag.
Brian Mathis
------------------------------
Date: Tue, 28 Apr 1998 21:43:50 -0700
From: Jan Krynicky <jkry3025@comenius.ms.mff.cuni.cz>
To: Pamela Culpepper <culpep@bcm.tmc.edu>
Subject: Re: Win32 Perl - Drag and Drop?
Message-Id: <3546B006.2112@comenius.ms.mff.cuni.cz>
Pamela Culpepper wrote:
>
> Using MacPerl, I can drag whatever file I want to
> process over the MacPerl camel icon and start Perl
> using that file.
>
> Can I do the same thing using Perl on Win32?
>
> Thanks,
> Pam
Yes.
1. Using shortcuts
. Create a shortcut to the script in question.
. Right click it and open the Properties.
. On the Shortcut tab, prepend the name of the script by
full path to perl.exe and click [OK]
. You are now able to drop files onto this shortcut.
You may want to open the Properties againg to set some
more options.
2. Write or find + install a generic DropHandler
(ingore unless you know what do I speak about)
and then update the registry information for Perl.
This way all scripts would be able to accept droped
files.
That DropHandler would see the extension of the
droped onto file and run the associated application
with both droped onto and droped files. (I hope )
That is if you associate .pl with this DropHandler
[HKEY_CLASSES_ROOT\Perl\shlexe\DropHandler]
@="{the-horrible-code-specifying-the-handler}"
and then droped c:\test.txt onto c:\scripts\process.pl,
the handler runs :
"c:\perl\bin\perl.exe c:\scripts\process.pl c:\test.txt".
Does anybody know/heard about such a beast?
Jenda
------------------------------
Date: Tue, 28 Apr 1998 18:03:52 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Joe Foose <foosejm@bp.com>
Subject: Re: writing a format to a scalar.
Message-Id: <Pine.GSO.3.96.980428110325.15049S-100000@user2.teleport.com>
On 28 Apr 1998, Joe Foose wrote:
> How does one go about writing a format to a scalar variable rather than
> to a filehandle without having to use an intermediate file? Is there a
> way to associate a filehandle with a scalar variable?
I think the FAQ has something to say about these questions. Hope this
helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 2444
**************************************