[11167] in Perl-Users-Digest
Perl-Users Digest, Issue: 4767 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 28 08:07:17 1999
Date: Thu, 28 Jan 99 05:00:46 -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 Thu, 28 Jan 1999 Volume: 8 Number: 4767
Today's topics:
Re: calculating weekunmber for given date (Steffen Beyer)
Cannot evaluate $query->param('thing') <design@raincloud-studios.com>
Re: Cannot evaluate $query->param('thing') <design@raincloud-studios.com>
Re: Cannot evaluate $query->param('thing') (brian d foy)
Re: Cannot evaluate $query->param('thing') (brian d foy)
Re: Cannot evaluate $query->param('thing') (Larry Rosler)
cgi in perl <C.N.Yeates@cs.cf.ac.uk>
Re: cgi in perl <gellyfish@btinternet.com>
Compiling DBD::Oracle <rolf@parallax.co.uk>
Re: Compiling PERL5.005_02 on a Sun Ultra 2 w/o Solaris <conmara@tcon.net>
format command in win32 (NT 4) <tristan.braun@pneu.com>
Free Banner / Link Exchange Script Available info@gadnet.com
Re: Gosh, s// faster than m// (was Re: Counting charact <jdf@pobox.com>
LWP and POST (peter)
Re: LWP and POST (peter)
LWP Questions (John )
Need Example for WIN32API::RegGetKeySecurity <burkhard.kiesel@med.siemens.de>
Re: Perl Threads <conmara@tcon.net>
Re: Q: CPAN on Win32 (Windows NT) Perl <matthew.sergeant@eml.ericsson.se>
Re: Rencontre Perl de Mtl (Richard Clamp)
Re: Sending email info@gadnet.com
Re: Setting LD_LIBRARY_PATH inside perl script <abey@hill.ucr.edu>
Re: Setting LD_LIBRARY_PATH inside perl script (Tommy Campbell)
Simple String-Scrambling (Roland Schneider)
Re: system function, Pros and Cons?? <abey@hill.ucr.edu>
Re: system function, Pros and Cons?? (Abigail)
Re: Test <bkennedy@one.net.au>
The behaviour of split() <michael.preminger@jbi.hioslo.no>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 28 Jan 1999 10:33:51 GMT
From: sb@engelschall.com (Steffen Beyer)
Subject: Re: calculating weekunmber for given date
Message-Id: <78peef$7qt$2@en1.engelschall.com>
clw1989@my-dejanews.com wrote:
> Hi, Just had to learn, that there is more than one way to calculate the
> weeknumber. Anybody got the complete (perl-)algorithm(s) for calculating the
> weeknumber of a given date? Thanks Clemens
See "man perlfaq" as well as Date::Manip and Date::Calc under
http://www.perl.com/CPAN/modules/by-module/Date/
and DIN 1355 under
http://www.engelschall.com/u/sb/download/Date-Calc/DIN1355/
(in german).
HTH.
Yours,
--
Steffen Beyer <sb@engelschall.com>
http://www.engelschall.com/u/sb/download/ (Free Perl and C Software
http://www.perl.com/CPAN/authors/id/STBEY/ for Download)
New: Build'n'Play 2.1.0 (all-purpose Unix batch installation tool)
http://www.oreilly.de/catalog/perlmodger/bnp.html
------------------------------
Date: 28 Jan 1999 09:07:43 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Cannot evaluate $query->param('thing')
Message-Id: <78p9cv$nqa@bgtnsc02.worldnet.att.net>
I swore I wouldn't come here until I had what I thought wasn't a
dumb question. :) So...
I've been converting a script that used cgi-lib.pl to CGI.pm and
all was going well until one of my conversions created this...
foreach $x(@form_vars){
if ($query->param('$x') eq "" || $query->param('$x') =~ /\|/) {
&NoValidValues();
exit;
}
#<snip> other stuff unrelated
}
The loop fetches the values of params named in @form_vars. I
have quadruple checked the values and they ARE there... However,
the if line does not seem to be evaluating $query->param('$x')
to anything valid. I realize I could put $query->param('$x')
into a scalar then evaluate it...
$test_val = $query->param('$x');
but I think there is a better way in this case and I'm left I'm
wondering 2 things..
1) Why doesn't it work in the first place?
2) Am I missing some clever way of handling this in the if
statement other than using a scalar?
Thanks..
CT
------------------------------
Date: 28 Jan 1999 09:14:33 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: Cannot evaluate $query->param('thing')
Message-Id: <78p9pp$aig@bgtnsc01.worldnet.att.net>
da#$ I really wish I could cancel messages here. :)
> if ($query->param('$x') eq "" || $query->param('$x') =~ /\|/)
{
I know... remove the single quotes. Some nights it's just way
too late to code coherently.
if ($query->param($x) eq "" || $query->param($x) =~ /\|/) {
CT
------------------------------
Date: Thu, 28 Jan 1999 06:07:47 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Cannot evaluate $query->param('thing')
Message-Id: <comdog-ya02408000R2801990607470001@news.panix.com>
In article <78p9cv$nqa@bgtnsc02.worldnet.att.net>, "Charles R. Thompson" <design@raincloud-studios.com> posted:
> The loop fetches the values of params named in @form_vars. I
> have quadruple checked the values and they ARE there... However,
> the if line does not seem to be evaluating $query->param('$x')
> to anything valid.
do you have a parameter named $x? that is, a literal $ followed
by a literal x? that's what you are asking CGI.pm to look for.
perhaps you wanted
$query->param($x);
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Thu, 28 Jan 1999 06:08:46 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Cannot evaluate $query->param('thing')
Message-Id: <comdog-ya02408000R2801990608460001@news.panix.com>
In article <78p9pp$aig@bgtnsc01.worldnet.att.net>, "Charles R. Thompson" <design@raincloud-studios.com> posted:
> da#$ I really wish I could cancel messages here. :)
you can :) well, maybe MS Outlook can't, but it's a usenet feature ;)
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Thu, 28 Jan 1999 03:11:44 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Cannot evaluate $query->param('thing')
Message-Id: <MPG.1119e5c76761d0df9899d5@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <78p9cv$nqa@bgtnsc02.worldnet.att.net> on 28 Jan 1999
09:07:43 GMT, Charles R. Thompson <design@raincloud-studios.com> says...
...
> if ($query->param('$x') eq "" || $query->param('$x') =~ /\|/) {
...
> but I think there is a better way in this case and I'm left I'm
> wondering 2 things..
>
> 1) Why doesn't it work in the first place?
You answered that one yourself. :-)
> 2) Am I missing some clever way of handling this in the if
> statement other than using a scalar?
This handles it with one evaluation of the function call:
if ($query->param($x) =~ /^$|\|/) {
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 28 Jan 1999 10:52:28 -0000
From: "Chris Yeates" <C.N.Yeates@cs.cf.ac.uk>
Subject: cgi in perl
Message-Id: <78pfhd$g6$1@fafnir.cf.ac.uk>
I am completely new to CGI programming in Perl. I wish to password protect
some web pages. Does anybody know how to do this?
Cheers!
Chris
------------------------------
Date: 28 Jan 1999 11:55:27 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: cgi in perl
Message-Id: <78pj7f$gi$1@gellyfish.btinternet.com>
On Thu, 28 Jan 1999 10:52:28 -0000 Chris Yeates wrote:
> I am completely new to CGI programming in Perl. I wish to password protect
> some web pages. Does anybody know how to do this?
>
Generally one would do this using the facilities provided by the HTTP
server - you probably want to check the documentation for your server or
ask in one of the comp.infosystems.www.servers.* groups.
This stuff can be done with CGI but again this is more appropriate to a
group like comp.infosystems.www.authoring.cgi or its FAQ
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Thu, 28 Jan 1999 11:38:57 +0000
From: Rolf Howarth <rolf@parallax.co.uk>
Subject: Compiling DBD::Oracle
Message-Id: <36B04C51.95DE30AE@parallax.co.uk>
Can anyone tell me where can I get hold of the minimal set of Oracle
client software necessary to get DBD::Oracle to compile under Linux?
Thanks
-Rolf
------------------------------
Date: Thu, 28 Jan 1999 07:33:52 -0500
From: Ken McNamara <conmara@tcon.net>
To: "Peter J. Messore" <Peter.J.Messore.1@gsfc.nasa.gov>
Subject: Re: Compiling PERL5.005_02 on a Sun Ultra 2 w/o Solaris 2.6 OS
Message-Id: <36B05930.79C4E0BC@tcon.net>
Pete -
Solaris ships with a "Worse than nothing" cc. That is, it appears to be
there - but is so crippled you can't even call it vaporware. Not only cc
but a lot of libraries are missing too (which generates a lot of errors).
We purchased the Solaris C compiler, installed it and (fortunately) used it
to bootstrap a gcc compiler. I say fortunately because the original cc has
failed - (a marvelous soft failure that lets cc start - then it just
continues to run and run and run... without ever coming back or erroring
out.)
KenMc
Peter J. Messore wrote:
> Our group just recently got a new Sun Ultra 2 which is running Solar 2.6
> for the operating system. We want to put Perl on our system so we can
> continue to run several of the WWW CGI utilities we've written. We've
> been using the instructions in the INSTALL file and using all of the
> defaults the configure shell suggests. However when it comes to issuing
> the make command we get nothing but errors.
>
> Has anyone out there built this release of Perl on their Sun Solaris
> system? Any help would be appreciated.
>
> - Peter
------------------------------
Date: Thu, 28 Jan 1999 13:38:44 +0100
From: "Tristan Braun" <tristan.braun@pneu.com>
Subject: format command in win32 (NT 4)
Message-Id: <36b059c5.0@news.ka.choin.net>
Please, could someone explain me, why the "format" command in the following
script does not work ?
format AUSGABE =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @###.###.###.###
$key, $Groesse{$key}
.
@ARGV=(2,"C:\\");
@dirinfo=`dir /s $ARGV[1]`;
$ARGV[0]+=$unc=2 if ($ARGV[1]=~/^\\\\/);
foreach (@dirinfo) {
next if(/<DIR>/);
if(/^V/) {
/Verzeichnis von (.*)/;
@part=split /\\/,$1;
($unc==2) ? ($dir="\\\\") : ($dir="");
for ($a=0;$a<=$ARGV[0];$a++) {
$dir=$dir.$part[$a]."\\" if ($part[$a] ne "");
}
}
else {
next if ($_=~/^\n/||$_=~/^ /);
/.*?\s+.*?\s+([\d.]*?)\s(.*)/;
$Groesse{$dir}+=join '', split '\.',$1;
}
}
foreach $key (sort keys %Groesse) {
write AUSGABE;
#printf "%-58s %15u byte\n",$key,$Groesse{$key} if ($Groesse{$key}!=0);
}
With the printf command I get a result.
Thanks in advance.
Regards,
Tristan
"You are loosing the most time, trying to win time."
Tristan Braun
Mailto:tristan.braun@pneu.com
------------------------------
Date: Thu, 28 Jan 1999 16:33:42 GMT
From: info@gadnet.com
Subject: Free Banner / Link Exchange Script Available
Message-Id: <36b09105.1686579@news.newsguy.com>
If anyone wants some freeware banner exchange / link exchange software
you can download my script from http://www.gadnet.com/bplus.
Any feedback will be gratefully received.
Drummond Miles
------------------------------
Date: 28 Jan 1999 04:20:03 +0100
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Gosh, s// faster than m// (was Re: Counting characters with tr/// (in perl))
Message-Id: <m3ww2813to.fsf@joshua.panix.com>
ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
> jdf@pobox.com wrote in article <m3ognkproe.fsf_-_@joshua.panix.com>:
> > sub substitute { $bucket =~ s/$foo/$foo/g }
> > sub match_1 { scalar (() = $bucket =~ m/$foo/g) }
> > sub match_2 { $c=0; ++$c while $bucket =~ m/$foo/g; $c }
>
> > Benchmark: timing 200000 iterations of match_1, match_2, substitute...
> > match_1: 13 wallclock secs (13.39 usr + 0.01 sys = 13.40 CPU)
> > match_2: 10 wallclock secs ( 9.89 usr + 0.00 sys = 9.89 CPU)
> > substitute: 6 wallclock secs ( 7.10 usr + 0.00 sys = 7.10 CPU)
> It is clear that Perl match_2 may be slower than C substitute. One of
> the differences with match_1 is that it creates/destroys a list of
> data. This *might* slow things down. Are you using system's malloc?
Well, I recompiled with perl's malloc, and lo!
Benchmark: timing 200000 iterations of match_1, match_2, substitute...
match_1: 11 wallclock secs (10.12 usr + 0.00 sys = 10.12 CPU)
match_2: 8 wallclock secs ( 8.98 usr + 0.00 sys = 8.98 CPU)
substitute: 8 wallclock secs ( 6.71 usr + 0.00 sys = 6.71 CPU)
Why is the perl malloc feature a default [n] in the config script?
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Thu, 28 Jan 1999 09:10:07 GMT
From: pdroogma@netscape.net (peter)
Subject: LWP and POST
Message-Id: <36b02839.5618939@192.168.0.1>
Hello,
I read the faq about posting and came up with this code.
The code is running fine (I got no compilation errors and no warnings), but I get an 405 Method not allowed when I post
The form I'm posting to is used to send messages to GSM (Mobiles).
I extracted the field names from the HTML source of this page.
Does anybody has an idea why this doesn't work ?
PS : This form uses a dll to process to request, but I guess that isn't the problem.
use LWP;
use HTTP::Headers;
use HTTP::Request::Common;
use HTTP::Request;
use strict;
my $ua = new LWP::UserAgent;
$ua->proxy(['http', 'ftp'], 'http://192.168.0.1:8080/'); # My local proxy server
my $res = $ua->request(GET 'http://www.advalvas.be/sms/index.html'); # URL of the form
if ($res->is_success)
{
print $res->as_string; # This print s the page in HTML format
print "\nOK\n";
my $res2 = $ua->request(POST 'http://www.advalvas.be/sms/index.html',
[ MfcISAPICommand => 'SendText',
origin => 'adva',
intlPrefix => '+3295',
prefix => '+3295',
tel => '123456',
bericht => 'Dag Sammy'
]);
if ($res2->is_success)
{
print "Post ok";
}
else
{
print "Error while posting";
print $res2->error_as_HTML();
}
}
else
{
print $res->error_as_HTML();
print "AAARGH";
}
Thanks anyway,
Peter
Please also CC to pdroogma@netscape.net
------------------------------
Date: Thu, 28 Jan 1999 10:11:25 GMT
From: pdroogma@netscape.net (peter)
Subject: Re: LWP and POST
Message-Id: <36b0375f.9496825@192.168.0.1>
Hello,
I found already an error, so I changed to code
<code>
my $res2 = $ua->request(POST 'http://www.advalvas.be/scripts/ProxiTextint.dll',
[ MfcISAPICommand => 'SendText',
origin => 'adva',
intlPrefix => '+3295',
prefix => '+3295',
tel => '123456',
bericht => 'Dag Sammy'
]);
<code>
But no I got the following error
500 Server error
If I try this using netscape I get
Invalid index
Peter
------------------------------
Date: Thu, 28 Jan 1999 12:38:20 GMT
From: John@melon17.freeserve.co.uk (John )
Subject: LWP Questions
Message-Id: <36b059f2.7317838@news.freeserve.net>
Is there any clear explanation as to how
you install this module on your server?
How do you call this module from your script?
John
------------------------------
Date: Thu, 28 Jan 1999 10:15:05 +0100
From: "Burkhard Kiesel" <burkhard.kiesel@med.siemens.de>
Subject: Need Example for WIN32API::RegGetKeySecurity
Message-Id: <78p9e8$3a1$1@med-iss3.erlm.siemens.de>
Hi there,
I need an example how to use the WIN32API::Registry function
"RegGetKeySecurity" and may be in addition the Function RegSetKeySecurity.
Thanks in advance
------------------------------
Date: Thu, 28 Jan 1999 07:46:11 -0500
From: Ken McNamara <conmara@tcon.net>
To: Nuno Leitao <nuno.leitao@uk.uu.net>
Subject: Re: Perl Threads
Message-Id: <36B05C13.B2E8AEBD@tcon.net>
Nuno -
I'm using threads with Perl 5.00554 to manage multiple telnet sessions
for downloading firmware from a Sun Solaris 2.5.1 box. I haven't pushed
the envelope, just 25 threads at a time - I don't know about thread
cancelation - it looks like they die with the main program.
Process is to start the Telnet sessions with main program calls to a
telnet pm - then once they are established, kick off the download via
threads.
It appears to be reasonably stable. I had some core dumps with the
5.00404 but they went away with 554.
KenMc
Nuno Leitao wrote:
> Hello,
>
> as anyone used multithreading in Perl 5.005 in a serious way ?
> How stabe is it ? Also, is there a way to do thread cancelation ?
>
> Thanks.
>
> PS: Could you please reply to e-mail to ?
>
> --Nuno.
------------------------------
Date: Thu, 28 Jan 1999 12:35:02 +0000
From: Matt Sergeant <matthew.sergeant@eml.ericsson.se>
Subject: Re: Q: CPAN on Win32 (Windows NT) Perl
Message-Id: <36B05976.29A6455B@eml.ericsson.se>
Denis.Haskin@bigfoot.com wrote:
>
> Does anyone have recommendations on getting CPAN to work well on Win32
> (Windows NT) Perl (the standard perl, 5.005.02, not the ActiveState version)?
ActiveState's _is_ the standard perl. There's no real reason to run
anything else unless you need:
- modules compiled with cygwin32
- fork (only if compiled with cygwin32, and not reliable)
- threading
(and possibly a couple of other minor points).
ActivePerl comes with Compress::Zlib and Archive::Tar pre-installed.
--
<Matt email="matt@teamamiga.org" />
| Fastnet Software Ltd | Perl in Active Server Pages |
| Perl Consultancy, Web Development | Database Design | XML |
| http://come.to/fastnet | Information Consolidation |
------------------------------
Date: Thu, 28 Jan 1999 12:33:59 GMT
From: richardc@tw2.com (Richard Clamp)
Subject: Re: Rencontre Perl de Mtl
Message-Id: <36b05906.7516065@news.highwayone.net>
On 28 Jan 1999 01:15:30 -0000, Jonathan Stowe
<gellyfish@btinternet.com> wrote:
>
>Is 'missionnaires' the same as 'mongers' ?
Pass me beer, I have important missionary work to fulful :)
Richard
--
Richard Clamp richardc@tw2.com
Frisbeetarianism, n.:
The belief that when you die, your soul goes
up on the roof and gets stuck
------------------------------
Date: Thu, 28 Jan 1999 16:43:10 GMT
From: info@gadnet.com
Subject: Re: Sending email
Message-Id: <36b09274.2051545@news.newsguy.com>
On Wed, 27 Jan 1999 23:11:48 -0500, rjk@linguist.dartmouth.edu (Ronald
J Kimball) wrote:
><info@gadnet.com> wrote:
>
>> What's wrong with ths:
>>
>> while (<MEMBERS>)
>> {
>> chomp;
>> open (MEMBER, "+<$bpdata/$_.txt");
>
>You don't check the return value when you open the file.
True, but that's not causing the problem.
>> @member = <MEMBER>;
>> close (MEMBER);
>> chomp $member[1];
>> open (MAIL, "|$mailprog -t") || die "Can't open $mailprog!\n";
>
>You don't report why the open failed. ($!)
True, but the message isn't being displayed anyway, so that's not it.
>> print MAIL "To: $member[1]\n";
>> print MAIL "From: $myemail\n";
>> print MAIL "Subject: $title\n\n";
>> print MAIL "$email\n\n";
>> close MAIL;
>
>You don't check the return value when you close the pipe.
I'll try that and report back.
>> }
>> close (MEMBERS);
>
>> When I run the script that contains this I get a Server Error message.
>> It sends three emails correctly, but then fails on the fourth. The
>> fourth email address in the MEMBERS file is invalid, but I would
>> expect it to send the email anyway. How can I change this so that it
>> will work whether the email address of the recipient is valid or not?
>
>What do you mean by "invalid"?
The email address in question looks like a real email address but is
just a made-up one. It is possible though that some email addresses
will just be gobbldygook. I suppose I could add some validation that
email address look at the minimum like a@b.c, but I still need the
script to work when these are not real email addresses.
Thanks,
Drummond
------------------------------
Date: Thu, 28 Jan 1999 01:47:06 -0800
From: Abraham Grief <abey@hill.ucr.edu>
To: Tommy Campbell <tommycampbell@mindspring.com>
Subject: Re: Setting LD_LIBRARY_PATH inside perl script
Message-Id: <Pine.LNX.4.05.9901280145230.1502-100000@hill.ucr.edu>
How about
$ENV{'LD_LIBRARY_PATH'} = 'somepath';
?
On Thu, 28 Jan 1999, Tommy Campbell wrote:
> I'm trying to write a CGI in Perl that needs to have the
> LD_LIBRARY_PATH env variable set in order for the program to find some
> needed .so files. I've read the FAQ's, the Perl Resource Kit with no
> luck. Any ideas?
>
>
------------------------------
Date: Thu, 28 Jan 1999 12:20:48 GMT
From: tommycampbell@mindspring.com (Tommy Campbell)
Subject: Re: Setting LD_LIBRARY_PATH inside perl script
Message-Id: <36b055f3.26853326@news.mindspring.com>
Doesn't work unless I set it and export if before I run the script
On Thu, 28 Jan 1999 01:47:06 -0800, Abraham Grief <abey@hill.ucr.edu>
wrote:
>
>How about
>
>$ENV{'LD_LIBRARY_PATH'} = 'somepath';
>
>?
>
>On Thu, 28 Jan 1999, Tommy Campbell wrote:
>
>> I'm trying to write a CGI in Perl that needs to have the
>> LD_LIBRARY_PATH env variable set in order for the program to find some
>> needed .so files. I've read the FAQ's, the Perl Resource Kit with no
>> luck. Any ideas?
>>
>>
>
------------------------------
Date: Thu, 28 Jan 1999 07:15:33 GMT
From: rs@jan99.fish.ch (Roland Schneider)
Subject: Simple String-Scrambling
Message-Id: <36b40a1b.7986493@news.fish.ch>
I have some POP3-Boxes for Virtual-Domain, the users are named
like "UserName%example.com". Some clients now putting in each
mail the string "username%user-domain.com@pop.mydomain.com" which
looks rather funny and is sometimes very confusing to others.
I am looking for a some simple way to 'scramble' (and unscramble)
the user-part to give each user an alternative pop3-login-name.
Tried with Crypt::DES, Crypt::IDEA and also "$cleartext ^ $key"
but this is all not what i need since it increases the user-part
to at least to the double length becase of 8-bit data in hex.
Anybody has a nice little RegExp to swap/alter some chars which
stays within the legal 7-bit charset without double the length ?
thanks for any pointers :)
Roland
------------------------------
Date: Wed, 27 Jan 1999 23:58:22 -0800
From: Abraham Grief <abey@hill.ucr.edu>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: system function, Pros and Cons??
Message-Id: <Pine.LNX.4.05.9901272145030.27407-100000@hill.ucr.edu>
On Wed, 27 Jan 1999, Tom Christiansen wrote:
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc, abey@cs.ucr.edu (Abraham Grief) writes:
> :But I think that if you're
> :making a professional quality script, you should
> :generally try to avoid the system function. If you're
> :hired to make a script for someone, you don't want
> :your program to fail if they change operating
> :systems.
>
> I have no idea what that means. Are you telling me that you honestly
> write scripts that will work on Unix, Microsoft, Apple, VMS, and MVS?
> I respectfully disbelieve you. Anyone who changes gears like that
> deserves and expects virtually infinite pain.
Well, I guess we just plain disagree on this subject. No, I don't
think all the scripts I write will run on all those platforms... I
don't even know what VMS and MVS are! :)
I will agree that absolute portability is impossible. However, I do
try to make my scripts so that they will run on most Unixes, and
sometimes even on both Unix and Windows. Possibly for something
like prex (I don't know what that is either), which from what I'm
reading is os-specific, system() might be the way to go. However, I
still believe system() should be avoided. system() might save you
from reinventing the wheel, but in the long run, it might make you
have to write a script twice, or even more.
Aside from portability issues, here are some other reasons not to
use system that have seem to have gone unrefuted:
- The performance cost of spawning a new process, especially when
your script needs to be run thousands of times per day or even per
second.
- The decreased likelihood of your script working successfully when
the os is unstable or not working in some way.
- Having the wrong program getting executed when the path is
different than what you expected.
Overall, I would say that system() can save you time and can
prevent the rewriting of programs that already exist, but I still
think it should be generally avoided for reasons of portability,
reusability, and performance.
------------------------------
Date: 28 Jan 1999 05:24:14 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: system function, Pros and Cons??
Message-Id: <78os9u$sbp$2@client2.news.psi.net>
Tom Christiansen (tchrist@mox.perl.com) wrote on MCMLXXVI September
MCMXCIII in <URL:news:36afdc20@csnews>:
,, [courtesy cc of this posting sent to cited author via email]
,,
,, In comp.lang.perl.misc, abigail@fnx.com writes:
,, :I certainly will frown upon seeing Perl code that uses 'system' to
,, :move files, list files in a directory, or to get the current time.
,,
,, So would I, probably. Although I have used:
,,
,, rename($old, $new) || system("mv", $old, $new)
,,
,, before to get the file-system copying stuff.
And not even "mv" behaves consistent between Unices. :(
Abigail
--
perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/'
------------------------------
Date: Thu, 28 Jan 1999 21:50:17 +1100
From: "Bill and Rowena Kennedy" <bkennedy@one.net.au>
Subject: Re: Test
Message-Id: <36b0460b.0@pink.one.net.au>
How's this!
Jeff Hester wrote in message <36AE62CA.265DFE53@toad.net>...
>Could someone please post a quick reply to this. I'm wondering if My
>posts are getting through.
>
>thanx.
------------------------------
Date: Thu, 28 Jan 1999 10:53:51 +0100
From: Michael <michael.preminger@jbi.hioslo.no>
Subject: The behaviour of split()
Message-Id: <36B033AF.69B8CAC6@jbi.hioslo.no>
Hello!
I have encountered difference in behaviour of the split function that
I do not understand:
In two different scripts I have strings like:
"0.01 -5.24 ...."
Those I split into an array using split(/\s+/, $string )
In one script the first element is found in the array, and in the other
it is not.
Any explanation?
Michael
------------------------------
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 4767
**************************************