[11494] in Perl-Users-Digest
Perl-Users Digest, Issue: 5094 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 9 11:07:28 1999
Date: Tue, 9 Mar 99 08:00:19 -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 Tue, 9 Mar 1999 Volume: 8 Number: 5094
Today's topics:
[ANNOUNCE] Chart::ThreeD::Pie 0.01 (Fabien Tassin)
Re: About Numerical Analysis with perl (Randy Kobes)
Announc: Generic Virtual Machine module sabren@manifestation.com
ANNOUNCE: lntree - Link files in directory trees (Johan Vromans)
Announce: PDF 1.09 antro@my-dejanews.com
ANNOUNCE: PostScript::Font -- tools for PostScript font (Johan Vromans)
ANNOUNCE: Text::Filter - base class to read and write t (Johan Vromans)
FAQ 3.13: How can I use X or Tk with Perl? <perlfaq-suggestions@perl.com>
Re: flock / sysopen / open confusion (Bill Moseley)
Gtk::Dialog alpha 2 <ac212@debian.org>
Re: help (Jonathan Stowe)
HTML::Subtext 1.03 (first public release) <kaelin@himalia.talarian.com>
Re: Illiad!!!!!! (Randal L. Schwartz)
lower/upper case conversion (Dennis M. Hancy)
Re: lower/upper case conversion (Steve Linberg)
Re: lower/upper case conversion (Jonathan Stowe)
Re: Nonscalar Array Access? (Tad McClellan)
Re: q// vs. '' (Tad McClellan)
Referencing arrays with contents of scalars? <Atro$Tossavainen@iki.ll-spam!fi>
Running c-shell commands in perl <John_o_Sullivan@hotmail.com>
Re: Running c-shell commands in perl <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: y2k and 4-digit dates (was Re: foreach and while) (Abigail)
Re: y2k and 4-digit dates (was Re: foreach and while) (Abigail)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 9 Mar 1999 15:58:17 GMT
From: fta@oleane.net (Fabien Tassin)
Subject: [ANNOUNCE] Chart::ThreeD::Pie 0.01
Message-Id: <7c3gep$4c9$1@play.inetarena.com>
I am pleased to announce the first public release of my 3D piechart module.
The current source code may be obtained from CPAN or directly from my
ftp site :
ftp://ftp.oleane.net/private/fta/perl/cpan/
For the module list :
Name DSLI Description Info
----------- ---- -------------------------------------------- -----
Chart::ThreeD::
::Pie bdpO 3D piecharts FTASSIN
Comments, suggestions and bug reports are welcome.
--
Fabien Tassin -+- fta@oleane.net
------------------------------
Date: 9 Mar 1999 15:39:47 GMT
From: randy@theory.uwinnipeg.ca (Randy Kobes)
Subject: Re: About Numerical Analysis with perl
Message-Id: <slrn7eagp7.km1.randy@theory.uwinnipeg.ca>
On Tue, 09 Mar 1999 16:42:25 +0900,
Koh Yeonseok <ysko@charly.kjist.ac.kr> wrote:
>
>I am going to solve some mathmatical problems with perl.
>There are some perl modules on numerical analysis but I could not find
>out the Gamma and Bessel functions.
Hi,
You could check out the PDL module (http://pdl.perl.org/),
which has support for Bessel functions and for the (log of
the) gamma function. Alternatively, the Math::Pari module supports
the gamma function and the (half integral) Bessel function J_{n+1/2}.
Finally, the Math::ematica module provides an interface to
Mathematica, if you have that.
--
Best regards,
Randy Kobes
Physics Department Phone: (204) 786-9399
University of Winnipeg Fax: (204) 774-4134
Winnipeg, Manitoba R3B 2E9 e-mail: randy@theory.uwinnipeg.ca
Canada http://theory.uwinnipeg.ca/
------------------------------
Date: 9 Mar 1999 15:57:20 GMT
From: sabren@manifestation.com
Subject: Announc: Generic Virtual Machine module
Message-Id: <7c3gd0$496$1@play.inetarena.com>
I am pleased to announce the initial (pre-pre-beta) version of GVM.pm, the
Generic Virtual Machine. The GVM lets you build and play with virtual
machines. It's very early pre-beta software at the moment. I want to mold it
into a useful tool for evolutionary programming. It's not there yet. But you
can still play. :)
WEB: http://www.sabren.com/code/gvm/
FTP: ftp://ftp.sabren.com/code/gvm/
Thanks,
Michal Wallace
sabren@manifestation.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 9 Mar 1999 15:56:03 GMT
From: JVromans@Squirrel.nl (Johan Vromans)
Subject: ANNOUNCE: lntree - Link files in directory trees
Message-Id: <7c3gaj$48p$1@play.inetarena.com>
'lntree old-dir new-dir' recursively examines all files in the two
source trees and link the files that are equal. To be precise: if two
files are equal (same size, same contents), the one in directory
new-dir is replaced by a link to the file in old-dir.
This results in cleaner source trees, and a substantial saving of disk
space, for example when multiple versions of the same source tree need
to be kept on-line.
Availability:
(web-page) http://www.squirrel.nl/people/jvromans/software.html
(download) http://www.perl.com/CPAN/authors/id/JV
Archive: lntree-1.9.tar.gz (or higher version)
----------------------------------------------------------------------------
Johan Vromans jvromans@squirrel.nl
Squirrel Consultancy Haarlem, the Netherlands
http://www.squirrel.nl http://www.squirrel.nl/people/jvromans
PGP Key 2048/4783B14D http://www.squirrel.nl/people/jvromans/pgpkey.html
----------------------- "Arms are made for hugging" ------------------------
------------------------------
Date: 9 Mar 1999 15:57:56 GMT
From: antro@my-dejanews.com
Subject: Announce: PDF 1.09
Message-Id: <7c3ge4$4bv$1@play.inetarena.com>
New Release: 1.09
Name DSLI Description Info
----------- ---- -------------------------------------------- -----
PDF bdpO Access information in a PDF file ANTRO
The PDF library is a proposed library for access the information
contained inside a PDF file. PDF stands for Portable Document Format and is
a standard proposed by Adobe ( See http://www.adobe.com/ for more details ) .
Install "as usual" with:
perl Makefile.PL
make
make install
Then, you can try the scripts in the example directory that tests
if a file is a PDF ( not looking at the .pdf extension :-), the PDF
version used to write them, their number of pages and the various
Info ( Author, Creation date, Crypting, etc. ).
PREREQUISITES:
A Perl distribution :-)
NEWS:
Added support for crypted PDF. The library can now check
if the parsed PDF has some kind of crypting.
I've also tested the library with the new PDF version ( 1.3 )
and it works correctly.
AVAILABILITY:
The library is available at
<http://www.geocities.com/CapeCanaveral/Hangar/4794/>
and at all CPAN mirror
Enjoy
Antonio "Antro" Rosella
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 9 Mar 1999 15:56:23 GMT
From: JVromans@Squirrel.nl (Johan Vromans)
Subject: ANNOUNCE: PostScript::Font -- tools for PostScript fonts
Message-Id: <7c3gb7$48u$1@play.inetarena.com>
This package contains a couple of modules to get information from
PostScript fonts and associated metrics files. Also included is a
program to make font samples, and programs to handle the conversion of
PostScript fonts from binary (.pfb) format to ASCII (.pfa) format, and
vice versa.
Modules:
PostScript::Font - get information from a PostScript font file
Information includes the font name, font
family name, but also encoding vector and list
of glyphs.
Font types 1 and 42 are supported; types 2, 3
and 5 are usually handled as well.
PostScript::FontMetrics - get information from Adobe Font Metrics file
Information includes the font name, font
family name, encoding vector, width and
kerning tables.
PostScript::FontInfo - get information from Windows .INF files
Information includes the font name, font
family name and PC filename prefix.
Programs:
fontsampler - makes detailed or concise sample pages of fonts
In detailed mode, one or more pages are
produced to show all the glyphs of the font.
Otherwise, just a sample of the font is
printed, allowing for 40 or more font samples
per page.
The output is compliant with Adobe's Document
Structuring Conventions version 3.0.
font2pfa - decodes a font file to ASCII (.pfa) format
font2pfb - encodes a font file to binary (.pfb) format
Availability:
(web-page) http://www.squirrel.nl/people/jvromans/software.html
(download) http://www.perl.com/CPAN/authors/id/JV
Archive: PostScript-Font-1.0.tar.gz (or higher version)
----------------------------------------------------------------------------
Johan Vromans jvromans@squirrel.nl
Squirrel Consultancy Haarlem, the Netherlands
http://www.squirrel.nl http://www.squirrel.nl/people/jvromans
PGP Key 2048/4783B14D http://www.squirrel.nl/people/jvromans/pgpkey.html
----------------------- "Arms are made for hugging" ------------------------
------- End of forwarded message -------
------------------------------
Date: 9 Mar 1999 15:56:15 GMT
From: JVromans@Squirrel.nl (Johan Vromans)
Subject: ANNOUNCE: Text::Filter - base class to read and write text lines
Message-Id: <7c3gav$48t$1@play.inetarena.com>
INTRODUCTION
A plethora of tools exist that operate as filters: they get data from
a source, operate on this data, and write possibly modified data to a
destination. In the Unix world, these tools can be chained using a
technique called pipelining, where the output of one filter is
connected to the input of another filter. Some non-Unix worlds are
reported to have similar provisions.
To create Perl modules for filter functionality seems trivial at
first. Just open the input file, read and process it, and write output
to a destination file. But for really reusable modules this approach
is too simple. A reusable module should not read and write files
itself, but rely on the calling program to provide input as well as to
handle the output.
Text::Filter is a base class for modules that have in common that they
process text lines by reading from some source (usually a file),
manipulating the contents and writing something back to some
destination (usually some other file).
This module should be used by deriving modules from it. See the
documentation for an extensive example.
FEATURES
Every module that derives from Text::Filter inherits the following
instance methods:
* readline ()
Returns the next line from the input stream, or undef if there is
no more input.
* writeline ($line)
Adds $line to the output stream.
* pushback ($line)
Pushes a line of text back to the input stream.
When creating a new instance of this module, the input and output (or
only one of them) must be specified.
For input, this can be:
* A scalar, containing a file name. The named file will be opened,
input lines will be read using <>.
* A file handle (glob). Lines will be read using <>.
* An instance of class IO::File. Lines will be read using <>.
* A reference to an array. Input lines will be shift()ed from the
array.
* A reference to an anonymous subroutine. This routine will be called
to get the next line of data.
For output:
* A scalar, containing a file name. The named file will be created
automatically, output lines will be written using print().
* A file handle (glob). Lines will be written using print().
* An instance of class IO::File. Lines will be written using print().
* A reference to an array. Output lines will be push()ed into the
array.
* A reference to an anonymous subroutine. This routine will be called
to append a line of text to the destination.
Additional attributes can be used to specify actions to be performed
after the data is fetched, or prior to being written. For example, to
strip line endings upon input, and add them upon output.
AVAILABILITY
(web-page) http://www.squirrel.nl/people/jvromans/software.html
(download) http://www.perl.com/CPAN/authors/id/JV
Archive: Text-Filter-1.5.tar.gz (or higher version)
----------------------------------------------------------------------------
Johan Vromans jvromans@squirrel.nl
Squirrel Consultancy Haarlem, the Netherlands
http://www.squirrel.nl http://www.squirrel.nl/people/jvromans
PGP Key 2048/4783B14D http://www.squirrel.nl/people/jvromans/pgpkey.html
----------------------- "Arms are made for hugging" ------------------------
------- End of forwarded message -------
------------------------------
Date: 9 Mar 1999 08:14:59 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 3.13: How can I use X or Tk with Perl?
Message-Id: <36e53af3@csnews>
(This excerpt from perlfaq3 - Programming Tools
($Revision: 1.33 $, $Date: 1998/12/29 20:12:12 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq3.html
if your negligent system adminstrator has been remiss in his duties.)
How can I use X or Tk with Perl?
Tk is a completely Perl-based, object-oriented interface to the
Tk toolkit that doesn't force you to use Tcl just to get at Tk.
Sx is an interface to the Athena Widget set. Both are available
from CPAN. See the directory http://www.perl.com/CPAN/modules/by-
category/08_User_Interfaces/
Invaluable for Perl/Tk programming are: the Perl/Tk FAQ at
http://w4.lns.cornell.edu/~pvhp/ptk/ptkTOC.html , the Perl/Tk
Reference Guide available at http://www.perl.com/CPAN-
local/authors/Stephen_O_Lidie/ , and the online manpages at
http://www-users.cs.umn.edu/~amundson/perl/perltk/toc.html .
--
"Work is the curse of the drinking class"
--Oscar Wilde
------------------------------
Date: Tue, 9 Mar 1999 07:28:48 -0800
From: moseley@best.com (Bill Moseley)
Subject: Re: flock / sysopen / open confusion
Message-Id: <MPG.114ede0ad703637e9896d3@206.184.139.132>
In article <36E512CF.5C6AE4E@nospam.com>, mymail@nospam.com says...
> I'm confused. In a recent post by Tom Christiansen he said that another
> Perl group poster had "closed the barndoor after the horses has escaped"
> [1]. The person had done something like
>
> open F,$myfile;
> flock F,$LOCK_EX;
> (do file I/O)
Would have been useful to give a reference to post in question, but there
was a post that looked more like:
open F,$myfile;
flock F,$LOCK_EX;
(do file I/O)
flock F,$LOCK_UN; <- here's the problem.
close( F );
It's not the time between the open an flock. There may be file activity
then, and that's ok. But if you unlock before you close, well, then the
file could get modified before the close actually flushes buffers to
disk.
There's a zillion topics about flock on this newsgroup. Check Dejanews.
--
Bill Moseley mailto:moseley@best.com
------------------------------
Date: 9 Mar 1999 15:58:31 GMT
From: Alistair Cunningham <ac212@debian.org>
Subject: Gtk::Dialog alpha 2
Message-Id: <7c3gf7$4cb$1@play.inetarena.com>
Announcing alpha release 2 of Gtk::Dialog.
Gtk::Dialog is a simple and very easy to use Perl interface to create
dialog boxes using the Gtk toolkit for X. It requires no knowledge of
Gtk or advanced Perl features. Complex dialog boxes can be created
in just a few lines of code. Gtk::Dialog has built in features for
validation of user input.
This version is much more usable than Alpha 1, but is still not
suitable for production systems.
Grab a copy at:
http://thor.cam.ac.uk/~ac212/GtkDialog/GtkDialog-alpha2.tar.gz
Alistair Cunningham.
--
--------------------------------------------------------------------------
Alistair Cunningham Selwyn College, Cambridge Email: ac212@debian.org
------------------------------
Date: Tue, 09 Mar 1999 15:27:08 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: help
Message-Id: <36e53d6f.3380060@news.dircon.co.uk>
On Tue, 09 Mar 1999 14:16:25 +0000, bahjaji aziz <bahjaji@iam.net.ma>
wrote:
>when i send my form method i have a like this in the location :
>http://206.103.27.119/scripts/cgi-bin/sqlenr.plmethod=?ticket=&ologin=&opassword=&nom=&ville=&tel1=&tel2=&tel3=&tel4=&nlogin=&npassword=&npassword2=&commentaire=&Go=Submit
>Please Can you help me for to see in my location only
>http://206.103.27.119/scripts/cgi-bin/sqlenr.pl
>whithout
>method=?ticket=&ologin=&opassword=&nom=&ville=&tel1=&tel2=&tel3=&tel4=&nlogin=&npassword=&npassword2=&commentaire=&Go=Submit
use POST method in your form
go to
comp.infosystems.www.authoring.cgi
do not collect #200
/J\
------------------------------
Date: 9 Mar 1999 15:57:05 GMT
From: Kaelin Colclasure <kaelin@himalia.talarian.com>
Subject: HTML::Subtext 1.03 (first public release)
Message-Id: <7c3gch$495$1@play.inetarena.com>
HTML::Subtext Version 1.03
Sun Mar 7 14:16:53 PST 1999
This module is designed to do simple textual substitutions into an
HTML template document in an "offline" process. It is *not* a
mechanism for implementing server-side includes -- there are plenty of
other perl modules that do that. There are also other modules which
let you embed arbitrary perl expressions in a template. [These are
quite powerful and useful, but assume a certain sophistication on the
part of the template author.] HTML::Subtext doesn't do that either.
What it does do is allow you to compose an HTML document using your
favorite WYSIWYG HTML editor, include place-holder strings in it like
"Customer's name here", and then turn those place holders into a
substitution field by making the text a link to a special 'subtext:'
URI. This approach has the following advantages:
1. Any Web server can display the finished documents -- you don't
need special support for server-side includes, or active server
pages, or anything beyond plain vanilla HTML. (Of course it is
still possible to use those features if you have and want them.)
2. The templates are easy for a non-technical user to prepare
(in particular a non-perl-literate user).
3. It's possible to view the template in its unprocessed form, in a
regular Web browser, and to see where the substituted strings
will be placed and approximately what your finished document
will look like.
4. The substitution mechanism is robust against errors in the
template specification. That is, the output is still a valid
HTML document even if some of the substitution field names are
misspelled or invalid.
In short, the idea is to make things as simple and convenient as
possible from the perspective of the template author. I looked through
a lot of HTML manipulation packages on CPAN, but none of them struck
me as having quite this goal in mind. [Perhaps this is because the very
idea of using a template is that you only have to get it right once,
so power and versatility are more important than convenience. But for
the particular application I was building at the time, there were a
number of templates to be built, and they were to be tweaked fairly
regularly.]
INSTALLATION
Installation is accomplished in the usual manner-- unpacking the tar
archive should create a directory called HTML-Subtext-1.03/. cd into
this directory and issue the following commands:
perl Makefile.PL
make
make test
Assuming all the tests succeed, you may require root or administrator
privledges on your system for the final step:
make install
It's possible to make use of the module without installing it. See the
perl documentation on @INC for details.
ACKNOWLEDGEMENTS
The implementation of this module was almost trivially simple, thanks
to the excellent work of Gisle Aas (and others) on the HTML::Parser
and URI modules.
--------
NAME
HTML::Subtext - Perform text substitutions on an HTML template
SYNOPSIS
use HTML::Subtext;
%context = ( ... ); # Hash of names to substitution text
$p = HTML::Subtext->new('CONTEXT' => \%context);
$p->parse_file("template.html");
DESCRIPTION
`HTML::Subtext' is a package for performing text substitutions
on a specially formatted HTML template. The template uses normal
HTML markup, but includes links of the form:
<a href="subtext:foo/bar">This text will be replaced</a>
The URI in this link tells `HTML::Subtext' to check in the
provided hash `'CONTEXT'' for a key named `'foo/bar''. If this
lookup succeeds in producing a string value, the text in the
body of the link is replaced by that value.
EXAMPLES
This example performs substitutions into a template embedded
into the Perl code as a *here-document*.
use HTML::Subtext;
%context = (
'author/name' => 'Kaelin Colclasure',
'author/email' => '<a href="mailto:kaelin@acm.org">kaelin@acm.org</a>'
);
$p = HTML::Subtext->new('CONTEXT' => \%context);
$p->parse(<<EOT);
<html><head><title>example</title></head><body>
<a href=\"subtext:author/name\">Author's name here</a>
<a href=\"subtext:author/email\">mailto: link here</a>
</body></html>
EOT
When run, the example produces the following output:
<html><head><title>example</title></head><body>
Kaelin Colclasure
<a href="mailto:kaelin@acm.org">kaelin@acm.org</a>
</body></html>
SEE ALSO
the HTML::Filter manpage, the HTML::Parser manpage
COPYRIGHT
Copyright 1999 Kaelin Colclasure.
This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
------------------------------
Date: 09 Mar 1999 07:12:04 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Illiad!!!!!!
Message-Id: <m1yal6ae9n.fsf@halfdome.holdit.com>
>>>>> "I" == I R A Aggie <fl_aggie@thepentagon.com> writes:
I> For your viewing pleasure:
I> <http://www.userfriendly.org/cartoons/archives/99mar/19990308.html>.
I> Amusing, I guess...don't tell Randal...
[fetches, views...] Egad!
print "Just another Perl book 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: 9 Mar 1999 15:09:43 GMT
From: dw724@cleveland.Freenet.Edu (Dennis M. Hancy)
Subject: lower/upper case conversion
Message-Id: <7c3djo$o84$1@alexander.INS.CWRU.Edu>
Probably a simple question, but how can I convert a string to upper or
lower case in Perl?
Dennis Hancy
Eaton Corporation
Cleveland, OH
------------------------------
Date: Tue, 09 Mar 1999 15:27:13 GMT
From: slinberg@crocker.com (Steve Linberg)
Subject: Re: lower/upper case conversion
Message-Id: <slinberg-0903991027140001@cc11620-a.lwmrn1.pa.home.com>
In article <7c3djo$o84$1@alexander.INS.CWRU.Edu>,
dw724@cleveland.Freenet.Edu (Dennis M. Hancy) wrote:
> Probably a simple question, but how can I convert a string to upper or
> lower case in Perl?
You mean other than the way described in section 4 of the Perl FAQ, which
is sitting on your system right now? :)
------------------------------
Date: Tue, 09 Mar 1999 15:28:29 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: lower/upper case conversion
Message-Id: <36e53dd8.3484877@news.dircon.co.uk>
On 9 Mar 1999 15:09:43 GMT, dw724@cleveland.Freenet.Edu (Dennis M.
Hancy) wrote:
>
>Probably a simple question, but how can I convert a string to upper or
>lower case in Perl?
>
Would you believe uc() & lc()
I cant remember which does which so you had better check it out in the
perlfunc manpage.
/J\
------------------------------
Date: Tue, 9 Mar 1999 04:23:09 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Nonscalar Array Access?
Message-Id: <t9p2c7.0a2.ln@magna.metronet.com>
@l@ (aqumsieh@matrox.com) wrote:
[snip about single-element array slice]
: Actually, there is a difference in the context between the two.
^^^^^^^^^^^^^^^^^^^^^^^^^
: $array[2] is a scalar. It is the third element in @array.
: @array[2] is an array slice. It is an array with one element, $array[2].
Neither of those affect the context when used with print().
In that case the _print()_ provides the context (which is always LIST)
They provide different context when they are used somewhere where
_they_ control the context, like on the LHS:
-------------------------
#!/usr/bin/perl -w
use strict;
my @array;
@array[1] = report_context();
print @array[1], "\n";
$array[1] = report_context();
print $array[1], "\n";
sub report_context {
wantarray ? "list" : "scalar";
}
-------------------------
prints:
Scalar value @array[1] better written as $array[1] at ./context line 6.
Scalar value @array[1] better written as $array[1] at ./context line 7.
list
scalar
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 9 Mar 1999 04:14:27 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: q// vs. ''
Message-Id: <jpo2c7.0a2.ln@magna.metronet.com>
Jari Aalto+mail.perl (jari.aalto@poboxes.com) wrote:
: tadmc@metronet.com (Tad McClellan) writes:
: > You should not ask for variable/backslash escape interpolation
: > unless you _need_ it. (when you use double quotes, you are
: > asking for those things)
: So, perl always Extrapolates if there is double quotes, regardless of the
: content inside the string? (could it peek existence of $ ...)
: @a = ( "a" , "abc" "def-ghi" );
: is more efficient than?
: @a = ( 'a' , 'abc', 'def-ghi' );
: Wow. Can anyone explain the benchmark results? the qq and q operators
: seem to be advantageou.
My point was for better maintenance, not faster execution.
When chasing a bug by scanning source code, double quotes
force me to examine the contents of the string to see if
there are variables in there.
I can immediately move on if I see single quotes, since I know
that the quoted stuff must be constant.
"Brain farts" like that are noise. I like it quiet when I'm
trying to concentrate on what the heck I was doing when I
wrote the code three months ago :-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 09 Mar 1999 17:02:49 +0200
From: Atro Tossavainen <Atro$Tossavainen@iki.ll-spam!fi>
Subject: Referencing arrays with contents of scalars?
Message-Id: <pgzaexm66zq.fsf@kontti.Helsinki.FI>
I wonder if what I'm trying to do is entirely stupid.
Basically, I've got a few arrays, and I want to be able to loop over
them all in one fell swoop, setting a scalar with the same name as
the array has if a subroutine call with the array as a parameter
succeeds. I don't want to have to list the names of the arrays more
than once.
Let me illustrate with a code fragment --
@name = ("whatever", "you get it");
@othername = ("some contents here");
foreach ("name", "othername") {
my $arrayref = \@$_;
eval '$' . $_ . '++' if subroutine (@$arrayref);
}
All help much appreciated.
--
Atro dot Tossavainen at iki dot fi
http colon 2*slash www dot iki dot fi slash atossava slash
Kehotan samaa sukupuolta olevia keskindiseen haureuteen.
http://liw.iki.fi/liw/haureus.html
------------------------------
Date: Tue, 09 Mar 1999 10:15:48 -0500
From: John A <John_o_Sullivan@hotmail.com>
Subject: Running c-shell commands in perl
Message-Id: <36E53B24.7CF6C08C@hotmail.com>
I Want to be able to specify in my perl script that all shell commands
are to be run in c-shell. it seems to be defaulting to Bourne.
Any ideas.
------------------------------
Date: 09 Mar 1999 16:35:28 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Running c-shell commands in perl
Message-Id: <83lnh6ad6n.fsf@vcpc.univie.ac.at>
Re: Running c-shell commands in perl, John
<John_o_Sullivan@hotmail.com> said:
John> I Want to be able to specify in my perl script
John> that all shell commands are to be run in
John> c-shell. it seems to be defaulting to Bourne.
John> Any ideas.
Ugh (sorry, but it's true :-)
http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/
How about using system() or fork(), exec() and
('csh', '-f', '-c', ....) ?
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien. | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: 9 Mar 1999 15:38:31 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: y2k and 4-digit dates (was Re: foreach and while)
Message-Id: <7c3f9n$8bm$1@client2.news.psi.net>
Russell Schulz (Russell_Schulz@locutus.ofB.ORG) wrote on MMXVI September
MCMXCIII in <URL:news:19990309.001741.0Y0.rnr.w164w@locutus.ofB.ORG>:
() Staffan Liljas <staffan@ngb.se> writes:
()
() > And there was a Y1.9K problem
()
() there has been for a long time. when did you first hear about a 106
() year old person getting a mailed notice reminding him/her that school
() was starting, and he/she'd better be ready to attend?
IIRC, the first documented case of a Y2K problem in a computer program
was on Jan 1, 1970, when a financial application dealing with 30 year
bonds went haywire.
Abigail
--
perl -wlne '}for($.){print' file # Count the number of lines.
------------------------------
Date: 9 Mar 1999 15:44:08 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: y2k and 4-digit dates (was Re: foreach and while)
Message-Id: <7c3fk8$8bm$2@client2.news.psi.net>
Russell Schulz (Russell_Schulz@locutus.ofB.ORG) wrote on MMXVI September
MCMXCIII in <URL:news:19990309.002212.8G9.rnr.w164w@locutus.ofB.ORG>:
&& abigail@fnx.com (Abigail) writes:
&&
&& >>> I'm not going to start writing 1/2/2000 when 1/2/00 will work just
&& >>> fine to indicate the second day of the first month of the closest year
&& >>> ending in 00.
&& >>
&& >> is that Feb 1 or Jan 2?
&& >
&& > That's a silly argument.
&&
&& it a tangential argument, but it's far from silly.
&&
&& > 8 digit dates don't magically solve the US vs rest-of-the-world
&& > ambiguity.
&&
&& if they're in ISO yyyymmdd format, they do.
No it won't. You still have to display it to be useful. And 1/2/2000 will
still be ambiguous, no matter how you store it internally. Most users
have no idea what the ISO format is; and even if they know, "1/2/2000"
doesn't indicate it's in ISO format. You would have to start writing
down something like "20000201" and hope people realize it's a date in
ISO format and not something triggered by a Y2K bug.
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
------------------------------
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 5094
**************************************