[22074] in Perl-Users-Digest
Perl-Users Digest, Issue: 4296 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 20 09:48:59 2002
Date: Fri, 20 Dec 2002 06:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 20 Dec 2002 Volume: 10 Number: 4296
Today's topics:
BGA Heatsink 26404 (Thermal King)
Re: csv file to mysql import <mgjv@tradingpost.com.au>
Re: enviroment variable set (Anno Siegel)
Getting perl to work on XP. (stew dean)
Re: Getting perl to work on XP. (Helgi Briem)
Re: help: perl script to make all DNA sequence Nmers? (Anno Siegel)
how do I split large file into separate files? <geoff.cox@blueyonder.co.uk>
Re: how do I split large file into separate files? <mgjv@tradingpost.com.au>
Re: how do I split large file into separate files? (Anno Siegel)
Re: how do I split large file into separate files? <geoff.cox@blueyonder.co.uk>
Re: HTAccess & Perl... <flavell@mail.cern.ch>
Re: Image creation/editing <daby55@NO23SPAM.com>
Re: Image creation/editing <mgjv@tradingpost.com.au>
Re: incorporating off-site content (M Browning)
pdf books on perl <igor@chorus.ru>
Re: pdf books on perl (Helgi Briem)
Re: search and replace text in many files (Anno Siegel)
Re: Strange loop (i5513)
Re: trapping connection timeout ... using sockets <spp@monaco377.com>
Wanted Help to implement search for my intRAnet site of <tamil@quicklogic.com>
Re: Wanted Help to implement search for my intRAnet sit <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
Re: xmlgrep <mirod@xmltwig.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 20 Dec 2002 13:27:53 GMT
From: altec@coolkeep.com(Thermal King)
Subject: BGA Heatsink 26404
Message-Id: <atv5sp$pto@netnews.hinet.net>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Aluminum Technology</TITLE><BASE
href=http://www.coolkeep.com/newpro.htm>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1"><LINK
href="file:///C|/WINDOWS/Desktop/copydvdmaincopy.css" type=text/css
rel=stylesheet>
<META content="MSHTML 5.50.4134.100" name=GENERATOR></HEAD>
<BODY text=#000000 vLink=#0000ff aLink=#6699ff bgColor=#ffffff>
<DIV> </DIV>
<DIV></DIV>
<DIV><BR></DIV>
<DIV align=center>
<CENTER>
<TABLE
style="MARGIN: 0px; WORD-SPACING: 0px; LINE-HEIGHT: 100%; TEXT-ALIGN: center"
borderColor=#0066ff cellSpacing=0 cellPadding=0 width=554 bgColor=#ffffff
border=2>
<TBODY>
<TR>
<TD
style="MARGIN: 0px; WORD-SPACING: 0px; TEXT-INDENT: 0px; TEXT-ALIGN: center"
vAlign=center align=middle width=548 bgColor=#0066ff height=36>
<DIV align=center><A href="http://www.coolkeep.com"><B><FONT
face="Times New Roman, Times, serif" color=#ffffff
size=5>www.coolkeep.com</FONT></B></A></DIV></TD></TR>
<TR>
<TD style="MARGIN-TOP: 2px; MARGIN-BOTTOM: 2px; MARGIN-LEFT: 0px"
vAlign=center align=left width=548>
<DIV align=center><B><FONT face=Verdana color=#000000><BR>Aluminum &
Heatsinks Technology in Taiwan</FONT><FONT face=Verdana
color=#501058><BR><BR></FONT></B></DIV></TD></TR>
<TR>
<TD align=middle width=548>
<DIV style="WIDTH: 527px" align=left>
<P align=center><FONT face=Verdana><B><FONT size=2><BR>We are in the
position to provide you aluminum products as
followed;</FONT></B></FONT></P>
<TABLE cellSpacing=0 cellPadding=0 width=450 align=center border=0>
<TBODY>
<TR vAlign=top>
<TD width=302 height=97>
<P><FONT face="Verdana, Arial, Helvetica, sans-serif" color=#0000ff
size=2><STRONG><A
href="http://www.coolkeep.com/products/standard1/s1.htm">Standard
Packages </A><BR><A
href="http://www.coolkeep.com/products/bga/bga.htm">Ball Grid Arrays
BGA</A><BR><A
href="http://www.coolkeep.com/products/cpu/cpu1.htm">CPU
Heatsinks</A><BR><A
href="http://www.coolkeep.com/products/hcpu/hcpu.htm">High Aspect
Ratio </A><BR><A
href="http://www.coolkeep.com/products/ups1/u1.htm">Converter
</A></STRONG><BR><B><A
href="http://www.coolkeep.com/products/oem/oem1.htm">Customer
Designs </A></B></FONT></P></TD>
<TD width=286 height=97><FONT
face="Verdana, Arial, Helvetica, sans-serif" color=#0000ff
size=2><STRONG><A
href="http://www.coolkeep.com/products/alcase/case.htm">Extruded
Shell Casing</A><BR><A
href="http://www.coolkeep.com/products/bgaclip/clip.htm">Ball Grid
Arrays PGA</A><BR><A
href="http://www.coolkeep.com/products/hanodized/harda.htm">Hard
Anodized</A><BR><A href="http://www.coolkeep.com/mold.htm">Extrusion
Molds</A><BR><A
href="http://www.coolkeep.com/products/valve/valve1.htm">Valve
Base</A><BR><A href="http://www.coolkeep.com/product.htm">Aluminum
Parts</A></STRONG></FONT></TD></TR></TBODY></TABLE></DIV>
<BLOCKQUOTE>
<DIV style="WIDTH: 527px" align=left><BR>
<TABLE cellSpacing=0 cellPadding=0 width="95%" border=0>
<TBODY>
<TR vAlign=top align=middle>
<TD width=154><FONT face=Arial size=2><IMG height=65
src="image/newpro/1to220.jpg" width=120 vspace=15><A
href="http://www.coolkeep.com/products/standard2/s2.htm"><BR></A><FONT
color=#0000ff><A
href="http://www.coolkeep.com/products/hanodized/harda.htm">Standard</A></FONT></FONT></TD>
<TD width=154><IMG height=65 src="image/newpro/2bga.jpg" width=120
vspace=15><BR><FONT face=Arial size=2><FONT face="MS Sans Serif"
color=#0000ff><A
href="http://www.coolkeep.com/products/hanodized/harda.htm">Chipset</A></FONT></FONT></TD>
<TD width=154><FONT face=Arial size=2><IMG height=65
src="image/newpro/3cpu.jpg" width=120 vspace=15 border=0><BR><FONT
color=#0000ff><A
href="http://www.coolkeep.com/products/cpu/cpu1.htm">Microprocessors</A></FONT>
</FONT></TD></TR>
<TR vAlign=top align=middle>
<TD width=154><FONT face=Arial size=2><IMG height=65
src="image/newpro/4hard%20anodized.jpg" width=120
vspace=15><BR><FONT color=#0000ff><A
href="http://www.coolkeep.com/products/hanodized/harda.htm">Hard
Anodized</A></FONT><BR></FONT></TD>
<TD width=154><FONT face=Arial size=2><IMG height=65
src="image/newpro/5extrude%20case.jpg" width=120
vspace=15><B><BR></B><FONT face="MS Sans Serif"><A
href="http://www.coolkeep.com/products/cpu/cpu1.htm">Aluminum Case
</A></FONT></FONT></TD>
<TD width=154><FONT face=Arial size=2><IMG height=65
src="image/newpro/6plate.jpg" width=120 vspace=15><BR><A
href="http://www.coolkeep.com/products/oem/oem1.htm"><FONT
face="MS Sans Serif">Customer
Designs</FONT></A></FONT></TD></TR></TBODY></TABLE>
<P><B><FONT face="Verdana, Arial, Helvetica, sans-serif"
size=2><BR>Should any samples be needed, please let us know the
product's specification and your company information.</FONT></B></P>
<P><B><FONT face="Verdana, Arial, Helvetica, sans-serif" size=2>Best
Regards,<BR>Jason Chen</FONT></B></P></DIV></BLOCKQUOTE></TD></TR>
<TR>
<TD vAlign=top align=middle width=548 bgColor=#0066ff height=1>
<P class=product_spotlight_style align=center><FONT
face="Verdana, Arial, Helvetica, sans-serif" color=#ffffff size=2><B>Your
new source for Aluminum alloy extrusion
parts!</B></FONT></P></TD></TR></TBODY></TABLE><FONT face=Verdana size=1>We are
sorry if this email as not your interest. kindly ignore it. <BR>If you do not
wish to receive again, simply reply this email with the subject "remove".
</FONT></CENTER></DIV></BODY></HTML>
UieqD
------------------------------
Date: Fri, 20 Dec 2002 23:29:41 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: csv file to mysql import
Message-Id: <slrnb0639l.aid.mgjv@martien.heliotrope.home>
On Fri, 20 Dec 2002 07:28:51 +0100,
Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com> wrote:
> Brian McCauley wrote (Thursday 19 December 2002 18:42):
>
>> Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com> writes:
>>
>>> Arunav Mandal wrote (Thursday 19 December 2002 14:55):
>>
>>> > use vars qw(
>>> > $q
>>> > );
>>> >
>>> > $q = CGI->new;
>>>
>>> I don't see any global use/need of $g. Instead, use:
>>>
>>> my $q = $CGI->new;
>>
>> Note: most of the objections raised to global variables are objections
>> to the programming style that uses them. For these purposes lexical
>> variables declared at file scope still count as global variables so
>> just chaning 'use vars' or 'our' to 'my' doesn't address the concerns
>> that prompted the original objections.
>
>
> This is an interesting observation. But is does raise another question:
> Is *file* scoping then something magic? If I declare a "my" three subs deep,
> is that any different than declaring the "my" at the top level -- that is
> the file? Doesn't it have the same purpose? Hmmm...
No.
A lexically scoped variable will be seen by all code in the same scope
that follows the declaration. A file scope variable will be seen by all
code following its declaration, including all subroutines and any other
blocks. A variable that is scoped inside the block that needs it, will
not be seen by code that follows it, after the scope ends.
When only using globals, or file scoped variables that are declared at
the top of the file, you increase the chance that you accidentally use
the wrong variable. It also increases the temptation to just refer to
that global, instead of structuring your code in such a way that you
pass the correct information around.
When scoping variables as tightly as possible, you prevent yourself from
making mistakes, and force yourself to program in a more structured way.
You also won't have to wonder all the time wheter it is now safe to use
or change that particular variable, or whether it is still in use by
some other piece of logic spread out over four or five subroutines.
Scope tightly, and pass needed information around.
That said: globals and file scoped variables do have their place. They
should, however, only be used when the alternative (and there always is
at least one) is uglier than the global.
None of this is particularly Perl specific, BTW.
Martien
--
|
Martien Verbruggen | Blessed are the Fundamentalists, for they
| shall inhibit the earth.
|
------------------------------
Date: 20 Dec 2002 11:12:07 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: enviroment variable set
Message-Id: <atutu7$j51$1@mamenchi.zrz.TU-Berlin.DE>
According to James Hou <happier_tj@hotmail.com>:
> > happier wrote:
> > > I need to run my perl program in cron job and before running it must
> > > set some enviroment variable,so I write a shell script as following.I
> > > add the shell script into cron job.But
> >
> > Why don't you set those env variables from your Perl script?
> You can't change the PERL5LIB in the Perl script, because even with a
> BEGIN block the "use" statements happen first.
Wrong reason. A BEGIN block is executed before any subsequent "use"
in the same file, so the environment variable will be set. However,
Perl only looks at the environment once at startup and not every
time a "use" happens. That's why setting the variable in the script
itself doesn't have the desired effect.
If you consider changing the calling script, don't use $ENV{ PERL5LIB}
but the "use lib ..." pragma. This will be honored in time.
> So I have to set the
> variables in a shell script, and then from that shell script call the
The "shell script" might as well be another Perl script, for that matter.
However, you can set the environment directly in the crontab entry:
55 19 * * * export PERL5LIB=/fie/foe; /path/to/script param param
That's all there's to it.
> Perl script.Can you tell me How can I set enviroment variable in shell script?
That depends on the shell. "export VAR=VALUE" for sh-like shells,
"setenv VAR VALUE" for csh-descendants.
All this has nothing to do with Perl, it's shell and Unix business.
Anno
------------------------------
Date: 20 Dec 2002 05:13:33 -0800
From: stewart@webslave.dircon.co.uk (stew dean)
Subject: Getting perl to work on XP.
Message-Id: <2b68957a.0212200513.309bf8ae@posting.google.com>
Simple task. I've Installed apache and set it up as a service on XP.
Install activestate perl
Server works - can see default page.
Access perl script in cgi-bin file and it tries to download it.
Now where do I go next? Is there a page which tells me what I should
be doing. I've been following all kinds of different pages and none of
this has worked.
I'm getting really hacked off with this but it's got to be done. What
do I tweak to get this to work?
Cheers
Stew Dean
------------------------------
Date: Fri, 20 Dec 2002 13:42:57 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Getting perl to work on XP.
Message-Id: <3e031d42.1359024474@news.cis.dfn.de>
On 20 Dec 2002 05:13:33 -0800, stewart@webslave.dircon.co.uk
(stew dean) wrote:
>Simple task. I've Installed apache and set it up as a service on XP.
>Install activestate perl
>
>Server works - can see default page.
>
>Access perl script in cgi-bin file and it tries to download it.
>
>Now where do I go next? Is there a page which tells me what I should
>be doing. I've been following all kinds of different pages and none of
>this has worked.
>
>I'm getting really hacked off with this but it's got to be done. What
>do I tweak to get this to work?
Your question has nothing to do with Perl.
Your question has nothing to do with XP
Your question has nothing to do with Activestate Perl.
Your question has to do with web server configuration.
Read the installation and configuration instructions
for apache that came with your installation. They
are also online at www.apache.org.
If you have problems, address them to a newsgroup
where web server configuration, such as
comp.infosystems.www.servers.*
--
Regards, Helgi Briem
helgi AT decode DOT is
------------------------------
Date: 20 Dec 2002 12:20:52 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: help: perl script to make all DNA sequence Nmers?
Message-Id: <atv1v4$j51$3@mamenchi.zrz.TU-Berlin.DE>
According to Benjamin Goldberg <goldbb2@earthlink.net>:
[...]
> Personally, I think that if vec() were changed from 1 function, into 6
> different functions (vec1, vec2, vec4, ... vec64), taking only a string
> and an index, it would be a little more DWIM.
>
> Or perhaps an even larger family of functions -- big and little endian,
> signed and unsigned, or both of those properties.
Watchit! You'll invent pack() and unpack() if you go on :)
Anno
------------------------------
Date: Fri, 20 Dec 2002 12:23:02 GMT
From: Geoff Cox <geoff.cox@blueyonder.co.uk>
Subject: how do I split large file into separate files?
Message-Id: <nn260v4e1pgsv87cqe8669gui03n1i2akm@4ax.com>
Hello,
I have a large file in which each subsection is separated by 3 line
feeds.
How can write a file for each subsection? Have tried and failed so
far!
I am using Perl/Windows 98
Cheers
Geoff
------------------------------
Date: Fri, 20 Dec 2002 23:39:57 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: how do I split large file into separate files?
Message-Id: <slrnb063ss.aid.mgjv@martien.heliotrope.home>
On Fri, 20 Dec 2002 12:23:02 GMT,
Geoff Cox <geoff.cox@blueyonder.co.uk> wrote:
> Hello,
>
> I have a large file in which each subsection is separated by 3 line
> feeds.
That is not really specific enough. Do double line feeds appear? Any
other specifics?
> How can write a file for each subsection? Have tried and failed so
> far!
Maybe something like:
$ perl -00pe '$i++; open STDOUT, ">section$i"' inputfile
Which splits in "paragraph mode"
or, if you really meant three newlines:
perl -pe 'BEGIN{$/="\n\n\n"} $i++; open STDOUT, ">section$i"' textie
> I am using Perl/Windows 98
In that case you might need to fiddle with the quotes. i believe that
windows shell does some odd things that I am not used to. Alternatively,
write the one-liners as Perl programs. If you need to check whether the
opens succeed, and stuff like that, you might want to do that anyway.
If each section is really large, you might want to choose another
apprach, and work line by line.
Martien
--
|
Martien Verbruggen |
| Can't say that it is, 'cause it ain't.
|
------------------------------
Date: 20 Dec 2002 12:55:06 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: how do I split large file into separate files?
Message-Id: <atv3va$nnc$1@mamenchi.zrz.TU-Berlin.DE>
According to Geoff Cox <geoff.cox@blueyonder.co.uk>:
> Hello,
>
> I have a large file in which each subsection is separated by 3 line
> feeds.
>
> How can write a file for each subsection? Have tried and failed so
> far!
What did you try, and how did it fail? Show your work!
Here is one suggestion. There are lots of other ways...
{
# space for private variables
my $name = 'segment';
my $seg_num = 1;
# open a new file for writing with the specified filehandle
sub next_file {
my $fh = shift;
my $file = "$name." . $seg_num++;
open( $fh, ">", $file) or die "Can't create $file: $!";
$fh;
}
}
my $empty = 0;
my $fh;
$fh = next_file( $fh);
while ( <DATA> ) {
# count empty lines
if ( /^$/ ) { $empty++ } else { $empty = 0 }
# print it. last empty line still goes to last file
print $fh $_;
# switch output if needed
$fh = next_file( $fh) if $empty >= 3;
}
__DATA__
part 1.1
part 1.2
part 1.3
part 2.1
part 2.2
part 2.3
part 2.4
part 3.1
part 3.2
part 3.3
part 3.4
part 3.5
part 3.6
------------------------------
Date: Fri, 20 Dec 2002 13:44:10 GMT
From: Geoff Cox <geoff.cox@blueyonder.co.uk>
Subject: Re: how do I split large file into separate files?
Message-Id: <2d760vcda1vqp4np25vbhk080fa5r3ih4c@4ax.com>
On 20 Dec 2002 12:55:06 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
Siegel) wrote:
>According to Geoff Cox <geoff.cox@blueyonder.co.uk>:
>> Hello,
>>
>> I have a large file in which each subsection is separated by 3 line
>> feeds.
>>
>> How can write a file for each subsection? Have tried and failed so
>> far!
>
>What did you try, and how did it fail? Show your work!
Anno,
I have got this v simple approach working
open (IN,"poems");
$file = join " ", <IN>;
@split = split "xxx", $file;
for ($n=0;$n<5;$n++) {
open (NEW, ">>$n.txt");
print NEW ($split[$n]);
}
I have put "xxxx" in front of each section (ie in front of each poem)
in the poems file and now I get a range of separate files, 0.txt,
1.txt etc with one poem in each file. So far so good.
Instead of naming the file $n.txt I would like to take the line in the
poems file which comes after the xxx. This is the title of each poem
and then each file would have the name of the poem as its name...
any thoughts?
Cheers
Geoff
>
>Here is one suggestion. There are lots of other ways...
>
>{
> # space for private variables
> my $name = 'segment';
> my $seg_num = 1;
>
> # open a new file for writing with the specified filehandle
> sub next_file {
> my $fh = shift;
> my $file = "$name." . $seg_num++;
> open( $fh, ">", $file) or die "Can't create $file: $!";
> $fh;
> }
>}
>
> my $empty = 0;
> my $fh;
> $fh = next_file( $fh);
> while ( <DATA> ) {
> # count empty lines
> if ( /^$/ ) { $empty++ } else { $empty = 0 }
> # print it. last empty line still goes to last file
> print $fh $_;
> # switch output if needed
> $fh = next_file( $fh) if $empty >= 3;
> }
>
> __DATA__
> part 1.1
> part 1.2
> part 1.3
>
>
>
> part 2.1
> part 2.2
> part 2.3
> part 2.4
>
>
>
> part 3.1
> part 3.2
> part 3.3
> part 3.4
> part 3.5
> part 3.6
------------------------------
Date: Fri, 20 Dec 2002 05:27:13 CST
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: HTAccess & Perl...
Message-Id: <Pine.LNX.4.40.0212201218000.25101-100000@lxplus069.cern.ch>
On Dec 20, codeWarrior inscribed on the eternal scroll:
> Using telnet / cuteFTP I discovered that I cannot:
>
> -- chmod 0777 filename.pdf (on the files)
> -- rm -f filename.pdf (on the files or rm -d on the directories)
> -- unlink -f filename.pdf or unlink the directories
That doesn't seem to be a Perl problem.
> The server is freeBSD 4.5 / Apache with Perl5 and all of the usual CPAN
> modules... I'm taking a (wild) stab at this and I believe that .htaccess is
> causing the problem by intefering with the permissions...
Pretty wild. I'm taking a wild stab and suggesting you haven't begun
to understand unix file ownerships and permissions in the CGI
environment. However, the details depend on how the server is set
up, so I'm not going to try to second-guess what yours does.
> Anyone have any suggestions on dealing with .htaccess from within a Perl
> script ?
You're looking in the wrong place. .htaccess tells the HTTPD what
controls to apply when accessing web resources. It's got nothing
directly to do with unix file ownerships and permissions, which is
what's going to be controlling your telnet and FTP sessions.
You really need to understand this stuff from the ground up if you're
to be handling CGI scripts safely (vis a vis yourself and possibly vis
a vis other users on the same system). The Perl language group is the
wrong place for that kind of detail.
(x-posted and f'ups set).
--
PLEASE NOTE: comp.infosystems.www.authoring.cgi is a
SELF-MODERATED newsgroup. aa.net and boutell.com are
NOT the originators of the articles and are NOT responsible
for their content.
HOW TO POST to comp.infosystems.www.authoring.cgi:
http://www.thinkspot.net/ciwac/howtopost.html
------------------------------
Date: Fri, 20 Dec 2002 12:34:32 -0000
From: "DM" <daby55@NO23SPAM.com>
Subject: Re: Image creation/editing
Message-Id: <atv2oj$c6l$1@news6.svr.pol.co.uk>
"w i l l" <willis3140@com.yahoo> wrote in message
news:9cs40vs7s5cul6n5jo8b2u7m2ak1hpd2u1@4ax.com...
> I saw an article about this once, I think they used GD.
>
> Search www.perl.com., I might have read it there.
>
> -Wi ll
>
> On Thu, 19 Dec 2002 12:54:23 -0000, "DM" <daby55@NO23SPAM.com> wrote:
>
> >I`ve had a look through the perl packages and can`t find anything that
looks
> >suitable. Basically I want to be able to create a new image (preferably a
> >.png) and then paste other images into it images into it, one after the
> >other (vertically). Any perl modules capable of doing this?
> >
Thanks all.
I have used GD to basically copy areas from a few source images to a new
image. I also tried Magick but found GD easier to use.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.431 / Virus Database: 242 - Release Date: 17/12/2002
------------------------------
Date: Fri, 20 Dec 2002 23:44:05 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Image creation/editing
Message-Id: <slrnb0644l.aid.mgjv@martien.heliotrope.home>
On Fri, 20 Dec 2002 12:34:32 -0000,
DM <daby55@NO23SPAM.com> wrote:
> "w i l l" <willis3140@com.yahoo> wrote in message
> news:9cs40vs7s5cul6n5jo8b2u7m2ak1hpd2u1@4ax.com...
>> I saw an article about this once, I think they used GD.
>>
>> Search www.perl.com., I might have read it there.
>>
>> -Wi ll
>>
>> On Thu, 19 Dec 2002 12:54:23 -0000, "DM" <daby55@NO23SPAM.com> wrote:
>>
>> >I`ve had a look through the perl packages and can`t find anything that
> looks
>> >suitable. Basically I want to be able to create a new image (preferably a
>> >.png) and then paste other images into it images into it, one after the
>> >other (vertically). Any perl modules capable of doing this?
>> >
>
> Thanks all.
> I have used GD to basically copy areas from a few source images to a new
> image. I also tried Magick but found GD easier to use.
Note that older versions of GD only works with paletted images, and
therefore with a (very) limited number of colours. Unless you have a new
GD which is linked with libgd 2.0 or above, you will lose colours.
Image::Magick and Imager do not have that problem.
Martien
--
|
Martien Verbruggen | System Administration is a dirty job, but
| someone said I had to do it.
|
------------------------------
Date: 20 Dec 2002 03:59:57 -0800
From: m.browning@plymouth.ac.uk (M Browning)
Subject: Re: incorporating off-site content
Message-Id: <eddc4731.0212200359.744cd4b1@posting.google.com>
zathras <moo@cow.com> wrote in message news:<lredvu446hf712gn1hsernms0a9kglo8vs@4ax.com>...
> What is the best method to incorporate off-site content into an
> existing site?
>
> I have setup some HTML pages in the following format:
>
> <table>
> ...
> ...content...
> ...
> </table>
>
> With the intention of some how referencing the above file from within
> another sites structure. Something like
>
> <other site's body>
> <other site's table>
> ...
> other site's content...
> ...
> *content from my site (the table structure above)*
> ...
> <other site's /table>
> <other site's /html>
>
> This is pretty simple to do with frames--just load the external
> content in a separate frame. But how do you do this on a site without
> frames?
>
> The goal is not to have to send files back and forth via FTP--I would
> like external sites to link directly to the file on my site. And also
> to make it as simple and generic as possible so the same method can be
> used on other sites. For the most part, I will have admin access to
> these external sites, so I will be able to place perl scripts to
> facilitate incorporating external content.
>
> Any ideas? I vaguely remember reading about some perl functionality
> that would allow code to reach out over the internet to a site and
> pull down content and be able to manipulate it for use. Don't know if
> it would apply here. But again, the less intrusive the method is for
> the site that will be pulling content off mine, the better.
The functionality I believe you refer to may be found within the LWP
modules, specifically LWP::UserAgent for getting the content and,
perhaps, HTML::TokeParser for manipulation. The developer should be
mindful of copyright issues when considering these techniques and
refer questions to the comp.lang.perl.modules newsgroup.
------------------------------
Date: Fri, 20 Dec 2002 16:32:59 +0300
From: "Igor Dombrovan [958160823]" <igor@chorus.ru>
Subject: pdf books on perl
Message-Id: <atv66b$kjh$1@n6.co.ru>
Hi group
Can anybody point me where I could get %subj% ?
Regards,
Igor
------------------------------
Date: Fri, 20 Dec 2002 13:46:21 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: pdf books on perl
Message-Id: <3e031e74.1359330634@news.cis.dfn.de>
On Fri, 20 Dec 2002 16:32:59 +0300, "Igor Dombrovan
[958160823]" <igor@chorus.ru> wrote:
>Can anybody point me where I could get %subj% ?
Your hard drive is full of superb Perl documentation
.pod format that can be read using perldoc or
a web browser. The web is full of utilites that can
convert the text to PDF format if you really think
that's desirable ( I wouldn't ).
--
Regards, Helgi Briem
helgi AT decode DOT is
------------------------------
Date: 20 Dec 2002 12:03:21 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: search and replace text in many files
Message-Id: <atv0u9$j51$2@mamenchi.zrz.TU-Berlin.DE>
According to Bob Walton <bwalton@rochester.rr.com>:
> BobbyD wrote:
>
> ...
> > It's been a few months since I've been tasked to do some text editing.
> > I'm sure something simple out there exists. I would like to create a
> > perl script to be used in an alias on a Unix platform that will search
> > and replace one or more strings in every file down a tree. Couldn't I
> > create an alias that begins with "find ." and then run the perl script
> > on each file it finds. Since find is recursive, it should search down
> > the tree. In most cases the string will be just one word, not that it
> > matters. I'm thinking that the alias call will look like:
> >
> > SRtext oldtext newtext
> >
> > And the alias definition would be:
> > alias SRtext 'find . -type -f | xargs perlscriptname "$1" "$2"'
> ...
> > BobbyD
>
>
> You could check out the File::Find module for an all-Perl solution
>
> which is not platform dependent. And won't involve firing off a
> process for each file.
Well, "xargs" helps with that. But of course, as you say, there's no
reason why a single Perl script shouldn't do all the job.
Anno
------------------------------
Date: 20 Dec 2002 04:28:45 -0800
From: i5513@hotmail.com (i5513)
Subject: Re: Strange loop
Message-Id: <a657ec02.0212200428.d205361@posting.google.com>
Ok, thanks for your helps.
I have verified howto C++ works like perl.
------------------------------
Date: Fri, 20 Dec 2002 14:20:23 +0100
From: =?ISO-8859-15?Q?S=E9bastien?= Cottalorda <spp@monaco377.com>
Subject: Re: trapping connection timeout ... using sockets
Message-Id: <3e0319cf$0$32262$626a54ce@news.free.fr>
Leo wrote:
> Is there a way to get out of connection timeout using IO::Socket,
> if the host im trying to connect to is down or won't give you
> any data for some time , how will I do this ... here's my function ...
> thanks
>
> sub getdaytime {
> my $svrhost = shift ;
> my $socket = IO::Socket::INET->new("$svrhost:daytime") or die $! ;
> chomp(my $time = $socket->getline());
> return $time ;
> }
You can use IO::Select module from CPAN
add just BEFORE my $socket = IO::Socket......:
my $time_out_sending=15; (timeout in second)
my $time_out_receiving=30; (dito)
my $s=IO::Select->new();
You then create the $s object.
then add AFTER my $socket = IO::Socket......:
$s->add($socket); # to allow the $s object to manage $socket handler
### For sending ###
if ($s->can_write($time_out_sending)){
chomp(my $time = $socket->getline());
}
else {
&logmsg("Time out sending \n");
}
### For Receiving ###
if ($s->can_read($time_out_receiving)){
$socket->print("You talk to me ?");
}
else {
&logmsg("Time out receiving \n");
}
### Do not forget to remove the $socket management, ###
### on $s, when the socket is closed ###
$s->remove($socket);
Hope this helps.
Sébastien.
------------------------------
Date: Fri, 20 Dec 2002 19:03:46 +0530
From: "R Tamilarasan" <tamil@quicklogic.com>
Subject: Wanted Help to implement search for my intRAnet site of our company
Message-Id: <atv64h$2uq31$1@ID-155648.news.dfncis.de>
I m setting up a INTRANET site for our company
I m planning to put directory-search in web page.
The requirment ::--
I have a load of files and directories in the server disk.
One way to search is using window-find/search utility.
I dont want that.
User of the intranet should be able to do the search as
it is in the www.google.com search. It lists down all
the files and some contents as a web page.
Is cgi-perl usefull. I have not much idea of how to use
it for the web applications like search-engine.
Can anybody help me out to setup such search system.
Thanks in Advance.
R Tamilarasan.
------------------------------
Date: Fri, 20 Dec 2002 14:42:21 +0100
From: Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
Subject: Re: Wanted Help to implement search for my intRAnet site of our company
Message-Id: <newscache$le7f7h$cim$1@news.emea.compuware.com>
R Tamilarasan wrote (Friday 20 December 2002 14:33):
> I m setting up a INTRANET site for our company
> I m planning to put directory-search in web page.
> The requirment ::--
> I have a load of files and directories in the server disk.
> One way to search is using window-find/search utility.
> I dont want that.
> User of the intranet should be able to do the search as
> it is in the www.google.com search. It lists down all
> the files and some contents as a web page.
> Is cgi-perl usefull. I have not much idea of how to use
> it for the web applications like search-engine.
>
> Can anybody help me out to setup such search system.
>
> Thanks in Advance.
> R Tamilarasan.
What is you Perl question?
But now we're at it, htdig may be interesting for you.
--
KP
------------------------------
Date: Fri, 20 Dec 2002 13:46:00 +0100
From: "Michel Rodriguez" <mirod@xmltwig.com>
Subject: Re: xmlgrep
Message-Id: <pan.2002.12.20.12.45.59.808532@xmltwig.com>
On Thu, 19 Dec 2002 17:05:11 +0000, bill schaller wrote:
> I need to do grep like functions on files containing mostly xml. I wrote this
> little program that works like grep to search through multiple files. You
> must specify a root, and each chunck of xml with that root is searched for
> additional requirements. If matchs are found, the chunk is printed. As
> with grep, this can be piped into other programs....
>
> arguments are a little strange, but run with a -help to figure them out.
A good idea but you really should use an XML tool and not regexps to parse
the XML, that would be false hubris (I can do it! You are not in this
version) and laziness (why would I bother install a module? Because it
would do the job instead of just kind of work on some XML).
Plus names starting with XML (or anything that matches /^[Xx]{Mm][Ll]/)
are illegal in XML (section 2.3 of the spec, see
http://xml.com/axml/target.html#sec-common-syn) so your results are not
valid XML documents.
Please invest a little time in learning how some XML modules work,
XML::LibXML would be a good start, it will save you time both now and in
the long run when you realize that your tool does not process some kind of
XML or an other. Having a look at the Getopt::* modules would help too BTW.
__
Michel
------------------------------
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 4296
***************************************