[17581] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5001 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 30 18:10:39 2000

Date: Thu, 30 Nov 2000 15:10:19 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <975625819-v9-i5001@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 30 Nov 2000     Volume: 9 Number: 5001

Today's topics:
    Re: how to print file to browser? nobull@mail.com
    Re: how to print file to browser? <jeff@vpservices.com>
    Re: how to print file to browser? <me@privacy.net>
    Re: how to print file to browser? <jeff@vpservices.com>
    Re: IO::Socket::INET::sockopt() syntax? <uri@sysarch.com>
    Re: Looking for utility to show execution path (Abigail)
    Re: lynx with PERL <jboes@eoexchange.com>
    Re: Multi Recipients from email attachment script dtbaker_dejanews@my-deja.com
        Network "Discovery" (Tyrone Mills)
    Re: reading from <STDIN> nobull@mail.com
    Re: reading from <STDIN> eggrock@my-deja.com
    Re: Recursively load all objects in an HTML page... <elijah@workspot.net>
        reformatting a perl script <ken@mail.org>
    Re: reformatting a perl script <joe+usenet@sunstarsys.com>
    Re: reformatting a perl script (Andrew Johnson)
    Re: reformatting a perl script (Tad McClellan)
    Re: reformatting a perl script <ka@pacific.net>
    Re: reformatting a perl script <ka@pacific.net>
    Re: reformatting a perl script <joe+usenet@sunstarsys.com>
    Re: reformatting a perl script (Randal L. Schwartz)
    Re: reformatting a perl script <revjack@radix.net>
    Re: running encrypted files (Abigail)
    Re: running encrypted files (Martien Verbruggen)
    Re: solution: installing Image::Magick to host as non-r dtbaker_dejanews@my-deja.com
    Re: solution: installing Image::Magick to host as non-r dtbaker_dejanews@my-deja.com
    Re: Sorting the result of a function <W.Hielscher@mssys.com>
    Re: Sorting the result of a function nobull@mail.com
    Re: Sorting the result of a function <jrw32982@my-deja.com>
    Re: splitting a string into an array and preserving the <nospam.newton@gmx.li>
    Re: Substituting international characters (Abigail)
    Re: Substituting international characters <bonev@gmc.ulaval.ca>
    Re: Substituting international characters (Tad McClellan)
    Re: Why? <brian+usenet@smithrenaud.com>
    Re: Why? <brian+usenet@smithrenaud.com>
    Re: Why? <brian+usenet@smithrenaud.com>
    Re: Wich module for download via http ? (Abigail)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 30 Nov 2000 18:57:29 +0000
From: nobull@mail.com
Subject: Re: how to print file to browser?
Message-Id: <u98zq1nv8m.fsf@wcl-l.bham.ac.uk>

"EM" <me@privacy.net> writes:

> but i need to do this without first having to open the file into the server
> memory because it could be very big

Simply opening a big file does not consume a lot of memory.  Reading
the whole file in one chunk does.  But there's nothing to stop you
reading a bit of the file (with read()), writing that to STDOUT,
reading a bit more and so on.

The code for this is not exactly complex but nonetheless personally
I'd use copy() from File::Copy rather than re-invent then wheel:

use File::Copy 'copy';
copy('/home/me/file.zip',\*STDOUT);

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Thu, 30 Nov 2000 12:15:23 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: how to print file to browser?
Message-Id: <3A26B55B.39C50170@vpservices.com>

nobull@mail.com wrote:
> 
> "EM" <me@privacy.net> writes:
> 
> > but i need to do this without first having to open the file into the server
> > memory because it could be very big
> 
> The code for this is not exactly complex but nonetheless personally
> I'd use copy() from File::Copy rather than re-invent then wheel:
> 
> use File::Copy 'copy';
> copy('/home/me/file.zip',\*STDOUT);

Hmm, that might not work without the optional third parameter of a
buffer size.  From File::Copy pod:

"The default buffer size depends upon the file, but will generally be
the whole file (up to 2Mb)".

Also, depending on OS, the OP might want to binmode before copy().

-- 
Jeff


------------------------------

Date: Thu, 30 Nov 2000 20:41:26 GMT
From: "EM" <me@privacy.net>
Subject: Re: how to print file to browser?
Message-Id: <WXyV5.6099$Nw6.20561@news.iol.ie>


"Jeff Zucker" <jeff@vpservices.com> wrote in message
news:3A26B55B.39C50170@vpservices.com...
> nobull@mail.com wrote:
> >
> > "EM" <me@privacy.net> writes:
> >
> > > but i need to do this without first having to open the file into the
server
> > > memory because it could be very big
> >
> > The code for this is not exactly complex but nonetheless personally
> > I'd use copy() from File::Copy rather than re-invent then wheel:
> >
> > use File::Copy 'copy';
> > copy('/home/me/file.zip',\*STDOUT);
>
> Hmm, that might not work without the optional third parameter of a
> buffer size.  From File::Copy pod:
>
> "The default buffer size depends upon the file, but will generally be
> the whole file (up to 2Mb)".

2MB?
The files i will be working with could be up to 20MB
So how do i set the buffer size?


>
> Also, depending on OS, the OP might want to binmode before copy().
>
> --
> Jeff




------------------------------

Date: Thu, 30 Nov 2000 13:10:03 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: how to print file to browser?
Message-Id: <3A26C22B.878B2DC8@vpservices.com>

EM wrote:
> 
> "Jeff Zucker" <jeff@vpservices.com> wrote in message
> news:3A26B55B.39C50170@vpservices.com...
> > nobull@mail.com wrote:
> > >
> > > use File::Copy 'copy';
> > > copy('/home/me/file.zip',\*STDOUT);
> >
> > Hmm, that might not work without the optional third parameter of a
> > buffer size.  From File::Copy pod:
> >
> > "The default buffer size depends upon the file, but will generally be
> > the whole file (up to 2Mb)".
> 
> 2MB?
> The files i will be working with could be up to 20MB
> So how do i set the buffer size?

That is the size of the buffer, in other words it would print 2mb at a
time until it had reached the end of the file unless you specify some
other buffer size.

BUT, I just experimented and File::Copy does something funny with the
order of printing.  Nobull, will this really work for what the OP
wanted?  How would you print the Content header using this?

-- 
Jeff


------------------------------

Date: Thu, 30 Nov 2000 21:32:18 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: IO::Socket::INET::sockopt() syntax?
Message-Id: <x7pujd9me7.fsf@home.sysarch.com>

>>>>> "HB" == Henry Barta <hbarta@enteract.com> writes:

  HB>     $sock = IO::Socket::INET->new(Listen    => 5,
  HB> 				 LocalPort => $port,
  HB> 				 Proto     => 'tcp');
  HB> $sock->sockopt(SO_REUSEADDR, 1 );

  HB>     This code still produces the error
  HB>     "IO::Socket::INET: Address already in use at ..."
  HB>     If I kill and immediately restart the program.

you have to set that option before you bind the socket. but since that
bind is done internally by Socket::INET, you can't do it yourself. but
since reuseaddr is a well known and needed option, it is available to be
set by Socket::INET


In addition to the key-value pairs accepted by the IO::Socket manpage,
IO::Socket::INET provides.

   PeerAddr    Remote host address          <hostname>[:<port>]
   PeerHost    Synonym for PeerAddr

 ....

   Listen      Queue size for listen
   Reuse       Set SO_REUSEADDR before binding

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


------------------------------

Date: 30 Nov 2000 19:52:16 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Looking for utility to show execution path
Message-Id: <slrn92dbvg.bha.abigail@tsathoggua.rlyeh.net>

On Thu, 30 Nov 2000 14:03:30 -0500, Stephan Gross (sg@loralskynet.com) wrote in comp.lang.perl.misc <URL: news:<pg8d2t0c7vsvvdcp7bhlle8lj0855qm5ub@4ax.com>>:
++ Is there a utility that will look through my source code and pull out
++ all subroutines, telling me which will get executed in what order?
++ For example, something like this:
++ 
++ Main------|
++            sub1
++            sub5-----|
++                          sub3
++            sub4
++            sub17


Except for actually running the program, there is none. Solving that
would solve the halting problem, which is known to be unsolvable for
Turing Machines.



Abigail


------------------------------

Date: Thu, 30 Nov 2000 14:11:04 -0500
From: "Jeff Boes" <jboes@eoexchange.com>
Subject: Re: lynx with PERL
Message-Id: <3a26a862$0$29999$44a10c7e@news.net-link.net>

Unless my newsreader has been taken over by the Illuminati, I think
waseema@my-deja.com babbled:

> Hi I am accessing a page on the net using lynx

You might want to look into the LWP family of modules. Here's a tutorial
(pretty basic):

http://wdvl.com/Authoring/Languages/Perl/PerlfortheWeb/LWP.html


> My 2nd question is :
> 
> If i create an HTML form , and then want to submit it to
> http://www.abc.com/login.asp it works ok , is there a way i can create a
> form but rather that it being submitted via IE its submitted via lynx ?
> i cant send any values via the url ,as the script on the other side is
> configured to chuck an error if this happens

LWP still looks like a better choice than going through lynx.

-- 
Jeff Boes <jboes@eoexchange.com>          Tel:  (616) 381-9889 x.18
Sr. Software Engineer, EoExchange, Inc.   http://www.eoexchange.com/
Search, Monitor, Notify.                  http://www.eomonitor.com/


------------------------------

Date: Thu, 30 Nov 2000 21:47:25 GMT
From: dtbaker_dejanews@my-deja.com
Subject: Re: Multi Recipients from email attachment script
Message-Id: <906htb$pq4$1@nnrp1.deja.com>



>
> You can place multiple recipients into a single To: header by
> stringing them up with commas as is described in the manual page.
--------
Yes this is possible, but looks weird to the recipients, and doesnt
allow Bcc-like hiding of addresses for privacy in large groups.


>
> You may also choose to queue the mail using the Net::SMTP module.
> In this way you can address the envelope directly by using the
> Net::SMTP::recipient method.  Then you can put almost anything you
> want into the To: header.
----------
yes, but with Net::SMTP is is a much more manual process to handle
attachments.


I am wondering now if there is a way to add multiple addresses to the
recipient header (without being visible to the recipient) when using
MIME::Lite ?

D


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Thu, 30 Nov 2000 21:20:31 GMT
From: tmills@total-care.com (Tyrone Mills)
Subject: Network "Discovery"
Message-Id: <3a26c222.7446667@news.junction.net>

Hello All,

First off, I'd like to thank those of you who helped me with the shell
and variable problems I was having yesterday. Everything is now
working as it should! Thanks!!

Now for what I am trying to accomplish today:

I want to write a Perl script that will find the NetBIOS names of all
computers on the network. Either through some sort of broadcast or by
accessing Server Manager on one of our NT boxes. I've looked on CPAN
and have found the Win32::NetResource and Win32::NetAdmin, but they
don't appear to be able to discover machines, only work on them once I
have the names.

Any thoughts?

Thanks in Advance!


------------------------------

Date: 30 Nov 2000 19:05:01 +0000
From: nobull@mail.com
Subject: Re: reading from <STDIN>
Message-Id: <u97l5lnuw2.fsf@wcl-l.bham.ac.uk>

simbean@my-deja.com writes:

> All I want to do is have a non-blocking read from <STDIN>.
> 
> How do I do that??

Put STDIN into non-blocking mode...

use Fcntl;
fcntl(STDIN,F_SETFL,O_NONBLOCK);

 ...and then use sysread().

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


------------------------------

Date: Thu, 30 Nov 2000 20:56:28 GMT
From: eggrock@my-deja.com
Subject: Re: reading from <STDIN>
Message-Id: <906eto$mvt$1@nnrp1.deja.com>

In article <9063tm$cub$1@nnrp1.deja.com>,
  simbean@my-deja.com wrote:
> Hi all,
>
> I stumbled over another problem. This might be really easy for you,
but
> I just cannot figure out how to do it:
>
> All I want to do is have a non-blocking read from <STDIN>.
>
> How do I do that??
>
> Ciao,
> René.

If you don't use Fcntl you can get the Term::ReadKey module from CPAN.

Happy hacking...


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: 30 Nov 2000 21:05:48 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: Recursively load all objects in an HTML page...
Message-Id: <eli$0011301553@qz.little-neck.ny.us>

In comp.lang.perl.misc, Bart Lateur  <bart.lateur@skynet.be> wrote:
> Eli the Bearded wrote:
> >$bv has the 'browser version'.
> >	if ($bv =~ /lynx/i) {
> >	  $getembed      = 0;	# <EMBED>
> >	  $getimages     = 0;	# <IMG>
> >	  $gettrimages   = 0;	# background= in <TR>
> [etc.]
> Oops. Lots of (global) variables. I would tend to stuff this in a hash.

These days I do, but I don't consider it important enough to 
rewrite this old code.

(These days I 'use strict' and declare nearly all variables via
'use vars', so I am lazy about creating variables.)

> If you do it properly, your program could even be data driven, so that
> this hash controls the behaviour of the retrieval tool. I don't know if
> it can be done. I'm thinking of something like:
> 
> 	$get{FRAMES}{HREF} = 1;
> 	$get{IMG}{SRC} = 1;

For most cases only only attribute will have the source, so why not:

	# IE
	$get{FRAMES} = 'HREF';	# use HREF for <FRAME>
	$get{IMG}    = 'SRC';	# use SRC for <IMG>
	$get{TR}     = undef;	# don't get anything for <TR>

> So, per tag (the first key), you get a list of attributes to look out
> for (keys of the subhash, if the subhash even exists), and see if you

If you need a hash, one could be used just for those:

	# Netscape
	$get{FRAMES} = 'HREF';              # use HREF for <FRAME>
	$get{IMG}    = { 'SRC', 'LOWSRC' }; # use SRC and LOWSRC for <IMG>
	$get{TR}     = 'BACKGROUND';        # use BACKGROUND for <TR>

> need to follow it. The way it needs to be followed, depends largely on
> the kind of content. That's where I'm not sure I've done the right
> thing.

All of that, though, would require me to write 'pageweight' in a
much cleaner fashion. :^)

Elijah
------
could use a better way to store the request headers, too


------------------------------

Date: Thu, 30 Nov 2000 11:33:50 -0800
From: Ken <ken@mail.org>
Subject: reformatting a perl script
Message-Id: <3A26AB9E.51D6DB7D@mail.org>

Does anyone know of a RELIABLE script or program for unix or windows
that will take a not very readable perl script that has been stripped of
most white space and appropriate line returns, and format it in a more
standard kind of way?
Freeware only please.
Please reply to ken@mail.org
Thanks,
Ken




------------------------------

Date: 30 Nov 2000 14:39:59 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: reformatting a perl script
Message-Id: <m37l5luu40.fsf@mumonkan.sunstarsys.com>

Ken <ken@mail.org> writes:

> Does anyone know of a RELIABLE script or program for unix or windows
> that will take a not very readable perl script that has been stripped of
> most white space and appropriate line returns, and format it in a more
> standard kind of way?
> Freeware only please.

http://www.emacs.org

-- 
Joe Schaefer


------------------------------

Date: Thu, 30 Nov 2000 21:19:06 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: reformatting a perl script
Message-Id: <evzV5.25990$Z9.1315134@news1.rdc1.mb.home.com>

In article <3A26AB9E.51D6DB7D@mail.org>,
 Ken <ken@mail.org> wrote:
> Does anyone know of a RELIABLE script or program for unix or windows
> that will take a not very readable perl script that has been stripped of
> most white space and appropriate line returns, and format it in a more
> standard kind of way?
> Freeware only please.

Why not give the Deparse backend module a try:

    perl -MO=Deparse scriptname > newscriptname

It changes a few things that are semantically equivelant (like:
'while(1)' to 'for(;;)') but the output is readable and not
only is it free, but if you have 5.6.0, you already have it :-)

regards,
andrew

-- 
Andrew L. Johnson   http://members.home.net/andrew-johnson/


------------------------------

Date: Thu, 30 Nov 2000 14:15:15 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: reformatting a perl script
Message-Id: <slrn92d9q3.75e.tadmc@magna.metronet.com>

Ken <ken@mail.org> wrote:

>that will take a not very readable perl script that has been stripped of
                                                              ^^^^^^^^^^^
>most white space and appropriate line returns, 


How did that happen?

Why don't you ask the author for the non-obfuscated source?


>and format it in a more
>standard kind of way?


Perl FAQ, part 3:

   "Is there a pretty-printer (formatter) for Perl?"


>Please reply to ken@mail.org

This is not a help desk.

Ask it here, get the answer here (maybe).


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Thu, 30 Nov 2000 14:01:00 -0800
From: Ken <ka@pacific.net>
Subject: Re: reformatting a perl script
Message-Id: <3A26CE1C.85608E1A@pacific.net>

Tried this. 
It stopped at the first sub and quit, though I have 5.005, not 5.6.0
Can you point me to some docs on this, or can you tell me the proper
command line switches to tell it to leave comments in and to parse the
whole script, not just the main section?
Thanks,
Ken


Andrew Johnson wrote:
> 
> In article <3A26AB9E.51D6DB7D@mail.org>,
>  Ken <ken@mail.org> wrote:
> > Does anyone know of a RELIABLE script or program for unix or windows
> > that will take a not very readable perl script that has been stripped of
> > most white space and appropriate line returns, and format it in a more
> > standard kind of way?
> > Freeware only please.
> 
> Why not give the Deparse backend module a try:
> 
>     perl -MO=Deparse scriptname > newscriptname
> 
> It changes a few things that are semantically equivelant (like:
> 'while(1)' to 'for(;;)') but the output is readable and not
> only is it free, but if you have 5.6.0, you already have it :-)
> 
> regards,
> andrew
> 
> --
> Andrew L. Johnson   http://members.home.net/andrew-johnson/


------------------------------

Date: Thu, 30 Nov 2000 14:03:26 -0800
From: Ken <ka@pacific.net>
Subject: Re: reformatting a perl script
Message-Id: <3A26CEAE.CFFE9D1F@pacific.net>

:-)
uh. Thanks, but unless there is a simple set of keystrokes to do this in
emacs, I am not likely to figure it out anytime soon, since I don't
normally use emacs for editing.
Ken


Joe Schaefer wrote:
> 
> Ken <ken@mail.org> writes:
> 
> > Does anyone know of a RELIABLE script or program for unix or windows
> > that will take a not very readable perl script that has been stripped of
> > most white space and appropriate line returns, and format it in a more
> > standard kind of way?
> > Freeware only please.
> 
> http://www.emacs.org
> 
> --
> Joe Schaefer


------------------------------

Date: 30 Nov 2000 17:39:21 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: reformatting a perl script
Message-Id: <m3pujdt78m.fsf@mumonkan.sunstarsys.com>

Ken <ka@pacific.net> writes:

> :-)
> uh. Thanks, but unless there is a simple set of keystrokes to do this in
> emacs, I am not likely to figure it out anytime soon, since I don't
> normally use emacs for editing.
> Ken
> ;

C-x C-f <filename>
M-x cperl-mode
M-% ; <RET> ; C-qC-j  <RET> (omit spaces)
<SPC>, <DEL> as needed
<TAB>, <SPC> arrow keys as needed


HTH
-- 
Joe Schaefer


------------------------------

Date: 30 Nov 2000 14:41:32 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: reformatting a perl script
Message-Id: <m1g0k913s3.fsf@halfdome.holdit.com>

>>>>> "Tad" == Tad McClellan <tadmc@metronet.com> writes:

Tad> Ask it here, get the answer here (maybe).

Get many answers here usually, some of which will be relatively
correct, some of which will be wrong, a few of which will likely be
wrong in a cargo-cult sense, republished from previous cargo-cult
answers from the previous time. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


------------------------------

Date: 30 Nov 2000 22:50:06 GMT
From: revjack <revjack@radix.net>
Subject: Re: reformatting a perl script
Message-Id: <906liu$dbc$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

Randal L. Schwartz explains it all:
:>>>>> "Tad" == Tad McClellan <tadmc@metronet.com> writes:

:Tad> Ask it here, get the answer here (maybe).

:Get many answers here usually, some of which will be relatively
:correct, some of which will be wrong, a few of which will likely be
:wrong in a cargo-cult sense, republished from previous cargo-cult
:answers from the previous time. :)

That reminds me, what's the general rule for converting a
list into a scalar again? I keep forgetting.

-- 
revjack@radix.net
stochasticgnosisthroughablativedissonance


------------------------------

Date: 30 Nov 2000 19:16:06 GMT
From: abigail@foad.org (Abigail)
Subject: Re: running encrypted files
Message-Id: <slrn92d9rm.bha.abigail@tsathoggua.rlyeh.net>

On Wed, 29 Nov 2000 16:04:57 -0700, Kelley Kent (kelley.a.kent@intel.com) wrote in comp.lang.perl.misc <URL: news:<904217$aht@news.or.intel.com>>:
++ I have some Perl files stored in common areas on our network where everyone
++ has access. I was wondering of there was a way to store these Perl files
++ (.pl, .cgi, etc) encrypted [not sure how i would do this though], and then
++ have some "master" perl control file that would decrypt the files and then
++ execute them. In this way, people could see the perl files but not know the
++ contents, meaning they could not execuste them and whatnot.
++ 
++ And I'm running on Linux, fyi. Any ideas? I've not dealt with any encryption
++ before.
++ 


Linux, being a Unix, has a command "chmod". Perhaps you should consult
the manpage.


Abigail


------------------------------

Date: Thu, 30 Nov 2000 21:50:47 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: running encrypted files
Message-Id: <slrn92dipj.br5.mgjv@verbruggen.comdyn.com.au>

On Wed, 29 Nov 2000 16:04:57 -0700,
	Kelley Kent <kelley.a.kent@intel.com> wrote:
> I have some Perl files stored in common areas on our network where everyone
> has access. I was wondering of there was a way to store these Perl files
> (.pl, .cgi, etc) encrypted [not sure how i would do this though], and then
> have some "master" perl control file that would decrypt the files and then
> execute them. In this way, people could see the perl files but not know the
> contents, meaning they could not execuste them and whatnot.

Scoot over to clp.modules. There's a current thread there that talks
about this. Maybe you'll get something out of that.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.   | enough features yet.
NSW, Australia                  | 


------------------------------

Date: Thu, 30 Nov 2000 22:21:37 GMT
From: dtbaker_dejanews@my-deja.com
Subject: Re: solution: installing Image::Magick to host as non-root user
Message-Id: <906jt9$rfp$1@nnrp1.deja.com>

In article <sean-A34607.22530317112000@usenet.plus.net>,
  Sean W <sean@motorsports.co.uk> wrote:
> I tried to follow your guide but I keep getting the following error
when
> I try to configure it
>
> configuring ImageMagick 5.2.0
> checking host system type... configure: error: cannot guess host type;
> you must
> specify one
>
> Can anyone shed any light on this
--------------

you know... I just noticed that your post indicates you are installing
verion 5.2.0.   I installed 5.2.4 , and I think there is a newer one yet
from www.imagemagick.org

D


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Thu, 30 Nov 2000 22:24:52 GMT
From: dtbaker_dejanews@my-deja.com
Subject: Re: solution: installing Image::Magick to host as non-root user
Message-Id: <906k3c$ros$1@nnrp1.deja.com>

Also, one additional addition to my original solution is that if you
intend to use TrueType fonts in Annotate() calls, you MUST install the
FreeType libs BEFORE you install IMageMagick, or be sure to go back and
re configure, and re-make. Apparently the libs HAVE to be in place prior
to the compilation of ImageMagick.

Dan


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Thu, 30 Nov 2000 20:07:54 +0100
From: Wolfgang Hielscher <W.Hielscher@mssys.com>
Subject: Re: Sorting the result of a function
Message-Id: <3A26A58A.F344C49C@mssys.com>

John Wiersba wrote:
>    Why doesn't sort produce the expected result in
> the following command?
> 
>    perl -e 'sub f { (3,2,1) } @a = sort   f() ; print "@a\n"'

There are three different flavors of the sort function, one of them is
   sort USERSUB LIST

So, you're supplying the sort-function an empty list (), which it is
supposed to sort according to the results of subroutine f.
The following program illustrates your situation:

#/usr/bin/perl -w
use strict;

sub f {
   print '.';
   return (3, 2, 1);
}

my @a = sort f( 'foo', 'bar', 'baz' );  # sort USERSUB LIST
print "@a\n";

f() gets called twice to sort the three element list.

I don't know if it is the most "perlish" way, but you can fix the
problem by 

my @a = sort &f( 'foo', 'bar', 'baz' );	# sort LIST
             ^
             ^
Cheers
	Wolfgang


------------------------------

Date: 30 Nov 2000 19:36:09 +0000
From: nobull@mail.com
Subject: Re: Sorting the result of a function
Message-Id: <u94s0pntg6.fsf@wcl-l.bham.ac.uk>

Wolfgang Hielscher <W.Hielscher@mssys.com> writes:

> I don't know if it is the most "perlish" way, but you can fix the
> problem by 
> 
> my @a = sort &f( 'foo', 'bar', 'baz' );	# sort LIST

More Perlish ways:

my @a = sort +f( 'foo', 'bar', 'baz' );
my @a = sort (f( 'foo', 'bar', 'baz' ));


------------------------------

Date: Thu, 30 Nov 2000 22:32:25 GMT
From: John Wiersba <jrw32982@my-deja.com>
Subject: Re: Sorting the result of a function
Message-Id: <906khp$s12$1@nnrp1.deja.com>

In article <u94s0pntg6.fsf@wcl-l.bham.ac.uk>,
  nobull@mail.com wrote:
> Wolfgang Hielscher <W.Hielscher@mssys.com> writes:
>
> > I don't know if it is the most "perlish" way, but you can fix the
> > problem by
> >
> > my @a = sort &f( 'foo', 'bar', 'baz' );	# sort LIST
>
> More Perlish ways:
>
> my @a = sort +f( 'foo', 'bar', 'baz' );
> my @a = sort (f( 'foo', 'bar', 'baz' ));
>

Thanks!  Way #3 fails -- sort (f(...)) fails.  The other two (+f and &f)
both work.

   $ perl -e 'sub f {@_} @a = sort (f(3,2,1)); print "@a\n"'
   3 2 1

I have to say that I think this is the ugliest perl gaff I have yet
seen.  That f(...) should be interpreted as two arguments, the first
being the name of a function and the second being a list, is abominable
beyond belief (but I guess I believe it now).  Something for the
obfuscated perl contest, I guess (or maybe it's too tame?)

Anyway, thanks again for the help!  (BTW, to me, using &f seems the most
perlish way to go.  I guess I'd prefer way #3 if it worked.)

--
John Wiersba


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Thu, 30 Nov 2000 18:57:07 +0100
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.li>
Subject: Re: splitting a string into an array and preserving the "\n"
Message-Id: <6k4d2tc3ahomc3gum545gonrs9j092amml@4ax.com>

On Wed, 29 Nov 2000 19:55:55 -0500, tadmc@metronet.com (Tad McClellan) wrote:

> When we see 'puters are having meetings and holding conferences,
> _then_ is when we'll know that the world has gone to 
> Helena Handbasket.

Is that in Montana? :-)

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
If you're not part of the solution, you're part of the precipitate.


------------------------------

Date: 30 Nov 2000 19:26:48 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Substituting international characters
Message-Id: <slrn92dafo.bha.abigail@tsathoggua.rlyeh.net>

On Thu, 30 Nov 2000 01:36:47 GMT, Ilian Bonev (bonev@gmc.ulaval.ca) wrote in comp.lang.perl.misc <URL: news:<3A25AF2F.1F2A3942@gmc.ulaval.ca>>:
++ HI,
++ 
++ Is there a simpler way of performing the following:
++ 
++ $intstring =~ tr/[è,é,ê,ë]/e/;
++ $intstring =~ tr/[à,á,â,ä,å]/a/;
++ $intstring =~ tr/[ì,í,î,ï]/i/;
++ $intstring =~ tr/[ò,ó,ô,õ,ö]/o/;
++ $intstring =~ tr/[ç]/c/;
++ $intstring =~ tr/[æ]/ae/;
++ $intstring =~ tr/[ù,ú,û,ü]/u/;

That doesn't do what you think it does.


You might want to focus on the correct way first before finding
"simpler" ways. In fact, once you look at the documentation of
tr, you'll find that the correct way *IS* the simple way.



Abigail


------------------------------

Date: Thu, 30 Nov 2000 19:56:11 GMT
From: Ilian Bonev <bonev@gmc.ulaval.ca>
Subject: Re: Substituting international characters
Message-Id: <3A26B013.4ED5B2F0@gmc.ulaval.ca>

Hi,

Thanks for the remark about the square brackets and the commas - you are
absolutely right. However, I wrote the following subroutine and it works
perfectly well:

sub IntCharSubs {
    my($intstring) =3D @_;
    my($ae) =3D 'ae';

    $intstring =3D~ tr/=C3=A8=C3=A9=C3=AA=C3=AB=C3=88=C3=89=C3=8A=C3=8B/e=
/;
    $intstring =3D~ tr/=C3=A0=C3=A1=C3=A2=C3=A4=C3=A5=C3=A3=C3=80=C3=81=C3=
=82=C3=84=C3=85=C3=83/a/;
    $intstring =3D~ tr/=C3=AC=C3=AD=C3=AE=C3=AF=C3=8C=C3=8D=C3=8E=C3=8F/i=
/;
    $intstring =3D~ tr/=C3=B2=C3=B3=C3=B4=C3=B5=C3=B6=C3=92=C3=93=C3=94=C3=
=95=C3=96/o/;
    $intstring =3D~ tr/=C3=B9=C3=BA=C3=BB=C3=BC=C3=99=C3=9A=C3=9B=C3=9C/u=
/;
    $intstring =3D~ tr/=C3=A7=C3=87/c/;
    $intstring =3D~ s/=C3=A6=C3=86/$ae/;
    return($intstring)
}

The only problem I still have, is that s/=C3=A6=C3=86/$ae/ substitutes on=
ly the
first character =C3=A6 or =C3=86 with ae. Unfortunately, it seems that tr=
///
cannot be used to substitute single characters with regular expressions.
(I use perl version 5.005_03 built for i386-linux.)

Ilian


Curtis Poe wrote:
> =

> I don't think you're going to particularly like this answer, but I thin=
k
> you'll want to use a hash and a substitute:
> =

> my %char =3D ( '=C3=A8' =3D> 'e',
>              '=C3=A9' =3D> 'e',
>              '=C3=AA' =3D> 'e',
>              '=C3=AB' =3D> 'e' );
> =

> my $test =3D" =C3=A8 =C3=A9 =C3=AA =C3=AB ";
> $test =3D~ s/([=C3=A8=C3=A9=C3=AA=C3=AB])/$char{$1}/g;
> print $test;
> =

> That prints " e e e e " (without the quotes).
> =

> Your tr/// has some problems.  One, you don't use [] to specify a chara=
cter
> class and two, you don't use commas.  Your translation will turn all of=
 your
> square brackets and commas into the appropriate letter.
> =

> Cheers,
> Curtis


------------------------------

Date: Thu, 30 Nov 2000 16:01:01 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Substituting international characters
Message-Id: <slrn92dg0d.7c3.tadmc@magna.metronet.com>

Ilian Bonev <bonev@gmc.ulaval.ca> wrote:

>first character =C3=A6 or =C3=86 with ae. Unfortunately, it seems that tr=
>///
>cannot be used to substitute single characters with regular expressions.
                                                ^^^^^^^^^^^^^^^^^^^^^^^^


Of course not. The description for tr/// in perlfunc.pod makes
no mention of regular expressions at all.

Because tr/// does not use regular expressions.

It uses "lists" of characters (where they are not "Perl lists").


Just because they "look like" pattern matches does not mean
that they _are_ pattern matches.

This is an understandable confusion given:

   $str =~  s/foo/bar/;   # a regex

   $str =~ tr/foo/bar/;   # NOT a regex


Sure do look the same.

Sure do not work the same :-)


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Thu, 30 Nov 2000 16:03:29 -0500
From: brian d foy <brian+usenet@smithrenaud.com>
Subject: Re: Why?
Message-Id: <brian+usenet-27991D.16032930112000@news.panix.com>

In article <gaqV5.18067$II2.1788036@newsread2.prod.itd.earthlink.net>, 
"Ed Grosvenor" <secursrver@hotmail.com> wrote:

> I have an idea.  For those of you who insist on tearing someone a new
> orifice whenever they fail to read the Perl docs, why don't you print up a
> copy of the Perl docs and publish a phone number that these poor newbies can
> call to get a copy.

well, they can get Programming Perl by calling O'Reilly & Associates.
notice it's written by the language designer and its chief documenter.
O'Reilly's number is on their website.


> First of all, yes, it's all in the documentation, but when it comes down to
> it, those docs are not only convoluted and difficult for some to read,

there are several ways to search them, including

    http://www.perldoc.com

but you can't learn to use the docs without actually using them at some
point. you, apparently, haven't learned to use them.

> every Thanksgiving.  Secondly, I'm pretty sure that in all of the hundreds
> of thousands of pages that make up the Perl documentation (official and

a bit over a thousand actually, if you print them. (yes, i've counted).

> unofficial) every one of the questions posted here could be adequetly
> answered using the "docs". 

not really.  indeed, some of the questions are about the docs.  other
questions are about a particular task rather than the language.  some
questions are about comparisons of different methods.  these sorts of
topics are not covered in the docs.


> However, I believe that a good portion of users
> of this newsgroup find it easier and more productive to shoot out a quick
> question here than pour over hundreds of pages looking for that specific
> answer.

a good portion of the responders beleive it is easier to get the best
possible answer by learning how to use the docs.


> So why don't we just all act in the spirit of sharing and, as a community,
> stop tearing each other down for asking the "documented" questions.
> Remember, there is no such thing as a stupid question.  Only stupid

> looked.  But he didn't.  He chose to come to you for your vast knowledge and
> expertise.  He trusts you more than a man page.  Feel special.  Enjoy that

some of the people answering questions are the same ones who wrote the
man pages.


if you don't like it, you can go away. defending other people based
on things you are unable to do is just silly.

-- 
brian d foy
Perl Mongers <URL:http://www.perl.org>
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


------------------------------

Date: Thu, 30 Nov 2000 16:08:23 -0500
From: brian d foy <brian+usenet@smithrenaud.com>
Subject: Re: Why?
Message-Id: <brian+usenet-AF285B.16082330112000@news.panix.com>

In article <905l86$nv9$1@lublin.zrz.tu-berlin.de>, 
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:

> The question at hand was (paraphrasing): Is it true that 'open F, ">$file"'
> truncates $file?  This question is answered in so many words in the
> documentation of open().  It's trivially found and all in one place.


not to mention one of the easiest ways to find out sometimes - just
try it and see what happens :)

-- 
brian d foy
Perl Mongers <URL:http://www.perl.org>
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


------------------------------

Date: Thu, 30 Nov 2000 16:11:33 -0500
From: brian d foy <brian+usenet@smithrenaud.com>
Subject: Re: Why?
Message-Id: <brian+usenet-00DBF9.16113330112000@news.panix.com>

In article <905rvv$kkc$2@bob.news.rcn.net>, Henry_Barta 
<hbarta@enteract.com> wrote:

>     Neither do I care to see questions that could have been answered
>     by a minimal effort at researching the documents. Of course
>     what is easily found by another may be not so easily found by
>     me.

there is http://www.perldoc.com which allows you to search the docs.

`man perl` is a good start.  it's your table of contents to the rest
of the manual pages.

>     The best answers are the ones that include the location of the
>     answer, be it FAQ, man page or whatever. That way I know where
>     to look next time.

that may be true, but having to look around in the docs is usually a 
good thing.  you'll learn the general layout of things and over time
learn your way around.  however, that will never happen if you never
start.

-- 
brian d foy
Perl Mongers <URL:http://www.perl.org>
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


------------------------------

Date: 30 Nov 2000 19:27:58 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Wich module for download via http ?
Message-Id: <slrn92dahu.bha.abigail@tsathoggua.rlyeh.net>

On Thu, 30 Nov 2000 16:12:17 +0100, François (avril@ece.fr) wrote in comp.lang.perl.misc <URL: news:<905qoi$jf7$1@s1.read.news.oleane.net>>:
++ I want to use Perl to make a script that download a file from a web site.
++ How can I do that ?


Step 1: Learn Perl.



Abigail


------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 5001
**************************************


home help back first fref pref prev next nref lref last post