[19742] in Perl-Users-Digest
Perl-Users Digest, Issue: 1937 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 16 06:05:45 2001
Date: Tue, 16 Oct 2001 03:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1003226708-v10-i1937@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 16 Oct 2001 Volume: 10 Number: 1937
Today's topics:
Re: #!/usr/bin/perl not being parsed properly (Villy Kruse)
Re: about special chars when split() (Joe Smith)
Checking if a file exists <simonp@NOSPAM.dircon.co.uk>
Re: Checking if a file exists <usenet@diefenba.ch>
Re: Checking if a file exists <Thomas@Baetzler.de>
Re: Checking if a file exists <simonp@NOSPAM.dircon.co.uk>
Re: Checking if a file exists <s.warhurst@rl.ac.uk>
Re: Checking if a file exists <s.warhurst@rl.ac.uk>
Re: color <pne-news-20011016@newton.digitalspace.net>
Does anyone happen to have a place where i could read u <sefy@bvr.co.il>
Don't want to invent the wheel <remco@polderland.nl>
Re: Help on wait and get process ids.. (Rashyid)
Re: Help requested - trying to understand the commify r (Bob Dubery)
HELP: cropping lines? (Bruno Boettcher)
Re: HELP: cropping lines? <bernard.el-hagin@lido-tech.net>
Re: HELP: cropping lines? <usenet@diefenba.ch>
how to logout from icewm or oroborus ?? <home@home.com>
Re: How to set timeout in Perl? (Joe Smith)
Re: How to undef many vars at once <pne-news-20011016@newton.digitalspace.net>
Re: How to undef many vars at once <bart.lateur@skynet.be>
Re: How to undef many vars at once <johni@pa.press.net>
Re: How to undef many vars at once <ilya@martynov.org>
Re: ImageMagick or Gimp?? <rob_13@excite.com>
Re: ImageMagick or Gimp?? (Martien Verbruggen)
Re: ImageMagick or Gimp?? <bart.lateur@skynet.be>
Re: PERL freelance programmer availeable <pne-news-20011016@newton.digitalspace.net>
problem in getting directory list and filelist through (Raja sekhar)
Re: putting $1..$9 into a replacement string such as $r <bernard.el-hagin@lido-tech.net>
Re: putting $1..$9 into a replacement string such as $r <bernard.el-hagin@lido-tech.net>
Re: putting $1..$9 into a replacement string such as $r (Joe Smith)
Re: Socket read/write select problem <real@earthling.net>
Re: sort an array and print out biggest number <pne-news-20011016@newton.digitalspace.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Oct 2001 07:55:55 GMT
From: vek@pharmnl.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: #!/usr/bin/perl not being parsed properly
Message-Id: <slrn9snpv9.jeg.vek@pharmnl.ohout.pharmapartners.nl>
On Mon, 15 Oct 2001 21:07:25 -0400,
Jean-Luc Lachance <jllachan@interlink.net> wrote:
>Well, turns out that there was a <CR> in my script - not this one but the one I
>wrote.
>for some reason, VI had :set ff=dos !!!
>
For those that dont know vim: when ff=dos the file line termination is
CRLF and it won't show on the screen. ":se ff=unix" and saving the file
will convert the file to unix line endings. "vim -b filename" will display
the line endings as ^M for dos files like traditional vi have always done.
Villy
------------------------------
Date: Tue, 16 Oct 2001 10:02:12 +0000 (UTC)
From: inwap@best.com (Joe Smith)
Subject: Re: about special chars when split()
Message-Id: <9qh0j4$9op$1@nntp1.ba.best.com>
In article <MPG.163115f7a7240a3989683@news.cuhk.edu.hk>,
Cliver Yang <divetolife@yahoo.com> writes:
> I am doing a log analyzer on Winroute log. But I donot know how to
> process special characters when split().Such as the following line:
> "192.168.1.25 - muwei [03/Sep/2001:14:23:45 +0800] "GET
> http://www.microsoft.com/isapi/redir.dll?Prd=ie&Pver=5.0&Ar=ie5update&O1
> =b1 HTTP/1.0" 302 296"
>
> @test=split(/\s+/,$_);
This is a task for matching delimiters, not split()ing.
# Typical input lines:
# uu.net /jms - [12/Apr/1995:06:36:33 -0700] "GET / HTTP/1.0" 200 2512
# uu.net /jms - [23/Dec/1996:06:36:33 -0700] "GET / HTTP/1.0" 200 2512 "R" "U"
($host,$user,$auth,$timestamp,$command,$status,$size) =
/(\S+) (\S+) (\S+) \[(.*)\] "([^"]*)" (\d+) (.*)/;
# Logs created on my ISP after 1-Apr-96 have HTTP_REFERER and HTTP_USER_AGENT
if ($size =~ /(\d+) "([^"]*)" "(.*)"/) {
($size,$referer,$useragent) = ($1,$2,$3);
} else {
$referer = $useragent = "";
}
($verb,$file,$vers) = split(' ',$command,3); # GET, POST or HEAD
($verb,$file,$vers) = ($command,"-","-") unless $file; # For "-"
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Tue, 16 Oct 2001 09:11:48 +0100
From: "Simon Pearce" <simonp@NOSPAM.dircon.co.uk>
Subject: Checking if a file exists
Message-Id: <9qgq4r$8d1$1@news6.svr.pol.co.uk>
Hi everyone :)
I have a CGI perl script that opens a particular document to read info from
it.
What I would like to do is be able to check if that file actually exists
first - something like:
if (file.txt does not exist) { &file_error; }
How can I do the file.txt does not exist bit!?
Thanks!
Simon
------------------------------
Date: 16 Oct 2001 12:22:30 +0200
From: Kai Diefenbach <usenet@diefenba.ch>
Subject: Re: Checking if a file exists
Message-Id: <uy7ktvnau1.fsf@diefenba.ch>
Hi,
>>>>> "Simon" == Simon Pearce <simonp@NOSPAM.dircon.co.uk> writes:
Simon> What I would like to do is be able to check if that file actually
Simon> exists first - something like:
Simon> if (file.txt does not exist) { &file_error; }
&file_error unless -e file.txt;
take care of the current directory or use a absolut path.
% perldoc -f -x
Kai.
------------------------------
Date: Tue, 16 Oct 2001 10:35:51 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Checking if a file exists
Message-Id: <k7snst0qvdmia5p21kcarpp89sm68po3qr@4ax.com>
On Tue, 16 Oct 2001, "Simon Pearce" <simonp@dircon.co.uk> wrote:
>How can I do the file.txt does not exist bit!?
See the file test operators section in the perlfunc manpage for details,
("perldoc -f -X").
HTH,
--
use strict;my($i,$t,@r)=(0,'5 -.@BHJPT4acd6e2hk2lmn2o4r2s3tuz',map{ord}
split//,unpack('u*','L#`T&)QD5#0`#!!`#%1D)#08`#P05!!(3``$$"``#"0L&``('.
'"`P<!`````0$`'));$t=~s/(\d)(.)/$2x$1/eg;map{$t.=substr$t,$i,1,''while
$_--;$i++}@r;print"$t\n";# Thomas@Baetzler.de - http://baetzler.de/perl
------------------------------
Date: Tue, 16 Oct 2001 09:46:59 +0100
From: "Simon Pearce" <simonp@NOSPAM.dircon.co.uk>
Subject: Re: Checking if a file exists
Message-Id: <9qgs6r$hth$1@news8.svr.pol.co.uk>
Thanks guys! That works great!
Simon
"Simon Pearce" <simonp@NOSPAM.dircon.co.uk> wrote in message
news:9qgq4r$8d1$1@news6.svr.pol.co.uk...
> Hi everyone :)
>
> I have a CGI perl script that opens a particular document to read info
from
> it.
>
> What I would like to do is be able to check if that file actually exists
> first - something like:
>
> if (file.txt does not exist) { &file_error; }
>
> How can I do the file.txt does not exist bit!?
>
> Thanks!
>
> Simon
>
>
>
------------------------------
Date: Tue, 16 Oct 2001 09:59:35 +0100
From: "S Warhurst" <s.warhurst@rl.ac.uk>
Subject: Re: Checking if a file exists
Message-Id: <9qgsto$g7o@newton.cc.rl.ac.uk>
"Simon Pearce" <simonp@NOSPAM.dircon.co.uk> wrote in message
news:9qgq4r$8d1$1@news6.svr.pol.co.uk...
> if (file.txt does not exist) { &file_error; }
>
> How can I do the file.txt does not exist bit!?
if(-e "c:/file.txt"){print "yes it exists!";}
Spencer
------------------------------
Date: Tue, 16 Oct 2001 10:03:17 +0100
From: "S Warhurst" <s.warhurst@rl.ac.uk>
Subject: Re: Checking if a file exists
Message-Id: <9qgt4m$14l0@newton.cc.rl.ac.uk>
"S Warhurst" <s.warhurst@rl.ac.uk> wrote in message
news:9qgsto$g7o@newton.cc.rl.ac.uk...
> "Simon Pearce" <simonp@NOSPAM.dircon.co.uk> wrote in message
> news:9qgq4r$8d1$1@news6.svr.pol.co.uk...
>
> > if (file.txt does not exist) { &file_error; }
> >
> > How can I do the file.txt does not exist bit!?
>
> if(-e "c:/file.txt"){print "yes it exists!";}
If I had of read your question properly, I would have said:
if(!-e "d:/access.log"){print "no it doesnt exist!";}
:)
Spencer
------------------------------
Date: Tue, 16 Oct 2001 07:28:43 +0200
From: Philip Newton <pne-news-20011016@newton.digitalspace.net>
Subject: Re: color
Message-Id: <c3gnst4ghnb3uqqogil6okhg538n56i1rf@4ax.com>
On Mon, 15 Oct 2001 18:42:56 +0200, "sefy" <sefy@bvr.co.il> wrote:
> print ("Hello word"); # in color
Curiously enough, `perldoc -q color` yields exactly one answer which is
phrased very similar to what you said: "How do I print something out in
color?".
Please check the Perl FAQs before you post, and indicate that you did so
and did not find anything. Thank you.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Tue, 16 Oct 2001 10:25:45 +0200
From: "sefy" <sefy@bvr.co.il>
Subject: Does anyone happen to have a place where i could read up on how to do
Message-Id: <9qgqr4$851$1@news.netvision.net.il>
Does anyone happen to have a place where i could read up on how to do
#/bin/perl
print ("Hello word"); # in color
exit(0);
Output > Hello word (the font color is change)
Thanks sefy twito B.V.R systems
sefy@bvr.co.il
------------------------------
Date: Tue, 16 Oct 2001 11:36:13 +0200
From: Remco van Veenendaal <remco@polderland.nl>
Subject: Don't want to invent the wheel
Message-Id: <3BCBFF8C.4A394993@polderland.nl>
Hi,
For my company, I'd like to set up a simple CGI (Perl) WebQ&A (FAQ)
system as a first step towards knowledge management (crud Q&A via Web
form, publish FAQ, etc).
I know Perl from a few years ago and I already implemented a very simple
prototype with text file database. But if there are examples of such
systems, please help me not to invent the wheel...
Thanks in advance,
Remco van Veenendaal
Linguistic Software Engineer
Polderland Language and Speech Technology
------------------------------
Date: 15 Oct 2001 23:56:37 -0700
From: rra@excite.com (Rashyid)
Subject: Re: Help on wait and get process ids..
Message-Id: <79c1319c.0110152256.37c7f220@posting.google.com>
hi there again...
well, actually i didn't make myslef clear... heres what i need to do
A------------>B-------------->C-------------->D--......
| | | |
| | | |
E F G H
| | | |
| | | |
J L M N
from the diagram above, A,B,C....are *sub-procedures* that i need to
call.
each line shows a wait.. where, for eg once A finishes, E and B starts
and then when B finishes running, C and F starts and so on.. the
subprocedures basically are system calls that pass through variables
and process the results..
is there a syntax such like..
run A
if A finishes{run B; (run E and then J;)}
if B finishes{run C; (run G and then M;)}
if C finishes{run D; (run H and then N;)}
......
and it goes on and on..
Sorry if this is a trivial question, but i am a newbie here..
Thnaks in advance again
Redza
------------------------------
Date: Tue, 16 Oct 2001 06:58:01 GMT
From: megapode@hotmail.com (Bob Dubery)
Subject: Re: Help requested - trying to understand the commify regex
Message-Id: <3bcbd95e.53749237@10.100.2.1>
On Sun, 14 Oct 2001 17:24:58 GMT, garry@ifr.zvolve.net (Garry
Williams) wrote:
>On 14 Oct 2001 10:03:35 -0700, Bob Dubery <megapode@hotmail.com> wrote:
>> $revno = reverse $number;
>> $revno =~ s/(\d{3})(?=\d)(?!\d*\.)/$1,/g;
>> $number = reverse $revno;
>>
>> Ok... I understand the reverse fine :-) The regex baffles me though...
>>
>> 1) I understand the first part of the regex... that's matching 3
>> digits. The others aren't so clear to me.
>
>Review the perlre manual page.
>
>The (?=\d) is a positive look-ahead assertion that requires a digit
>after the first three. The (?!\d*\.) is a negative look-ahead
>assertion that requires that *no* periods appear after the first three
>and possibly more digits. These look-ahead assertions do *not*
>consume any part of the string being matched, so they both can be true
>about the same part of the string at the same time.
>
>Look-ahead is pretty cool, eh?
It seems it isn't working quite the way I thought it did...
{\d{3}) says "match 3 digits..."
(?=\d) says "...but only if there's a digit immediately to the
left..."
(?!\d*\.) says "... and if there is NOT a decimal point to the
left...".
And the s/// operator must take ALL of those into account.
$1 then matches only what (\d{3}) matched - if anything.
And then it would seem that if the string you start with is something
like 98765432 then Perl starts matching from the 9, finds it is has a
match and then does a substitution so that the string now looks like
987,65432 and so it can't find matches starting at the 8 and the 7,
but can find another match starting at the 6....
Interesting. Yes, and cool :-)
------------------------------
Date: Tue, 16 Oct 2001 07:26:13 +0000 (UTC)
From: bboett@bboett.dyndns.org (Bruno Boettcher)
Subject: HELP: cropping lines?
Message-Id: <9qgnel$ngd$1@quark.noos.net>
hello
i have a real strange problem....
i have parts coming through a split and i want to crop them, means,
remove any whitespace at the beginning and the end of the thing...
naively i made a
$i =~ s/^\s*(.*)\s*$/$1/;
and then since it didn't do anything,
$i =~ s/^\s+(.*)$/$1/;
$i =~ s/^(.*)\s+$/$1/;
but still there are leading and ending whitespaces that leak through...
how can this be? and how can i crop them with absolute certainty?
i am running v5.6.1 built for i386-linux
on a debian linux distro
--
ciao bboett
==============================================================
bboett@earthling.net
http://inforezo.u-strasbg.fr/~bboett http://erm1.u-strasbg.fr/~bboett
------------------------------
Date: 16 Oct 2001 07:35:24 GMT
From: Bernard El-Hagin <bernard.el-hagin@lido-tech.net>
Subject: Re: HELP: cropping lines?
Message-Id: <slrn9snodt.85e.bernard.el-hagin@gdndev25.lido-tech>
On Tue, 16 Oct 2001 07:26:13 +0000 (UTC), Bruno Boettcher
<bboett@bboett.dyndns.org> wrote:
> hello
> i have a real strange problem....
>
> i have parts coming through a split and i want to crop them, means,
> remove any whitespace at the beginning and the end of the thing...
>
> naively i made a
>
> $i =~ s/^\s*(.*)\s*$/$1/;
>
> and then since it didn't do anything,
>
> $i =~ s/^\s+(.*)$/$1/;
> $i =~ s/^(.*)\s+$/$1/;
>
> but still there are leading and ending whitespaces that leak through...
> how can this be? and how can i crop them with absolute certainty?
$i =~ s/\s+$//;
$i =~ s/^\s+//;
Cheers,
Bernard
------------------------------
Date: 16 Oct 2001 12:16:09 +0200
From: Kai Diefenbach <usenet@diefenba.ch>
Subject: Re: HELP: cropping lines?
Message-Id: <8lbsj7nb4m.fsf@diefenba.ch>
Hi,
>>>>> "Bruno" == Bruno Boettcher <bboett@bboett.dyndns.org> writes:
Bruno> i have parts coming through a split and i want to crop them, means,
Bruno> remove any whitespace at the beginning and the end of the thing...
% perldoc -q strip
Kai.
--
------------------------------
Date: Tue, 16 Oct 2001 05:53:43 GMT
From: "Qiang" <home@home.com>
Subject: how to logout from icewm or oroborus ??
Message-Id: <HXPy7.270240$j65.69905578@news4.rdc1.on.home.com>
hi,
I have tried these two windows managers. Both i found no way to logout( back
to the login window again).need some help please.
for icewm
there is the logout option on the menu, having chosen it, it asks me "all
app will be closed and proceed? " ...press ok then nothing happen....another
way by pressing "ctrl+alt+del" there are various option such as"reboot"
"logout" "shutdown" "reload icewm" which i tried each of them and only the
last one works..
for oroborus
i don't even know how to log out.. there must have a command can do this,
but i don't know.
Thanks!
Qiang
------------------------------
Date: Tue, 16 Oct 2001 09:30:01 +0000 (UTC)
From: inwap@best.com (Joe Smith)
Subject: Re: How to set timeout in Perl?
Message-Id: <9qgump$8ap$1@nntp1.ba.best.com>
In article <9qga7n$ks74@imsp212.netvigator.com>,
Wade <wade_ng@infrasys.com.hk> wrote:
>I want to set timeout in perl to call a external program,
>say, I have a foo.pl ,
>
>system("external_program");
>
>how to set timeout to call the external program?
eval {
local $SIG{ALRM} = sub { die $timeout_message,"\n"; };
alarm $seconds;
system('rsh', @rsh_args, @ARGV); # Do it
alarm 0;
}
But rsh is one of those commands that forks another process.
It's a little harder to kill all of the external command's child
processes. This is not the greatest, but it works for me.
-Joe
#!/usr/local/bin/perl
# Name: /usr/local/etc/timed-rsh Author: Joe.Smith@inwap.com 24-Jun-1999
# Purpose: Execute `rsh` on a remote host, with a timeout
($me = $0) =~ s%.*/%%;
$Usage = "uname_info=`$me -9 remotehost uname -s -r -m`";
$default_timeout = 70; # Number of seconds to wait for response
@rsh_args = ();
while (($_ = $ARGV[0]) =~ /^-/) {
if (/^-(\d+)/) {
$seconds = $1; shift @ARGV; next;
} elsif ($_ eq "-n") {
push @rsh_args,$_; shift @ARGV; next;
} elsif ($_ eq "-l") {
push @rsh_args,$_,$ARGV[1]; shift @ARGV; shift @ARGV; next;
} else {
die "Unrecognized option: @ARGV\nUsage: $Usage\n";
}
}
die "Usage: $Usage\n" unless scalar(@ARGV) >= 2; # Need host name and command
$seconds = $default_timeout unless $seconds > 0;
open(STDERR,">&STDOUT"); # Send all error messages to STDOUT
$| = 1;
eval {
$timeout_message = join " ","timeout:",@rsh_args,@ARGV;
local $SIG{ALRM} = sub { die $timeout_message,"\n"; };
alarm $seconds;
system('rsh', @rsh_args, @ARGV); # Do it
alarm 0;
};
if ($@) {
print $@; # Output "timeout: $host\n"
local $SIG{HUP} = 'IGNORE';
kill HUP => -$$; # Kill both 'rsh' processes
sleep 1;
local $SIG{INT} = 'IGNORE';
kill INT => -$$; # 'rsh' may be stubborn at times
exit 1;
}
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Tue, 16 Oct 2001 07:28:43 +0200
From: Philip Newton <pne-news-20011016@newton.digitalspace.net>
Subject: Re: How to undef many vars at once
Message-Id: <n5gnst4l6k7cde13iks0q5t1oe94efj6mm@4ax.com>
On 15 Oct 2001 09:55:25 -0700, ineverreadanythingsenttome@hotmail.com
(David Filmer) wrote:
> I want to do something like:
>
> undef $a $b $c;
>
> but it seems I have to
>
> undef $a; undef $b; undef $c;
>
> Surely there's a better way - anyone know?
Often, scoping is better:
foreach(@something) {
my($a, $b, $c);
blabla();
}
Now $a, $b, $c will be reinitialised each time through the loop.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Tue, 16 Oct 2001 09:01:08 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How to undef many vars at once
Message-Id: <rotnst0pdn9sslpl9jo948u53tbt38gbnr@4ax.com>
Steven Smolinski wrote:
>What about a loop?
>
>undef $_ for ($a, $b, $c);
@b = (1 .. 4);
undef $_ for $a, @b, $c;
Eh, that's not quite right. You'll merely undef() each array element.
--
Bart.
------------------------------
Date: Tue, 16 Oct 2001 10:40:49 +0100
From: John Imrie <johni@pa.press.net>
Subject: Re: How to undef many vars at once
Message-Id: <3BCC00A1.3080009@pa.press.net>
David Filmer wrote:
> I want to do something like:
>
> undef $a $b $c;
>
> but it seems I have to
>
> undef $a; undef $b; undef $c;
>
> Surely there's a better way - anyone know?
($a, $b, $c) = (undef) x 3;
------------------------------
Date: 16 Oct 2001 13:47:06 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: How to undef many vars at once
Message-Id: <87d73nhq79.fsf@abra.ru>
>>>>> On Tue, 16 Oct 2001 10:40:49 +0100, John Imrie <johni@pa.press.net> said:
JI> David Filmer wrote:
>> I want to do something like:
>> undef $a $b $c;
>> but it seems I have to
>> undef $a; undef $b; undef $c;
>> Surely there's a better way - anyone know?
JI> ($a, $b, $c) = (undef) x 3;
slightly more short version
($a, $b, $c) = ();
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) TIV.net (http://tiv.net/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: Tue, 16 Oct 2001 04:33:04 GMT
From: "Rob - Rock13.com" <rob_13@excite.com>
Subject: Re: ImageMagick or Gimp??
Message-Id: <Xns913C58235096rock13com@64.8.1.226>
John J. Trammell
<news:slrn9smml5.fam.trammell@haqq.hypersloth.net>:
> On Mon, 15 Oct 2001 14:11:33 -0700, tszeto
> <tszeto@mindspring.com> wrote:
>> I'd like to write a script to convert Adobe Photoshop and
>> Illustrator files to thumbnails.
> [snip]
>> Should I use ImageMagick or the Gimp?
>
> Yes, you should definitely use ImageMagick or the Gimp.
If you are doing it on your workstation and you have more
experience with Gimp then use it. If you were to do this
dynamically on the server (why?) then ImageMagick would be the
better choice.
--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/
------------------------------
Date: Tue, 16 Oct 2001 05:52:12 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: ImageMagick or Gimp??
Message-Id: <slrn9snioc.l88.mgjv@verbruggen.comdyn.com.au>
On Tue, 16 Oct 2001 04:33:04 GMT,
Rob - Rock13.com <rob_13@excite.com> wrote:
> John J. Trammell
><news:slrn9smml5.fam.trammell@haqq.hypersloth.net>:
>
>> On Mon, 15 Oct 2001 14:11:33 -0700, tszeto
>> <tszeto@mindspring.com> wrote:
>>> I'd like to write a script to convert Adobe Photoshop and
>>> Illustrator files to thumbnails.
>> [snip]
>>> Should I use ImageMagick or the Gimp?
>>
>> Yes, you should definitely use ImageMagick or the Gimp.
>
> If you are doing it on your workstation and you have more
> experience with Gimp then use it. If you were to do this
> dynamically on the server (why?) then ImageMagick would be the
> better choice.
Or if you have to do this for a large number of images, use
ImageMagick. But use the command line tools. A simple run from convert
or mogrify would do this job quite easily.
Quite offtopic, now.
Martien
--
Martien Verbruggen |
Interactive Media Division | You can't have everything, where
Commercial Dynamics Pty. Ltd. | would you put it?
NSW, Australia |
------------------------------
Date: Tue, 16 Oct 2001 08:38:27 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: ImageMagick or Gimp??
Message-Id: <lesnst4v4i5tnusp11g1413b7vkb86nv55@4ax.com>
tszeto wrote:
>I'd like to write a script to convert Adobe Photoshop and Illustrator files
>to thumbnails.
>
>What's the best way to do this? Should I use ImageMagick or the Gimp?
Photoshop, I'd think. Photoshop 5 supports a primitive form of
scripting. But then you can't do it using Perl.
--
Bart.
------------------------------
Date: Tue, 16 Oct 2001 06:42:18 +0200
From: Philip Newton <pne-news-20011016@newton.digitalspace.net>
Subject: Re: PERL freelance programmer availeable
Message-Id: <etdnstg3ujta1d1ici9m19dmjre8fr8hjs@4ax.com>
On Mon, 15 Oct 2001 00:18:50 GMT, Tim Hammerquist <tim@vegeta.ath.cx>
wrote:
> Me parece que Philip Newton <pne-news-20011014@newton.digitalspace.net> dijo:
> > He's probably done most of his work for clients who keep insisting
> > they're only 99 and 44/100 % satisfied and therefore don't need to pay
> > him. So he's been doing a lot of work for free.
>
> 99.44%? Was the Ivory soap implication diliberate, or am I just
> getting old? =)
Kind of. I was looking for a number that was just under 100%, and
remembered that Ivory soap had an advertising slogan with such a number,
so I did a quick google to find out the exact number. But the fact that
it was soap was not relevant; 99.75% would have done as well, or 98%, or
whatever.
F'up2poster.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: 15 Oct 2001 22:32:50 -0700
From: raja_kj@yahoo.com (Raja sekhar)
Subject: problem in getting directory list and filelist through perl
Message-Id: <528a392b.0110152132.72256a9@posting.google.com>
hello,
I have some problem in getting directory list through perl.my
requirement is 1.to get all directory names.
2.enter into each directory and get all the file list in that
directory.
3. and to perform some operation on each and every file.
I am using File::Find module but it returns path of the
directory.which is not desirable. I want to get only direcroty names.
if any body have solution plz let me know
help is very much appreciated.
------------------------------
Date: 16 Oct 2001 07:26:58 GMT
From: Bernard El-Hagin <bernard.el-hagin@lido-tech.net>
Subject: Re: putting $1..$9 into a replacement string such as $repl="=csinfo$1$2^$3"
Message-Id: <slrn9snnu3.85e.bernard.el-hagin@gdndev25.lido-tech>
On 15 Oct 2001 14:36:54 -0700, shòwdög <showdog@my-deja.com> wrote:
[snip]
> Yes I am using warnings, and strict:
>
> use strict;
> use warnings;
>
> Actually my code above was misleading. I am reading these expressions
> from a file as such:
>
> my @lines = `type "$filename"`;
> chomp (@lines);
>
> foreach my $line (@lines) { #lines look like: /UU|Ü
> my @tokens = split (/\|/, $line);
> $hECodes{$counter++} = \@tokens;
> # I quotemeta the lh expression elsewhere in the code
> }
> @sortedECodeKeys = sort { $a <=> $b } keys %hECodes;
>
> Then later in the code I do this:
>
> while (<INPUTFILE>) {
> chomp;
> foreach my $ecode (@sortedECodeKeys) {
> my $source = $hECodes{$ecode}[0];
> my $dest = $hECodes{$ecode}[1];
> s{$source}{$dest}g;
> }
> }
>
> SO, when $source equals '\=csinfo(.*)([A-Za-z]+)\/([A-Za-z]+)'
> and $dest equals '=csinfo$1$2^$3'
> and $_ equals '=csinfo 00000130c/c overruled on other grounds'
> Then,
> s{$source}{$dest}g
> sets $_ equal to '=csinfo$1$2^$3 overruled on other grounds'
>
> so the digits variables are being taken literally.
Try changing the substitute to:
eval "s{$source}{$dest}g;";
Cheers,
Bernard
------------------------------
Date: 16 Oct 2001 07:29:40 GMT
From: Bernard El-Hagin <bernard.el-hagin@lido-tech.net>
Subject: Re: putting $1..$9 into a replacement string such as $repl="=csinfo$1$2^$3"
Message-Id: <slrn9sno35.85e.bernard.el-hagin@gdndev25.lido-tech>
On 15 Oct 2001 14:44:07 -0700, shòwdög <showdog@my-deja.com> wrote:
[snip]
> Another related question, when you read a line :
>
> while <FOO> {}
>
> is $_ a single quoted or double quoted variable? based on what i see
> it is neither, if that makes sense.
I don't understand this. The way $_ is interpreted depends
on how it's quoted.
Cheers,
Bernard
------------------------------
Date: Tue, 16 Oct 2001 09:51:47 +0000 (UTC)
From: inwap@best.com (Joe Smith)
Subject: Re: putting $1..$9 into a replacement string such as $repl="=csinfo$1$2^$3"
Message-Id: <9qgvvj$966$1@nntp1.ba.best.com>
In article <187c116b.0110151344.73b0e1f3@posting.google.com>,
=?ISO-8859-1?Q?sh=F2wd=F6g?= <showdog@my-deja.com> wrote:
>Another related question, when you read a line :
>
>while <FOO> {}
>
>is $_ a single quoted or double quoted variable? based on what i see
>it is neither, if that makes sense.
$_ is not a "quoted variable". It is a scalar variable that has a
string, consisting of one line of bytes from the intput file, verbatim.
Well, almost. On Win32, "\r\n" is converted to "\n" and on
MacOS-classic, "\r" is converted to "\n" (if no binmode(FOO)).
Anyway, if the line from the file is
$5 can't be right, said "the man"
then the contents of $_ will include an actual dollar sign, an
apostrophe, and two double quotes.
-Joe
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Tue, 16 Oct 2001 10:12:23 +0200
From: "Real" <real@earthling.net>
Subject: Re: Socket read/write select problem
Message-Id: <9qgq57$slt$1@news.surfnet.nl>
"Sean Egan" <sean.egan@eei.ericsson.se> wrote in message
news:3BCB3B39.3617FC68@eei.ericsson.se...
> I you uncomment the 'sleep 3' in the code the problem goes away...
You can try to disable buffering using $| = 1;
Good luck,
Real
------------------------------
Date: Tue, 16 Oct 2001 07:28:42 +0200
From: Philip Newton <pne-news-20011016@newton.digitalspace.net>
Subject: Re: sort an array and print out biggest number
Message-Id: <tsfnst441ojt19nsbfvj39ulisfr55j14s@4ax.com>
On Sun, 14 Oct 2001 23:42:11 -0700, "Jürgen Exner"
<jurgenex@hotmail.com> wrote:
> There is also another problem with 'sort': sort is O(n * log n) while a
> trivial linear search would be only O(n), i.e. quite a bit faster for large
> n.
That depends on the constant. O(n log n) is not necessarily faster than
O(n).
sort() is one perl op, with the body written in C. A foreach search with
comparisons is several perl ops. In general, reducing the number of perl
ops will speed this up. So if you use an algorithm with a better O
value, but which requires more perl ops, then it may end up being slower
because of the larger constant factor.
(One solution would be to implement a "maximum element of list" in C,
for example with Inline::C or XS, to make comparisons simple.)
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
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 1937
***************************************