[18049] in Perl-Users-Digest
Perl-Users Digest, Issue: 209 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Feb 4 09:05:31 2001
Date: Sun, 4 Feb 2001 06:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <981295509-v10-i209@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 4 Feb 2001 Volume: 10 Number: 209
Today's topics:
Re: 'print' problem-again! <b0l4549@cs.tamu.edu>
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
Re: `backticks` broken with fresh install of ActivePerl (Rudolf Polzer)
Re: added? <christopher_j@uswest.net>
Re: Apologies to Joyce Kilmer, a hack for your enjoymen (Rudolf Polzer)
Re: Apologies to Joyce Kilmer, a hack for your enjoymen (Rudolf Polzer)
Re: Apologies to Joyce Kilmer, a hack for your enjoymen (Rudolf Polzer)
Re: Apologies to Joyce Kilmer, a hack for your enjoymen (Abigail)
Re: Apologies to Joyce Kilmer, a hack for your enjoymen <bart.lateur@skynet.be>
Re: Apologies to Joyce Kilmer, a hack for your enjoymen (Rudolf Polzer)
Call .ksh from perl <jc@home.com>
Re: CSV and XML <bart.lateur@skynet.be>
Re: input parameters <uri@sysarch.com>
Re: Is it possible for perl to open Dos programs? (Rudolf Polzer)
Re: JAPH (Mark Jason Dominus)
Keyword Search <rworth5@home.com>
Re: matching integer's and end of a string problem <bart.lateur@skynet.be>
Platform independent pathnames <james@NOSPAM.demon.co.uk>
Re: Substituting variables in a text file (Mihai N.)
Re: System call correct? (Gwyn Judd)
Re: System call correct? (Rudolf Polzer)
Thanks <maw@markaw.com>
Re: to shift, or not to shift, without shift significan <jfh@jfh00.fernuni-hagen.de>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 4 Feb 2001 01:33:05 -0600
From: Bin - Lu <b0l4549@cs.tamu.edu>
Subject: Re: 'print' problem-again!
Message-Id: <Pine.SOL.4.10.10102040129030.27688-100000@robert>
On 3 Feb 2001 nobull@mail.com wrote:
> > Your information is very helpful. But I need the print content-type line
> > because I use a socket before the redirection. The socket doesn't work
> > without the print "content-type: text/html\n\n";
>
> What!? Can you explain what lead to you that conclusion?
Because if I delete the print content-type line, my socket doesn't work;
while I add the line, it works.
>
> > Maybe I can change the socket code to make it work without the print line?
> > I don't know how to do it. Do you have any clue? Thanks very much!
>
> It would help if first you gave us a clue as to why you thing that
> code to open a socket would be magically linked with whether or not a
> particular string had be emitted on STDOUT.
>
Because when I don't use the print content-type line the cookie and
redirection work; while I use it, they don't.
All my conclusions came from experiments. Actually I'm not very familiar
with printing header stuff.
------------------------------
Date: Sun, 04 Feb 2001 11:21:17 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage981285845.24522@news.teleport.com>
Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 29 Apr 2000
[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last _major_ update of the Perl FAQ was in Summer
of 1998; of course, ongoing updates are made as needed. ]
For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).
http://www.cpan.org/doc/FAQs/
Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.
For an alternative way to get answers, check out the Perlfaq website.
http://www.perlfaq.com/
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.
perldoc perlfaq
man perlfaq
If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.
If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.
http://www.cpan.org/
http://www.perl.com/CPAN/
http://www.cpan.org/doc/FAQs/FAQ/html/
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/
You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)
California ftp://ftp.cdrom.com/pub/perl/CPAN/
Texas ftp://ftp.metronet.com/pub/perl/
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
Australia ftp://cpan.topend.com.au/pub/CPAN/
Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Sun, 4 Feb 2001 11:35:28 +0100
From: rpolzer@web.de (Rudolf Polzer)
Subject: Re: `backticks` broken with fresh install of ActivePerl on Win98
Message-Id: <slrn97qc3g.1i4.rpolzer@rebounce.rpolzer-lx>
Tom Bates <tfbiv@SPAMMENOTerols.com> schrieb Folgendes:
> Well, this is really wacky. I did some reading on ActiveState's Win32
> mailing list and got the idea that maybe I needed to set the
> environment variable PERL5SHELL. It was not set at the time, although
> COMSPEC was ok, so I would think that the perl install would know how
> to find command.com.
>
> Anyway, I "set PERL5SHELL=c:\windows\command.com" and did my "perl -d
> -e 1" trick. No output at all - not to screen, not to variable.
> Changed PERL5SHELL to c:\command.com and tried again. Still nothing.
> (command.com resides in both places).
>
> Then I removed PERL5SHELL from the environment, AND NOW IT WORKS! I
> have NO CLUE what happened, but now it's working. Open a new DOS
> window and it's still fixed.
>
> Well, reboot and now it's broken again. I knew it was too good to be
> true.
I do not know why, but did you try inserting "SET PERL5SHELL=" in your
AUTOEXEC.BAT? Or in the C:\WINDOWS\WINSTART.BAT?
--
Nuper erat medicus, nunc est vispillo, Diaulus:
Quod vispillo facit, fecerat et medicus.
------------------------------
Date: Sat, 3 Feb 2001 22:10:13 -0800
From: "Christopher M. Jones" <christopher_j@uswest.net>
Subject: Re: added?
Message-Id: <om6f6.3117$uH6.801754@news.uswest.net>
"Victor Fontes" <victor@fontes.net> wrote:
> Hello...
>
> How can I make a script that can make it:
>
> At a web page the user put a number betwen 01 and 99.
> The script should return which numbers where added to form the result, and
> it these numbers can only be 01, 02, 04, 08, 16, 32 or 64.
>
> eg 1: user's input:19 -> script's result:01, 02 e 16.
> eg 2: users' input:31 -> script's result:01, 02, 04, 08, 16.
Ummm, sounds like you just want the binary digits of the
number. For example:
####### BEGIN ############
#!/usr/bin/perl
use CGI;
$query = new CGI;
$var = pack('S', $query->params{var});
$bits = unpack('B8', $var);
print "Content-type: text/html\n\n";
print $query->param{var}, " (dec) = $bits (bin)";
####### END ##############
In the example above, the parameter "var" is the input, so
you'd use a url like "blah.cgi?var=77" or whatever.
--
The last thing I coughed up we kept in a cage and fed for three days before
it died!
------------------------------
Date: Sun, 4 Feb 2001 11:19:52 +0100
From: rpolzer@web.de (Rudolf Polzer)
Subject: Re: Apologies to Joyce Kilmer, a hack for your enjoyment
Message-Id: <slrn97qb68.1i4.rpolzer@rebounce.rpolzer-lx>
Abigail <abigail@foad.org> schrieb Folgendes:
> Rudolf Polzer (rpolzer@web.de) wrote on MMDCCXIII September MCMXCIII in
> <URL:news:slrn97og9j.p7j.rpolzer@rebounce.rpolzer-lx>:
> [] Joe Schaefer <joe+usenet@sunstarsys.com> schrieb Folgendes:
> [] > rpolzer@web.de (Rudolf Polzer) writes:
> [] >
> [] > > Does not work. Perl complains about this. Is it really _your_ hack or did
> [] > > you copy it from a book? I tried replacing the b with a 6 but that was
> [] > > not the fault; I also tried inserting a x before it, but no text
> [] > > appeared; just a row of all the same characters and then another one.
> [] > >
> [] > Are you using 5.6? It works fine for me on linux w/5.6,
> [] > but not w/5.005_03.
> []
> [] Sorry, I have 5.005_03. I did not check it because I though "a current
> [] Linux has a current Perl" (I am using S.u.S.E 7.0).
>
>
> *snort*
>
>
> There's no relation between Linux and Perl. Linux is a kernel, written
> in C. SuSE is a Linux _distribution_.
Of course I meant, a corrent distribution should have a current Perl
package in it.
--
Nuper erat medicus, nunc est vispillo, Diaulus:
Quod vispillo facit, fecerat et medicus.
------------------------------
Date: Sun, 4 Feb 2001 11:29:48 +0100
From: rpolzer@web.de (Rudolf Polzer)
Subject: Re: Apologies to Joyce Kilmer, a hack for your enjoyment
Message-Id: <slrn97qbos.1i4.rpolzer@rebounce.rpolzer-lx>
Abigail <abigail@foad.org> schrieb Folgendes:
> /^1?$|^(11+?)\1+$/
I like this prime test...
but why does it not get faster when compiled once? I know that the second
? just improves the speed by beginning with small divisors instead of big
ones.
--
Nuper erat medicus, nunc est vispillo, Diaulus:
Quod vispillo facit, fecerat et medicus.
------------------------------
Date: Sun, 4 Feb 2001 11:18:30 +0100
From: rpolzer@web.de (Rudolf Polzer)
Subject: Re: Apologies to Joyce Kilmer, a hack for your enjoyment
Message-Id: <slrn97qb3m.1i4.rpolzer@rebounce.rpolzer-lx>
Ilya Zakharevich <ilya@math.ohio-state.edu> schrieb Folgendes:
> [A complimentary Cc of this posting was sent to Abigail
> <abigail@foad.org>],
> who wrote in article <slrn97opbi.r6a.abigail@tsathoggua.rlyeh.net>:
> > Clinton A. Pierce (clintp@geeksalad.org) wrote on MMDCCXIII September
> > MCMXCIII in <URL:news:1pVe6.277018$hD4.66747295@news1.rdc1.mi.home.com>:
> > __
> > __ It's a 5.6-ism. You aren't using 5.6? Shame on you. It's been out
> > __ since...well gee, at least the summer of 1999.
> >
> > I guess summer was late in Detroit in 1999, but according to the file
> > Changes5.6, perl5.6.0 came into being on March 23, 2000.
>
> And is still at pre-beta quality. Sigh. 5.006 was promised to be
> released at Summer 1999, adn we still do not have a Perl-quality level
> release.
So this is the reason why I do not have it!
--
Nuper erat medicus, nunc est vispillo, Diaulus:
Quod vispillo facit, fecerat et medicus.
------------------------------
Date: 4 Feb 2001 12:08:16 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Apologies to Joyce Kilmer, a hack for your enjoyment
Message-Id: <slrn97qhhg.jf8.abigail@tsathoggua.rlyeh.net>
Rudolf Polzer (rpolzer@web.de) wrote on MMDCCXIV September MCMXCIII in
<URL:news:slrn97qbos.1i4.rpolzer@rebounce.rpolzer-lx>:
$$ Abigail <abigail@foad.org> schrieb Folgendes:
$$ > /^1?$|^(11+?)\1+$/
$$
$$ I like this prime test...
$$ but why does it not get faster when compiled once? I know that the second
$$ ? just improves the speed by beginning with small divisors instead of big
$$ ones.
What makes you think it gets compiled more than once to begin with?
Abigail
--
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");
------------------------------
Date: Sun, 04 Feb 2001 12:57:51 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Apologies to Joyce Kilmer, a hack for your enjoyment
Message-Id: <vakq7t8l2t5s65e1jo8o3jviv5ai9fu94g@4ax.com>
Clinton A. Pierce wrote:
>>> '*' =>0b01,
>> ^^^^
>> Does not work. Perl complains about this.
>It's a 5.6-ism.
>Simply replace it with:
>
> '*' => 1,
'*' => 0001;
would be more in sync with the rest of the program.
>BTW, there are other things in the hack
>that use 5.6-isms: I think pack "B*" is one and sprintf "%b" is another).
pack 'B*' is no problem, but sprintf '%b' sure is.
--
Bart.
------------------------------
Date: Sun, 4 Feb 2001 13:27:41 +0100
From: rpolzer@web.de (Rudolf Polzer)
Subject: Re: Apologies to Joyce Kilmer, a hack for your enjoyment
Message-Id: <slrn97qilt.44h.rpolzer@rebounce.rpolzer-lx>
Abigail <abigail@foad.org> schrieb Folgendes:
> Rudolf Polzer (rpolzer@web.de) wrote on MMDCCXIV September MCMXCIII in
> <URL:news:slrn97qbos.1i4.rpolzer@rebounce.rpolzer-lx>:
> $$ Abigail <abigail@foad.org> schrieb Folgendes:
> $$ > /^1?$|^(11+?)\1+$/
> $$
> $$ I like this prime test...
> $$ but why does it not get faster when compiled once? I know that the second
> $$ ? just improves the speed by beginning with small divisors instead of big
> $$ ones.
>
>
> What makes you think it gets compiled more than once to begin with?
When I call it more often. But it is easy to read and the | does not
matter, I think, and therefore no improvement.
--
Nuper erat medicus, nunc est vispillo, Diaulus:
Quod vispillo facit, fecerat et medicus.
------------------------------
Date: Sun, 04 Feb 2001 02:53:37 -0600
From: JC <jc@home.com>
Subject: Call .ksh from perl
Message-Id: <3A7D1891.F5351EE4@NOSPAM.cottingim.com>
I need to call a .ksh script from a perl script, but have no idea how.
Can someone please help out with this?
Thanks in advance.
JC
john@NOSPAM.cottingim.com
(remove the spam filter to reply)
------------------------------
Date: Sun, 04 Feb 2001 11:56:45 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: CSV and XML
Message-Id: <qjeq7to2ovcvh5jrrt9hbrkm5gnv3d9oeb@4ax.com>
MAW wrote:
>I
>have a java class which can convert any CSV file into an XML file, in the
>following format:
>
>CSV File contents
>"item1","item2","item 3","this is the fourth item"
>
>Result in:
><COL_1>item1</COL_1>
><COL_2>item2</COL_2>
><COL_3>item 3</COL_3>
><COL_4>this is the fourth item</COL_4>
It looks to me like you've forgotten something. There probably must be a
<RECORD>...</RECORD> wrapper around this.
And it's not unlikely that your need some intro lines as well, beginning
with "<?XML ... ?>".
>Well, now I have to
>convert everything over to Perl so I need a script/module that can convert
>from a CSV file to an arbitary XML file
It's not an arbitrary XML file. It is a very simple, fixed one. You can
easily generatte this kind of XML in a few lines of Perl. What you need
to take care of, is that some special characters: "&", "<", and ">", "'"
and '"' don't hurt either, are escaped. That, too, can be done in two
lines of Perl.
As for reading the CSV file: you can either use a module, like Text::CSV
(or better: Text::CSV_XS, because it's faster), or write the function in
plain Perl, if you're at least an intermediate level perl coder. If
Text::CSV chokes on your "CSV" file, that's the only option. The entry
"How can I split a [character] delimited string except when inside
[character]? (Comma-separated files)" in perlfaq4 can then be a starting
point. But, let's go with Text::CSV or Text::CSV_XS, shall we?
#! perl -w
my $file = "testfile.csv";
use Text::CSV_XS;
use FileHandle;
my $fh = new FileHandle;
open $fh, $file or die "Cannot open file \"$file\": $!";
my %escape = ( '&' => '&', '<' => '<', '>' => '>',
'"' => '"', '\'' => ''' );
my $csv = Text::CSV_XS->new({ binary => 1 });
# accepting accented chars
until (eof $fh) {
my $columns = $csv->getline($fh);
print "<RECORD>\n";
for my $i (1 .. scalar @$columns) {
local $_ = $columns->[$i-1];
s/([&<>])/$escape{$1}/g;
# you can add the other chars as well, if you like
print "<COL_$i>$_</COL_$i>\n";
}
print "</RECORD>\n";
}
There. That's the whole script. Oh BTW, it works with multiline fields
as well.
--
Bart.
------------------------------
Date: Sun, 04 Feb 2001 05:42:37 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: input parameters
Message-Id: <x7y9vnqa0i.fsf@home.sysarch.com>
>>>>> "DP" == Derek Paterson <derek@dpat.fsnet.co.uk> writes:
DP> I already discover ARGV and it seems to assume anything passed is
DP> a filename - which is how I've finally had to do it.
huh? you need to rtfm some more. @ARGV is only assumed to have filenames
if you use <> or -p/n. read up on perlrun and perlop.
and don't jeopardy quote.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Sun, 4 Feb 2001 11:43:50 +0100
From: rpolzer@web.de (Rudolf Polzer)
Subject: Re: Is it possible for perl to open Dos programs?
Message-Id: <slrn97qcj6.1i4.rpolzer@rebounce.rpolzer-lx>
fenderstratocaster@my-deja.com <fenderstratocaster@my-deja.com> schrieb Folgendes:
> O.K. I got it working. Thank you for the "point in the right direction."
>
> One more thing though.
>
> What would people need to do, to get this program to run on their
> system? Or is Perl a bad language to use for this sort of programming?
They would need the perl interpreter. Perhaps perlcc is also available for
DOS/Windows, but there is another problem: I do not know how to statically
link the programs with perl!
--
Nuper erat medicus, nunc est vispillo, Diaulus:
Quod vispillo facit, fecerat et medicus.
------------------------------
Date: Sun, 04 Feb 2001 12:19:54 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: JAPH
Message-Id: <3a7d48e9.30d9$288@news.op.net>
In article <030220011953405664%wuerz@yahoo.com>,
Mona Wuerz <wuerz@yahoo.com> wrote:
>In article <irrelevant>, <snipped> wrote:
>
>#!:perl -w
>use strict;
>use diagnostics;
It's an obfuscation. Who the heck cares if it's not strict-clean?
'strict subs' is there to prevent maintenance headaches from unquoted
strings. That is a non-issue for this program.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Sun, 04 Feb 2001 05:49:42 GMT
From: "Richard & Stacy" <rworth5@home.com>
Subject: Keyword Search
Message-Id: <W36f6.9803$wI1.760781@news1.rdc1.mb.home.com>
I am trying to figure out how to extract keywords from the URL when someone
visits my site and keep a log of all keywords.
When they are extracted from URL, I want to increment if it already exists
or if it is a new keyword add to the list.
I know this is probably very simple, but my head is becoming very sore from
banging against the keyboard and I have resoted to asking for some help.
Thanks,
Richard
------------------------------
Date: Sun, 04 Feb 2001 12:44:55 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: matching integer's and end of a string problem
Message-Id: <0njq7tsglunqpvqrkjfg09ot9rq2tja2p9@4ax.com>
jay wrote:
>now my problem is that I don't want the pattern to match if there is a
>carage return or line feed at the end of the scalar (as there obviously
>is).
Try using \z instead of $ .
--
Bart.
------------------------------
Date: Sun, 4 Feb 2001 13:55:21 +0000
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Platform independent pathnames
Message-Id: <ant0413219eefNdQ@oakseed.demon.co.uk>
I'm writing a Perl program to take a directory containing a website
in a kind of "source" form and then (via various template files and
automatic hierarchic navbar creation) to output a directory containing
the complete site ready for upload.
A major part of the program is that it has to calculate relative paths
between all the pages, the graphics, and the navbar items, making sure
that they are written into the HTML in the standard Unix format. At the
same time it has to know where all the source and destination files are by
native absolute pathname, and be able to convert between the two freely.
The program will run on RISC OS during the initial development of
sites, but then I also wish to be able to give it to my clients so
that they can update their sites themselves - and they could be
running Windows, Linux, MacOS or anything else. Obviously Perl is
nicely portable, but I have a problem with how to perform all the
pathname manipulations and conversions in a platform independent
manner. It's rather a headache and your assistance would be much
appreciated.
I've had a look at File::Spec and children but it does not seem to have
the necessary functionality, and to be honest, I'm not sure how to convert
back and forth between the unknown "native" format and Unix format.
Specific problems I've had are in the use of File::Spec->canonpath()
which does not seem to perform the tidying operations it promises.
I don't know where to start because the treatment of pathnames is so
central to the whole thing. Can someone please explain to me what I
need to understand. Thanks.
--
James Taylor <james (at) oakseed demon co uk>
Based in Hammersmith, London, UK.
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02
------------------------------
Date: 4 Feb 2001 07:08:59 GMT
From: nmihai_2000@yahoo.com (Mihai N.)
Subject: Re: Substituting variables in a text file
Message-Id: <903DE01A2MihaiN@207.172.3.55>
Take a look at the Text::Template module.
It is doing exactly this (and much more).
Mihai
------------------------------
Date: Sun, 04 Feb 2001 10:19:25 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: System call correct?
Message-Id: <slrn97qbf2.159.tjla@thislove.dyndns.org>
I was shocked! How could John Boy Walton <johngros.NOSPAM@bigpond.net.au>
say such a terrible thing:
>Could some one tell me if this is a correct system call?
>system ("C:/Program Files/Junker/junk.exe") || die "can't start proxy $!";
>My understanding of the docs is yes but it is not working.
Your understanding is wrong. The return value of system signifies an
error occured if it is non-zero, therefore a correct usage is more
likely:
system("some-pgogram") = 0
or die "Error: $?";
>Yet an open like,
>open BOGUS,"C:/Program Files/G6FTP/Users.ini" || die "can't open Users.ini
>$!";
>works a treat.
That's because the open() call is not the same as the system() call. I
get them mixed up all the time.
>I am wondering if this is me not understanding the docs or not. (If not I
>will go else where for help.)
Don't worry, it's just you misunderstanding the docs.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
As long as the answer is right, who cares if the question is wrong?
------------------------------
Date: Sun, 4 Feb 2001 11:54:12 +0100
From: rpolzer@web.de (Rudolf Polzer)
Subject: Re: System call correct?
Message-Id: <slrn97qd6k.22r.rpolzer@rebounce.rpolzer-lx>
Gwyn Judd <tjla@guvfybir.qlaqaf.bet> schrieb Folgendes:
> I was shocked! How could John Boy Walton <johngros.NOSPAM@bigpond.net.au>
> say such a terrible thing:
> >Could some one tell me if this is a correct system call?
> >system ("C:/Program Files/Junker/junk.exe") || die "can't start proxy $!";
> >My understanding of the docs is yes but it is not working.
>
> Your understanding is wrong. The return value of system signifies an
> error occured if it is non-zero, therefore a correct usage is more
> likely:
>
> system("some-pgogram") = 0
> or die "Error: $?";
You assign to the result of system?
You have a program named some-pgogram? (SCNR)
--
Nuper erat medicus, nunc est vispillo, Diaulus:
Quod vispillo facit, fecerat et medicus.
------------------------------
Date: Sun, 4 Feb 2001 12:53:10 -0000
From: "MAW" <maw@markaw.com>
Subject: Thanks
Message-Id: <981291499.20421.0.nnrp-10.c2deffc1@news.demon.co.uk>
Thanks to everyone who helped mw out here. Inow have a "perfect" working
solution - at least it works well enough for my needs
Thansk
Mark
------------------------------
Date: 04 Feb 2001 12:14:37 +0100
From: Fritz Heinrichmeyer <jfh@jfh00.fernuni-hagen.de>
Subject: Re: to shift, or not to shift, without shift significant faster
Message-Id: <86zog2pun6.fsf@jfh00.fernuni-hagen.de>
I have testet a little fibonacci function with and without shift.
It made 1/3 difference. The program without shift only spent only 66% of the
time of the program with shift.
--
Fritz Heinrichmeyer mailto:fritz.heinrichmeyer@fernuni-hagen.de
FernUniversitaet Hagen, LG ES, 58084 Hagen (Germany)
tel:+49 2331/987-1166 fax:987-355 http://www-es.fernuni-hagen.de/~jfh
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V10 Issue 209
**************************************