[15680] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3093 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 18 21:05:47 2000

Date: Thu, 18 May 2000 18:05:12 -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: <958698312-v9-i3093@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 18 May 2000     Volume: 9 Number: 3093

Today's topics:
    Re: "Breakthrough" Perl compiler? <rootbeer@redcat.com>
    Re: Accurate IP return? <gellyfish@gellyfish.com>
    Re: Array Question <rootbeer@redcat.com>
    Re: Bug or Feature: Can't dereference array ref inside  (Abigail)
    Re: Delay in Perl (Abigail)
    Re: extracting a list from multiple regex matches (Abigail)
    Re: Fixed number of fields <lr@hpl.hp.com>
    Re: Fixed number of fields <jeff@vpservices.com>
    Re: generating gif image from cgi <edbubbleluk@hotmail.com>
    Re: Giving a string the name of a string <rootbeer@redcat.com>
    Re: glueing a scalar onto a variable <jhelman@wsb.com>
    Re: glueing a scalar onto a variable <rootbeer@redcat.com>
    Re: glueing a scalar onto a variable <danielxx@bart.nl>
    Re: glueing a scalar onto a variable <danielxx@bart.nl>
    Re: glueing a scalar onto a variable <jhelman@wsb.com>
    Re: glueing a scalar onto a variable <danielxx@bart.nl>
    Re: HELP: how to compile (when necessary) a module down <glauber.ribeiroNOglSPAM@experian.com.invalid>
    Re: Long datatype update problem <geoff@crc-sugar.jcu.edu.au>
        Manipulate all *values* using CGI.pm? <trent@jps.net>
        need starting point: manipulating graphics aaronp@removeme-shore.net
    Re: need starting point: manipulating graphics <rootbeer@redcat.com>
    Re: need starting point: manipulating graphics <makarand_kulkarni@My-Deja.com>
    Re: need starting point: manipulating graphics <makarand_kulkarni@My-Deja.com>
    Re: Problem with different Perl version <rootbeer@redcat.com>
        Q: children, signals, etc... (Elliot Finley)
        Reading Binary Files <gt7314c@prism.gatech.edu>
    Re: simple newbie question <lr@hpl.hp.com>
    Re: split a list of number equally <ppi@searchy.net>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 18 May 2000 15:47:24 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: "Breakthrough" Perl compiler?
Message-Id: <Pine.GSO.4.10.10005181544090.25459-100000@user2.teleport.com>

On Thu, 18 May 2000, Charles Henry wrote:

> It is often so much easier to just give a compiled program that you
> give your script and require your friend to install Perl on his
> system. True isn't it?

Nope. With the current state-of-the-art for compiling Perl, it's easier to
successfully distribute Perl-and-a-script than to use a compiled binary.
Believe it or not.

And it's _much_ easier to successfully distribute Perl-and-several-scripts
than to use several compiled binaries.

Maybe someday this will change. But that's the way it is today, and for as
far into the future as my crystal ball can see. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 17 May 2000 21:07:37 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Accurate IP return?
Message-Id: <8fuu69$hfn$1@orpheus.gellyfish.com>

On Wed, 17 May 2000 13:52:38 +0100 [TNN]G.Bloke wrote:
> <CUT>
>> I think I could have put that better.
>>
>> In the case of a cache, proxy, firewall, network address translating
>> router or any of the other multitude of means by which the actual IP
>> address of a host might be concealed from you the address that you get in
>> $ENV{REMOTE_HOST} *is* the address of the host that requested the page
>> as far as the HTTP server is concerned: that it might not be the IP of
>> the machine on which the browser which ultimately initiated the request
>> is running is immaterial as whatever goes on between that machine and
>> the device that is talking to your server is their private business -
>> for all you know it might not even have an IP address at all.
>>
> 
> Thanks....I was aware of the problems of obtaining the correct IP address
> (see my other post in this thread). All I was asking is was there a way
> using perl.....you have answered that question, thank-you.
> 
> I was also aware why $ENV{REMOTE_HOST} didn't work, I just wondered if there
> was a better perl alternative to this.
> 

But how could there be a 'better perl alternative'.  It would make no
difference what language you used, it would make no difference if you
wrote your own HTTP server.  This is the way that it works.

/J\
-- 
Now go on, boy, and pay attention. Because if you do, someday, you may
achieve something that we Simpsons have dreamed about for generations:
You may outsmart someone!
-- 
fortune oscar homer


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

Date: Thu, 18 May 2000 15:42:50 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Array Question
Message-Id: <Pine.GSO.4.10.10005181526460.25459-100000@user2.teleport.com>

On Thu, 18 May 2000, Arthur Merar wrote:

> I am been playing with multidimentional associative arrays.  

We changed the name from "associative arrays" to "hashes". 

I could leave it at that, but you might think I was just being fussy. But
about seven years ago, all of us in the Perl world got tired of saying
"As-so-ci-a-tive ar-rays" eighteen times per day, and even more tired of
typing it, so we invented a shorter name. Now, that was a long time ago -
back then, chalupas hadn't even been invented yet. :-)

So, if you're using that name today, chances are that you've been learning
from oooold Perl books. Throw them out! Get new ones. Things have changed
in the last few years; we have better ways of doing things. 

Besides, if you don't use the right name, you'll never be able to find the
answers in the documentation.

> %pers_record=('Bogdan'=>{'Address'=>'C1605','Phone'=>'x7869','College'=>'BMC'})
> 
> Now, I want to add another row, with another persons name, how do I do
> it?

It's just storing another key/value pair into the hash. Like:

    $price{taco} = 99;
    $price{burrito} = 120;
    $price{nachos} = 320;

 ...except that you're using a hash reference as well; read the perlref
manpage for information on references. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 19 May 2000 00:13:46 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Bug or Feature: Can't dereference array ref inside hash
Message-Id: <slrn8i91pq.lb4.abigail@ucan.foad.org>

On Wed, 17 May 2000 23:03:51 -0700, Steve Leibel <stevel@coastside.net> wrote:
++ If I have a hash reference, one of whose keys is an array ref, like this:
++ 
++ $myhash = {
++     arrayref => (),
++ };

Had you used -w, you wouldn't have to ask, as Perl would have told you
the above as an error.

() is an empty list. [] creates an array reference.

++ 
++ In theory I should be able to dereference the arrayref using syntax such as
++ 
++     @$myhash->{arrayref}

Not that way. But this way:

    @{$myhash -> {arrayref}}



Abigail


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

Date: 19 May 2000 00:07:56 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Delay in Perl
Message-Id: <slrn8i91es.lb4.abigail@ucan.foad.org>

On Thu, 18 May 2000 01:30:18 -0400, Alex Shi <chpshi@connection.com> wrote:
++ 
++ How can I set a time delay or sleep (5 or 10 seconds) in Perl?


	{my $now = time; 1 while $now + 5 > time};


Abigail


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

Date: 19 May 2000 00:01:40 GMT
From: abigail@foad.org (Abigail)
Subject: Re: extracting a list from multiple regex matches
Message-Id: <slrn8i9134.lb4.abigail@ucan.foad.org>

On 18 May 2000 04:20:22 GMT, Jed Parsons <jed@socrates.berkeley.edu> wrote:
++ Hi, all,
++ 
++ Here's my problem.  I want to scan a text for a number of strings of
++ text connected by + signs.  For example:
++ 
++ 	a b+c d e+f+g+h i j 
++ 
++ In this text, I would want to capture the set [ab] as well as [efgh].

Well, that's odd. 'a' and 'b' aren't connected by a '+', and 'b' and 'c'
are. Perhaps you want to capture [bc] and [efgh]?

++ I'm trying to do this with a regex, but am having trouble.  I'm thinking
++ of a solution along these lines
++ 
++ 	@matches = ($text =~ /(\w+)(?:\+(\w+))*/g)
++ 
++ You don't need to tell me this doesn't work :-)  I'm not sure exactly
++ where I'm going wrong.  Can anyone offer me some suggestions?

"Doesn't work" isn't a useful statement. What does it do, and what do 
you expect it to do?

Perhaps you want /(\w+(?:\+\w+)+)/g.



Abigail


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

Date: Thu, 18 May 2000 15:40:11 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Fixed number of fields
Message-Id: <MPG.138e111cda83cdd598aa9b@nntp.hpl.hp.com>

In article <3923FD5A.D2E00D08@vpservices.com> on Thu, 18 May 2000 
07:25:30 -0700, jeff@vpservices.com says...
> R wrote:
> > 
> > I'm working on a script that handles the input from a webpage-form so that
> > all fields are filled in to a file. I.e not only the fields that are filled
> > in by the user, the number of fields must be fixed.
> > 
> > If a user don't fill in the address, that field must be filled in anyway in
> > the file by the perlscript.
> 
> The script needs to know the names of all the fields and do a loop
> through that list of names.  For each name on the list, if there is a
> filled in form parameter, add that to the record, and if not, add undef
> or '', or 'NULL' or whatever you want to use to indicate an empty field.

The script doesn't need to know the names of all the fields.  Using 
CGI.pm (and if not, why not?), the param() function returns a list of 
the names of the fields.  If the field wasn't filled in, the value of 
the corresponding parameter is the null string, "".

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Thu, 18 May 2000 16:04:03 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Fixed number of fields
Message-Id: <392476E3.57A32B13@vpservices.com>

Larry Rosler wrote:
> 
> In article <3923FD5A.D2E00D08@vpservices.com> on Thu, 18 May 2000
> 07:25:30 -0700, jeff@vpservices.com says...
> > R wrote:
> > >
> > > I'm working on a script that handles the input from a webpage-form so that
> > > all fields are filled in to a file. I.e not only the fields that are filled
> > > in by the user, the number of fields must be fixed.
> > >
> > > If a user don't fill in the address, that field must be filled in anyway in
> > > the file by the perlscript.
> >
> > The script needs to know the names of all the fields and do a loop
> > through that list of names.  For each name on the list, if there is a
> > filled in form parameter, add that to the record, and if not, add undef
> > or '', or 'NULL' or whatever you want to use to indicate an empty field.
> 
> The script doesn't need to know the names of all the fields.  Using
> CGI.pm (and if not, why not?), the param() function returns a list of
> the names of the fields.  If the field wasn't filled in, the value of
> the corresponding parameter is the null string, "".

Hmm, try this script and press submit without filling in any of the form
fields.  It will tell you about the existence of the radio group because
that has an automatic default, but will be completely ignorant about the
scrolling lists.  I stand by my original statement.

#!perl -w
use strict;
use CGI;
my $q = new CGI;
my $a = ['a','b','c'];
print
    $q->header,
    $q->start_form,
    $q->radio_group(-name=>'radio_group',-values=>$a),
    $q->scrolling_list(-name=>'scroll',-values=>$a),
    $q->scrolling_list(-name=>'mscroll',-values=>$a,-multiple=>1),
    $q->submit,
    $q->end_form, "<p>"
;

for ($q->param) {
   print "$_ : ";
   print $q->param($_) if defined $q->param($_);
   print "<br>";
}

-- 
Jeff


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

Date: Thu, 18 May 2000 18:11:47 -0400
From: "Ed" <edbubbleluk@hotmail.com>
Subject: Re: generating gif image from cgi
Message-Id: <8g1pji$q09$1@nntp9.atl.mindspring.net>

what is php3??



Reo M. <reo@infi.net> wrote in message
news:3923304d.10545267@news.infi.net...
> On Wed, 17 May 2000 15:06:24 -0700, Makarand Kulkarni
> <makarand_kulkarni@My-Deja.com> wrote:
>
>
> use  php3
>
> >No special cgi script is required ( unless you want to determine
> >the characteristics of the gif file at runtime ..)
> >
> >if $counter has the number  --
> >
> >print  join  ( '',map { "<image border=0 src=$_\.gif>"} split ( //,
$counter )
> >);
> >
> >--
> >
>




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

Date: Thu, 18 May 2000 15:19:19 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Giving a string the name of a string
Message-Id: <Pine.GSO.4.10.10005181517480.25459-100000@user2.teleport.com>

On Thu, 18 May 2000, Penpal International wrote:

> I tought this question could be found I the faq's, but I couldn't find
> any which even looks like it:
> 
> How can I give a string a name from the contents of an other string. 

I'm not sure, but you may be asking about how to use a variable's contents
as the name of another variable. Is that it?

    http://www.plover.com/~mjd/perl/varvarname.html

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Thu, 18 May 2000 22:07:50 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: glueing a scalar onto a variable
Message-Id: <392469D8.5F4650F3@wsb.com>

Uhh...bad idea and very error prone.  Use either a hash or an array. 
Type:

perldoc perldata

on your command line and read.
JH

Daniel van den Oord wrote:
> 
> I want to glue a number I get from a outside variable to another variable..
> like I have the variable $number and I wanna glue 12 onto it making it
> $number12
> this is supposed to be an easy way for a huge list of selections
> to make the right $number<xx> = "selected";
> 
> Daniel van den Oord      ( Daniel304 RTCL )
> ------------------------------------------------------------------
> It's nice to be important, but it's more important to be nice
> See there be good bye bye
> ------------------------------------------------------------------
> Daniel304rt ResearchTriangle Community Leader
> http://www.geocities.com/ResearchTriangle/Forum/5577

-- 
----------------------------------------------------------------
Jeff Helman                 Product Manager -- Internet Services
jhelman@wsb.com                    CCH Washington Service Bureau
----------------------------------------------------------------

99 little bugs in the code, 99 bugs in the code.
Fix one bug, compile again, 100 little bugs in the code.
100 little bugs in the code, 100 bugs in the code.
Fix one bug, compile again, 101 little bugs in the code...

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


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

Date: Thu, 18 May 2000 15:22:04 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: glueing a scalar onto a variable
Message-Id: <Pine.GSO.4.10.10005181520590.25459-100000@user2.teleport.com>

On Thu, 18 May 2000, Daniel van den Oord wrote:

> I want to glue a number I get from a outside variable to another variable..

Do you want the .= operator?

> like I have the variable $number and I wanna glue 12 onto it making it
> $number12

Or do you want to use the contents of a variable as a variable name?

    http://www.plover.com/~mjd/perl/varvarname.html

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Thu, 18 May 2000 22:33:44 GMT
From: "Daniel van den Oord" <danielxx@bart.nl>
Subject: Re: glueing a scalar onto a variable
Message-Id: <cd_U4.2174$Kk2.27945@Typhoon.bART.nl>

uhm
let's say I receive a number through a HTML form with name number!! that is
through Get method &number=12
I put that number in a variable like this

$number = param(number);

now $number has contents 12 right ??
I want to have a variable variable like

$count12 = <a value>;

if $number has contents 8
I want the variable variable to be

$count8 = <value>

I'm sorry if my English isn't very good that's because I'm dutch !!!
Please help !!






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

Date: Thu, 18 May 2000 22:44:50 GMT
From: "Daniel van den Oord" <danielxx@bart.nl>
Subject: Re: glueing a scalar onto a variable
Message-Id: <Cn_U4.2175$Kk2.27850@Typhoon.bART.nl>

an little example if I don't get it this way I can add 77 lines like this

 ....
if ($count = 12)    {$coun12 = "selected";}
if ($count = 13)    {$coun13 = "selected";}
if ($count = 14)    {$coun14 = "selected";}
 ....                 \_________/
                      this is my point.. don't want to over stress the NT
server to much by adding so much confirmation lines... he has to go through
them a few times !!




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

Date: Thu, 18 May 2000 22:48:40 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: glueing a scalar onto a variable
Message-Id: <3924736A.47469635@wsb.com>

Try this instead...

$Values{'8'} = <SOME VALUE>;
$Values{'9'} = <SOME OTHER VALUE>;
$Values{'12'} = <YET ANOTHER VALUE>;

$number = param(number);

Now, to access whatever value you want, just use:

$Values{$number}

This isn't the most efficient way to do this, but it is much better than
what you were trying to do.  I suggest that you type:

perldoc perldata 

at a command prompt and read it.

JH

Daniel van den Oord wrote:
> 
> uhm
> let's say I receive a number through a HTML form with name number!! that is
> through Get method &number=12
> I put that number in a variable like this
> 
> $number = param(number);
> 
> now $number has contents 12 right ??
> I want to have a variable variable like
> 
> $count12 = <a value>;
> 
> if $number has contents 8
> I want the variable variable to be
> 
> $count8 = <value>
> 
> I'm sorry if my English isn't very good that's because I'm dutch !!!
> Please help !!


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

Date: Thu, 18 May 2000 22:51:09 GMT
From: "Daniel van den Oord" <danielxx@bart.nl>
Subject: Re: glueing a scalar onto a variable
Message-Id: <xt_U4.2179$Kk2.28044@Typhoon.bART.nl>

damn got it thanks
using an array
$count[number] = "selected"




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

Date: Thu, 18 May 2000 15:10:10 -0700
From: glauber <glauber.ribeiroNOglSPAM@experian.com.invalid>
Subject: Re: HELP: how to compile (when necessary) a module downloaded from CPAN
Message-Id: <059e26f0.415e6c52@usw-ex0104-026.remarq.com>

In article <3924650c.23742339@news1.newscene.com>,
ekliao@mediaone.net (Eric Liao) wrote:
>I need help on how to compile a CPAN module and put it under
the right
>place in local machine's (NT) win32 perl installation.
[...]


If you got it from CPAN, it should have a file called
Makefile.PL. Run it, like this:
perl Makefile.PL

Now you should have a standard "makefile".
make
make test
make install


Problem is, unless you have compiled the Perl you are using
(that is, you didn't download the binary from Activestate), then
you will have trouble, since you won't have the include files,
etc, you need.

Many modules are pure perl (no C components). With those, you
will have no problem.

For users of the Activestate binary, it's often better to use
the "ppm" utility to download and install precompiled modules
(when available).

glauber

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Fri, 19 May 2000 09:04:29 +1000
From: Geoff <geoff@crc-sugar.jcu.edu.au>
Subject: Re: Long datatype update problem
Message-Id: <392476FD.9627569B@crc-sugar.jcu.edu.au>

I have solved this problem now - thanks to all who read and were about to
reply.

Geoff



Geoff wrote:

> This is an SQL problem really.. but any help would be good
>
> I am having a problem doing an update on a column in a table which is of
>
> a long datatype.  My interface is the following, but my problem is
> happening at the SQL level
>
> Browser-Perl Script-Oraperl Module-Oracle
>
> Essentially, the perl stuff generates a string which it sends to oracle
> as an SQL statement, and it is giving me an error ORA:1704 when the
> string literal within the statement is more than 4000 characters. ie:
>
> UPDATE PEOPLE
> SET LIFE_STORY="this is the literal string which has to be <4000 chars
> to work"
> WHERE ID=3
>
> (strange already as oracle says it can only handle string literals of
> 2000 characters)  Anyway I can send up to 4000 characters and update
> successfully, but any more gives me the 1704 message.  I thought this
> was weird cos a varchar2 has a max size of 4000 also.  I need to send
> more than this amount of chars to the database.
>
> Anyhow, I'm trying to do this in anyway possible without using PL/SQL -
> is there any way of perhaps doing an update-append style statement in
> SQL, or to bypass this problem with the long datatype?  It seems weird
> to have a datatype which can handle so many characters and only be able
> to send x amount of chars in a string literal to it.
>
> PS - I had to play with $ora_long in Perl to get to submit anything at
> all to the datatype, but as I said the problem now lies in the SQL I
> think
>
> If there's no way of doing it in straight SQL could someone maybe give
> me an example of the PL/SQL needed (something about the bind datatype?),
>
> and if they know whether this can be sent via the &ora_do statement in
> Oraperl?
>
> Any help greatly appreciated,
> Geoff.



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

Date: Thu, 18 May 2000 16:11:27 -0700
From: "Trent" <trent@jps.net>
Subject: Manipulate all *values* using CGI.pm?
Message-Id: <vL_U4.99$Li.19372@nntp2.onemain.com>


Hi Gents, Ladies -

I'm changing all of my scripts to utilize CGI.pm for obvious reasons...
But, my old "roll your own" forms processing allowed me to easily manipulate
all my form values at once.

e.g.(during the value pair loop)
 $value =~ s/(\w+)/\u\L$1/g;

Question- The CGI.pm docs explain how to
return *all input keys*(@names = $new_query->param;), and get
the values for specific keys, but I'm not clear on how to
grab and modify *all input values* in a single stroke...

Any help or productive tounge lashing appreciated :)

--

Thanks,
Trent Hare






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

Date: Thu, 18 May 2000 22:06:30 GMT
From: aaronp@removeme-shore.net
Subject: need starting point: manipulating graphics
Message-Id: <GPZU4.49$A81.7983@news.shore.net>

 Hi, I need to take an image file and manipulate it. Basically, I need to
draw a simple box somewhere on it. Any recommendations on where I should
start learning about this? I see lots of graphics options for Perl, but
which ones allow you to edit a previously made graphics file as opposed to
just creating a brand new one?


Aaron Price, UNIX Sysadmin
American Association of Variable Star Observers, www.aavso.org
"We are the music makers, we are the dreamers of the dreams." - Roald Dahl


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

Date: Thu, 18 May 2000 15:52:04 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: need starting point: manipulating graphics
Message-Id: <Pine.GSO.4.10.10005181549340.25459-100000@user2.teleport.com>

On Thu, 18 May 2000 aaronp@removeme-shore.net wrote:

> I need to take an image file and manipulate it. Basically, I need to
> draw a simple box somewhere on it. Any recommendations on where I
> should start learning about this? I see lots of graphics options for
> Perl, but which ones allow you to edit a previously made graphics file
> as opposed to just creating a brand new one?

If a module has a README file (or similar), see what it says. You can read
these over the web:

    http://search.cpan.org/Catalog/Graphics/

If a module doesn't have docs like that, don't use it. :-)

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Thu, 18 May 2000 15:53:19 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: need starting point: manipulating graphics
Message-Id: <3924745F.5A95A0C@My-Deja.com>

>  Hi, I need to take an image file and manipulate it. Basically, I need to
> draw a simple box somewhere on it. Any recommendations on where I should
> start learning about this? I see lots of graphics options for Perl, but
> which ones allow you to edit a previously made graphics file as opposed to
> just creating a brand new one?
>

perldoc GD.pm.
--




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

Date: Thu, 18 May 2000 15:54:59 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: need starting point: manipulating graphics
Message-Id: <392474C3.4EE8EAC4@My-Deja.com>

>  Hi, I need to take an image file and manipulate it. Basically, I need to
> draw a simple box somewhere on it. Any recommendations on where I should
> start learning about this? I see lots of graphics options for Perl, but
> which ones allow you to edit a previously made graphics file as opposed to
> just creating a brand new one?

perldoc GD.pm.

---8<--------------------------------------------------------------
GD::Image::newFromGif(FILEHANDLE) class method
This will create an image from a GIF file read in through the provided
filehandle.
The filehandle must previously have been opened on a valid GIF
 file or pipe. If successful, this call will return an initialized image which
you can then manipulate
as you please.
--




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

Date: Thu, 18 May 2000 15:48:51 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Problem with different Perl version
Message-Id: <Pine.GSO.4.10.10005181547590.25459-100000@user2.teleport.com>

On Thu, 18 May 2000, Saddek Rehal wrote:

> It seems that my program "hdate.exe" cant be called by the script under
> Perl 5.6 Why this difference???

If true, it may be a bug in 5.6. 

> I am running Perl under Win NT.

Or in NT. :-)

But file a bug report anyway. Good luck with it!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Fri, 19 May 2000 00:20:13 GMT
From: efinley@efinley.com (Elliot Finley)
Subject: Q: children, signals, etc...
Message-Id: <39298762.176269378@news.firstworld.net>

Perl 5.005_03
FreeBSD 4.0-stable

     I have a long running perl daemon that needs to send emails every
so often.  I would like to be able to fork and have the child process
send the email and then exit.

     The first question is: are signals reliable in Perl 5.005_03?
Every time I fork and send an email, the parent process will
eventually receive a CHLD signal.

     The second question hinges on the possibility that signals are
NOT reliable.  Is there a way for a child that has been forked to
disassociate itself from the parent in such a way that when it exits,
the parent will NOT receive a CHLD signal?
-- 
Elliot (efinley@efinley.com) Weird Science!


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

Date: Thu, 18 May 2000 20:27:51 -0400
From: Bob <gt7314c@prism.gatech.edu>
Subject: Reading Binary Files
Message-Id: <39248A86.E99AE888@prism.gatech.edu>

First, I appologize for asking a question that I'm sure has come up
often before, but I can't find the answer anywhere.

I would like to know how to read a binary file with PERL.  In most
cases, the binary file will have been created by a FORTRAN program and I
will know the format of the data in it.

Also, can anything at all be decifered if I know nothing about the
format of its data?

thanks,
Bob M.



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

Date: Thu, 18 May 2000 15:24:14 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: simple newbie question
Message-Id: <MPG.138e0d6514ca347098aa9a@nntp.hpl.hp.com>

In article <39241B35.60B6C1DD@alphacomp.ch> on Thu, 18 May 2000 18:32:53 

+0200, admin@alphacomp.ch says...
+ I just started to learn Perl with a book. As far all code examples
+ were ok when running in a DOS box.
+ But now to print out to the browser nothing is happening with this 2
+ files.

Perlfaq9 will give some help on what to do when a program runs from the 
command line but not from a webserver.

+ test.pl:
+ 
+ #!d:/prog/perl/bin/perl.exe
+ read(STDIN, $Daten, $ENV{'CONTENT_TYPE'});

That should be $ENV{CONTENT_LENGTH}, because $ENV{CONTENT_TYPE} is just 
'POST'.  But you should be using CGI.pm instead of trying to do this 
yourself.

+ print "Content-type: text/html\n\n";
+ print "<html><head><title>CGI-Reaktion</title></head>\n";
+ print "<body><h1>Reaktion des CGI-Programmes</h1>\n";
+ print $ENV{'CONTENT_TYPE'};

I assume you intended 'print $Daten;', but that is empty anyhow.

+ print "</body></html>\n";
+ 
+ test.html:
+ 
+ <html>
+ <head>
+ <title>Testsite</title>
+ </head>
+ <body>
+ <h1>Testformular</h1>
+ <form action="/cgi-bin/test.pl" method=post>
+ Name: <input size=40 maxlength=40 name="UserName"> <br>
+ Text: <textarea rows=5 cols=70 name="Comment"
+ wrap=virtual></textarea><p>
+ <input type=submit value="Send">
+ </form>
+ </body>
+ </html>
+ 
+ Who likes to help?

The extensive documentation in the CGI module will help, but first make 
sure you can execute a trivial program.  If not, you probably have 
issues rearding the configuration of you web server, which should be 
handled in another newsgroup.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Fri, 19 May 2000 01:40:51 +0200
From: Penpal International <ppi@searchy.net>
Subject: Re: split a list of number equally
Message-Id: <39247F83.8CA8A11C@searchy.net>

This is a multi-part message in MIME format.
--------------AA9FADC51DD97577F84A64E0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi!

I've made a script which can do this. (If I've understood you well).
I've attached the script. I've made this one pretty quick. As soon as I
have more time I could make one that's more accurate.
I've put no comments in the script for instructions... sorry...


Don Byington wrote:
> 
> Does anyone have any Perl 5 code for spliltting a list of numbers into
> two or more lists, where the new lists have a sum that is as close as
> possible?
> 
> Thanks,
> 
> Don
> 
> donby@synopsys.com

-- 
Penpal International
http://ppi.searchy.net/
ppi@searchy.net
--------------AA9FADC51DD97577F84A64E0
Content-Type: application/x-perl;
 name="test.pl"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="test.pl"

#!/usr/bin/perl

@list = ("26","2","53","32","86","6","14","54","58","23","76","90","45","1","43","4","54","98");

@sort = sort { my ($v1)=(split(/\|/,$a))[0]; my ($v2)=(split(/\|/,$b))[0] ; $v1 <=> $v2; } @list;

foreach $line(@sort) {
	if ($line) { push @sort1,$line;	}
}

@f = split(/\|/,$sort1[0]);
@l = split(/\|/,$sort1[(@sort1-1)]);


$first = $f[0];
$last  = $l[0];

$count =0;
$usedb = "false";
sub addfirst{
	push @list1,$sort1[($count)];
	push @useda,$count;
	$usedb = "true";
	@splitthis = split(/\|/,$sort1[($count)]);
	$first = $first+$splitthis[0];
	$count++;
}
sub addlast{
	$revcount = $#sort1 - $count;
	if ($usedb eq "true") {
		foreach $num(@useda) {
			#print "!$revcount-$num!\n";
			if ($revcount eq $num) { $nomore="true";goto forgetit; }
		}
	}
	push @list2,$sort1[($revcount)];
	@splitthis = split(/\|/,$sort1[($count)]);
	$last = $last+$splitthis[0];
	$count++;
	forgetit:
}
&addlast("ja");

while ($count <= $#sort1) {
	if ($first <= $last) { &addfirst; }
	else { &addlast; }
	last if $nomore eq "true";
}

print "List1:\n";
foreach $line(@list1) { print "$line\n"; }

print "\n\nList2:\n";
foreach $line(@list2) { print "$line\n"; }

print "\n\n";
--------------AA9FADC51DD97577F84A64E0--



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

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 3093
**************************************


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