[6657] in Perl-Users-Digest
Perl-Users Digest, Issue: 282 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 11 18:37:25 1997
Date: Fri, 11 Apr 97 15:00:24 -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 Fri, 11 Apr 1997 Volume: 8 Number: 282
Today's topics:
Re: "Bad free()" warning, splitting on variable delimit <rra@stanford.edu>
5.003_95 - 'boot_SOMESYMBOL' not found <nneul@umr.edu>
Re: @array as input symbol in <@array> (Laurel Shimer)
Re: CGI.pm and redirect (Lincoln Stein)
Re: compiled pel5 (Nathan V. Patwardhan)
Dynaloader error message <sib@worldnet.att.net>
Re: Help doing a FORK type process <rra@stanford.edu>
Re: Help! Calling PERL from HTML... (Laurel Shimer)
Re: How to access shadowed passwords? <rra@stanford.edu>
Re: Image redirect problem (Nathan V. Patwardhan)
Re: In-line GIF extraction <rra@stanford.edu>
Re: linux/socket calls <rra@stanford.edu>
Re: Name of SUID'ed perl script on Solaris? (Brooks Davis)
Re: New Microsoft Perl Product (fwd) <rra@stanford.edu>
Re: Ousterhout and Tcl lost the plot with latest paper (Tom Poindexter)
Re: parsing a line w/ quoted strings (newbie) (Ken Irving)
Re: Perl and MSDOS (Ilya Zakharevich)
Re: Perl Syslog Problem <rra@stanford.edu>
Re: PERL Training Course (Laurel Shimer)
Re: perl- equivalent to set -x (Andreas Karrer)
Re: perl- equivalent to set -x (Ilya Zakharevich)
Re: Perl5 sin function has dain bramage ?!?!?!?!? (Ilya Zakharevich)
Re: Porting Perl to C (Help with) <rra@stanford.edu>
Re: problem with file handling in perl (Laurel Shimer)
Re: repeat pattern in one line (Tim Gim Yee)
Re: Reply to Ousterhout's reply (was Re: Ousterhout and <bhouse@dazsi.com>
Re: Reply to Ousterhout's reply (was Re: Ousterhout and (Cyber Surfer)
Re: Splitting Hairs, or strings, rather (Laurel Shimer)
Re: Unix and ease of use (WAS: Who makes more ...) <tuomo@cs.chalmers.se>
Re: Unix and ease of use (WAS: Who makes more ...) (jason olmsted)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Apr 1997 14:06:22 -0700
From: Russ Allbery <rra@stanford.edu>
To: mcovingt@coewl.cen.uiuc.edu (covington maiko)
Subject: Re: "Bad free()" warning, splitting on variable delimiters
Message-Id: <qumiv1tjmlt.fsf@cyclone.stanford.edu>
[ Posted and mailed. ]
covington maiko <mcovingt@coewl.cen.uiuc.edu> writes:
> However, I'm still curious as to why the error only appeared in
> the case where I split on the variable delimiters. I'd expect to get an
> error ALL the time!
Bad free() errors are not Perl code errors, and while changing your code
may make them go away, that's only a workaround. They're caused by
problems with the malloc() that Perl is using. If you have the ability to
recompile Perl, try compiling it to use your system malloc() if it's
currently using Perl's malloc(), and Perl's malloc() if it's currently
using the system malloc().
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: 11 Apr 1997 19:28:30 GMT
From: Nathan Neulinger <nneul@umr.edu>
Subject: 5.003_95 - 'boot_SOMESYMBOL' not found
Message-Id: <5im3cu$c21$1@news.cc.umr.edu>
Keywords: symbols perl5 resolution module
I have been having lots of trouble getting a staticly compiled copy of
perl to work.
I am building on an HP-UX 10.20 machine with Perl 5.003_95. I have to
build the DBI and DBD modules statically due to the Informix libraries
not being shared.
I can do the above without any problems at all. But when I start to work
on building other modules, I get weird errors like the following:
Can't find 'boot_Data__Dumper' symbol in
/afs/umr.edu/software/perl5004/hpux10/lib/site_perl/
PA-RISC1.1/auto/Data/Dumper/Dumper.sl at Configure line 8
BEGIN failed--compilation aborted at Configure line 8.
I get those both on other dynamic modules that I have installed as well
as on modules that are standard with perl (i.e. 'IO') I did an 'nm' on
that .sl file and that symbol is defined in it.
Unfortunately, this makes it pretty unusable, since I am unable to
install even basic modules like libnet.
Suggestions anyone?
-- Nathan
------------------------------------------------------------
Nathan Neulinger Univ. of Missouri - Rolla
EMail: nneul@umr.edu Computer Center
WWW: http://www.umr.edu/~nneul SysAdmin: rollanet.org
------------------------------
Date: Fri, 11 Apr 1997 13:14:17 -0700
From: autopen@quake.net (Laurel Shimer)
Subject: Re: @array as input symbol in <@array>
Message-Id: <autopen-1104971314170001@l94.d22.quake.net>
Well I'm fully willing to be one of those 'clueless idiots' you refer to
in your next message, but I can't find any reference in my Camel book
index to (<*.c>) . What is that? Can you give me something to look up? I
looked all through the parenthesis section....
Laurel
---------
In article <5i5tg7$81t@picasso.op.net>, mjd@plover.com (Mark-Jason
Dominus) wrote:
> Someone recently sent me a code sample that included
>
> while (<@array>) {
> print $_, "\n";
> }
>
> and when I saw it, I said, ``Well, no wonder your program doesn't
> work; you can't treat an array like a filehandle.'' But then I tried
> it and it *did* work.
>
> So I wondered how I could have missed this feature in my extensive and
> dilligent perusal of the manual, and I went back to chack, and I
> couldn't find it in the manual this time either. I have the manual
> that came with 5.003_22, and the blue camel book, and I couldn't find
> it in either place.
>
> Yes, I know about while (<*.c>) ..., but this isn't like that either.
> It's something else.
>
> What I want to know is: *Is* this in the manual? If so, where is it?
>
>
> --
>
> mjd@pobox.com Mark-Jason Dominus
> mjd@plover.com Plover Systems, Philadelphia, PA
--
The Reader's Corner: Mystery, Romance, Fantasy
http://www.autopen.com/index.shtml
Subscribe to our free StoryBytes publication
New: Fashion Challenges for the Time Traveling Heroine http://www.autopen.com/romance.well.dressed.shtml
------------------------------
Date: 11 Apr 1997 21:12:43 GMT
From: lstein@logo (Lincoln Stein)
Subject: Re: CGI.pm and redirect
Message-Id: <5im9gb$mfe@senator-bedfellow.MIT.EDU>
In article <334D482B.7BF9@scott.net>, <ghouston@scott.net> wrote:
>When using the redirect function in CGI.pm, for example:
>
>use CGI;
>$query = new CGI;
>print $query->redirect( 'http://www.BhamOnline.com/' );
>
>Does it produce the 'Location:' or 'URI:' field in the HTTP header (or
>both)?
The easiest way to find out the answer to this kind of question is to
try it out yourself. E.g.
(logo:~/.rn) 11 % perl
use CGI;
$query = new CGI;
print $query->redirect( 'http://www.BhamOnline.com/' );
^D
Status: 302 Found
Uri: http://www.BhamOnline.com/
Location: http://www.BhamOnline.com/
Content-type: text/html
(logo:~/.rn) 11 %
>From this you can see that CGI.pm does indeed produce both header
fields.
Lincoln
------------------------------
Date: 11 Apr 1997 20:09:56 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: compiled pel5
Message-Id: <5im5qk$bf@fridge-nf0.shore.net>
DJ Morgan (dmorgan@nght.demon.co.uk) wrote:
: Hi All you Perl Guru's
Stop it. You're offending me. Not because I'm a guru and I feel touchy
about being called a guru, but because I'm not a guru and you're
discriminating against me. :-(
: I understand that you can compile perl scripts under unix so to save
: execution speed and to stop people reading the script. How ?
Dear Santa,
I'm feeling greedy this year. Please leave me everything you have, and
don't expect any milk or cookies.
Love,
Mr. Lumps
Seriously, your impression of the compiler is slightly incorrect. The
compiler can/will create an executable using your Perl code, but I don't
expect your programs to be very much faster, as the executable includes
a Perl interpreter. Your executables will be very large. Code hiding
is never an excuse to compile anything. If this is a CGI script, and
people are reading your source, either you have left ~ files around,
or your server is hideously broken.
On the other hand, if you wish the use the compiler, the included docu-
mentation is excellent, and you should be up and running in no time.
Get it here: http://www.perl.com/CPAN/modules/by-authors/Malcolm_Beattie/
and pick up: Compiler-a3.tar.gz.
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Fri, 11 Apr 1997 16:45:10 -0400
From: Scott Blanksteen <sib@worldnet.att.net>
Subject: Dynaloader error message
Message-Id: <334EA2D6.370B@worldnet.att.net>
Hi -
Some code I've written needs on a new system needs to load the
GDBM_File module (which has been built and installed, as has
libgdbm.a). I'm getting the following error message which does
not seem to be in the blue Camel book:
-----------------------------------
ads% perl -w Bets.pm
Can't load '/opt/lib/perl5/site_perl/i386-svr4/auto/GDBM_File/GDBM_Fil
e.so' for module GDBM_File: dynamic linker: perl: relocation error: sy
mbol not found: bcopy at /opt/lib/perl5/DynaLoader.pm line 140.
at /opt/lib/perl5/site_perl/GDBM_File.pm line 81
BEGIN failed--compilation aborted at Bets.pm line 16.
ads% cd /opt/lib/perl5/site_perl/i386-svr4/auto/GDBM_File/
ads% ll GDBM_File.so
-r-xr-xr-x 1 sys 50620 Apr 11 15:38 GDBM_File.so
-----------------------------------
Any idea on what I should tell the sys-admin? It's a UnixWare
2.1.1 system, running Perl 5.003.
Perl -V gives the following:
-----------------------------------
Summary of my perl5 (5.0 patchlevel 3 subversion 0) configuration:
Platform:
osname=svr4, osver=, archname=i386-svr4 uname='unix_sv sasquatch
4.2mp 2.1 i386 x86at '
hint=recommended, useposix=true, d_sigaction=define
Compiler:
cc='/bin/cc', optimize='-O', gccversion=
cppflags='-I/usr/include -I/usr/ucbinclude'
ccflags ='-I/usr/include -I/usr/ucbinclude'
stdchar='unsigned char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=0, d_casti32=define, d_castneg=define
intsize=4, alignbytes=4, usemymalloc=y, randbits=15
Linker and Libraries:
ld='/bin/cc', ldflags ='-L/usr/ccs/lib -L/usr/ucblib
-L/usr/local/lib -L/usr
/gnu/lib'
libpth=/usr/local/lib /usr/gnu/lib /lib /usr/lib /usr/ccs/lib
/usr/ucblib
libs=-lsocket -lnsl -ldbm -ldl -lld -lm -lc -lcrypt -lucb -lx
libc=/usr/ccs/lib/libc.so, so=so
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags=' '
cccdlflags='-Kpic', lddlflags='-G -L/usr/ccs/lib -L/usr/ucblib
-L/usr/local/
lib -L/usr/gnu/lib'
@INC: /opt/lib/perl5/i386-svr4/5.003 /opt/lib/perl5
/opt/lib/perl5/site_perl/i38
6-svr4 /opt/lib/perl5/site_perl .
-----------------------------------
Thanks!
Scott
------------------------------
Date: 11 Apr 1997 14:33:38 -0700
From: Russ Allbery <rra@stanford.edu>
To: Allen May <allenm@lexis-nexis.com>
Subject: Re: Help doing a FORK type process
Message-Id: <qum208hjlcd.fsf@cyclone.stanford.edu>
[ Posted and mailed. ]
Allen May <allenm@lexis-nexis.com> writes:
> Below is what I got so far.. It brings up the XTERM(c-shell) but how do
> I get the print statements to come up inside the new XTERM window?
You run the Perl script in the xterm, rather than trying to run the xterm
from the Perl script. Write a script to print out whatever you want to do
and then start it with:
xterm -e script.pl
(including whatever options you want to xterm, but -e must be the last
option on the line). See the man page for xterm for more details.
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: Fri, 11 Apr 1997 13:20:54 -0700
From: autopen@quake.net (Laurel Shimer)
Subject: Re: Help! Calling PERL from HTML...
Message-Id: <autopen-1104971320540001@l94.d22.quake.net>
I say take pity on the lad. In the beginning it's overwhelming.
Make sure your perl script allows outsiders to access it. Try 'chmod 755'.
This is everybody's most common mistake.
Now you can go and read all the vital documents.
Laurel
------------
In article <oaj5i5.ej.ln@localhost>, tadmc@flash.net (Tad McClellan) wrote:
> Pete Cion (pcion@vfi.com) wrote:
> : Hello!
>
> : I am testing a procedure where I call a PERL script from an HTML script,
> : and the PERL script is not executing.
>
> : My HTML program is basically as follows:
> ^^^^^^^^^^^^
>
>
> HTML is not programming.
>
> It is merely marked-up data for some _other_ program to process (browser).
>
>
> : <HTML>
> : <BODY>
> : <FORM ACTION="testperl.pl" METHOD="POST">
> : Name:<INPUT TYPE="text" NAME="realname">
> : Email:<INPUT TYPE="text" NAME="email">
> : <INPUT TYPE="submit" VALUE="Process Order">
> : </FORM>
> : </BODY>
> : </HTML>
>
> : It resides on a local directory: /users/pcion/web.
>
> : The file testperl.pl, residing on the same directory, merely writes
> ^^^^^^^^^^^^^^
>
> Most servers (which is what executes the CGI script) are configured
> for the scripts to be in a place separate from where the HTML
> documents are stored...
>
>
> : "Hello World" to a local output file.
>
> It should pump some HTML to STDOUT too, else the browser won't
> have anything to display.
>
>
> : I use netscape to open the HTML progam as a file, hit the "Process
> : Order" button, but the PERL script does not run, evidenced by the lack
> : of output file.
>
> : Could someone give me a hand as to what I am missing?
>
>
> You are missing an HTTP server, as well as missing a basic introduction
> to CGI programming in general. As this is the perl newsgroup, not the
> CGI newsgroup, CGI questions are appropriately asked in the CGI newsgroup:
>
> comp.infosystems.www.authoring.cgi
>
>
> The perl FAQ, part 9, has several URLs to check for an intro to
> CGI scripting:
>
> -------------------------------
> =head2 My CGI script runs from the command line but not the browser.
Can you help me fix it?
>
> Sure, but you probably can't afford our contracting rates :-)
>
> Seriously, if you can demonstrate that you've read the following FAQs
> and that your problem isn't something simple that can be easily
> answered, you'll probably receive a courteous and useful reply to your
> question if you post it on comp.infosystems.www.authoring.cgi (if it's
> something to do with HTTP, HTML, or the CGI protocols). Questions that
> appear to be Perl questions but are really CGI ones that are posted to
> comp.lang.perl.misc may not be so well received.
>
> The useful FAQs are:
>
> http://www.perl.com/perl/faq/idiots-guide.html
> http://www3.pair.com/webthing/docs/cgi/faqs/cgifaq.shtml
> http://www.perl.com/perl/faq/perl-cgi-faq.html
> http://www-genome.wi.mit.edu/WWW/faqs/www-security-faq.html
> http://www.boutell.com/faq/
> -------------------------------
>
>
> --
> Tad McClellan SGML Consulting
> Tag And Document Consulting Perl programming
> tadmc@flash.net
--
The Reader's Corner: Mystery, Romance, Fantasy
http://www.autopen.com/index.shtml
Subscribe to our free StoryBytes publication
New: Fashion Challenges for the Time Traveling Heroine http://www.autopen.com/romance.well.dressed.shtml
------------------------------
Date: 11 Apr 1997 14:02:09 -0700
From: Russ Allbery <rra@stanford.edu>
To: sgiovann@mail.prog.arch.unige.it (Sergio Giovannini)
Subject: Re: How to access shadowed passwords?
Message-Id: <qumn2r5jmst.fsf@cyclone.stanford.edu>
[ Posted and mailed. ]
Sergio Giovannini <sgiovann@mail.prog.arch.unige.it> writes:
> I am goint to write a mail gateway for our server at my university,
> but before all I would like to know how to access to the shadowed
> passwords (located in /etc/shadow instead of /etc/passwd).
You're not supposed to have access to the shadow passwords unless you're
root (that's the entire point of them). If you are root, just open
/etc/shadow and read it like a normal file.
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: 11 Apr 1997 20:22:53 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Image redirect problem
Message-Id: <5im6it$1uk@fridge-nf0.shore.net>
Rich (scrich@cris.com) wrote:
: I have written a script that displays rotating image files but I have
: one problem with it. If the image is animated, for some reason which I
: can't figure out, the image will display the animated loop once and
[snip]
Be careful with that weapon, junior! By taking a shot in the dark,
you might accidentally shoot someone. :-) In other words, I presume
this is a CGI question which doesn't belong here.
Follow-ups set.
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: 11 Apr 1997 14:18:58 -0700
From: Russ Allbery <rra@stanford.edu>
To: brye@acronet.net (Kent Brye)
Subject: Re: In-line GIF extraction
Message-Id: <qumafn5jm0t.fsf@cyclone.stanford.edu>
[ Posted and mailed. ]
This is not a Perl question. It's a general question about HTML, really,
but would certainly be more at home in any of the WWW newsgroups than it
is here. Please try to only post Perl questions to comp.lang.perl.misc.
Kent Brye <brye@acronet.net> writes:
> I've inherited a Perl script that is run by CRON to go out to a web site
> and pull in a GIF. The page at the server end I believe changed to use
> an inline gif. What are the steps I should take in order to put this
> inline gif into a file, where we then use it on our site?
It doesn't matter if it's inline or not. Either way, the GIF has to have
its own URL due to the way HTML works. If you've already got a Perl
script set up to fetch a GIF from a given URL from cron, just look at the
source of the remote page, find out where they put the GIF, and change the
URL.
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: 11 Apr 1997 14:26:39 -0700
From: Russ Allbery <rra@stanford.edu>
To: prentner@monaco.kapsch.co.at (Wolfgang Prentner)
Subject: Re: linux/socket calls
Message-Id: <qum67xtjlo0.fsf@cyclone.stanford.edu>
[ Posted and mailed. ]
Wolfgang Prentner <prentner@monaco.kapsch.co.at> writes:
> If written my first perl script a couple of days ago! Now, I am testing
> or try to understand the perl socket calls.
> Unfortunaley, the communications examples don't work on my Linux box
> :-(!
That's because you're using horribly obsolete socket code, which is
probably because...
> Could someone please clearify some steps in the following example (Book:
> Perl 5 by Example)
...you're referring to a fairly poor book. I'd highly recommend reading
man perlipc and following those examples instead, and then reading perldoc
Socket. You may also want to look for a better book; I would recommend
the second edition of Programming Perl (the Camel).
> 1. I got the following error msg.
> Global symbol "packFormat" requires explicit package name at 18lst02.pl line 24.
> Variable "$packFormat" is not imported at 18lst02.pl line 27.
> Global symbol "packFormat" requires explicit package name at 18lst02.pl line 27.
> Execution of 18lst02.pl aborted due to compilation errors.
You're running under use strict. If you do that, you need to predeclare
your variables in one way or another, either with "my" or "use vars".
> 2. No knowledge about the line of
> code ('S n a4 x8' ???)!
> $packFormat = 'S n a4 x8'; # Windows 95, SunOs 4.1+
> #$packFormat = 'S n c4 x8'; # SunOs 5.4+ (Solaris 2)
You don't have to worry about this any more. The Socket module takes care
of it for you. Rather than doing a pack, all you have to do now is call
sockaddr_in, which is part of the Socket module.
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: 11 Apr 1997 19:11:00 GMT
From: brdavis@orion.ac.hmc.edu (Brooks Davis)
Subject: Re: Name of SUID'ed perl script on Solaris?
Message-Id: <5im2c4$e10$1@cinenews.claremont.edu>
Brian Wheeler (bdwheele@indiana.edu) wrote:
:
: I'm writing a script on solaris that needs to be suid. since I symlink it
: with different names, I need to know what name I'm being called as. I'm
: getting back "/dev/fd/4" in $0 which I assume is solaris' implementation of
: secure suid scripts. Is there a way I can get the real program name?
I asked this a while ago and Bennett Todd <bet@onyx.interactive.net> wrote
a great response. Check it out by searching www.DejaNews.com for:
"$0 has strange value with setgid script"
It's not in the "Current" database, but if you search the "Old" database
from the page you get when the inital query fails.
--
Brooks Davis +------------------------------------------------+
brdavis@hmc.edu | "_Slackware_ [Linux] is the MacOS of UNIXes." |
Harvey Mudd College | -- Richard Garnish |
340 E. Foothill Blvd. | on alt.sysadmin.recovery |
Claremont, CA 91711 +------------------------------------------------+
------------------------------
Date: 11 Apr 1997 13:59:47 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: New Microsoft Perl Product (fwd)
Message-Id: <qumpvw1jmws.fsf@cyclone.stanford.edu>
Since we're discussing issues of style....
Matthew Cravit <mcravit@best.com> writes:
> I would probably write it as:
> $arg = "-n" unless ($arg eq "-n");
Generally, though, the assignment isn't the common case. The ideal in my
mind is to put what the statement *normally* does first. So I'd write it
as:
unless ($arg eq '-n') { $arg = '-n' }
(unless, of course, the assignment is the common case, in which case I'd
use your phrasing.)
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: 11 Apr 1997 14:26:47 -0600
From: tpoindex@nyx.cs.du.edu (Tom Poindexter)
Subject: Re: Ousterhout and Tcl lost the plot with latest paper
Message-Id: <5im6q7$gua@nyx.cs.du.edu>
In article <5ilt3e$n1m$1@csnews.cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
>
>In comp.lang.perl.misc,
> rv@erix.ericsson.se (Robert Virding) writes:
>:A final question which has long interested me and which seems relevant
>:to this whole discussion: who would use Tcl if it DIDN'T have such a
>:integrated interface to Tk?
>
>The people using it for expect.
Actually, quite a few folks use Tcl without Tk for a variety of tasks - CGI,
sysadmin, database monitoring, software testing, space flight control
software, factory control automation, to name a few. Take a look at papers
from the past Tcl Workshops, or try searching around the web.
However, I'd speculate that Tcl gets used very little for any purpose
at the perl.com domain :)
--
Tom Poindexter
tpoindex@nyx.net
http://www.nyx.net/~tpoindex/
------------------------------
Date: Fri, 11 Apr 1997 21:21:27 GMT
From: systech@polarnet.com (Ken Irving)
Subject: Re: parsing a line w/ quoted strings (newbie)
Message-Id: <4b7cd$c151b.373@PolarNet>
Well, here's my brute force solution, good enough for now.
while($iargs = <>) {
print"$iargs\n";
while($iargs =~ s/("\S*)( )(.*")/\1\222\3/) {}; # subst quoted spaces
foreach $a (split / /, $iargs) { # construct %idefs hash
if ((($t,$v) = split("=", $a))>1) { # found an embedded =
$v =~ tr/\222/ /; # replace \222 w/ spaces
$v =~ tr/"//d; # delete dbl quote marks
$idefs{$t} = $v;
}
}
foreach $key (keys %idefs) {print "$key => $idefs{$key}\n"};
}
--
Ken
>
>I'd like to parse an input line
> tag1=value1 tag2="a quoted string" tag3=value3
>
>into the hash
> tag1 => value1
> tag2 => a quoted string
> tag3 => value3
>
>One way would be to replace whitespace between quotes with a special
>value, delete the quotes, split on whitespace, then split on "=",
>and finally restore the special value to whitespace. Is there an
>easier way? Thanks.
>
>--
>Ken Irving
>systech@polarnet.com
>
------------------------------
Date: 11 Apr 1997 20:48:12 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl and MSDOS
Message-Id: <5im82c$ebr$2@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Piet van Oostrum
<piet@cs.ruu.nl>],
who wrote in article <wzlo6tyblw.fsf@kemmel.cs.ruu.nl>:
> SAC> hex edited the perl.exe so that where it said f:/bin/sh.exe it
> SAC> now says c:4dos.com (shareware DOS command interpreter) so that
> SAC> the exe will spawn a subshell nicely.
Do not do it. While this may create an impression that things work,
they do not. Globbing will not work, as well as most of pipelines and
commands. Try
system "perl -le 'print 567'" and die;
> sh.exe will also do this, and there may be some cases where it it more up
> to perls expectations than 4dos.com.
This is exactly why I do not allow the shell-name customization via
environment, only the shell directory.
Ilya
------------------------------
Date: 11 Apr 1997 13:53:16 -0700
From: Russ Allbery <rra@stanford.edu>
To: Jeremy Hansen <jeremy@xxedgexx.com>
Subject: Re: Perl Syslog Problem
Message-Id: <qumu3ldjn7n.fsf@cyclone.stanford.edu>
[ Posted and mailed. ]
Jeremy Hansen <jeremy@xxedgexx.com> writes:
> Now here's the error I receive when executing this program.
> Undefined subroutine &Sys::Syslog::hostname called at
> /usr/lib/perl5/Sys/Syslog.pm line 92.
> BEGIN failed--compilation aborted at ./ser2.pl line 11.
Just delete line 92 of /usr/lib/perl5/Sys/Syslog.pm. Yes, really. It
isn't necessary.
This is a known bug which has been fixed in 5.004beta.
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: Fri, 11 Apr 1997 13:41:56 -0700
From: autopen@quake.net (Laurel Shimer)
Subject: Re: PERL Training Course
Message-Id: <autopen-1104971341560001@l94.d22.quake.net>
Also if you have University Extension courses nearby, check them out. I've
taken 3 different perl classes through UC Berkley extension. (You still
have to apply what you learn on your own however. And I was glad I had
spent time fighting through perl on my own, with the books and with the
help of this newsgroup first.)
Laurel
-------------
In article <3346AE61.562C@randysoft.com>, randy@randysoft.com wrote:
> I am assuming that you are looking for a professional training course in
> perl. Please take a look at my web site http://www.randysoft.com
>
> I produce professional, interactive web based training courses in
> computer programming. You can take the demo versions of the course at my
> web site.
>
> My training allows you to take a lesson and write code and submit the
> code to the server for interpretation. The results are returned to you.
> Therefore, the person taking the training does not have to have a
> development environment nor perl on their system. You will see how this
> works if you take the demo course in perl.
>
> This is being used by Hewlett-Packard and Lucent Technologies for their
> internal training. It has been very successful and they are requesting
> more of this type training from me on other topics.
>
> Randy Hootman
--
The Reader's Corner: Mystery, Romance, Fantasy
http://www.autopen.com/index.shtml
Subscribe to our free StoryBytes publication
New: Fashion Challenges for the Time Traveling Heroine http://www.autopen.com/romance.well.dressed.shtml
------------------------------
Date: 11 Apr 1997 20:49:45 GMT
From: karrer@ife.ee.ethz.ch (Andreas Karrer)
Subject: Re: perl- equivalent to set -x
Message-Id: <slrn5kt8vd.1ki.karrer@kuru.ee.ethz.ch>
In article <199704101532.PAA10156@castor.cmc.ec.gc.ca>, Howard Salomon wrote:
>Operationally we run mostly in batch mode, in our shell scripts we use
>set -x to echo back to a file each command line, is there something in
>perl that does the same?
Not exactly the same as -x, but: the trace option of the debugger
might help you. Use:
% perl -d yourscript params ...
DB<1> t
Trace = on
DB<1> c
...
- Andi
------------------------------
Date: 11 Apr 1997 20:59:15 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: perl- equivalent to set -x
Message-Id: <5im8n3$ebr$3@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Howard Salomon
<Howard.Salomon@ec.gc.ca>],
who wrote in article <199704101532.PAA10156@castor.cmc.ec.gc.ca>:
> Operationally we run mostly in batch mode, in our shell scripts we use
> set -x to echo back to a file each command line, is there something in
> perl that does the same?
RTF-perldebug. Specifically, pay attension to t command.
Ilya
------------------------------
Date: 11 Apr 1997 20:40:15 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl5 sin function has dain bramage ?!?!?!?!?
Message-Id: <5im7jf$ebr$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Allen Windhorn
<aewindhorn@re.ra.rockwell.com>],
who wrote in article <u912pv8x6.fsf@re.ra.rockwell.com>:
> "David J. Topper" <topper@panix.com> writes:
>
> > and my output is:
> >
> > sin(6.28318530717959) = -2.44929359829471e-16
> > sin(360) = 0.958915723414307
> >
>
> My calculator gives sin(2*pi) = 4.1352e-13, so not only is it the
> wrong value, it's the wrong sign! :-)
This is very wrong. PARI says:
? \precision=200
precision = 200 significant digits
? sin(6.28318530717959)
%1 = 3.5230747132334409942316056611939616885843187948418177896379691513441785975588087821902064759962540572499385206294436872030553708788028498344382654648114871563946185914738518372375606502622204971730289 E-15
I get the same results on Solaris as the above one, this means that
the roundoff error is 4e-15, this looks pretty big... What does IEEE
say about it? Note that this is decimal->binary conversion + sin()-error.
Ilya
------------------------------
Date: 11 Apr 1997 14:14:35 -0700
From: Russ Allbery <rra@stanford.edu>
To: asched1@medtronic.COM (Dan Ascheman)
Subject: Re: Porting Perl to C (Help with)
Message-Id: <qumenchjm84.fsf@cyclone.stanford.edu>
[ Posted and mailed. ]
Dan Ascheman <asched1@medtronic.COM> writes:
> I have a question concering a Perl to C conversion...I have been told
> that the only thing that will do a conversion from Perl to C code is the
> Perl Alpha compiler....Is that true?
The only thing that will do a conversion from Perl to C is the human
brain. The compiler can generate C code for *some* constructs, but the
"Alpha" in "Perl Alpha compiler" should be strongly emphasized. It's
alpha in the sense that it doesn't work very well yet.
> I am running SunOS and OS/2 - Is one better than the other for what I
> want to do?
Almost certainly SunOS, since you won't have to deal with non-Unix
compilers and strangeness. But you're going to have a lot of trouble
doing automated conversion of Perl to C regardless of where you try to do
it at.
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: Fri, 11 Apr 1997 13:22:30 -0700
From: autopen@quake.net (Laurel Shimer)
Subject: Re: problem with file handling in perl
Message-Id: <autopen-1104971322300001@l94.d22.quake.net>
And make sure you set your file protections correctly on your perl script.
I use 'chmod 755'.
Laurel Shimer
In article <Pine.GSO.3.96.970405045919.2974F-100000@kelly.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
> On 4 Apr 1997, Alestair B. Niere wrote:
>
> > I am studying perl for a week now.
> > I made this simple CGI script but once this script is executed by
> > clicking the submit button, Netscape generates an error.
>
> When you're having trouble with a CGI form in Perl, you should first look
> at the please-don't-be-offended-by-the-name Idiot's Guide to solving such
> problems. It's available on the perl.com web pages. Hope this helps!
>
> http://www.perl.com/perl/
> http://www.perl.com/perl/faq/
> http://www.perl.com/perl/faq/idiots-guide.html
>
> -- Tom Phoenix http://www.teleport.com/~rootbeer/
> rootbeer@teleport.com PGP Skribu al mi per Esperanto!
> Randal Schwartz Case: http://www.lightlink.com/fors/
--
The Reader's Corner: Mystery, Romance, Fantasy
http://www.autopen.com/index.shtml
Subscribe to our free StoryBytes publication
New: Fashion Challenges for the Time Traveling Heroine http://www.autopen.com/romance.well.dressed.shtml
------------------------------
Date: Fri, 11 Apr 1997 21:44:49 GMT
From: tgy@chocobo.org (Tim Gim Yee)
Subject: Re: repeat pattern in one line
Message-Id: <334eadde.15433121@news.seanet.com>
On 11 Apr 1997 13:41:35 GMT, Mr. Chow Wing Siu
<wschow@Comp.HKBU.Edu.HK> wrote:
>For example, if I want to match the pattern ABCDEF in the following file,
>how to count the frequency?
You start by reading the FAQ. It will give you this code as an
example:
$string = "-9 55 48 -2 23 -76 4 14 -44";
while ($string =~ /-\d+/g) { $count++ }
print "There are $count negative numbers in the string";
>ANS:6 Please mail the source to me.
Please read the newsgroup.
>Thanks.
Uh huh. <-- my Tad imitation :)
-- Tim Gim Yee tgy@chocobo.org
http://www.dragonfire.net/~tgy/moogle.html
"Will hack perl for a moogle stuffy, kupo!"
------------------------------
Date: 11 Apr 1997 20:08:04 GMT
From: "Bill House" <bhouse@dazsi.com>
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <01bc46b2$8dd068a0$03d3c9d0@wjh_dell_133.dazsi.com>
Andreas Eder <are@laphroig.mch.sni.de> wrote in article
<m37miangj6.fsf@laphroig.mch.sni.de>...
>
> And what about all those not so intelligent shoppers ?
> Majority rules, you know.
>
Which is why it ought to be important that good technology gets some kind
of market awareness, even if it's word of mouth. Unfortunately, the world
is still mostly divided into incompatible platforms, so a technology can be
20 years old in one place and yet-to-be commercialized for the first time
in another.
Of course, the Web and related technologies are lessening that
fracturization. We'll probably see a lot more competitive evolution in
languages as time goes on. Browser-based delivery of language-execution
engines should not remain Java-specific, but should allow many languages to
serve specialized domains on a common, cross-platform environment.
Bill House
--
bhouse@dazsi.com
http://www.dazsi.com
------------------------------
Date: Fri, 11 Apr 1997 21:47:29 +0100
From: cyber_surfer@gubbish.wildcard.demon.co.uk (Cyber Surfer)
Subject: Re: Reply to Ousterhout's reply (was Re: Ousterhout and Tcl ...)
Message-Id: <MPG.db89beacd15c997989760@news.demon.co.uk>
With a mighty <334E4F18.AF8@not4u.polaroid.com>,
prasadm@not4u.polaroid.com uttered these wise words...
> C++ people are by and large not familiar with Lisp.
> If there were comments on Lisp, it had to be people
> familiar with it, the c++ newsgroups being involved
> only because the original trollers posted to clc++
> in hopes of attracting converts.
This is what you'd expect. Sadly, it was not the case. I've seen
people familiar with Lisp malign it, and I've seen people attempt to
the same thing, who neither knew anything, nor cared to know anything
about Lisp. They also appeared to be equally ignorant of basic CS, but
perhaps that means nothing.
You're probably right about the trolling, tho. It's an excellent way
to spread memes. Very messy, and sure to be _noticed_. Unfortunately
for the trollers, the Lisp people knew loads of CS, knew where to find
online CS papers and software, and how to put together arguments of
beautiful clearity and patience.
A few of them even had a Zen-like quality to them. If only it could
always be so simple. ;)
--
<URL:http://www.wildcard.demon.co.uk/> You can never browse enough
Martin Rodgers | Programmer and Information Broker | London, UK
Please note the "gubbish" in my email address.
------------------------------
Date: Fri, 11 Apr 1997 14:12:27 -0700
From: autopen@quake.net (Laurel Shimer)
Subject: Re: Splitting Hairs, or strings, rather
Message-Id: <autopen-1104971412270001@l94.d22.quake.net>
Been trying to figure out how to do Joshua's 'break a string into chunks
of 100' and so far having no luck.
I mucked around with the 'limit' part of split. And I keep getting '10'
returned (pretending I want strings of length 10 'cause it's easier to
check) instead of the substring.
Then just thinking logically and not keying in on the word 'split', I
thought about the concept of breaking apart a a string into substrings. In
the camel book index- 'substring' refers me to 'backreference strings'.
Pursued this through the index...The term 'backreference' has me a little
confused right now. Probably because I have to go to the dentist and am
trying to figure this out fast. I'll take the book w/ me!
But am I on the right track with this?
Thanks for the good homework problem, Joshua.
Laurel
--------
In article <3346dc89.16327060@news.inreach.com>, jkugler@inreach.com
(Joshua J. Kugler) wrote:
> Hi. I am looking for some efficient code to split strings in to 100
> character sub strings. I was given some, and have been concocting
> some of my own, but I have gotten only garbled output. I would like
> to be able to give the code snippet a string and have it return an
> array, like so:
>
> @arr = &splitter($var)
>
> Any help would be great.
>
> Oh, and if post to the news group, please respond via e-mail as well,
> because my ISP's news server is behaving rather weirdly.
>
> Thanks!
>
> j----- k-----
>
> Joshua J. Kugler
> Computer Consultant--Web Developer
> jkugler@inreach.com
--
The Reader's Corner: Mystery, Romance, Fantasy
http://www.autopen.com/index.shtml
Subscribe to our free StoryBytes publication
New: Fashion Challenges for the Time Traveling Heroine http://www.autopen.com/romance.well.dressed.shtml
------------------------------
Date: 11 Apr 1997 21:15:27 +0200
From: Tuomo Takkula <tuomo@cs.chalmers.se>
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <sfj208h5q28.fsf@muppet17.cs.chalmers.se>
"Tim Behrendsen" <tim@a-sis.com> writes:
> But I don't even need to go there. Name one freely available
> *significant* product that is *clearly* better than *any* commercial
> product, regardless of price. There are some good programs of limited
> size that are not worth a commercial entity rewriting (some may
> say Emacs, but I wouldn't...), but I mean products of significant
> size and complexity.
What about ghostscript/ghostview/ppmtools? Dealing with Adobe
Postscript better than Adobe (and any other commercial company)
and heaviliy used in virtually any university/company running Unix,
perhaps TeX, and having a Postscript printer? Writing a reliable
Postscript interpreter/viewer is surely no afternoon task.
My two Vre.
Tuomo
------------------------------
Date: 11 Apr 1997 19:26:18 GMT
From: olmstj@phat-media.com (jason olmsted)
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <5im38q$njn$3@news8.gte.net>
On 11 Apr 1997 14:05:00 GMT, heller@nacs.net (Jettero Heller) wrote:
>Justin Hickey (jhickey@hpcc.nectec.or.th) wrote:
>: Tim Behrendsen wrote:
>: >
>: > But I don't even need to go there. Name one freely available
>: > *significant* product that is *clearly* better than *any* commercial
>: > product, regardless of price. There are some good programs of limited
>: > size that are not worth a commercial entity rewriting (some may
>: > say Emacs, but I wouldn't...), but I mean products of significant
>: > size and complexity.
>:
>: How about X Windows? It has been accepted by all UNIX vendors as their
>: windowing system (nothing else has challenged it that I know of ie I'm
>: talking strictly UNIX here), and I may be wrong and feel free to correct
>: me, but I do believe that it is free software. And it certainly is
>: significant in size and complexity IMHO.
>
>And now to prove that it is better than it's "commercial" counter
>part (ie. all other GUIs). I know of one program that tries to
>emulate the look of the Win95 GUI on X windows, and of at least a
>half a dozen X servers that run on 95/NT (I'm not sure about MacOS,
>but I bet there's a number of them out there).
>
Thinking of fvwm95?
I now live outside university and would prefer to use the fvwm type
shell instead of this win 95 stuff (a wee bit expensive too maintain
decent unix workstations individually - don't mention linux as I need
to run peripheral equipment that don't have linux device drivers).
Why somebody would take a useful thing and emulate MS is beyond me,
though I guess Netscape is doing it too with Communicator.
jason olmsted
olmstj@phat-media.com
http://www.phat-media.com/olm
------------------------------
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 282
*************************************