[11232] in Perl-Users-Digest
Perl-Users Digest, Issue: 4832 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 5 10:11:59 1999
Date: Fri, 5 Feb 99 07:00:29 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 5 Feb 1999 Volume: 8 Number: 4832
Today's topics:
Re: any comments on the Ultimate Bulleting Board? droby@copyright.com
Re: Caputuring output and return code (M.J.T. Guy)
Re: Changing Form Input via Perl Script/Mail Script <ebohlman@netcom.com>
Re: checking existance of subroutine (Tad McClellan)
Re: Checking for reachable URL <ebohlman@netcom.com>
Dynamically Naming Array Variables <george@tapestry.net>
Re: Dynamically Naming Array Variables <bjorn@daimi.au.dk>
Re: Dynamically Naming Array Variables <ebohlman@netcom.com>
Re: Dynamically Naming Array Variables <jdf@pobox.com>
Re: How do I get local IP Address ? droby@copyright.com
Re: Is matching a range of ASCII characters possible? (Mike Stok)
Re: Is perl a freeware? finleyd@vrinet.com
Re: Is perl a freeware? droby@copyright.com
Re: join func. appending delimiiter before 1st field.. (Randal L. Schwartz)
Perlscript / ASP: Packages ? (Markus Geish|ttner)
Re: problem with PerlTk <jdf@pobox.com>
Problems with shell parsing of exec. <mkbowler@nortelnetworks.com>
Re: Programming with Style chad@vcn.net
Re: Python vs. Perl vs. tcl ? lvirden@cas.org
Q:PERL & Tk: file_select for directory anface@geocities.com
Re: Q:PERL & Tk: file_select for directory <jdf@pobox.com>
Re: Question: Arrays of associative arrays (Steve Linberg)
Re: Reference Question.... droby@copyright.com
Re: replacing non-printable characters (Mike Stok)
Re: Sending Perl output to 2 diffent html frames dturley@pobox.com
Re: Sending Perl output to 2 diffent html frames <safrit@mindspring.com>
Re: testing for scalar/list/array <jdf@pobox.com>
Re: The best way to learn C? <aidan@salvador.blackstar.co.uk>
Re: UNIX 'tail' command in Perl?? (M.J.T. Guy)
Re: UNIX 'tail' command in Perl?? (Randal L. Schwartz)
XML & Perl <frage@post1.tele.dk>
Re: XML & Perl <christoph.wernli@ubs.com>
Re: XML & Perl <garethr@cre.canon.co.uk>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 05 Feb 1999 13:46:55 GMT
From: droby@copyright.com
Subject: Re: any comments on the Ultimate Bulleting Board?
Message-Id: <79esod$o9m$1@nnrp1.dejanews.com>
In article <36B9E590.7E89@geocities.com>,
23_skidoo@geocities.com wrote:
> Jonathan Feinberg wrote:
> >
> > 23_skidoo <23_skidoo@geocities.com> writes:
> >
> > > i'm looking into using the ultimate bulletin board instead as it
> > > looks a tad more professionally done, has anyone else used this
> > > script?
> >
> > This newsgroup is not really *for* the discussion of WWW middleware.
> > It's for the discussion of the Perl language. Therefore, you're
> > unlikely to get knowledgable responses about WWW middleware here!
> >
> > You might go to DejaNews and search for groups that deal with the web,
> > CGI scripting, things like that. HTH.
>
> well, i thought it was relevant since i was asking about any inherent
> difficulties in modifying a perl script, i'm asking if it's well written
> Perl or not *shrugs* everytime someone comes on this NG and says "i'm
> having trouble with wwwboard" everyone says "uuurrgh, don't use it, it
> sucks". this kind of information would have saved me a lot of time and
> trouble about 6 months ago, just wondering if there are any opinions
> about UBB in here.
>
But as Jonathan noted, that's not what we discuss here. Except we groan every
time Matt is mentioned.
We're into programming here. Learn how to do that well, and you'll also be
able to judge whether other people have done it well. And we'll be delighted
to help you get there.
To judge whether a WWW middleware product is worth your time, check out the
CGI FAQs and security FAQs and decide whether it looks like the middleware
author did the same.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 5 Feb 1999 13:50:15 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Caputuring output and return code
Message-Id: <79esun$d6n$1@pegasus.csx.cam.ac.uk>
Dan Sugalski <sugalskd@netserve.ous.edu> wrote:
>
>Well, $? holds the exit status of the most recently executed child
>process. You could try that.
To be pedantic, not "the most recently executed" but "the most recently
waited for".
So after `command` or system 'command', it contains the exit status of
the command. After close(PIPE), it contains the exit status of the
child connected to the pipe. And after wait() or waitpid() it contains
the status of whatever you waited for.
Mike Guy
------------------------------
Date: Fri, 5 Feb 1999 14:24:38 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Changing Form Input via Perl Script/Mail Script
Message-Id: <ebohlmanF6oqp3.z9@netcom.com>
tnova@riconnect.com wrote:
: Hello, I've got a form where one would enter their username, say 'USERNAME'
: with a password also. This feeds into a very complex pop3 webmail viewer. I
: would like to find a way, any means, by which the entered 'USERNAME' would be
: lookd up in a seperate file or in the script itself to equal another
: username... i.e. username entered into the form: webmaster - would translate
: to anyname1 which my script would then use.
That's what hashes are for. In your case, you probably want a hash tied
to a db file.
: Also, is there a way I can have a perl script post to another cgi script, or
: is that just for forms on browsers? If so I could create two scripts working
: independently.
That's what LWP is for.
------------------------------
Date: Fri, 5 Feb 1999 07:20:17 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: checking existance of subroutine
Message-Id: <h6re97.um9.ln@magna.metronet.com>
Arran Price (arranp@datamail.co.nz) wrote:
: Subject: Re: checking existance of subroutine
^^^^^ ^^^^^^^^^^
: Im using an eval statement such as
: while ($CS<=$LS)
: {
: print"trying to run $STEP_SUB[$CS]\n";
: eval ("$STEP_SUB[$CS]");
: ++$CS;
: }
: so basically it loops through a whole lot of subroutines whose names are
: defined in @STEP_SUB. This works fine apart from when an entry in
: @STEP_SUB is not a valid subroutine. It dosent fail, just continues onto
: the next one.
It prints warning messages though.
You _do_ have warnings enabled, right?
: How do I check to make sure the subroutine is valid?
step 1)
grep -i exist *.pod | grep -i subroutine
that returns 7 hits on my system.
step 2)
note that one of them sounds like it will help with this problem
go read it
step 3)
# untested!
if ( defined &$STEP_SUB[$CS] )
{ eval $STEP_SUB[$CS] }
else
{ print "'$STEP_SUB[$CS]' is not a valid subroutine\n" }
: Any help or pointers to help appreciated.
Use the docs Luke.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 5 Feb 1999 13:58:04 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Checking for reachable URL
Message-Id: <ebohlmanF6opGt.Mn4@netcom.com>
Marc-A. Woog <mwoog@pobox.ch> wrote:
: > if ($remote) {
: > $remote->autoflush(1);
: > print $remote "GET $document HTTP/1.0\n\n";
: Change To:
: print $remote "HEAD $document HTTP/1.0\n\n";
Some servers will not honor HEAD requests, so if the HEAD request fails,
you should try a GET before giving up.
------------------------------
Date: Wed, 03 Feb 1999 13:06:21 -0600
From: "George H" <george@tapestry.net>
Subject: Dynamically Naming Array Variables
Message-Id: <01be4fa7$fa1d27a0$152a5d18@george.austin.rr.com>
I am trying to dynamically give names to array variables but
I have been stumped for a couple hours now. The code is below.
for $affiliate(@affiliates)
{
open(LOG, "$basedir/$affiliate/searchlog") or die "Could not open log.";
while (<LOG>)
{
chomp;
push(@log,$_);
push(@$affiliate,$_); ###THIS IS MY PROBLEM
}
close(LOG);
}
Early in the program I grab the names of all the 'affiliates' and put them into an array called @affiliates (names like larry,
bill, megan). Each affiliate directory has a file called searchlog. I open all those files one at a time and put it into @log ...
but I also want to put larry stuff into @larry and the megan stuff into @megan ... you can see some code above that doesn't work.
I tried some referencing and dereferencing stuff but that isn't working either. I read the FAQ pages and my manuals ... no real
example how to do this. I am starting to think that this may be a problem with my approach or
methodology. Any ideas or guidance would be welcome.
------------------------------
Date: 05 Feb 1999 15:10:56 +0100
From: Thomas Bjorn Andersen <bjorn@daimi.au.dk>
Subject: Re: Dynamically Naming Array Variables
Message-Id: <yeh7ltxvt3j.fsf@vertigo.daimi.au.dk>
"George H" <george@tapestry.net> writes:
>
> I am trying to dynamically give names to array variables but
> I have been stumped for a couple hours now. The code is below.
>
> for $affiliate(@affiliates)
> {
> open(LOG, "$basedir/$affiliate/searchlog") or die "Could not open log.";
> while (<LOG>)
> {
> chomp;
> push(@log,$_);
> push(@$affiliate,$_); ###THIS IS MY PROBLEM
> }
> close(LOG);
> }
push @{$affiliate},$_; should do the trick :-)
Thomas
--
| Thomas Bjorn Andersen, bjorn@daimi.au.dk |
+----------------------------------------------------------+
------------------------------
Date: Fri, 5 Feb 1999 14:37:00 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Dynamically Naming Array Variables
Message-Id: <ebohlmanF6or9o.1Lx@netcom.com>
George H <george@tapestry.net> wrote:
: I am trying to dynamically give names to array variables but
: I have been stumped for a couple hours now. The code is below.
: for $affiliate(@affiliates)
: {
: open(LOG, "$basedir/$affiliate/searchlog") or die "Could not open log.";
: while (<LOG>)
: {
: chomp;
: push(@log,$_);
: push(@$affiliate,$_); ###THIS IS MY PROBLEM
: }
: close(LOG);
: }
: Early in the program I grab the names of all the 'affiliates' and put them into an array called @affiliates (names like larry,
: bill, megan). Each affiliate directory has a file called searchlog. I open all those files one at a time and put it into @log ...
: but I also want to put larry stuff into @larry and the megan stuff into @megan ... you can see some code above that doesn't work.
You haven't told *how* it doesn't work. What are you getting that you
don't want to get or not getting that you do want to get?
: I tried some referencing and dereferencing stuff but that isn't working either. I read the FAQ pages and my manuals ... no real
: example how to do this. I am starting to think that this may be a problem with my approach or
: methodology. Any ideas or guidance would be welcome.
I'd say you do have a problem with approach and methodology. Rather than
using a bunch of arrays whose names are computed at runtime, why not use
a hash of arrays (ok, ok, it's really a hash of array references) as
described in perllol and perldsc?
------------------------------
Date: 05 Feb 1999 15:53:22 +0100
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Dynamically Naming Array Variables
Message-Id: <m3679ggavx.fsf@joshua.panix.com>
"George H" <george@tapestry.net> writes:
> I am trying to dynamically give names to array variables but
> I have been stumped for a couple hours now.
Good! You're now sufficiently motivated to use array references.
> open(LOG, "$basedir/$affiliate/searchlog") or die "Could not
> open log.";
You might as well say why the open failed by including $! in your
error message.
> Early in the program I grab the names of all the 'affiliates' and
> put them into an array called @affiliates (names like larry, bill,
> megan). Each affiliate directory has a file called searchlog. I
> open all those files one at a time and put it into @log ... but I
> also want to put larry stuff into @larry and the megan stuff into
> @megan ... you can see some code above that doesn't work.
Instead of @affiliates, you might want %affiliates, where the keys are
affiliate names (larry, moe, shemp) and the values are array refs.
Also, there's no good reason to store the logs redundantly. You can
always retrieve the logs from their individual affiliate arrays.
my @affiliate_names = qw/moe larry curly curly_joe shemp/;
my %affiliates;
foreach my $affil (@affiliate_names) {
# open log file
chomp (@{$affiliates{$affil}} = <LOG>);
# close log file
}
And now to read moe's log:
foreach my $line (@{$affiliates{moe}}) {
Or to see line 3 of shemp's log:
my $third = $affiliates{shemp}->[2];
> I tried some referencing and dereferencing stuff but that isn't
> working either. I read the FAQ pages and my manuals ... no real
> example how to do this.
Umm, you somehow missed the following documents: perllol, perlref,
perldsc. They are positively rife with example code.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Fri, 05 Feb 1999 14:29:31 GMT
From: droby@copyright.com
Subject: Re: How do I get local IP Address ?
Message-Id: <79ev7v$qbr$1@nnrp1.dejanews.com>
In article <x73e4lnzpr.fsf@home.sysarch.com>,
Uri Guttman <uri@home.sysarch.com> wrote:
> >>>>> "MC" == Michael Ching <m_ching@hotmail.com> writes:
>
> MC> if under winnt, ipconfig
>
> not that i really give a damn, but can that be called from perl or is it
> another winblows only useless program? you can't parse a window.
>
winblows, but DOS shell based, so you can do `ipconfig` and parse the result.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 03 Feb 1999 16:38:55 -0600
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Is matching a range of ASCII characters possible?
Message-Id: <uWKd8X8T#GA.143@news2.texas.rr.com>
In article <918072675.866485@neptune.uniserve.ca>,
Mike Skovgaard <mikesk@vipcourier.com> wrote:
>I am trying to match a set of ASCII characters from 128 -> 255.
>The following match operator does not seem to work:
You need to study the perlre manual page a little harder,
Because patterns are processed as double quoted strings,
the following also work:
[...]
\033 octal char (think of a PDP-11)
\x1B hex char
\c[ control char
[...]
so you might try using \200 and \377 as ways to represent the charcacters
e.g. [\200-\377]
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
| 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Fri, 05 Feb 1999 13:24:20 GMT
From: finleyd@vrinet.com
Subject: Re: Is perl a freeware?
Message-Id: <79erdt$muj$1@nnrp1.dejanews.com>
In article <2o5u2.60$_E3.4792@nsw.nnrp.telstra.net>,
> ...
> PS. You'll find out that perl is free. Any advice to silly questions
> on this newsgroup however is charged at a going rate of about $1 - $5 ...
Martien and all,
Perl itself is free. But a number of key add-ons, such as the recent IDE from
activestate are NOT! As Perl gets more "mainstream", you are likely to see
more of this.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 05 Feb 1999 14:20:18 GMT
From: droby@copyright.com
Subject: Re: Is perl a freeware?
Message-Id: <79eumn$pu1$1@nnrp1.dejanews.com>
In article <79cvmi$63l$1@nnrp1.dejanews.com>,
dhosek@webley.com wrote:
> In article <x3yk8xyp03r.fsf@tigre.matrox.com>,
> Ala Qumsieh <aqumsieh@matrox.com> wrote:
>
> > In addition, the latest issue of TPJ shows a Perl Atari cartridge. I
> > always thought Perl was entertaining, but I don't suppose it's easy to
> > write any useful code with a joystick!
>
> But you would use the "keyboard" that came with the BASIC Programming
> cartridge and that would solve the problem.
>
> A friend actually had that cartridge when I was a kid. Your programs were
> limited to 10 statements and the language was unable to parse I=I+1. Amazingly
> feeble.
>
I had an Atari-800 8bit computer in the early 80s. Would have been nice to
have that Perl cartridge then. The BASIC wasn't quite as horrible as what
you describe, but it was pretty limited. You could put machine code in
strings and call them though. That was fun.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 05 Feb 1999 03:51:32 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: join func. appending delimiiter before 1st field..
Message-Id: <m1k8xxysor.fsf@halfdome.holdit.com>
>>>>> "prasad" == prasad <prasad@my-dejanews.com> writes:
prasad> I want to scan a line with fields delimited by '--' and print
prasad> it in a file as,
prasad> field1``field2``field3``field4``x
prasad> Instead, it is being written as follows,
prasad> ``field1``field2``field3``field4``x
prasad> current code->
prasad> ---------------------
prasad> @field_array = split(/--/, $splitlist[$a]);
prasad> chomp @field_array;
prasad> print FILE join("``",(@field_array)),'``x',"\n";
prasad> ---------------------
My guess is that $field_array[0] is an empty string. So you need
to look upstream a bit and find out if it had a newline in it
before the chomp, or maybe your $splitlist[$a] has "--field1--field2"
in it.
We actually use that as a feature in our classes:
@data = (3,5,7,9);
$before = join "-","",@data; # "-3-5-7-9"
$after = join "\n",@data,""; # "3\n5\n7\n9\n"
$both = join "~","",@data,""; # "~3~5~7~9~"
print "Just another Perl hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Fri, 05 Feb 1999 13:08:15 GMT
From: garbage@gmx.de (Markus Geish|ttner)
Subject: Perlscript / ASP: Packages ?
Message-Id: <36baea19.186064797@news.strex.allianz>
I use the following perlscript-ASP and module and get the error
message
UseTestPM::Test(); $Response->writeblock(1); error '80004005'
Can't call method "write" on an undefined value at
E:\FaxPlus\IIS\Modules/UseTestPM.pm.
/Test/UseTestPM.asp, line 11
It seems like $Response is not known to the package. Is there any way
to pass $Response to the package ?
<%@ LANGUAGE = PerlScript %>
<HTML>
<BODY>
<%
use UseTestPM;
$Response->Write( "Line 1<BR>" );
UseTestPM::Test();
%>
</BODY>
</HTML>
package UseTestPM;
sub Test
{
$Response->write( "Line 2" );
}
1;
------------------------------
Date: 05 Feb 1999 15:16:49 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: stefano@rerumnatura.zool.su.se (Stefano Ghirlanda)
Subject: Re: problem with PerlTk
Message-Id: <m3d83pey0e.fsf@joshua.panix.com>
stefano@rerumnatura.zool.su.se (Stefano Ghirlanda) writes:
> Since I found it unlikely to be a bug in the Tk module, I ask what
> I'm doing wrong.
The program text you posted works fine for me. Perhaps a re-install
of Tk is in order?
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Fri, 05 Feb 1999 09:40:03 -0500
From: Michael Bowler <mkbowler@nortelnetworks.com>
Subject: Problems with shell parsing of exec.
Message-Id: <36BB02C3.976331A@nortelnetworks.com>
I am trying to do the following... (simplified code)
unless ($pid = fork) {
#Child processing...
exec("$BinaryExe 1>$stdoutfile 2>$stderrfile");
}
#Parent processing...
kill('HUP', $pid); #Kill off the child.
This works fine if I leave off the stdout/stderr redirection from the exec
statement, however, when the redirection is present, the exec creates a shell
interpreter which creates another process for $BinaryExe. In this case
signalling $pid, kills the shell, but not $BinaryExe. Any way around this?
Perl 5.004_4, Solaris 2.6
Thanks for any help.
Michael Bowler.
--
Michael Bowler Phone: 613-765-3432
IC Design Tools - 5T11 ESN: 39+53432
Nortel Semiconductors Email: mkbowler@nortelnetworks.com
------------------------------
Date: Fri, 05 Feb 1999 14:34:08 GMT
From: chad@vcn.net
Subject: Re: Programming with Style
Message-Id: <79evh0$qfr$1@nnrp1.dejanews.com>
In article <slinberg-0502990034460001@cc11620-a.lwmrn1.pa.home.com>,
slinberg@crocker.com (Steve Linberg) wrote:
> In article <79dr91$ttv$1@nnrp1.dejanews.com>, chad@vcn.net wrote:
>
> > I'm sure I'll get
> > better with more and more experience and practice, just
> > wondering if anyone ran across a good book. I heard of one
> > called "The Pearls of Programming", but have never been able
> > to find it in a store.
>
> The Perl Cookbook, by Tom Christiansen and Nathan Torkington, is a great
> place to start. Lots of nice code samples in there.
I have that one. What I'm looking for is a book on complete program design
from the ground up. Ya, I have my own style when it comes to designing a
script, I would just like to see how the perl guru's do it.
-chad
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 5 Feb 1999 14:07:17 GMT
From: lvirden@cas.org
Subject: Re: Python vs. Perl vs. tcl ?
Message-Id: <79etul$pdr$1@srv38s4u.cas.org>
:In article <36B5AB97.C2874740@ibm.net>, Jon McLin <jon_mclin@ibm.net> wrote:
:>The point to this post? I'm specifically looking for references to
:>concise, perhaps tabular reasonably-objective comparisons between
:>Python, Perl, and TCL. Although I believe I can accomplish this
One resource you might take a peek at is the fairly regular column in
SunWorld titled "Regular Expressions", written by our own Cameron Laird,
which provides objective coverage of a variety of scripting (and
occasionally almost scripting) languages.
--
<URL: mailto:lvirden@cas.org> Quote: Saving the world before bedtime.
<*> O- <URL: http://www.purl.org/NET/lvirden/>
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
------------------------------
Date: Fri, 05 Feb 1999 11:35:16 GMT
From: anface@geocities.com
Subject: Q:PERL & Tk: file_select for directory
Message-Id: <79el1k$i79$1@nnrp1.dejanews.com>
Hi,
I'm starting to program with TK PERL.
I'm looking for an instruction, similar to file_select
to select only directory.
Could you help me?.
Thanks in advance
Ciao
Fabrizio
P.S. plese send the message also to my e-mail box
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 05 Feb 1999 15:33:01 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: anface@geocities.com
Subject: Re: Q:PERL & Tk: file_select for directory
Message-Id: <m3aeysgbtu.fsf@joshua.panix.com>
anface@geocities.com writes:
> I'm looking for an instruction, similar to file_select to select
> only directory.
You can coerce your FileSelect widget into allowing the user to choose
a directory with this line of code, hidden in the docs for
Tk::FileSelect:
$fileselect->configure(-verify => ['-d']);
However, it's confusing (since directories appear only in the lefthand
list box). I don't know of a corresponding "DirectorySelect" widget.
You may have to roll your own.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Fri, 05 Feb 1999 09:36:00 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Question: Arrays of associative arrays
Message-Id: <linberg-0502990936010001@ltl1.literacy.upenn.edu>
In article <MPG.11244dc64b5ae1e2989a09@nntp.hpl.hp.com>, lr@hpl.hp.com
(Larry Rosler) wrote:
> No matter how loose the terminology 'List of Hashes' is, you cannot have
> a list of hashes. You *can* have a list of hash references, though,
> and you do in each of the examples I snipped.
Gotcha. Thanks.
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>
------------------------------
Date: Fri, 05 Feb 1999 13:54:14 GMT
From: droby@copyright.com
Subject: Re: Reference Question....
Message-Id: <79et63$oeu$1@nnrp1.dejanews.com>
In article <3990edewmx.fsf@ibnets.com>,
Uri Guttman <uri@ibnets.com> wrote:
> >>>>> "d" == droby <droby@copyright.com> writes:
>
> d> In article <36B9CBD1.8CD64CF0@cedarnet.org>,
> d> Steve Wells <wells@cedarnet.org> wrote:
> >>
> >> my @array = $obj->function;
> >> $hash{foo} = \@array;
> >>
> >> It works. But I wanted to get rid of the array and
> >> just have it point to the data so I tried:
> >>
> >> $hash{foo} = \@{$obj->function};
>
> d> neatest way is to dereference $hash{foo} in an array assignment:
>
> d> @{$hash{foo}} = $obj->function;
>
> $hash{foo} = [$obj->function] ;
>
> anon lists are your friend. this of course copies the list which is what
> the original code seems to want.
>
> uri
>
Indeed. I regretted ny post (mildly) as soon as I saw Dan Boorstein's. This
is likely better unless you have a strong desire to NOT copy the list.
Of course, I might have just had the function return a reference in the first
place...
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 03 Feb 1999 07:20:55 -0600
From: mike@stok.co.uk (Mike Stok)
Subject: Re: replacing non-printable characters
Message-Id: <eJAtIg3T#GA.153@news2.texas.rr.com>
In article <lfnnjBAq54t2Ewsy@beausys.demon.co.uk>,
Andrew Fry <andrewf@beausys.demon.co.uk> wrote:
>
>I am trying to write a Perl module that decodes
>a trace of network traffic, and I need a bit of
>Perl that replaces all non-printable characters
>by, say, a '.' (...to display each octet in
>hex on one side and ASCII on the other side).
>Does anyone have such a piece of code to hand ?
>(...to do the replacing, that is).
If you're talking ASCII then
$string =~ tr/ -~/./c;
might be a place to start.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
| 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Fri, 05 Feb 1999 12:26:28 GMT
From: dturley@pobox.com
Subject: Re: Sending Perl output to 2 diffent html frames
Message-Id: <79eo1e$kbo$1@nnrp1.dejanews.com>
> Bob Van Der Ploeg wrote:
> >
> > How do I get perl to send output to 2 different html frames?
>
>
If you *REALLY* must do this, just have your script send the whole frameset
and redraw the complete set. I have a simple demo of this at:
http://www.binary.net/dturley/cgi-local/frames.cgi
Yea, it's a waste of cpu and download time, but if one insists on frames,
that's the price you occasionally pay. :-)
cheers
--
____________________________________
David Turley
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 05 Feb 1999 08:29:42 -0500
From: John Safrit <safrit@mindspring.com>
Subject: Re: Sending Perl output to 2 diffent html frames
Message-Id: <36BAF246.48A7B587@mindspring.com>
Actually, there is a way to do it using Perl. Check out the
following scripts:
http://www.terminalp.com/scripts/redirection.shtml
He uses a "Window-target: target-name" to redirect the output to the
named window.
John Safrit
safrit@mindspring.com
--- Come visit Safrit Solutions Website Design ---
http://safrit.com/safritsolutions/
------------------------------
Date: 05 Feb 1999 15:09:52 +0100
From: Jonathan Feinberg <jdf@pobox.com>
To: Patrick Hayes <Patrick.Hayes.CAP_GEMINI@renault.fr>
Subject: Re: testing for scalar/list/array
Message-Id: <m3g18leybz.fsf@joshua.panix.com>
Patrick Hayes <Patrick.Hayes.CAP_GEMINI@renault.fr> writes:
> Um, would you mind explaining it?
perldoc perlsub
The Perl model for function call and return values is
simple: all functions are passed as parameters one single
flat list of scalars, and all functions likewise return to
their caller one single flat list of scalars.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 5 Feb 1999 11:06:02 GMT
From: Aidan Rogers <aidan@salvador.blackstar.co.uk>
Subject: Re: The best way to learn C?
Message-Id: <79ejaq$agf$1@nclient3-gui.server.ntli.net>
Thanks guys.
I guess Kernighan and Ritchie it is then.
Aidan
(posting from work)
------------------------------
Date: 5 Feb 1999 13:25:48 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: UNIX 'tail' command in Perl??
Message-Id: <79ergs$blj$1@pegasus.csx.cam.ac.uk>
Dave McIntyre <davem@nortak.com> wrote:
>You could try:
>
>open(FILE,"mybigfile");
>@allrecords=<FILE>; #put all records in array
>
>for ($i=0;$i<10;$i++)
>{
>$last=pop@allrecords; #get the last one
>push (@last_ten, $last); # if you want to keep them for some reason
>}
>
># @allrecords now has the last ten chopped off
That's an absurdly complicated way of simulating splice(). Try instead
@last_ten = splice @allrecords, -10;
And, of course, in the particular application, you don't need to actually
copy or remove the records. So just write
@allrecords[-10..-1]
Mike Guy
------------------------------
Date: 05 Feb 1999 05:58:14 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: UNIX 'tail' command in Perl??
Message-Id: <m14sp1ymtl.fsf@halfdome.holdit.com>
>>>>> "M" == M J T Guy <mjtg@cus.cam.ac.uk> writes:
M> And, of course, in the particular application, you don't need to actually
M> copy or remove the records. So just write
M> @allrecords[-10..-1]
Although I've gotten bitten by that when there weren't actually ten items,
so I've used something like:
@all > 10 ? @all[-10..-1] : @all
It'd be nice if there was a shorter idiom for that.
print "Just another Perl idiot^Widiom hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Fri, 05 Feb 1999 14:03:26 +0100
From: "F. Geeb" <frage@post1.tele.dk>
Subject: XML & Perl
Message-Id: <36BAEC1D.CA187515@post1.tele.dk>
Hi
Is there any mailinglist about XML and Perl?
Franziskus Geeb
------------------------------
Date: Fri, 05 Feb 1999 14:18:06 +0100
From: Christoph Wernli <christoph.wernli@ubs.com>
Subject: Re: XML & Perl
Message-Id: <36BAEF8E.7C3A4708@ubs.com>
"F. Geeb" wrote:
>
> Is there any mailinglist about XML and Perl?
There's one at perl-xml@listserv.ActiveState.com
-w
------------------------------
Date: Fri, 5 Feb 1999 13:25:34 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: XML & Perl
Message-Id: <siogn9kmnl.fsf@cre.canon.co.uk>
"F. Geeb" <frage@post1.tele.dk> wrote:
> Is there any mailinglist about XML and Perl?
ActiveState runs the `perl-xml' mailing list. To subscribe, send an
email to lyris@activestate.com with the message body:
subscribe perl-xml
--
Gareth Rees
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4832
**************************************