[21774] in Perl-Users-Digest
Perl-Users Digest, Issue: 3978 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 16 06:05:50 2002
Date: Wed, 16 Oct 2002 03:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 16 Oct 2002 Volume: 10 Number: 3978
Today's topics:
[cgi] How to read user file (edvjacek)
Re: [cgi] How to read user file <bernard.el-hagin@DODGE_THISlido-tech.net>
Re: [cgi] How to read user file <nobody@nowhere.com>
Re: array of array? <me@dwall.fastmail.fm>
Re: array of array? <jackkon@ms29.url.com.tw>
Re: array of array? <Tassilo.Parseval@post.rwth-aachen.de>
array problem (BUCK NAKED1)
Re: array problem <uri@stemsystems.com>
Re: array problem <bernard.el-hagin@DODGE_THISlido-tech.net>
Re: array problem <depesz@depesz.pl>
Re: array problem <bernard.el-hagin@DODGE_THISlido-tech.net>
Re: Can anyone tell me how to get GD (& GD::Graph) work <rubberducky703@hotmail.com>
Re: Can anyone tell me how to get GD (& GD::Graph) work <david.hawley@acm.org>
Re: Converting undefined strings to null strings <nobull@mail.com>
Create NT/WIN2000 domain accounts through website using <cyberob@freemail.nl>
Re: http://lists.perl.org (slightly OT) <comdog@panix.com>
Re: http://lists.perl.org (slightly OT) <mgjv@tradingpost.com.au>
Re: http://lists.perl.org (slightly OT) <Tassilo.Parseval@post.rwth-aachen.de>
Image::Magick JPEG=>TIF Conversion <dzluk8fsxsw0001@sneakemail.com>
Re: Installing Modules <ron@savage.net.au>
Internal error (code 500) on every CGI <bielak.antoine@free.fr>
Re: need help with extraction <derek@wedgetail.com>
Re: need help with extraction <krahnj@acm.org>
Re: need help with extraction (Peter Ludikovsky)
Newbie: Date comparison <anthony.heuveline@wanadoo.fr>
Re: Newbie: Date comparison <krahnj@acm.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Oct 2002 02:29:06 -0700
From: jacek@pc1.ips.lodz.pl (edvjacek)
Subject: [cgi] How to read user file
Message-Id: <2abb9911.0210160129.48f22d8d@posting.google.com>
Hallo,
I have to read normal user file in my cgi script. The directory has
0700 and the file 0600. How can I make?
Thanks,
Jacek
------------------------------
Date: Wed, 16 Oct 2002 09:34:57 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: [cgi] How to read user file
Message-Id: <slrnaqqcil.12b.bernard.el-hagin@gdndev25.lido-tech>
In article <2abb9911.0210160129.48f22d8d@posting.google.com>, edvjacek
wrote:
> Hallo,
>
> I have to read normal user file in my cgi script. The directory has
> 0700 and the file 0600. How can I make?
What is your Perl question?
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'
------------------------------
Date: Wed, 16 Oct 2002 19:49:53 +1000
From: "Gregory Toomey" <nobody@nowhere.com>
Subject: Re: [cgi] How to read user file
Message-Id: <Iuar9.54206$g9.156703@newsfeeds.bigpond.com>
edvjacek wrote in message
<2abb9911.0210160129.48f22d8d@posting.google.com>...
>Hallo,
>
>I have to read normal user file in my cgi script. The directory has
>0700 and the file 0600. How can I make?
>
Change to permissions that allow you to read them?
gtoomey
------------------------------
Date: Wed, 16 Oct 2002 05:01:30 GMT
From: "David K. Wall" <me@dwall.fastmail.fm>
Subject: Re: array of array?
Message-Id: <Xns92A9A6DF2242dkwwashere@204.127.202.16>
"jackkon" <jackkon@ms29.url.com.tw> wrote:
> I extract the source code from a COBOL code.
> So the indents are not always exactly 8 spaces.
Oh well. I had fun playing with it. :-)
> But the first-level is always 01.
> I must decide the level according to the frist two digital numer in a
> line. for example,
> 01-----> level 1
> 03-----> level 2
> 05-----> level 3
> So, I must record the "digitail number--level" realtion.
> the line beginnig with 01 digital number line is always in level 1,
> But thel ine beginning with 03 digital number line is not always in
> level 2. may be the line beginning with 02 digital number line is
> level 2. Every line begining with 01 affect the level line begining
> with digital number less then 01.
>
> Sorry, my English is poor. I can't explain the rule clearly -.-"
That's ok, my command of languages other than English is, for all
practical purposes, nonexistent. I can order a beer in Spanish
("Cerveza, por favor?"), but that's about it. :-)
>
>> Of course I had Tassilo's solution to work from, so I just altered it
>> a little. :-)
>
> What's Tassilo's solution?
You can find the entire thread in Google's archives at
http://groups.google.com/groups?threadm=aogejf%244p5%40netnews.hinet.net
Since I've never used Cobol (Thank You, Random Quanta), I didn't
recognize the format and take the first digits in the lines into account.
I think you'll prefer Tassilo v. Parseval's or Benjamin Goldberg's
solution to mine. *I* would, anyway, as I think their solutions are more
applicable to your task. Benjamin's is more succinct and elegant than
what Tassilo and I posted.
--
David Wall - me@dwall.fastmail.fm
"Oook."
------------------------------
Date: Wed, 16 Oct 2002 14:26:09 +0800
From: "jackkon" <jackkon@ms29.url.com.tw>
Subject: Re: array of array?
Message-Id: <aoj0d5$fcr@netnews.hinet.net>
"Benjamin Goldberg" <goldbb2@earthlink.net> ?????
news:3DAC4D05.61AC210C@earthlink.net...
> jackkon wrote:
> > ========text file
> > 01 AAAA-F.
> > 03 AA-ERR PIC S9(05).
> > 03 AA-FNAME PIC X(10).
> > 03 AA-COUNT-K PIC 9(10).
> > 01 AAAA-R.
> > 03 AA-REC-KEY.
> > 05 AA-DEPT-NO PIC X(02).
> > 05 AA-DEPT-MAX PIC X(02).
> > 03 AA-DEPT-NAME PIC X(12).
> > 03 AA-BED-NO PIC 9(05).
> > 03 AA-TOT-BED-NO PIC 9(05).
> This solution was inspired by both tassilo's and david's solutions, but
> I believe it to be simpler and more elegant.
>
> my @data;
> while( <DATA> ) {
> chomp;
> my ($depth, $hasinfo) = /(\d+) \S+(\s?)/;
I change the line to
my ($depth, $hasinfo) = /(\d+)(.*)/;
> my $dref = \@data;
What the three lines below mean and do?
I can't understand it -.-"
May I ask for you to explain it. Thanks a lot ^^
> $dref = $dref->[-1] for 1 .. ($depth - 1) / 2;
> push @$dref, $_;
> push @$dref, [] if !$hasinfo;
> }
> [untested]
I test the code, and it works but not what I expect.
If I could, I will modify the code to fit my need.
Thanks Benjamin
------------------------------
Date: 16 Oct 2002 07:15:01 GMT
From: "Tassilo v. Parseval" <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: array of array?
Message-Id: <aoj3ll$222$1@nets3.rz.RWTH-Aachen.DE>
Also sprach jackkon:
> "Benjamin Goldberg" <goldbb2@earthlink.net> ?????
> news:3DAC4D05.61AC210C@earthlink.net...
>> This solution was inspired by both tassilo's and david's solutions, but
>> I believe it to be simpler and more elegant.
>>
>> my @data;
>> while( <DATA> ) {
>> chomp;
>> my ($depth, $hasinfo) = /(\d+) \S+(\s?)/;
>
> I change the line to
> my ($depth, $hasinfo) = /(\d+)(.*)/;
>
>> my $dref = \@data;
>
> What the three lines below mean and do?
> I can't understand it -.-"
> May I ask for you to explain it. Thanks a lot ^^
>
>> $dref = $dref->[-1] for 1 .. ($depth - 1) / 2;
>> push @$dref, $_;
>> push @$dref, [] if !$hasinfo;
You need to be familiar with references to understand those (in case you
are not, start with 'perldoc perlreftut' or 'perldoc perlref').
What Benjamin did is actually descending into the hierarchie of the
array. That is, the above code finds the nested array-ref into which the
data is pushed (Gee, that is hard to describe as non-native speaker).
$depth is either "01", "03" or "05" in your sample data. The
transformation:
($depth - 1) / 2;
turns that into either 0, 1 or 2 and thus determines how often the code
has to pick the last element of the array-ref. Once done that:
push @$dref, $_;
pushes the current line onto the array that was previously found with
the for-loop.
push @$dref, [] if !$hasinfo;
then pushes a reference to an empty array onto the very same array. This
is only done if the second pair of parens of
/(\d+) \S+(\s?)/
^^^
did not match a whitespace character (what they matched is stored in
$hasinfo).
Tassilo
--
$_=q!",}])(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
$_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;
------------------------------
Date: Wed, 16 Oct 2002 00:33:49 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: array problem
Message-Id: <19831-3DACFA3D-993@storefull-2278.public.lawson.webtv.net>
Is there a way to reverse an array? I've read perlfaq4, perldocs, and
googled, and can't find out how to reverse an array. reverse(@names)
doesn't reverse it. Can $_ be reversed? If so, how?
I thought it may not be working because of scoping; but when I removed
the my's, it still did not reverse the array. Note that this array is in
a foreach block.
The array values and length are unknown until the script gets them; but
to illlustrate, let's say that my array is
@names = ("bob", "fred", linda);
and I want my foreach loop to start with linda and go backwards, as in
@names = ("linda", "fred", "bob");
Could someone please tell me what documentation to look at or how to
solve this.
Thanks,
Dennis
------------------------------
Date: Wed, 16 Oct 2002 05:49:35 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: array problem
Message-Id: <x7zntf9bm9.fsf@mail.sysarch.com>
>>>>> "BN" == BUCK NAKED1 <dennis100@webtv.net> writes:
BN> Is there a way to reverse an array? I've read perlfaq4, perldocs, and
BN> googled, and can't find out how to reverse an array. reverse(@names)
BN> doesn't reverse it. Can $_ be reversed? If so, how?
define reverse.
and rtfm again. the reverse function will do what you want. read it
again carefully. if you don't figure it out, read it again. it is
staring you in the face.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Wed, 16 Oct 2002 05:58:06 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: array problem
Message-Id: <slrnaqpvrm.7rm.bernard.el-hagin@gdndev25.lido-tech>
In article
<19831-3DACFA3D-993@storefull-2278.public.lawson.webtv.net>, BUCK
NAKED1 wrote:
> Is there a way to reverse an array? I've read perlfaq4, perldocs, and
> googled, and can't find out how to reverse an array. reverse(@names)
> doesn't reverse it. [...]
What do you mean reverse(@names) doesn't reverse it???
-----------
my @blah = qw/a b c d e/;
print for reverse @blah;
RESULT:
edcba
-----------
Show us your code. You must be doing something else wrong.
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'
------------------------------
Date: Wed, 16 Oct 2002 09:24:30 +0200
From: hubert depesz lubaczewski <depesz@depesz.pl>
Subject: Re: array problem
Message-Id: <slrn.pl.aqq51e.a9v.depesz@depeszws.depesz.pl>
BUCK NAKED1 wyrzeĽbił(a):
> googled, and can't find out how to reverse an array. reverse(@names)
> doesn't reverse it. Can $_ be reversed? If so, how?
it does reverse it. just remember it's a function and it returns
something.
as for $_. it can be reversed too. in the same manner.
but remember: never do: print reverse $_; this will not work.
> The array values and length are unknown until the script gets them; but
> to illlustrate, let's say that my array is
> @names = ("bob", "fred", linda);
> and I want my foreach loop to start with linda and go backwards, as in
probably reverse is overkill. i would start with something simplier:
like:
for (my $i=$#names; $i>=0; $i--) {
print $names[$i]."\n";
}
depesz
--
hubert depesz lubaczewski http://www.depesz.pl/
------------------------------------------------------------------------
Mój Boże, spraw abym milczał, dopóki się nie upewnię, że naprawdę mam
co¶ do powiedzenia. (c) 1998 depesz
------------------------------
Date: Wed, 16 Oct 2002 08:31:38 +0000 (UTC)
From: Bernard El-Hagin <bernard.el-hagin@DODGE_THISlido-tech.net>
Subject: Re: array problem
Message-Id: <aoj85a$2q7$1@korweta.task.gda.pl>
In article <slrn.pl.aqq51e.a9v.depesz@depeszws.depesz.pl>, hubert
depesz lubaczewski wrote:
> BUCK NAKED1 wyrzeĽbił(a):
>> googled, and can't find out how to reverse an array. reverse(@names)
>> doesn't reverse it. Can $_ be reversed? If so, how?
>
> it does reverse it. just remember it's a function and it returns
> something.
> as for $_. it can be reversed too. in the same manner.
> but remember: never do: print reverse $_; this will not work.
Sure it'll work. Just not the way one might expect.
>> The array values and length are unknown until the script gets them; but
>> to illlustrate, let's say that my array is
>> @names = ("bob", "fred", linda);
>> and I want my foreach loop to start with linda and go backwards, as in
>
> probably reverse is overkill. i would start with something simplier:
> like:
> for (my $i=$#names; $i>=0; $i--) {
> print $names[$i]."\n";
> }
Jesus, you call that simpler than using reverse()???
print "$_\n" for reverse @names;
or
for (reverse @names) {
print "$_\n";
}
Both seem simpler than that C-style for.
Cheers,
Bernard
--
echo 42|perl -pe '$#="Just another Perl hacker,"'
------------------------------
Date: Wed, 16 Oct 2002 08:57:24 +0100
From: "Rubber Duck" <rubberducky703@hotmail.com>
Subject: Re: Can anyone tell me how to get GD (& GD::Graph) working on Win32!!
Message-Id: <aoj62v$n0d5o$1@ID-116287.news.dfncis.de>
I've given up, couldn't get ppm to work (prolly firewall or proxy settings)
i have resorted to good ole win32::OLE
"Bob Walton" <bwalton@rochester.rr.com> wrote in message
news:3DACC6D9.1060607@rochester.rr.com...
> Rubber Duck wrote:
>
> ...
> > As subject. I've searched google till i'm blue in the face Played
about
> > with GD.dll and GD.pll. I'm trying to use GD::Graph but of course this
> > needs GD which on linux has C dependencies.
> ...
>
>
> > PT
>
>
> At a command prompt:
>
> ppm install GD
>
> followed by:
>
> ppm install GDGraph
>
> should do the trick. Works for me, anyway (AS build 633, Windoze 98SE).
>
> --
> Bob Walton
>
------------------------------
Date: Wed, 16 Oct 2002 17:21:45 +0900
From: "Sojourneer" <david.hawley@acm.org>
Subject: Re: Can anyone tell me how to get GD (& GD::Graph) working on Win32!!
Message-Id: <aoj7d7$5hv$1@newsflood.tokyo.att.ne.jp>
I've got GD on a hosted Win server to work without using ppm.
Points:
- in your Perlscript add the line
"use server_mappath_to_my_Perllib_directory;"
Create this directory on the server.
- ftp your GD libraries to the server under that directory, ie.
server_mappath_to_my_Perllib_directory/GD
server_mappath_to_my_Perllib_directory/GD/Graph
together with the directory contents
- copy the GD.dll, GD.exp and GD.dll libraries under
server_mappath_to_my_Perllib_directory
And thats it. I arrived at this by a little experimentation.
Cheers
David Hawley
------------------------------
Date: 16 Oct 2002 09:18:22 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Converting undefined strings to null strings
Message-Id: <u9lm4yer01.fsf@wcl-l.bham.ac.uk>
nospam@behrendsen.com (Tim Behrendsen) writes:
> Benjamin Goldberg <goldbb2@earthlink.net> wrote in message news:<3DAC5563.43D5E213@earthlink.net>...
> >
> > Then you should use the lexical pragma, "no warnings qw(undefined);" in
> > the scope of the place where you're doing that comparison.
>
> That's certainly one way to do it, but something with a little finer
> granularity would be nice. I like having the warnings for normal
> cases, but sometimes you just want to compare a database column to ''
> without having to jump through hoops.
You appear to be saying you want an operator that returns true for
undef and '' and false for all others?
Have you considered defining an operator that returns true for
undef and '' and false for all others?
sub is_null($) { no warnings 'uninitialized'; '' eq shift }
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 16 Oct 2002 08:31:30 +0200
From: "Rob" <cyberob@freemail.nl>
Subject: Create NT/WIN2000 domain accounts through website using Netadmin, AdminMisc
Message-Id: <3dad07c1$0$64895$e4fe514c@dreader1.news.xs4all.nl>
Hello,
How can I create Domain NT accounts through a CGi script running on an IIS
win2000 member server, so not a root domain controller. (formerly a PDC)
If it can be done show me how please. The only accounts I create through the
cgi using the netadmin module are local and is not done on a very secure
manner.
Thankz in Advance.
------------------------------
Date: Wed, 16 Oct 2002 00:05:59 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: http://lists.perl.org (slightly OT)
Message-Id: <161020020005596679%comdog@panix.com>
In article <slrnaqplmv.1qr.mgjv@verbruggen.comdyn.com.au>, Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
> On 15 Oct 2002 18:10:17 GMT,
> Tassilo v. Parseval <Tassilo.Parseval@post.rwth-aachen.de> wrote:
> > Also negative. But there is nntp.perl.org, as I just discovered. A
> > newsserver dedicated to Perl...I finally found heaven. ;-)
> Last time I tried, it was still a read-only news service
i've been posting through it without problems for months.
--
brian d foy <comdog@panix.com> - Perl services for hire
The Perl Review - a new magazine devoted to Perl
<http://www.theperlreview.com>
------------------------------
Date: Wed, 16 Oct 2002 05:20:49 GMT
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: http://lists.perl.org (slightly OT)
Message-Id: <slrnaqpts8.1qr.mgjv@verbruggen.comdyn.com.au>
On Wed, 16 Oct 2002 00:05:59 -0500,
brian d foy <comdog@panix.com> wrote:
> In article <slrnaqplmv.1qr.mgjv@verbruggen.comdyn.com.au>, Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
>
>> On 15 Oct 2002 18:10:17 GMT,
>> Tassilo v. Parseval <Tassilo.Parseval@post.rwth-aachen.de> wrote:
>
>> > Also negative. But there is nntp.perl.org, as I just discovered. A
>> > newsserver dedicated to Perl...I finally found heaven. ;-)
>
>> Last time I tried, it was still a read-only news service
>
> i've been posting through it without problems for months.
Hmm.. I think it's more like 6 to 9 months ago that I last tried..
Good to know it should work now. I'll give it a try again next time I
see a message on one of the lists which I feel a need to respond to :)
Martien
--
|
Martien Verbruggen |
Trading Post Australia | "Mr Kaplan. Paging Mr Kaplan..."
|
------------------------------
Date: 16 Oct 2002 08:37:44 GMT
From: "Tassilo v. Parseval" <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: http://lists.perl.org (slightly OT)
Message-Id: <aoj8go$6on$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Martien Verbruggen:
> On Wed, 16 Oct 2002 00:05:59 -0500,
> brian d foy <comdog@panix.com> wrote:
>> In article <slrnaqplmv.1qr.mgjv@verbruggen.comdyn.com.au>, Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
[nntp.perl.org]
>>> Last time I tried, it was still a read-only news service
>>
>> i've been posting through it without problems for months.
>
> Hmm.. I think it's more like 6 to 9 months ago that I last tried..
>
> Good to know it should work now. I'll give it a try again next time I
> see a message on one of the lists which I feel a need to respond to :)
Don't hesitate to stuff your MUA back into the lowest drawer. I just had
my first post to perl.xs show up in the mailing list's archive. :-)
Looks as though you don't even have to subscribe to the list you are
posting to (assuming that my desperate attempts to subscribe yesterday
didn't work since I never received any reply).
Really a big thanks to all those people having built this impressive
infrastructure (CPAN, *.perl.org, etc etc) around Perl...and to those
who keep improving and maintaining it!
Tassilo
--
$_=q!",}])(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
$_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;
------------------------------
Date: Wed, 16 Oct 2002 09:35:41 +0200
From: "Jonas Nilsson" <dzluk8fsxsw0001@sneakemail.com>
Subject: Image::Magick JPEG=>TIF Conversion
Message-Id: <aoj4s8$k92$1@news.island.liu.se>
Hello
Among other things, at one stage I want to convert a JPEG picture into TIF
using Image::Magick. Some problems arise which seems like bugs to me. Here
is some example code:
#!perl
use strict;
use Image::Magick;
my $file="P4130004.JPG"; #1600x1200 jpeg
my $res;
my $p = new Image::Magick;
$res=$p->Read($file); warn "$res" if "$res";
my $width=$p->Get('width');
my $height=$p->Get('height');
my $dim="${width}x$height";
print "$dim\n";
$res=$p->Write(filename=>"out1.tif"); warn "$res" if "$res";
$p->Set('magick'=>'RGB');
$res=$p->Write(filename=>"out2.tif"); warn "$res" if "$res";
my $p2=$p->Montage(geometry=>$dim);
$res=$p2->Write(filename=>"out3.tif"); warn "$res" if "$res";
$p2->Crop($dim);
$res=$p2->Write(filename=>"out4.tif"); warn "$res" if "$res";
According to me all four tif:s should be identical. However out1.tif and
out2.tif are impossible to open with my picture viewer and the files are
very much to small (476 kb). Both out3.tif and out4.tif are valid picture
files (5635 kb and 5645 kb) but out3.tif is 1600x1202 pixels (showing two
white lines in the bottom) and only out4.tif seems to be correct.
So why doesn't it work?
I also get some warnings which I don't understand:
Warning 330: no magic configuration file found (magic.mgk) [No such file or
directory] at cplm.pl line 7.
Warning 315: no delegates configuration file found (delegates.mgk) [No such
file or directory] at cplm.pl line 13.
Warning 315: no delegates configuration file found (delegates.mgk) [No such
file or directory] at cplm.pl line 16.
1600x1200
I'm using PPM:s Image-Magick [5.26] An objected-oriented Perl interface to
ImageMagick for Windows 2000.
Also another thing. Is there any good reference or tutorial for
Image::Magick. The homepage http://www.imagemagick.org is incomplete and
functions are not very well specified.
/jN
------------------------------
Date: Wed, 16 Oct 2002 20:00:00 +1000
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: Installing Modules
Message-Id: <aojdd6$2on4$1@arachne.labyrinth.net.au>
"Graeme" <invalid@pinnock.com> wrote in message news:TwTq9.823$a32.67836@newsfep1-win.server.ntli.net...
>
> "Brian McCauley" <nobull@mail.com> wrote in message
> news:u9r8esdkqw.fsf@wcl-l.bham.ac.uk...
> > "Graeme" <invalid@pinnock.com> writes:
> >
> > > I downloaded SerialPort-0_19.zip from
> > > http://members.aol.com/Bbirthisel/alpha.html but the install
> > > instructions are a bit light on detail.
There is a general guide here:
http://savage.net.au/Perl-modules/html/installing-a-module.html
--
Cheers
Ron Savage
ron@savage.net.au
http://savage.net.au/index.html
------------------------------
Date: Wed, 16 Oct 2002 11:45:15 +0200
From: Antoine <bielak.antoine@free.fr>
Subject: Internal error (code 500) on every CGI
Message-Id: <3dad3920$0$242$626a54ce@news.free.fr>
Hello
I've installed e-swish on my apche server and i try to use swish.cgi.
I've configured my virtual server to use cgi but I always have a 500 error
(internal error) ...
I've made a test with a test script (in the cgi-bin directory of my virtual
server):
#!/bin/sh
echo "hello world !"
It also give me a 500 error ...
Anyone have an idea ?
Antoine
------------------------------
Date: Wed, 16 Oct 2002 04:46:44 GMT
From: Derek Thomson <derek@wedgetail.com>
Subject: Re: need help with extraction
Message-Id: <Ua6r9.445$i84.52854@news.optus.net.au>
Sunil Abraham wrote:
> 1. C:\ABC\xyz\trw\rti.doc
> 2. x:\trw\yuw\yuts\yurx@yur_utx\lastinfo
>
> In 1., I want to be able to extract everything after C:\ABC\ ie.
> xyz\trw\rti.doc
> In 2. everything starting with the last "\" ie. \lastinfo
It would help immensely if you explain why you want to do this,
otherwise any advice we give you may be too specific, and not actually
cope with your situation very well.
With that in mind, here's my answers:
1.
If you want to extract everything after, literally 'C:\ABC\' one answer is:
my $string1 = 'C:\ABC\xyz\trw\rti.doc';
if ($string1 =~ m/C:\\ABC\\(.*)$/) {
print $1, "\n";
}
If you want to match on any top-level directory, it would be something like:
if ($string1 =~ m/C:\\[^\\]+\\(.*)$/) {
print $1, "\n";
}
You can probably extend this to achieve what you really want from here.
2.
This is less ambiguous. You just want to extract the last path
component, I think. I'm not sure why you want that last '\', so I'll
assume you don't really want it for now.
my $string2 = 'x:\trw\yuw\yuts\yurx@yur_utx\lastinfo';
if ($string2 =~ m/\\([^\\]*)$/) {
print $1, "\n";
}
See the perlre page for an explanation of regular expressions, if these
examples are confusing.
Now, all of the above doesn't even begin to touch on the complexities of
portably dealing with file paths. Not the least of which is the issue of
whether the separator is going to be '/' or '\'.
I normally use the standard File::Basename module to do this sort of
thing, as it deals with many of the issues for you.
For example:
use File::Basename;
my $basename = basename $string2;
print $basename, "\n";
... outputs 'lastinfo' on MSDOS derived systems.
--
D.
------------------------------
Date: Wed, 16 Oct 2002 04:52:21 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: need help with extraction
Message-Id: <3DACF057.3B2E3F41@acm.org>
Sunil Abraham wrote:
>
> 1. C:\ABC\xyz\trw\rti.doc
> 2. x:\trw\yuw\yuts\yurx@yur_utx\lastinfo
>
> In 1., I want to be able to extract everything after C:\ABC\ ie.
> xyz\trw\rti.doc
> In 2. everything starting with the last "\" ie. \lastinfo
use File::Spec;
# 1.
my ( undef, $directories, $file ) = File::Spec->splitpath( 'C:\ABC\xyz\trw\rti.doc' );
my @dirs = File::Spec->splitdir( $directories );
shift @dirs;
my $path = File::Spec->catfile( @dirs, $file );
# 2.
my ( undef, undef, $file ) = File::Spec->splitpath( 'x:\trw\yuw\yuts\yurx@yur_utx\lastinfo' );
John
--
use Perl;
program
fulfillment
------------------------------
Date: 16 Oct 2002 00:28:23 -0700
From: darthludi@gmx.net (Peter Ludikovsky)
Subject: Re: need help with extraction
Message-Id: <c5e72ad8.0210152328.7f520b7b@posting.google.com>
> 1. C:\ABC\xyz\trw\rti.doc
> 2. x:\trw\yuw\yuts\yurx@yur_utx\lastinfo
> In 1., I want to be able to extract everything after C:\ABC\ ie. xyz\trw\rti.doc
> In 2. everything starting with the last "\" ie. \lastinfo
1. Try a regex like /^\w\:\\\w?\\(\w*)/
2. Much alike: /\\\w?$/
Explanation: see perldoc perlretut || perldoc perlre
Peter
------------------------------
Date: Wed, 16 Oct 2002 11:32:18 +0200
From: "Anthony" <anthony.heuveline@wanadoo.fr>
Subject: Newbie: Date comparison
Message-Id: <aojbic$o2i$1@news-reader10.wanadoo.fr>
Hi,
I want to compare the creation date of some files with the current date.
How can I can get the number of days that separate these two dates?
Thank you in adavance.
Anthony.
------------------------------
Date: Wed, 16 Oct 2002 09:44:01 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Newbie: Date comparison
Message-Id: <3DAD34B2.D870D735@acm.org>
Anthony wrote:
>
> I want to compare the creation date of some files with the current date.
> How can I can get the number of days that separate these two dates?
Which operating system? In Unix, files do not have a creation date.
John
--
use Perl;
program
fulfillment
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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 3978
***************************************