[6625] in Perl-Users-Digest
Perl-Users Digest, Issue: 250 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Apr 7 19:27:23 1997
Date: Mon, 7 Apr 97 16:00:22 -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 Mon, 7 Apr 1997 Volume: 8 Number: 250
Today's topics:
Can It Be Done jhardy@cins.com
Defining local loop variables (Bernard Cosell)
Re: Defining local loop variables <tchrist@mox.perl.com>
Getting system function output into variable? <aboyd@wpo.borland.com>
Re: Getting system function output into variable? <tchrist@mox.perl.com>
Re: giving a subroutine as a parameter of a function (Matthew Cravit)
Re: Help! How do I pass filehandles to subroutines? (Eric Hollander)
HELP: perl5.003 dynamic extensions don't build on Solar (Benedict Lofstedt)
Re: Is function interpolation possible in RE? <walter@wbriscoe.demon.co.uk>
Re: Ousterhout and Tcl lost the plot with latest paper (Kelly Murray)
Re: Ousterhout and Tcl lost the plot with latest paper (Carl Zmola)
Re: Ousterhout and Tcl lost the plot with latest paper (cano_jonathan)
Re: Ousterhout and Tcl lost the plot with latest paper (Mark A Harrison)
References to built-in functions/commands (Bernard Cosell)
Re: References to built-in functions/commands <tchrist@mox.perl.com>
San Diego Sybase Job Opportunities!!! <dglass@swpartners.com>
system call <pchang@sherman.cs.columbia.edu>
Thanks to this newsgroup was Re: Win32::NetAdmin/Misc (Betty Kainz)
Re: VMS Perl question (Jonathan Hudson)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 7 Apr 1997 20:30:36 GMT
From: jhardy@cins.com
Subject: Can It Be Done
Message-Id: <5iblhc$stu$1@news>
Come on guy's, give me a break! I know one of you Guru's know how to do this
and I just can't figure it out.
I have a flat file database whcih looks like this;
Item Description Price
Monitor MegaImage $375.00
Monitor Toshiba $800.00
CPU 486 $100.00
CPU 486 OD 100 MHZ $235.00
Motherboards MB $25.00
Motherboards MN2 $100.00
So far I can get the script to read the file and print out the database in a table.
Being a newbie to Perl I finally figured that out. Now instead of printing it to a
table I want to read it in like below
#!/usr/bin/perl
# Name: quoteSYS.pl
# Version: 1.0
# Last Modified: 04-03-97
$tax1_label ="7% GST - 8% PST";
$tax2_label = "7% GST";
$tax_rate1 = .08;
$tax_rate2 = .07;
$database = "./Data_files/crise.data";
$| = 1;
open(DATABASE, "$database") || die "Content-type:
text/html\n\nCannot open database!";
@database = <DATABASE>;
close(DATABASE);
Now that I have the file in the variable @database I want to somehow get it to
read the text in the first columb
and extract all the monitor rows and send them to a drop down list in a form .
Then do the same for the CPU rows, etc. so my form will have a selection of drop
down boxes which will contain the entire database. Then items could be selected
sent back to the script and priced and sent back as an HTML quote.
I know how to do this from a form and I have seen many of them but I want to
avoid the updateing problems by just updating the database with the new items
which will then be read in by the script and sent to the form. This way I avoid
having to manually update the HTML everytime I want to add a new item .
I can figure out the rest of the script myself I just can't get the gist of the part to
seperate the incoming data from the database and send it to the form in a drop
down box.
Beleive me I have been trying to do it myself and don't want to trouble anyone. I
have searched Deja News and all other news groups and I think in the last week I
have covered pretty much the entire web with no success. The more I read about it
the more confused I get. To much data for this brain to handle:) If I could even see
one example of this being done I would be able to understand it.
Help me out and I'll credit you in the script (yeah I know, Big Deal!) Im broke or I
would pay you, whine,whine,whine.
I posted this same problem a while back and the post went unanswered and seems
to have disapeared?
any help would be much appreciated.
If you are willing to help can you email me with your suggestions if possible.
Thanks
John
jhardy@cins.com
------------------------------
Date: Mon, 07 Apr 1997 20:58:33 GMT
From: bernie@rev.net (Bernard Cosell)
Subject: Defining local loop variables
Message-Id: <33495c0d.1066067239@news.rev.net>
I am a real fanatic when it comes to limiting the scope of my
variables. Is there some 'idiom' in Perl for having a for or foreach
loop with an index variable local to the loop? The kind of thing I
find that I need to do almost all the time is:
{
my $i ;
for ($i = 0 ; $i < something ; ...) [or foreach $i (list) ]
{ .... }
}
But that seems like such a waste [and, indeed, is a nuisance to type
[not to mention the extra, superfluous level of indention it causes]]
since the loop localizes the variable anyway. Is there some
clean/clever/standard way to express these semantics. I've tried a
bunch of things [more in hope than in a real expectation that they'd
work] to no avail ... for example "foreach my $i (0 .. 4) { ...}"
[and that brings up a meta question wrt to loop index vbls: since the
loop machinery localizes the variable anyway, why not have it
implicitly 'declare' it? The value of the loop index can't leak out
of the loop anyway [since it is localized to the loop], and that seems
to make the necessity of the external declaration of the vbl just a
bother...
/Bernie\
--
Bernie Cosell mailto:bernie@rev.net
Roanoke Electronic Village
------------------------------
Date: 7 Apr 1997 21:59:29 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Defining local loop variables
Message-Id: <5ibqo1$b0m$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, bernie@rev.net writes:
:work] to no avail ... for example "foreach my $i (0 .. 4) { ...}"
Fixed in the next release: get 5.004beta now if you're eager.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
:The only reason [not to use] perl is that some sysadmins don't allow software that they didn't pay for.
By all means, let them send me money if it makes them feel better. :-)
--Larry Wall in <1993Dec13.213032.26623@netlabs.com>
------------------------------
Date: Mon, 07 Apr 1997 12:30:45 -0700
From: Anthony Boyd <aboyd@wpo.borland.com>
Subject: Getting system function output into variable?
Message-Id: <33494B65.E6D@wpo.borland.com>
I couldn't find this in the FAQ, so here goes. I have a tiny script:
$Moz3 = system("'grep' -c \"Mozilla/3\" data/cppbreg.dat");
print "The grep found $Moz3 Mozilla 3 users\n";
However, when I run the script, I can see the grep results (25) on the
command line, but the print statement shows:
The grep found 0 Mozilla 3 users
Why is the system function not assigning results to $Moz3? I thought
putting backticks around the grep would return the data. I am missing a
basic concept, I assume....
-Anthony Boyd
------------------------------
Date: 7 Apr 1997 22:54:03 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Getting system function output into variable?
Message-Id: <5ibtub$cp2$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, aboyd@wpo.borland.com writes:
:I couldn't find this in the FAQ, so here goes.
You didn't look hard enough. :-(
:I have a tiny script:
:
:$Moz3 = system("'grep' -c \"Mozilla/3\" data/cppbreg.dat");
:print "The grep found $Moz3 Mozilla 3 users\n";
:
:However, when I run the script, I can see the grep results (25) on the
:command line, but the print statement shows:
:
:The grep found 0 Mozilla 3 users
:
:Why is the system function not assigning results to $Moz3?
:I thought
:putting backticks around the grep would return the data.
It would, but you didn't use backticks. Does Microsoft Brain Damage
extend to confusion about ticks and backticks the way it does to
slashes and backslashes? :-)
:I am missing a
:basic concept, I assume....
Backticks.
Here's the FAQ entry I was thinking of:
How can I capture STDERR from an external command?
There are three basic ways of running external commands:
system $cmd; # using system()
$output = `$cmd`; # using backticks (``)
open (PIPE, "cmd |"); # using open()
With system(), both STDOUT and STDERR will go the same place
as the script's versions of these, unless the command redirects
them. Backticks and open() read only the STDOUT of your command.
With any of these, you can change file descriptors before the call:
open(STDOUT, ">logfile");
system("ls");
or you can use Bourne shell file-descriptor redirection:
$output = `$cmd 2>some_file`;
open (PIPE, "cmd 2>some_file |");
You can also use file-descriptor redirection to make STDERR a
duplicate of STDOUT:
$output = `$cmd 2>&1`;
open (PIPE, "cmd 2>&1 |");
Note that you *cannot* simply open STDERR to be a dup of STDOUT
in your Perl program and avoid calling the shell to do the
redirection. This doesn't work:
open(STDERR, ">&STDOUT");
$alloutput = `cmd args`; # stderr still escapes
This fails because the open() makes STDERR go to where STDOUT was
going at the time of the open(). The backticks then make STDOUT
go to a string, but don't change STDERR (which still goes to the
old STDOUT).
Note that you *must* use Bourne shell (sh(1)) redirection
syntax in backticks, not csh(1)! Details on why Perl's system()
and backtick and pipe opens all use the Bourne shell are in
http://www.perl.com/CPAN/doc/FMTEYEWTK/versus/csh.whynot .
You may also use the IPC::Open3 module (part of the standard perl
distribution), but be warned that it has a different order of
arguments from IPC::Open2 (see the IPC::Open3 manpage).
Hm... that perhaps is subclear. Here's a new FAQ entry, in your
honor. It'll be there next time around.
Why can't I get the output of a command with system()?
You're confusing the purpose of system() and backticks ('').
system() runs a command and returns exit status information (as
a 16-bit value -- the low 8 bits are the signal the process died from, if
any, and the high 8 bits are the actual exit value). Backticks ('')
run a command and return what it sent to STDOUT.
$status = system("mail-users");
$output = `ls`;
Make sense?
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
If you want your program to be readable, consider supplying the argument.
--Larry Wall in the perl man page
------------------------------
Date: 7 Apr 1997 13:28:22 -0700
From: mcravit@shell3.ba.best.com (Matthew Cravit)
Subject: Re: giving a subroutine as a parameter of a function
Message-Id: <5ibld6$dkd@shell3.ba.best.com>
In article <Pine.SUN.3.96.970407204222.13836A-100000@bicho.eui.upm.es>,
Frederiek Lefebvre <fretje@bicho.eui.upm.es> wrote:
> I wander if there is a way to give a function a subroutine
>as parameter in Perl. Does anybody know?
Yes. You can pass a reference to a subroutine like this:
&DoSomething($foo, $bar, \&SubroutineRef);
Hope this helps.
/MC
PS: Posting a 25 line ASCII art signature to a 2 line message is kind of
annoying, especially to people reading news over a slow connection.
--
--
Matthew Cravit, N9VWG | Experience is what allows you to
E-mail: mcravit@best.com (home) | recognize a mistake the second
mcravit@taos.com (work) | time you make it.
------------------------------
Date: 7 Apr 1997 14:57:32 -0700
From: hh@scam.XCF.Berkeley.EDU (Eric Hollander)
Subject: Re: Help! How do I pass filehandles to subroutines?
Message-Id: <5ibqkc$m10@scam.XCF.Berkeley.EDU>
Thanks to some help from this newsgroup, I figured out how to pass around
filehandles. Here's my little example program that works, with use strict.
This kind of thing should be better documented.
use strict;
foo(\*STDIN);
sub foo {
my($var, $in);
*var = $_[0];
$in = <var>;
print seek(var, 0, 1) . " is 1 if seek works\n";
print tell(var);
print "you said: $in\n";
}
In article <5i4bij$7of@scam.XCF.Berkeley.EDU>,
Eric Hollander <hh@scam.XCF.Berkeley.EDU> wrote:
>
>I'm trying to do something like this:
>
>#/usr/local/bin/perl
>use strict;
>
>foo(<STDIN>);
>
>sub foo {
> my($FD, $byte);
>
> $FD = $_[0];
>
> seek(<$FD>, 0, 1);
> read(<$FD>, $byte, 1)
> # ....
>}
>
>but I can't get it to work! I looked at the FAQ about using files and
>filedescriptors, but it was no help. Is it possible to do this, or do I
>have to turn off "use strict"?
------------------------------
Date: 7 Apr 1997 15:23:57 GMT
From: benedict@daimi.aau.dk (Benedict Lofstedt)
Subject: HELP: perl5.003 dynamic extensions don't build on Solaris ?
Message-Id: <5ib3id$sbs$1@gjallar.daimi.aau.dk>
Hi,
Can anyone help on this? I'm trying to install perl5.003 on
HPUX9.05, Solaris 2.4, 2.5, 2.5.1, IRIX5.3, 6.2.
I have libdb.a and libgdbm.a on my system. I can build the perl executable
if I define '-Dusedl=false' in Configure, and the executable passes all
self tests.
If I try to use the dynamic extensions as dynamic [ which ought to be the
intention ;-) ], I get the following error under the self test:
lib/anydbm.....Can't load '../lib/auto/Fcntl/Fcntl.so' for module Fcntl: ld.so.1: ./perl: fatal: relocation error: symbol not found: main: referenced in ../lib/auto/Fcntl/Fcntl.so at ../lib/DynaLoader.pm line 140.
and a lot of other instances of what appears to be the same error.
Also, under Solaris I get
lib/filehand...Bareword "O_RDONLY" not allowed while "strict subs" in use at ./lib/filehand.t line 23.
Execution of ./lib/filehand.t aborted due to compilation errors.
FAILED on test 0
I have tried to search for previous instances of this problem on DejaNews
but failed to find anything. Can anyone help?
--- benedict
--
Benedict Lofstedt <blofstedt@daimi.aau.dk>
Computer Science Department, Aarhus University, Fax: + 45 8942 3255
Ny Munkegade, DK-8000 Aarhus C, Denmark. Phone: + 45 8942 3222
------------------------------
Date: Mon, 7 Apr 1997 22:08:34 +0100
From: Walter Briscoe <walter@wbriscoe.demon.co.uk>
Subject: Re: Is function interpolation possible in RE?
Message-Id: <BEGFpBASJWSzEwkO@wbriscoe.demon.co.uk>
I found a more general method:
s/([\000-\007\013-\037])/^${\(chr(64+ord($1)))}/g
prompted by the replies given to my original posting and the following:
In article <5gkju3$bfq$5@csnews.cs.colorado.edu>, Tom Christiansen
<tchrist@mox.perl.com> writes
>NAME
> perlfaq4 - Data Manipulation ($Revision: 1.15 $)
[snip]
> How do I expand function calls in a string?
>
> This is documented in the perlref manpage. In general, this is
> fraught with quoting and readability problems, but it is
> possible. To interpolate a subroutine call (in a list context)
> into a string:
>
> print "My sub returned @{[mysub(1,2,3)]} that time.\n";
>
> If you prefer scalar context, similar chicanery is also useful
> for arbitrary expressions:
>
> print "That yields ${\($n + 5)} widgets\n";
My thanks to all who assisted!
In article <E8559t.7o9@world.std.com>, "Andrew M. Langmead"
<aml@world.std.com> writes
>Walter Briscoe <walter@wbriscoe.demon.co.uk> writes:
>
>>I have an application in which I want to replace characters with values
>>less than space in the same way as is done in the presentation of such
>>characters in vi. e.g. I want to replace "\001" with "^A". I can't use
>>tr because that does a 1 to 1 mapping and I want a 1 to 2. Am I correct
>>that there is no ability to interpolate functions in perl?
>
>>i.e. that one can't do something like:
>>s/([\000-\007\013-\037])/^$(chr(64+ord($1)))/g
>># I use the $() backtick symbolism from the Korn shell for illustration.
>
>There is the /e modifier, which makes the right hand side of the
>substitute operator a perl expression to evaluate. That would make it:
>
> s/([\000-\007\013-\037])/'^' . chr(64+ord($1))/eg;
>
>Another option would be to make a hash of all of your character
>mappings ahead of time, then the result is just a simple substitution:
>
>
> # by default everything matches itself.
> %charmap = map { chr $_ , chr $_ } ( 0 .. 0377);
>
> # make exceptions for control characters.
> for $ctrl (0 .. 007, 013 .. 037) {
> $charmap{chr $ctrl} = '^'.chr(64 + $ctrl);
> }
>
> # time passes ...
>
> s/([\000-\007\013-\037])/$charmap{$1}/g;
>
--
Walter Briscoe
------------------------------
Date: 7 Apr 1997 21:26:54 GMT
From: kem@math.ufl.edu (Kelly Murray)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <5iboqu$qhk$1@sparky.franz.com>
It's only because people can't seem to stop using C/C++
that there is demand for inefficient "scripting" languages.
Common Lisp has so much versatility that it can be used for both
low-level "system" programming as well as "scripting" languages.
Extensive type declarations and safety optimization settings can produce
highly efficient machine code similiar to C compilers.
Fully general purpose macros can be used to define very high level
language constructs, like rules in an expert system,
or also very low-level constructs, like "assembly" languages,
or bit-level array graphics commands, which can expand into
heavily type-declared and optimized "system" CL code.
It's the best of both worlds, and only one simple language and set
of tools needs to be learned.
No other (widely known) language in the world has as much flexibility.
-Kelly Murray kem@franz.com http://www.franz.com
------------------------------
Date: Mon, 07 Apr 1997 20:36:23 GMT
From: zmola@campbellsci.com (Carl Zmola)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <33495a61.19863462@192.168.2.19>
On 06 Apr 1997 18:35:10 +0200, Fritz Heinrichmeyer
<fritz.heinrichmeyer@fernuni-hagen.de> wrote:
>James Lee <jlee@math.purdue.edu> writes:
>
>> ] 2. Many people objected to the fact that their favorite programming
>> ] was left out of the white paper. Yes, I have heard of Scheme,
>> ] Smalltalk, ML, etc. I left these languages out because they
>> ] didn't seem particularly relevant for the discussion. No offense
>> ] intended...
>>
>> Why were they irrelevant? Your paper concentrates on system and
>> scripting languages exclusively while ignoring an entire genre of
>> languages that may offer the features you're looking for in both.
>
>I agree! At least ML and Scheme (i dont know smalltalk very well ..) are
>particulary relevant to this discussion. They at least are intended to
>solve all the mentioned problems (terser code means shorter development
>time and less errors, inheritance is not so important, the computer
>should look for types etc.).
>
>The last posting of J. Ousterhout is outing him as candidate for getting
>an ML-fan!
>
This is clearly an Eastcoast-Leftcoast argument. Although it seems
that the leftcoast is pushing for conformity. :-)
Carl
------------------------------
Date: 07 Apr 1997 14:33:37 -0700
From: cano@loc201.tandem.com (cano_jonathan)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <k9qk9meplfy.fsf@prism.loc201.tandem.com>
-----BEGIN PGP SIGNED MESSAGE-----
>>>>> "CS" == Cyber Surfer <cyber_surfer@gubbish.wildcard.demon.co.uk> writes:
CS> With a mighty <5i7euq$cmg@engnews2.Eng.Sun.COM>,
CS> ouster@tcl.eng.sun.com uttered these wise words...
>> Wow, there's been quite a party going on over here on
>> comp.lang.scheme!
CS> I'm not MFC expert, either, nor do I wish to be one, but I have
CS> used it enoigh to know that I wouldn't write such code to create a
CS> button or two, using a particular font. Instead, I'd create a
CS> dialog resource, and if I wanted to place it within part of a
CS> window, then I'd make it a child of that window and size it
CS> accordingly.
CS> In other words, Your Mileage May Vary. A contest between VB and
CS> Tcl might be more realistic, as it seems to me that their
CS> strengths are very similar.
IMHO, Ousterhout's paper isn't about how TCL is better than VB as a
scripting language (this bias may show through but it isn't the main
thrust) but how scripting languages have a definite role to play.
- From this standpoint having players who are on the same "team" compete
against one another is meaningless.
- From the point of the white paper, we should have contests between VB
and VC++ to illustrate the the paper's thesis in the Win-tel realm and
we should have contests between TCL and <insert your favorite *system
programming* language> to illustrate the thesis in the UNIX realm.
--
Changing the subject, I'd have to say that MFC used with MSVC++ is
much more productive than writing directly to the Win32 API (I'm not
going to quibble about the exceptions to this generalization). While
much of this could be attributed to MSVC++'s gui building
functionality, I think that *implementation inheritance* works well
for MFC (contradicting Ousterhout's proposition ...).
--
As for VB verses MSVC++, I know several windows developers who have
used both environments for professional development and they all rave
about how great VB is for creating (non computationally intensive)
applications.
I haven't heard one person slander VB's ability to build GUI
applications quickly and effectively.
This anecdotal evidence supports Ousterhout's claim that "scripting"
language are better at being "glue".
Cheers,
--jfc
-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface
iQCVAwUBM0ljqdg65GR/Kx7xAQFNsgP+JppjeA9zcEejjnG1L3AR+WnAYW91+2+I
+GuydoGYKrZ1AWoOjFmLn53NIx1cgvI7KqsxZeMjMSd4Y3o0JtXhlyAVYIXGj300
EW6EeFNBJZhJSigwrJ5mBWcsIgYvbPuCYlhUMkIW/9Sd+Rr7FRXFnr16yMrQ0nSc
fgfUL4QRvQQ=
=oGKe
-----END PGP SIGNATURE-----
------------------------------
Date: 7 Apr 1997 22:17:04 GMT
From: mharriso@utdallas.edu (Mark A Harrison)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <5ibrp0$n3l$1@news.utdallas.edu>
John Ousterhout (ouster@tcl.eng.sun.com) wrote:
: - TCL does not scale well to large systems; it is fine for small
: "glueing" applications, but in the "real world", such applications
: are expected to grow with time, and soon proper typing becomes
: necessary, more efficiency becomes necessary, etc.
: When I started on Tcl I thought this would be true, but in fact many
: people have built surprisingly large programs in Tcl. For example,
: there is a real-time Tcl application containing several hundred thousand
: lines of code that controls a $5 billion oil well platform and (much to
: my shock) it seems to be quite maintainable. Sybase has something like
: a million lines of Tcl code in their test suite.
I agree with John's sentiments, but would like to point out that
many (most?) of the sites with large Tcl projects use the extension
[incr Tcl] which adds an object system to Tcl. Class-based programming
seems to scale more gracefully both in terms of program size and
and the number of people working on a project.
Mark.
------------------------------
Date: Mon, 07 Apr 1997 21:12:32 GMT
From: bernie@rev.net (Bernard Cosell)
Subject: References to built-in functions/commands
Message-Id: <334a6288.1067726273@news.rev.net>
I'm setting up a dispatch table, the kind of thing with:
$tbl{cmd1} = \&fcn1 ; $tbl{cmd2} = \&fcn2 ; ...
and I wanted one of the dispatches just to do an 'exit'. Of course, I
could do the trivial --- sub myexit { exit ; } --- but that seemed a
LOT less elegant than putting the link to 'exit' right into the
dispatch table... so I tried:
$tbl{exitcmd} = \&exit ;
but that didn't work at all.. Is there some way to make this work?
Perl goes to rather a lot of bother to blur the line between built-ins
and subroutine calls, it seems like it'd be a shame if something like
this didn't work...
Thanks
/Bernie\
--
Bernie Cosell mailto:bernie@rev.net
Roanoke Electronic Village
------------------------------
Date: 7 Apr 1997 22:02:08 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: References to built-in functions/commands
Message-Id: <5ibqt0$b0m$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
bernie@rev.net writes:
:dispatch table... so I tried:
: $tbl{exitcmd} = \&exit ;
:but that didn't work at all..
Closures are your friend:
$tbl{exitcmd} = sub { exit };
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
Q. Why is this so clumsy?
A. The trick is to use Perl's strengths rather than its weaknesses.
--Larry Wall in <8225@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: Mon, 07 Apr 1997 14:48:27 -0700
From: Daniel Glassman <dglass@swpartners.com>
Subject: San Diego Sybase Job Opportunities!!!
Message-Id: <33496BAB.72F5@swpartners.com>
Sybase Engineers Wanted!!!
Software Partners is a solutions oriented consulting company serving the
southern California area. We specialize in developing custom
client/server
applications, such as data-driven intranets and Internet web sites. We
are
also an authorized reseller of Sybase and PowerBuilder products. We
provide quality service to our customers and have an excellent track of
achieving total customer satisfaction.
Software Partners currently has several job openings for Sybase
engineers
who will be assigned to work with one of our key customers in the
financial
services industry. Job assignment areas include Sybase Reporting,
Sybase
Data Integrity, Sybase/Forte Application Development, Sybase/Visual
Basic
Application Development, Sybase Data Import, Sybase/Perl Development,
and Sybase DBA.
The successful candidate will have a Bachelors or Masters degree in
Computer
Science or related discipline, will have at least one year of Sybase
experience,
will have strong Unix skills (except for the Sybase/Visual Basic
assignment), and will enjoy working in customer environments. The Forte
assignment also requires one year of Forte experience, and the
Sybase/Perl assignment requires one year of Perl experience.
If this sounds good to you, mail, fax, or e-mail your resume to:
Human Resources
Software Partners
Box 230229
Encinitas, CA 92023-0229
Fax: (619) 350-0372
email: dglass@swpartners.com
------------------------------
Date: Mon, 7 Apr 1997 18:06:36 -0400
From: Po-shan Chang <pchang@sherman.cs.columbia.edu>
Subject: system call
Message-Id: <Pine.GSO.3.95.970407180241.8821P-100000@sherman.cs.columbia.edu>
Hi,
Can someone tell me what does the error
"ran with non-zero exit status 255" mean, when I was trying to use the
debug method suggested by Camel's book on page 230?
thanks.
Po-Shan.
------------------------------
Date: 07 Apr 1997 22:40:00 +0100
From: midimani@site88.ping.at (Betty Kainz)
Subject: Thanks to this newsgroup was Re: Win32::NetAdmin/Misc
Message-Id: <6UQ49yCSdNB@site88.ping.at>
On 05 Apr 97 rothd@roth.netX wrote :
> My site should be back up. I had some troubles getting the
> InterNIC to change my primary DNS, but all is well now (I hope).
> There is also a version of AdminMisc for build 304 available.
Thanks to everybody who answered !
...got 'em both already ! :-)
BTW, Dave...thanks a million for all the work you've done to
make your modules (the two mentioned and all the others as well) available
to all of us !!! :-)))))
I'm using odbc.pm combined with gd.pm and Matt Kruse's graph.pm
(thanks, Matt !) to read data and create on-the-fly graphs,
and the combined results are just great !
Of course I'm using Lincoln Stein's wonderful cgi.pm as well, so
I'd like to say thanks to Lincoln too ! :-)
Sorry for using up bandwidth getting sentimental, but I'm a musician-
turned-Perl-freak, who learned (is learning) Perl from reading this newsgroup
and just got a great job working in this branch, so I wanted to take
a minute to give credit where credit is due.
There are too many names to mention here, but if you've posted to this
newsgroup, then you've helped me to learn Perl...all of you.
Thanks again, everybody ! :-)
Betty
------------------------------
Date: 7 Apr 1997 17:48:13 GMT
From: Jonathan.Hudson@jrhudson.demon.co.uk (Jonathan Hudson)
To: Liyun Wang <Liyun.Wang.1@gsfc.nasa.gov>
Subject: Re: VMS Perl question
Message-Id: <5ibc0t$lg@trespassersW.local>
In article <33456E97.41C6@gsfc.nasa.gov>,
Liyun Wang <Liyun.Wang.1@gsfc.nasa.gov> writes:
[mailed, posted]
>I write perl scripts to be run under VMS. I have a routine that uses
>system call to convert *all* logical names into %ENV:
....
>SUMOP1$DRA0:[SYS0.SYSCOMMON.SYSEXE] is changed to
>SUMOP1$DRA0:[SYS0.][SYSEXE]. Because of that, the OS no longer can find
>any executable (images), including dir, show, or even help.
I'm not entirely sure that this isn't a VMS issue rather than a Perl
question.
First, why spawn a sub-process to get the logical name table when Perl
will do it for you:
#! /usr/bin/perl -w
use strict;
my ($key, $val);
foreach $key (keys %ENV)
{
my $i;
for($i =0; $val = $ENV{$key.';'.$i}; $i++)
{
if ($i == 0)
{
print $key. " = " ;
}
else
{
print "\t\t";
}
print $val,"\n";
}
}
See perlvms.pod for the ;N trick to get all values of a logical name
with multiple translations.
However, if you look at either these or the `show logical`
translations, you will see that VMS gives you the "device:[dir.]"
translation, not Perl. This is a VMS feature, as the following shows:
Note: aroot == dka200:[hudsonj.]
#! /usr/bin/perl -w
use strict;
my ($aroot,$fn,$aaroot);
$aroot = $ENV{'aroot'} or die "you're uprooted";
print "aroot ==> ", $aroot, "\n";
$fn = $aroot.'[tmp]x.pl';
print "try ",$fn, "\n";
open (FD, $fn) or warn "can't open $fn\n";
($aaroot = $aroot) =~ s/\.\]/\.tmp\]/;
$fn = $aaroot."x.pl";
print "try ",$fn, "\n";
open (FD, $fn) or warn "can't open $fn\n";
$fn = "aroot:[tmp]x.pl";
print "try ",$fn, "\n";
open (FD, $fn) or warn "can't open $fn\n";
Which results in:
aroot ==> DKA100:[HUDSONJ.]
try DKA100:[HUDSONJ.][tmp]x.pl # this is OK (suprised ?)
try DKA100:[HUDSONJ.tmp]x.pl # and so is this
try aroot:[tmp]x.pl # may bother with ENV ?
So, Perl open() can open *all permunations* of the above; so why
bother translation the logical name because VMS will do it when you
attempt to access the file ?
Sorry this doesn't directly answer your question ... but is there
still one ?
--
-----------------------------------------------------------------------
Jonathan R Hudson Email: jrh@jrhudson.demon.co.uk
WWW: http://www.jrhudson.demon.co.uk Voice/Fax: +44 (0)1703 867843
------------------------------
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 250
*************************************