[17845] in Perl-Users-Digest
Perl-Users Digest, Issue: 5 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 6 09:05:32 2001
Date: Sat, 6 Jan 2001 06:05:09 -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: <978789908-v10-i5@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 6 Jan 2001 Volume: 10 Number: 5
Today's topics:
Re: A Socket Server Problem <kistler@gmx.net>
Beginner cgi question.. <wavetable@birdmail.com>
Re: FAQ 7.9: How do I create a module? <whataman@home.com>
Going from unix to windows server sandywadkins123@my-deja.com
LWP and referer <news@_NOSPAM_mtvwebdesign.hypermart.net>
Re: LWP and referer egwong@netcom.com
Re: LWP and referer <bjoern@hoehrmann.de>
Re: LWP and referer <news@_NOSPAM_mtvwebdesign.hypermart.net>
Modify @INC? <leekembel@hotmail.com>
Re: Modify @INC? <jjbrandt@rcn.com>
Re: Modify @INC? (Martien Verbruggen)
Re: Modify @INC? (Martien Verbruggen)
Need help inserting commas in a string.. <hinson@home.com>
Re: Need help inserting commas in a string.. <kistler@gmx.net>
Newbie but serious - Problems reading file from multipa <pholthuizen@celwood.com>
Re: newbie to Perl on W2K. How do I 'make' CPAN modules <robert@chalmers.com.au>
perl / CGI backend to change a user's unix password ? <bmoore@door.net>
Running Perl scripts with no extensions <cmon_209@hotmail.com>
Shall use a reference instead? bababozorg@aol.com
Re: Split String by Character, Except Between.... <nospam.newton@gmx.li>
still having problems with cookies <Sian@Baldwin.net>
The best way? <founder@pege.org>
Re: Unitialised value error. <johngros@Spam.bigpond.net.au>
Re: Using C code in Perl <ingy@ActiveState.com>
Re: Using C code in Perl <bart.lateur@skynet.be>
Re: Win32 User <johngros@Spam.bigpond.net.au>
Re: Win32 User <carvdawg@patriot.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 06 Jan 2001 09:37:01 +0100
From: Per Kistler <kistler@gmx.net>
To: Bernhard Schelling <schelling@bluewin.ch>
Subject: Re: A Socket Server Problem
Message-Id: <3A56D92D.3D5A4A6F@gmx.net>
Hi
Does the standard thing, that the socket says it's readable but if
you read nothing shows up, not work here?
Per.
Bernhard Schelling wrote:
I have a Perl socket server connecting with a httpclient.
I need a longer multipart connection, but thats not the problem.
How do I know, when a client disconnects? (closes his browser)
My program just doesn't know, when the socket connection isn't open
anymore. My program can close the connection at any time, and the
browser puts up a messagbox.
--
Per Kistler, Zurich, Switzerland
------------------------------------------------------------------------
------------------------------
Date: Sat, 6 Jan 2001 16:04:41 +0200
From: "Wavetable" <wavetable@birdmail.com>
Subject: Beginner cgi question..
Message-Id: <9378gc$dqs$1@news.kolumbus.fi>
This is a really simple question but as I haven't found the answer anywhere
I'll try it here. I don't know really anything about perl/cgi...
How do you read parameters in cgi programs? I have tried the $QUERY_STRING
method with #!/usr/local/bin/perl but it doesn't work, yet it works with
#!/bin/sh. Thanks..
------------------------------
Date: Sat, 06 Jan 2001 05:06:59 GMT
From: "What A Man !" <whataman@home.com>
Subject: Re: FAQ 7.9: How do I create a module?
Message-Id: <3A56A858.A8E97968@home.com>
Tad McClellan wrote:
{snip]
> Maybe a cause of the friction is that you keep on saying "locally"
> when you mean "remotely". If you say the opposite of what you
> meant, you should expect that things will not go smoothly.
>
Yep, I meant "remotely." Sorry 'bout that.
Regards,
Dennis
JAPB [ just another perl beg-inner ]
------------------------------
Date: Sat, 06 Jan 2001 13:35:51 GMT
From: sandywadkins123@my-deja.com
To: sandyw@clear.lakes.com
Subject: Going from unix to windows server
Message-Id: <9376vn$ivn$1@nnrp1.deja.com>
Help...
what should I use instead of shebang line???
here's error message I keep getting..
Is it me or server config, I don't have any path saying c:\web
thanks sandy
CGI Error
The specified CGI application misbehaved by not returning a complete
set of HTTP headers. The headers it did return are:
Can't open perl script "C:\web": No such file or directory
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Sat, 6 Jan 2001 11:19:48 +0100
From: "Maarten Veerman" <news@_NOSPAM_mtvwebdesign.hypermart.net>
Subject: LWP and referer
Message-Id: <936rg4$3e8$1@news.tudelft.nl>
Is there a way to set a specific URL as a referer when asking for a page
using LWP::UserAgent?
For example, when I access a script form a page, my browser sends the page
where the request was made to the script, so the script can use
$ENV{'HTTP_REFERER'}. Now, when I make a LWP request, can I also send the
page which made the request?
Maarten
------------------------------
Date: Sat, 06 Jan 2001 11:30:52 GMT
From: egwong@netcom.com
Subject: Re: LWP and referer
Message-Id: <MlD56.37081$bw.2434000@news.flash.net>
Maarten Veerman <news@_nospam_mtvwebdesign.hypermart.net> wrote:
> Is there a way to set a specific URL as a referer when asking for a page
> using LWP::UserAgent?
> For example, when I access a script form a page, my browser sends the page
> where the request was made to the script, so the script can use
> $ENV{'HTTP_REFERER'}. Now, when I make a LWP request, can I also send the
> page which made the request?
> Maarten
use LWP::UserAgent;
my $ua = new LWP::UserAgent;
my $req = new HTTP::Request( ... );
$req->header( 'Referer' => 'http://something' );
...
this is probably is HTTP::Request or HTTP::Header or something.
Cheers!
------------------------------
Date: Sat, 06 Jan 2001 13:24:31 +0100
From: Bjoern Hoehrmann <bjoern@hoehrmann.de>
Subject: Re: LWP and referer
Message-Id: <3a5904a7.16640527@news.bjoern.hoehrmann.de>
* Maarten Veerman wrote in comp.lang.perl.misc:
>Is there a way to set a specific URL as a referer when asking for a page
>using LWP::UserAgent?
$request->header('Referer' => 'http://websitedev.de/');
--
Björn Höhrmann ^ mailto:bjoern@hoehrmann.de ^ http://www.bjoernsworld.de
am Badedeich 7 ° Telefon: +49(0)4667/981028 ° http://bjoern.hoehrmann.de
25899 Dagebüll # PGP Pub. KeyID: 0xA4357E78 # http://learn.to/quote [!]e
"I am told that God is in these newsgroups. Does he post here often ?"
------------------------------
Date: Sat, 6 Jan 2001 14:09:42 +0100
From: "Maarten Veerman" <news@_NOSPAM_mtvwebdesign.hypermart.net>
Subject: Re: LWP and referer
Message-Id: <9375en$70f$1@news.tudelft.nl>
Thanks a lot!
"Maarten Veerman" <news@_NOSPAM_mtvwebdesign.hypermart.net> wrote in message
news:936rg4$3e8$1@news.tudelft.nl...
> Is there a way to set a specific URL as a referer when asking for a page
> using LWP::UserAgent?
>
> For example, when I access a script form a page, my browser sends the page
> where the request was made to the script, so the script can use
> $ENV{'HTTP_REFERER'}. Now, when I make a LWP request, can I also send the
> page which made the request?
>
> Maarten
>
>
>
------------------------------
Date: Sat, 06 Jan 2001 06:17:02 GMT
From: "Studio 51" <leekembel@hotmail.com>
Subject: Modify @INC?
Message-Id: <yLy56.227634$_5.51208011@news4.rdc1.on.home.com>
I'm trying to load a module I've created into a perl script that resides in
the same directory. I've found that with -T on it doesn't look in "." (the
same directory the script is in) for the module. Modifying @INC doesn't help
because it's trying to load the module before it executes any code (I
think?). Is there any way to make sure the script looks in the same
directory when I use "use module;"?
LKembel
------------------------------
Date: Sat, 06 Jan 2001 02:29:17 -0500
From: Joe Brandt <jjbrandt@rcn.com>
Subject: Re: Modify @INC?
Message-Id: <B67C337D.F0B%jjbrandt@rcn.com>
Howdy. Whenever I use a module that I wrote or had to put in my own
directory I just use the "use /path/to/my/lib/;" pragma, which tells perl to
look in my mod directory as well as the @INC. I don't think that taint mode
has anything to do with it. Good luck.
-Joe B.
------------------------------
Date: Sat, 6 Jan 2001 19:41:05 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Modify @INC?
Message-Id: <slrn95dmh1.la.mgjv@martien.heliotrope.home>
On Sat, 06 Jan 2001 02:29:17 -0500,
Joe Brandt <jjbrandt@rcn.com> wrote:
[in response to an unquoted post stating that -T removed . from @INC]
> Howdy. Whenever I use a module that I wrote or had to put in my own
> directory I just use the "use /path/to/my/lib/;" pragma, which tells perl to
> look in my mod directory as well as the @INC. I don't think that taint mode
> has anything to do with it. Good luck.
But it does have something to do with -T.
[line wrap inserted to fit within 72 chars]
$ perl -wle 'print "@INC"'
/opt/perl/lib/5.6.0/i686-linux /opt/perl/lib/5.6.0
/opt/perl/lib/site_perl/5.6.0/i686-linux /opt/perl/lib/site_perl/5.6.0
/opt/perl/lib/site_perl .
$ perl -wTle 'print "@INC"'
/opt/perl/lib/5.6.0/i686-linux /opt/perl/lib/5.6.0
/opt/perl/lib/site_perl/5.6.0/i686-linux /opt/perl/lib/site_perl/5.6.0
/opt/perl/lib/site_perl
See the difference?
To the OP:
You could just put the current directory back in @INC, with the lib
pragma. That's what it's for:
$ perl -wTle 'use lib "."; print "@INC"'
. /opt/perl/lib/5.6.0/i686-linux /opt/perl/lib/5.6.0
/opt/perl/lib/site_perl/5.6.0/i686-linux /opt/perl/lib/site_perl/5.6.0
/opt/perl/lib/site_perl
Note that this means that . will be searched _before_ the other paths,
not as the last one. If oyu want it to be the last one, you'll need to
do something like:
BEGIN { push @INC, '.' }
at the start of your program.
Documentation of interest:
perlvar : @INC
perlsec
perlrun : -T
perlfunc : shift, unshift, pop, push
the documentation for the lib pragma
perlfaq8
Martien
--
Martien Verbruggen |
Interactive Media Division | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd. | you come to the end; then stop.
NSW, Australia |
------------------------------
Date: Sat, 6 Jan 2001 19:44:49 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Modify @INC?
Message-Id: <slrn95dmo1.la.mgjv@martien.heliotrope.home>
On Sat, 06 Jan 2001 06:17:02 GMT,
Studio 51 <leekembel@hotmail.com> wrote:
> I'm trying to load a module I've created into a perl script that resides in
> the same directory. I've found that with -T on it doesn't look in "." (the
> same directory the script is in) for the module. Modifying @INC doesn't help
> because it's trying to load the module before it executes any code (I
> think?). Is there any way to make sure the script looks in the same
> directory when I use "use module;"?
Just a clarification: '.' is NOT the directory the script is in. It is
the working directory of the script, or the current directory. If your
script gets started from somewhere else, then that somewhere else is the
current directory. If you script does a chdir, then you changed the
current directory. If, however, your script actually runs from the same
place where it lives, then . refers to that particular directory.
See my other post on more info. You should probably read perl FAQ,
section 8:
How do I add the directory my program lives in to the mod
ule/library search path?
and
How do I add a directory to my include path at runtime?
Martien
--
Martien Verbruggen |
Interactive Media Division | Can't say that it is, 'cause it
Commercial Dynamics Pty. Ltd. | ain't.
NSW, Australia |
------------------------------
Date: Sat, 06 Jan 2001 05:46:15 GMT
From: Roger Hinson <hinson@home.com>
Subject: Need help inserting commas in a string..
Message-Id: <3A56B0E4.6581DBAA@home.com>
Hi all,
Here is the portion of a script I am using to reorganize a text file.
for($x = 7; $x < @template; $x++) { ### This takes care of multiple
backup details
if ( "$template[$x]" ) { ### This makes sure the line has
some info
print OUTFILE "@template[3,$x]\n"; ### This appends the template name
and backup details
}
And this is an example of one of the lines I'm getting as a result.
Sorry about the word wrap.
BACKUP_1, Primary: fs_1 server-bu:/usr 0 1/01/01 03:04:01
3:34:31 Completed 29\ 0 16.4 GB Complete
What I would like to do is put commas into the string so that it's
easier to import into Excel with the Excel wizard. I would like to add
commas after say the second, third, fourth, fifth, seventh, and so on..
I don't want to get a comma after each word, but they are always the
same positions.
I think it has to do with split, but I haven't been able to figure out
how.. Any help is appreciated.
Roger
------------------------------
Date: Sat, 06 Jan 2001 09:48:49 +0100
From: Per Kistler <kistler@gmx.net>
To: Roger Hinson <hinson@home.com>
Subject: Re: Need help inserting commas in a string..
Message-Id: <3A56DBF1.8DCFFAB6@gmx.net>
Before printing a line I'd create a second array, with the exact
elements
in it. And while building that second array, one knows where to put
commas.
Or one creates the lines as a string with sprintf("%-10s%4s,%s,
etc",$val1,$val2,...);
Per.
Roger Hinson wrote:
> for($x = 7; $x < @template; $x++) { ### This takes care of multiple
> backup details
> if ( "$template[$x]" ) { ### This makes sure the line has
> some info
> print OUTFILE "@template[3,$x]\n"; ### This appends the template name
> and backup details
> }
> BACKUP_1, Primary: fs_1 server-bu:/usr 0 1/01/01 03:04:01
> 3:34:31 Completed 29\ 0 16.4 GB Complete
>
> What I would like to do is put commas into the string so that it's
> easier to import into Excel with the Excel wizard. I would like to add
> commas after say the second, third, fourth, fifth, seventh, and so on..
> I don't want to get a comma after each word, but they are always the
> same positions.
--
Per Kistler, Zurich, Switzerland
------------------------------------------------------------------------
------------------------------
Date: Sat, 06 Jan 2001 13:23:37 +0100
From: Patrick Holthuizen <pholthuizen@celwood.com>
Subject: Newbie but serious - Problems reading file from multipart forms (no binmode!) (repost)
Message-Id: <3A570E49.989CF625@celwood.com>
Hi all,
I've asked this before, but I didn't receive any reactions. Here it is
again, please help me out.
As you all have I'm writing a script to upload files from a web browser
to a web site. Yes, I've stumble across all the common problems
(binmode) but I'm still having corrupt binary file uploads. The problem
seems to be in the file reading system, when I read the file supplied by
the user the script seems to read more bytes than the number actually
available in the file. These bytes seem to be occuring at random places
within the file. Seems like a binmode problem, but it isn't.
The script:
# Upload files
$onnum = 1;
while ($onnum != 11) {
my $file = $req->param("FILE$onnum");
if ($file ne "") {
my $fileName = $file;
$fileName =~ s!^.*(\\|\/)!!;
open (OUTFILE, ">F:/www/mysite/$user/$fileName") || print "<br><b>$0
ERROR: $!</b><br>";
binmode ($file);
binmode (OUTFILE);
$teller =0;
while (read ($file, $buffer, 10000)) {
$teller = $teller + length($buffer);
print OUTFILE $buffer;
}
close (OUTFILE);
print "File no. $onnum ($fileName) has been transfered. ($teller
bytes)<p>\n";
}
$onnum++;
};
I have also used sysread and syswrite but the same problem occurs. The
file I try to read is 9277 bytes long but the variable $teller contains
the value 9314 after reading the file???
Please inform me how to adjust my script (literally) so that my upload
works??
Any help is appreciated. Mail me if you want the binaries involved, I'm
unable to attach them to this newsgroup.
Sincerely,
Patrick Holthuizen
------------------------------
Date: Sat, 6 Jan 2001 18:43:00 +1000
From: "Merlin" <robert@chalmers.com.au>
Subject: Re: newbie to Perl on W2K. How do I 'make' CPAN modules ?
Message-Id: <o%A56.5$1R4.1526@nsw.nnrp.telstra.net>
Dear Helgi Briem,
This is brilliant - where has this been all my life ! So much to learn and
so little time to learn it in.
I don't have a proxy, so I just set "set HTTP_proxy=" and the rest works as
you say.
Absolutly BrillianT !!
Thank you so much - you've saved me many hours. I can't believe it.
Regards
Robert
"Helgi Briem" <helgi@NOSPAMdecode.is> wrote in message
news:3a55c56f.2512366481@news.itn.is...
> On Fri, 5 Jan 2001 16:24:14 +1000, "Merlin"
> <robert@chalmers.com.au> wrote:
>
> >Do I need to install a C compliler so I can have access to a Make program
so
> >I can 'make install' the perl modules etc.??? I'm a Unix person - first
time
> >on W2K and finding it very spartan when it comes to tools ...
> >
> While you can install a C compiler, for example
> C++Builder or Microsoft Visual C++, the
> standard and much easier method to install
> modules on Windows is to use the PPM
> (Perl Package Manager) tool that comes with
> Activestate's Perl distribution. A lot of people
> fail to use it and think it is broken, but the
> reason for that is simply that they have not
> specified a proxy server. If you have a
> proxy server the procedure is:
>
> From the Command line:
> set HTTP_proxy=myproxy.mydomain.com:XXXX
>
> #substituting your own proxy server and
> #port number (for XXXX).
>
> then cd to c:/perl/bin
> # or wherever you have installed perl
> and run perl ppm.pl
>
> #This will run the Perl Package Manager
> #that comes with Activestate's Perl
> #distribution.
>
> #This will give you a prompt that looks like:
> PPM>
>
> type install Modulename from there
> and ppm will download the module
> package and install it.
>
> Type quit when you have finished.
>
> Regards,
> Helgi Briem
------------------------------
Date: Sat, 06 Jan 2001 07:25:43 GMT
From: "Brett L. Moore" <bmoore@door.net>
Subject: perl / CGI backend to change a user's unix password ?
Message-Id: <XLz56.117269$yR4.3209986@news1.rdc1.tx.home.com>
Hi,
I am new to perl and am attempting to develop the script to change a user's
password on Solaris/Irix machines. The HTML front end was the easy part, as
I feared.
Can I simply perform system calls to passwd ? I am betting it is more
complicated than that - for example, I would like to trap an invalid
username / password condition to report failure to the user.
Thanks,
Brett
------------------------------
Date: Sat, 06 Jan 2001 06:06:37 GMT
From: CM <cmon_209@hotmail.com>
Subject: Running Perl scripts with no extensions
Message-Id: <936clc$11o$1@nnrp1.deja.com>
Hi.
How do I run a Perl script WITHOUT any extension on my Apache-on-Linux
Web Server?
For example the Perl program on my server is named DISPLAY.
How do I tell my Server to execute this script with the Perl
interpreter.
Has this got anything to do with configuration of Perl ( should I
manipulate #!/usr/bin/perl )
or
should I manipulate my Server config in some way?
Thank you very much!
regards
CM
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Sat, 06 Jan 2001 13:51:49 GMT
From: bababozorg@aol.com
Subject: Shall use a reference instead?
Message-Id: <9377tk$jmj$1@nnrp1.deja.com>
Hi,
i am writing this program that its performance in terms of memory/CPU
usage is very important for me...
i have devided parts of the program in different modules... one of
those modules loads up my configs that i will be using thoughout the
program in all other modules, as an object... for example i have:
use MyConfs;
my $config=MyConfs->new;
my $color = $config->get_color;
i am also planning to use this program under mod_perl too...
well that was a little introductions... BUT the problem i have is: that
$config object will fly on all the subroutines i have throughout my
program and modules... so it will be passed from one sub to another...
and i will catch the config in subs by "my $config = $_[0]"...
Now... this thing just accored to me that i could pass it as a
reference to each of the subs instead of the actual $config...
so i would pass:
MyOtherModule::MySub(\$config)
and then catch it as:
my $config = $_[0];
and use it like:
my $color = $$config->get_color;
do u think that would shorten the memory usage? or would it make any
problems later on if i use this program under mod_perl... (by the
way... i do not have much experience with mod_perl neither so...)
Regards
Hamed Nik
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Sat, 06 Jan 2001 09:07:24 +0100
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.li>
Subject: Re: Split String by Character, Except Between....
Message-Id: <dp7c5t4d2tms7aharrl7t7p2j0v31k30rg@4ax.com>
On Thu, 4 Jan 2001 12:07:44 +0100, "berndt zeitler"
<berndt.zeitler@tu-berlin.de> wrote:
> hi adrian,
>
> i'm quite new at perl, but i found a solution. i'm sure there is a better
> why to do this, but here's my version:
>
> $line_code = '1062 S%=HP/3/(1+RND(1)):HP=HP-S%:VA=0:PRINT"<204>HIT
> OINTS: -"S%;';
>
> $line_code =~ s/"(.*):(.*)"/\"$1~~~~~$2\"/g;
> @line_expressions = split /:/, $line_code;
>
> $length = @line_expressions;
> for ($i = 0; $i < $length; $i++){
> $line_expressions[$i] =~ s/~~~~~/:/g;
> print "$line_expressions[$i]\n";
> }
>
> i just substituted the colon between the double quotes by five tildes and
> after splitting subtituted them back again.
What if there is more than one colon between the quotes? Your solution will no
longer work then (only the last colon will be "escaped").
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Sat, 6 Jan 2001 12:17:29 -0000
From: "Sian Baldwin" <Sian@Baldwin.net>
Subject: still having problems with cookies
Message-Id: <3a570b1c_2@news.bizonline.net>
I posted this question a couple of days agao and got a resonse from
Rafael...unfortunately, this didn't resolve the problem...so I am still in
need of help, here was my original posting:
I have written some code that takes user details and enters them in a
database and then sets a cookie with the users name. I then use this cookie
to welcome the user back on the main home page when they return to the
site...my problem is that I cannot retrieve the cookie???
Here is the code I am trying to retrieve the cookie with:
#!/local/bin/perl
use CGI qw(:standard :html3);
use CGI::Carp ('fatalsToBrowser');
%stored_cookie = cookie('ID');
$personalised = $stored_cookie{name} ?
"Welcome back, $stored_cookie{name}!" : "Customizable Page";
print header();
print start_html('Home Page');
print h1($personalised);
print end_html;
I always get the "customizable page" bit, rather than the "welcome back
whoever" bit....I have checked my cookies folder and a cookie has clearly
been lodged by the other script....I cannot figure this one out??
Help would be greatly appreciated!!!
Sian
------------------------------
Date: Sat, 6 Jan 2001 11:40:47 +0100
From: "Mösl Roland" <founder@pege.org>
Subject: The best way?
Message-Id: <3a56f600$0$17822@SSP1NO25.highway.telekom.at>
There are many different methods to finish a task.
All have advantages and disadvantages.
So I would like now to discuss here the best
method for some tasks.
I have a software package written in PerlScript.
This means MSIE with Perl via ActiveX as
scripting language.
My software needs improvemnt
http://BeingFound.com/seminar
because I have to deal with more and more
low computer literate clients.
1.) ZIP a folder
I need to zip a whole folder.
On all computer is WinZip 8 installed
There is a command line extension of WinZip 8
Should I use this WinZip8 command line extension
or is there a more elegant way in Perl to ZIP files
2.) FTP to the server
Transfer files from the local harddisk per FTP
to the web server
3.) Manipulate and store pictures
All clients have now PSP 7 on their computers.
The common task is to store a picture from a
3.3 M Pixel digital camera in 3 different resolutions.
name_print.jpg in original size
name.jpg 600 width or 540 height
name_dir.jpg 80 height
I want to make this automatic.
Perfect picture resize and interlaced JPG store
are necessary. Maybe to test and to decide to
store the small pic in JPG or PNG.
--
Mösl Roland founder@pege.org
http://www.pege.org clear targets for a confused civilization
http://www.BeingFound.com web design starts at the search engine
------------------------------
Date: Sat, 06 Jan 2001 10:36:54 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Re: Unitialised value error.
Message-Id: <azC56.47654$xW4.381336@news-server.bigpond.net.au>
"Wolfgang Hielscher" <W.Hielscher@mssys.com> wrote in message
news:3A559C08.C47994E3@mssys.com...
> [lines 82, 83 and 84 as follows:]
> > if ($xaxis[$i] != 5){
> > if ($cells[$xaxis[$i] + 1][$yaxis[$i]] ne 'B'){
> > if ($cells[$xaxis[$i] + 1][$yaxis[$i]] == 0){
>
> So what happens if $xaxis[$i] equals 2?! Then, as first step, you try to
> access the 4th element of @cells, which you didn't define, so it springs
> into existence and gets the value undef. Then, as a second step, you
> take undef, treat it as an array (reference) and try to access it at
> offset $yaxis[$i]. What did you expect to happen?! The same as before:
> an (anonymous) array gets created, its reference stored in
> $cells[$xaxis[$i] + 1] and there an entry is created at offset
> $yaxis[$i] init'ed with undef.
>
>
> And you know what?
> Anno and I did point you to this (potential) bug before. Ignoring advice
> is the fast lane to never getting any advice in the future.
I adjusted that portion after I realised I had set up the data the other
way.
I had looked at the logic of the array selection over and over in my
original because I knew it would be the easiest place to make an error
before I even posted originally. I even switched from using @data to hold
$xaxis and $yaxis to using twin arrays @xaxis and @yaxis to get rid of
having an $i+1 indice. To try and make things more readable. The 'if
($xaxis[$i] != 1){' and a similar if for the yaxis should hold all indexes
within the array limits. I am sorry that my example had some bugs that my
original did not have. I can only say this holiday season has been a heavy
season. (Thank God it is over. ;-] )
------------------------------
Date: Sat, 06 Jan 2001 06:26:02 GMT
From: Brian Ingerson <ingy@ActiveState.com>
Subject: Re: Using C code in Perl
Message-Id: <3A56B870.8000302@ActiveState.com>
Tad McClellan wrote:
>> I've got some C/C++ functions that I want to use in a perl program, but
>> I can't figure out how and if this is possible.
> perldoc -q " C "
> Ah, that's better:
> "Where can I learn about linking C with Perl?"
Great in theory, but in practice this query does not mention anything
about Inline.pm :) It mentions a lot about XS, but XS is an insane
starting point for Robert.
Robert, please try installing Inline.pm, read the docs, try the examples
from the cookbook, and if you still have questions, you can send them to
'inline@perl.org'. The folks there, like Jochen, will be glad to help
you out.
Brian
--
perl -e 'use Inline C=>q{void japh(){printf("Just Another Perl
Hacker\n");}};japh'
------------------------------
Date: Sat, 06 Jan 2001 11:58:39 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Using C code in Perl
Message-Id: <902e5t0cesjc94frfl6q7gn2i1m4b2uh62@4ax.com>
ruittenb wrote:
>I've got a little problem which is the following :
>I've got some C/C++ functions that I want to use in a perl program, but
>I can't figure out how and if this is possible.
Yes it's possible and in more than one way. You need a C compiler
(duh!).
Then, check out the module Inline on CPAN.
<http://search.cpan.org/search?dist=Inline>
--
Bart.
------------------------------
Date: Sat, 06 Jan 2001 10:48:09 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Re: Win32 User
Message-Id: <JJC56.47674$xW4.381312@news-server.bigpond.net.au>
<2obvious@my-deja.com> wrote in message news:93606a$non$1@nnrp1.deja.com...
> I can't figure out how to keep the DOS window that my scripts run in
> open when I make mistakes coding. I attach <STDIN> to the bottom of
> all my scripts, but this is only helpful when my scripts are
> interpreted correctly.
run your scripts from the dos window Start->Programs->Acessories->MS-Dos
prompt
Then perl -w your/path/to/your/script.pl
------------------------------
Date: Sat, 06 Jan 2001 07:28:39 -0500
From: H C <carvdawg@patriot.net>
Subject: Re: Win32 User
Message-Id: <3A570F77.3028B64@patriot.net>
> How can I make my script open a file in its native program? For
> instance, how can I make my script open .doc file in Word?
It depends...what do you want to do with it once it's open? For Word
docs,
as well as Excel spreadsheets, use Win32::OLE. If you only want the
window
open, and you don't necessarily want the script to interact with the
window, just
use the system() function....backticks will work, as well.
For Access...use Win32::ODBC. Most straight text documents can be
opened with
the open() function.
> I can't figure out how to keep the DOS window that my scripts run in
> open when I make mistakes coding. I attach <STDIN> to the bottom of
> all my scripts, but this is only helpful when my scripts are
> interpreted correctly.
Try opening the DOS prompt and running the script from the command line.
------------------------------
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 V10 Issue 5
************************************