[12217] in Perl-Users-Digest
Perl-Users Digest, Issue: 5817 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 28 13:07:16 1999
Date: Fri, 28 May 99 10:00:17 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 28 May 1999 Volume: 8 Number: 5817
Today's topics:
Re: Can someone help me on this challenging problem? adamfman@my-deja.com
Re: cgi counter a nightmare <cassell@mail.cor.epa.gov>
cont'd jknoll@my-deja.com
Re: Converting a string to URL Encoding <gellyfish@gellyfish.com>
Re: Error with HTTP::Message void@expulsion.org
Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe (Tony)
Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Pe (I R A Aggie)
Re: HASH troubles? <cassell@mail.cor.epa.gov>
Re: HTTP Upload using CGI.pm johnand@my-deja.com
Re: Incrementing a value in a slice (Greg Bacon)
Re: Incrementing a value in a slice <uri@sysarch.com>
Re: Incrementing a value in a slice (Kate)
Re: killing exec()ed process - how? <otis@my-deja.com>
Re: Newbie: Line spacing <e.h.bogart@larc.nasa.gov>
Re: Obtaining file version info <cassell@mail.cor.epa.gov>
Re: opening .exe files <cassell@mail.cor.epa.gov>
Re: PB writing an uploaded file in perl (size changes!) <olivier.maas@at-lci.com>
Re: PB writing an uploaded file in perl (size changes!) <gellyfish@gellyfish.com>
Thanks man....HOWS THIS? jknoll@my-deja.com
Re: Thanks man....HOWS THIS? <arnej@fc.hp.com>
Win32: using CPAN with Perl 5.005-03 and Cygnus tools? Denis.Haskin@bigfoot.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 28 May 1999 16:10:47 GMT
From: adamfman@my-deja.com
Subject: Re: Can someone help me on this challenging problem?
Message-Id: <7imf64$oqk$1@nnrp1.deja.com>
<snip> ... but because of
> reasons out of my control, I will not be getting any new books for a
long
> time + I don't allready have an algorithm book.
Why not try the library? *Algorithms in C* by Robert Sedgewick is a
classic. It should be at most good libraries.
-- Adam Fineman
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 28 May 1999 09:16:49 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: jdwstevens@hotmail.com
Subject: Re: cgi counter a nightmare
Message-Id: <374EC171.B4A647B4@mail.cor.epa.gov>
jdwstevens@hotmail.com wrote:
>
> Does anyone else experience what a nightmare it is to get cgi working?
>
> I moved a week ago to a new webhost that is very fast (www.icom.com) and
> happy to have access to cgi, but after having tried 7 different
> counters, a guestbook and a form, I have given up.
>
> I will just use the old free counter and let them put an ad on my page
> at
>
> http://genealogylinks.net
>
> I just can't beleive cgi shopuld be that big a mess to use. It's like
> some programmer from hell set it up as a joke on us.
I hate to break it to you, but CGI is a lot easier than
programming languages. It's just a protocol. Real programming
takes a willingness to sit and work at a (potentially long
or potentially steep) learning curve.. and maybe multiple
learning curves, at that.
With web-stuff, you also run into a gray area, where it is
totally non-obvious to the beginner that you're really
facing the interaction of HTML, the CGI spec, differences
between web servers, differences between operating systems
hosting those web servers, and *also* the scripting languages
used to make CGI do something useful.
That is why your question is really appropriate for a CGI
or web newsgroup, but you found yourself posting to a Perl
newsgroup instead. You may want to read the
comp.infosystems.www.authoring.cgi newsgroup for a while
and sort of get the feel for what others are doing.
> Does anyone have a positive solution to having an access counter or
> forms handling...that runs on Unix/sunos 2.6
Sam already gave you some good answers. So I'll tell you
something else unhelpful. :-) Hit counters are totally
bogus. They really don't tell you (or your visitors)
anything. 1000 hits. Is that 10 real hits and 990 web-
crawlers? 100 visitors, with a lot of page re-loads
due to flaky access to your ISP? 50,000 visitors with
49,000 of them having their graphics turned off for fast
web access? It's anybody's guess. Randal Schwartz has a
non-hit counter that puts up a random number instead.
It's just as good as anything else. Also, good hit
counters require proper locking, and other sophisticated
features that you really don't want to tackle yet.
> Ian
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 28 May 1999 16:25:59 GMT
From: jknoll@my-deja.com
Subject: cont'd
Message-Id: <7img2i$pk3$1@nnrp1.deja.com>
> i think we should add the deja.com domain to the list of, if you post
> from there, you don't know perl.
You know what, you are right. I don't know perl. THAT IS WHY IM ASKING
YOU!!! I didnt understand it on my own, so I thought I would ask
someone that did. But I cant even get an answer or any kind of help
from this guy. Believe me, if I didnt exhaust my options I wouldnt have
posted here.
jrk
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 28 May 1999 17:12:57 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Converting a string to URL Encoding
Message-Id: <374ec089@newsread3.dircon.co.uk>
Daniel <daniel.mendyke@digital.com> wrote:
>
> I must have found dozens of scripts that convert from url encoding
> to text but I have not found one that converts text to url encoding.
>
> Can anyone point me to some code that converts plain text
> into a url encoded string?
>
Someone asked this (in my newsreader anyhow) 15 threads back - the subject
was 'conver to URL encoded' the author was Mark Hamlin. I answered it
there.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Fri, 28 May 1999 16:12:21 GMT
From: void@expulsion.org
Subject: Re: Error with HTTP::Message
Message-Id: <7imf93$ora$1@nnrp1.deja.com>
Well, unfortunately, when I try that the LWP:UserAgent doesn't know how
to do anything with the package "POST". Nor can I use the
"authorization_basic" method. It gives me the error:
Can't locate object method "authorization_basic" via package "POST" at
test.test.com\cgi-bin\test.pl line 16.
--
William Hurley
> > I'm trying to write a cgi script in perl that will
> > POST to another cgi program. When I try to create
> > a HTTP::Request as a POST operation in the format:
> >
> > my $req = new HTTP::Request POST =>
> > 'http://test.test.com/test.cgi',
> > [ page => 'test',
> > test1 => 'test',
> > test2 => 'test',
> > test3 => 'test'];
> > $req->authorization_basic('username',
> > 'password');
> >
> > I get the error:
> >
> > Can't call method "clone" on unblessed reference
> > at C:\Perl\site\5.005\lib/HTTP/Message.pm line 50.
>
> Try to write it like this instead:
>
> use HTTP::Request::Common qw(POST);
> my $req = POST 'http://test.test.com/test.cgi',
> [ page => 'test',
> test1 => 'test',
> test2 => 'test',
> test3 => 'test'
> ];
> $req->authorization_basic('username', 'password');
> #print $req->as_string;
>
> --
> Gisle Aas
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 28 May 1999 16:05:28 GMT
From: root@missy.shef.ac.uk (Tony)
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <374ebd2f.27540494@missy.shef.ac.uk>
Eric Bohlman <ebohlman@netcom.com> imparted the following:
<Snip all sorts of relevent and interesting stuff to alow for some
flippancy>
:->
:->There is a view, frequently and sometimes unfairly attributed to
:->Microsoft, that a computer program, language, etc. should be designed so
:->that a newbie can make full use of it *while remaining a newbie*; that no
:->learning should be required. This is *not* part of the Perl philosophy,
:->which holds that learning the language increases one's power.
:->
Wow yes, you could have Visual P++ as part of DevStudio, it would have
funny animated characters to guide you through regular expressions.
Various things of interest would turn funny colours and it would ping
at you if you used localtime() wrong.
The second release would of course then store all the pre-code code in
a completely different format from the first so that it would take
twice as long as starting again to get it working again.
Subsequent releases would fail entirely to produce code on anything
but the newest machines, and all three would require huge great
run-time libraries to give you the correct error message when it fell
over coughing and weezing.
--
>From Tony Kennick aka Gonzo The Great
http://missy.shef.ac.uk/users/old-firm/
Gonzo: Slang for "the last man standing
at a drinking marathon"
------------------------------
Date: 28 May 1999 16:42:18 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: FAQ 4.16: Does Perl have a year 2000 problem? Is Perl Y2K compliant?
Message-Id: <slrn7kti18.8u6.fl_aggie@thepentagon.com>
On Fri, 28 May 1999 14:22:11 GMT, Benjamin Franz
<snowhare@long-lake.nihongo.org>, in
<nEx33.1997$kd5.212304@typhoon-sf.snfc21.pbi.net> wrote:
+ In article <slrn7kt73u.78p.fl_aggie@thepentagon.com>,
+ I R A Aggie <fl_aggie@thepentagon.com> wrote:
+ >read both 'perldoc -f localtime' and the man page for the C library
+ >localtime. I *know* what localtime returns for a year, and I know what
+ >an "offset" means, and how to deal with it...
+ What it means is 'Broken-As-Designed'.
Yeah, well, as the saying goes: you're a day late and a dollar short.
I'm not going to argue that it may have been easier all around to just
return the Fully Qualified Year Number (FQYN) -- it would. The opportunity
to do that is *gone*. Ultimately, we have to deal with what IS.
+ Perl doesn't have any direct Y2K problems (although its POD system
+ does) - but it without question greased the rails (following in C's
+ footsteps) for *programmers* to have Y2K problems.
*shrug* Another design desicision -- emulate libc calls, a good call
IMHO. "Fix" the underlying libc and you've "fixed" perl, too. Have you
submitted a patch to GNU libc?
Whoa. Brain{storm|fart}. Anyone up for localtime2[*]? Then the
documentation can say "Use localtime2(), do not use localtime(), as it
is a dead, camel-bitten flea carcass".
James
[*] -- call it what you will...
------------------------------
Date: Fri, 28 May 1999 09:46:45 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: HASH troubles?
Message-Id: <374EC875.CBF6106C@mail.cor.epa.gov>
Tobin wrote:
>
> Hi,
>
> Sorry if this email is repeated but it hasn't appeared on the list after 2
> hours! So i'm re-sending....
Bad idea, in general. Usenet is a slow medium. Double-posting
makes you look bad to others. And it's just a heck of a lot
slower than finding the answers oneself. Sometimes *days*
slower. Urgh.
> Basically, my search script seen at http://www.freephonedirectory.com (panel
> in right bottom corner of main page) is not outputting correctly. If you
> have a look you will see that the search results are displaced by 1 to 3
> characters.
Can't get a glom at it now. Network problems. But the general
approach here is that you cut your problem code down to less
than 40 lines (less than 20 if possible), and post it, telling
us what is does, what is was supposed to do, and what errors
you got. Then we have a chance to help you.
> The script works by loading in records from a DBF file and storing them in a
> hash (for sorting etc). Is there a common problem with hashes getting
> confused.
Not unless you deliberately confuse them yourself.
> This script works fine when run locally from the command prompt.
Ohhhhh! Well, if the program works some places and not other
places, then don't you think that kind of suggests it's not
the program itself, but the environment? So it doesn't sound
like the hashes are the problem after all. But who can tell
without code and some info on the environment where you run it?
> Any help would be ace!
Sorry, but that's as much help as I can give you, given
what you gave me.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 28 May 1999 16:12:26 GMT
From: johnand@my-deja.com
Subject: Re: HTTP Upload using CGI.pm
Message-Id: <7imf97$orc$1@nnrp1.deja.com>
In article <374C7CE9.1CEEA742@csd.sdl.usu.edu>,
Neal Barney <nbarney@csd.sdl.usu.edu> wrote:
[snip]
>
> 1. Does CGI.pm have the capability to change the default filter from
> '*.html' to '*'?
>
No, because that is a function of the browser, not CGI.pm.
> 2. Is there anyway using CGI.pm (or any other perl module) to create
a
> file upload progress box, similar to the browser download progress
box?
> Or must I use JavaScript to accomplish this?
>
Again, this is a browser issue; if Navigator/IE would realize you're
uploading a file and display a progress bar, it would be great, but they
don't, and your script can't do it because you script doesn't run until
*after* the file has been uploaded. I seriously doubt you could write a
JavaScript to do it either, unless on form submission you manually
grabbed the contents of the form, opened the HTTP socket yourself, and
sent each chunk of data through. That's a lot of work to do just for a
little graph, especially since the browser does (and is supposed to do)
all of this for you. I suppose you could write an ActiveX control for
IE/Plug-in for Communicator 4 that would replace/override their internal
upload capability, but again, that seems like a lot of wasted effort.
OTOH, writing such a thing for Mozilla might not be such a bad idea...
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 28 May 1999 16:04:41 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Incrementing a value in a slice
Message-Id: <7imeqp$k5o$1@info2.uah.edu>
In article <8DD4695EFXXkateXX@news.chiso.com>,
kate_no_spam@for_me_chiso.com (Kate) writes:
: Greg Bacon <gbacon@cs.uah.edu> wrote in <7imcj5$jh2$3@info2.uah.edu>:
: >Please read section four of the Perl FAQ. Pay careful attention when
: >you reach "How can I extract just the unique elements of an array?".
:
: If I do it this way, I'm still not sure how to count how many times an
: entry occurs. Extracting the unique entries isn't my problem, its
: incrementing my counter.
my @uniq;
my %seen;
while (<>) {
chomp;
push @uniq, $_ unless $seen{$_}++;
}
my $mode = shift @uniq;
for (@uniq) {
$mode = $_ if $seen{$_} > $seen{$mode};
}
print "The most frequently occurring line was:\n $mode\n",
"It occurred $seen{$mode} time",
$seen{$mode} == 1 ? "" : "s",
".\n";
Greg
--
A lot of people mistake a short memory for a clear conscience.
-- Doug Larson
------------------------------
Date: 28 May 1999 12:12:09 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Incrementing a value in a slice
Message-Id: <x7emk1i36u.fsf@home.sysarch.com>
>>>>> "GB" == Greg Bacon <gbacon@itsc.uah.edu> writes:
GB> In article <8DD4695EFXXkateXX@news.chiso.com>,
GB> kate_no_spam@for_me_chiso.com (Kate) writes:
GB> : Greg Bacon <gbacon@cs.uah.edu> wrote in <7imcj5$jh2$3@info2.uah.edu>:
GB> : >Please read section four of the Perl FAQ. Pay careful attention when
GB> : >you reach "How can I extract just the unique elements of an array?".
GB> :
GB> : If I do it this way, I'm still not sure how to count how many times an
GB> : entry occurs. Extracting the unique entries isn't my problem, its
GB> : incrementing my counter.
GB> my @uniq;
GB> my %seen;
GB> while (<>) {
GB> chomp;
GB> push @uniq, $_ unless $seen{$_}++;
GB> }
GB> my $mode = shift @uniq;
GB> for (@uniq) {
GB> $mode = $_ if $seen{$_} > $seen{$mode};
GB> }
greg, you can do better than that! why two loops? why the push into @uniq?
while(<>) {
chomp ;
$count = ++$seen{$_} ;
$max_line = $_ && $max_count = $count if $count > $max_count ;
}
@uniq = keys %seen ;
or for you fans of shorter code:
$max_line = $_ && $max_count = $seen{$_} if ++$seen{$_} > $max_count ;
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 28 May 99 16:19:05 GMT
From: kate_no_spam@for_me_chiso.com (Kate)
Subject: Re: Incrementing a value in a slice
Message-Id: <8DD471A67XXkateXX@news.chiso.com>
Jon, Greg, & Uri,
Thanks alot for your guidance. I appreciate the help!
Thanks again,
Kate
Uri Guttman <uri@sysarch.com> wrote in <x7emk1i36u.fsf@home.sysarch.com>:
>>>>>> "GB" == Greg Bacon <gbacon@itsc.uah.edu> writes:
>
> GB> In article <8DD4695EFXXkateXX@news.chiso.com>,
> GB> kate_no_spam@for_me_chiso.com (Kate) writes:
> GB> : Greg Bacon <gbacon@cs.uah.edu> wrote in
<7imcj5$jh2$3@info2.uah.edu>:
> GB> : >Please read section four of the Perl FAQ. Pay careful attention
when
> GB> : >you reach "How can I extract just the unique elements of an
array?".
> GB> :
> GB> : If I do it this way, I'm still not sure how to count how many
times an
> GB> : entry occurs. Extracting the unique entries isn't my problem, its
> GB> : incrementing my counter.
>
> GB> my @uniq;
> GB> my %seen;
>
> GB> while (<>) {
> GB> chomp;
>
> GB> push @uniq, $_ unless $seen{$_}++;
> GB> }
>
> GB> my $mode = shift @uniq;
> GB> for (@uniq) {
> GB> $mode = $_ if $seen{$_} > $seen{$mode};
> GB> }
>
>greg, you can do better than that! why two loops? why the push into @uniq?
>
> while(<>) {
> chomp ;
>
> $count = ++$seen{$_} ;
> $max_line = $_ && $max_count = $count if $count > $max_count ;
> }
>
> @uniq = keys %seen ;
>
>or for you fans of shorter code:
>
> $max_line = $_ && $max_count = $seen{$_} if ++$seen{$_} > $max_count
;
>
>uri
>
>
------------------------------
Date: Fri, 28 May 1999 15:46:57 GMT
From: Otis Gospodnetic <otis@my-deja.com>
Subject: Re: killing exec()ed process - how?
Message-Id: <7imdpg$nof$1@nnrp1.deja.com>
In article <7im7l0$io7$1@nnrp1.deja.com>,
Otis Gospodnetic <otis@my-deja.com> wrote:
> In article <u990a98mg9.fsf@wcl-l.bham.ac.uk>,
> Brian McCauley <B.A.McCauley@bham.ac.uk> wrote:
> > Otis Gospodnetic <otis@my-deja.com> writes:
> >
> > > I was wondering if it is possible to get the PID of a 'command'
> executed
> > > by exec()
> >
> > Exec does not fork(). The PID of the command is the same as the PID
> > of the process that called the exec.
> >
> > If the command is given as a single string with metacharacters
rather
> > than a list then the string is passed to the shell. This can add an
> > extra process which could explain your problem.
>
> I do exec() like this:
> $mycommand = "/some/command';
> $myconfig = '/some/config.conf';
> $mystring = 'foo bar';
> exec("$mycommand -C$myconfir $mystring");
>
> Would calling it like this work (prevent /bin/sh -c stuff):
> exec($mycommand, $myconfig, $mystring);
I think I found the problem.
My exec() actually had >> (redirect/append) in it, which I guess are
these shell meta characters causing /bin/sh -c ... process to get
spawned.
Thanks for the help!
Otis
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 28 May 1999 12:39:47 -0400
From: Ed Bogart <e.h.bogart@larc.nasa.gov>
Subject: Re: Newbie: Line spacing
Message-Id: <374EC6D3.9F46BB6@larc.nasa.gov>
Uri Guttman wrote:
>
> >>>>> "j" == jknoll <jknoll@my-deja.com> writes:
>
> j> Okay when you are printing text in the ' quotes you just hit return to
> j> move down a line, right?
>
> j> when you are printing text in the " quotes you use the \n escape to
> j> move down a line, but say you need to move down 4 lines- do you just do
[some noise snipped]
> j> jrk
>
> this has my vote for the most confused newbie of the week. you seem to
> have english for a first language but i have absolutely no idea what
> you are asking. what does quoting have to do with directories? what does
> "moving down lines" mean? what are tia and jrk and where did they come
> from (and why don't they go back there)?
>
> i think we should add the deja.com domain to the list of, if you post
> from there, you don't know perl. i haven't seen any webtv posts here
> yet. my impression is they make aol'er look like einstein. they are so
> stupid, they bought into that service!
>
> do we want to start a newbie of the week (or day or microsecond)
> contest? :-)
>
> uri
>
I have been wondering about the deja.com post too but have come to a
different conclusion. I think they are Computer Sci 101 students who are
just smart enough to know that they will get flamed if they post their
homework using there .edu account so the use deja. They remind me of the
days (a looooong time ago) when I was a computer center 'consultant' and
the dweebs would come in with the printout from their first compile and
announce that they had discovered a bug in the compiler!
Ed (who still has his old FORTRAN books)
------------------------------
Date: Fri, 28 May 1999 09:48:41 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Obtaining file version info
Message-Id: <374EC8E9.1AE0F9C@mail.cor.epa.gov>
Kurt Stickler wrote:
>
> Yep, NT's QuickView program can do it. But only within it's GUI. I need
> to obtain file version information from within a PERL script.
>
> Thanks,
> Kurt
Well kurt, if you don't get a good answer here, go to the
perl-win32-users listserv, which specializes in win32 issues.
http://www.activestate.com/support/mailing_lists.htm
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 28 May 1999 09:56:16 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: opening .exe files
Message-Id: <374ECAB0.E6268FE4@mail.cor.epa.gov>
amidalla@my-deja.com wrote:
>
> I'm relatively new to Perl and I am unable to figure out how to run a
> simple .exe file using some perl code. All I want to do is be able to
> open and run one or more programs simultaneously by a call from a perl
> script. Thanks for your help.
Well, the Perl docs have all the info you want. You just
have to find it. I suggest you use the perldoc program
(just don't tell TomC you're using it :-) and run the
following commands at your command prompt:
perldoc perldoc
perldoc perl
perldoc -f system
perldoc -f qx
perldoc -f open
The first two will tell you about the perldoc programs, and the
Perl manpages it can show you. The last three will show you
info on your specific question. Then go to the FAQ, and you'll
find lots more help there.
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
The WWW:
"Share what you don't know is wrong.
Learn what you don't want to verify."
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 28 May 1999 17:51:50 +0200
From: Olivier Maas <olivier.maas@at-lci.com>
Subject: Re: PB writing an uploaded file in perl (size changes!)
Message-Id: <374EBB95.C1E4C0DB@at-lci.com>
where to put this "binmode" ?
which is very likely to B the solution with the
ENCTYPE="multipart/form-data"?
in the perl script?
thanks...
Jonathan Stowe a icrit :
> Olivier Maas <olivier.maas@at-lci.com> wrote:
> > Hello again
> > I tried to upload a word or excel document,
> > I now have the filehandle available in my perl script but when I write
> > the output file, is does not have the same size... ? how come?
> >
>
> binmode binmode binmode binmode binmode binmode binmode binmode binmode
> <snip>
> /J\
> --
> Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: 28 May 1999 17:15:38 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: PB writing an uploaded file in perl (size changes!)
Message-Id: <374ec12a@newsread3.dircon.co.uk>
Olivier Maas <olivier.maas@at-lci.com> wrote:
> where to put this "binmode" ?
jns [pigment] $ perldoc -f binmode
=item binmode FILEHANDLE
Arranges for the file to be read or written in "binary" mode in operating
systems that distinguish between binary and text files. Files that are
not in binary mode have CR LF sequences translated to LF on input and LF
translated to CR LF on output. Binmode has no effect under Unix; in MS-DOS
and similarly archaic systems, it may be imperative--otherwise your
MS-DOS-damaged C library may mangle your file. The key distinction between
systems that need C<binmode()> and those that don't is their text file
formats. Systems like Unix, MacOS, and Plan9 that delimit lines with a single
character, and that encode that character in C as C<"\n">, do not need
C<binmode()>. The rest need it. If FILEHANDLE is an expression, the value
is taken as the name of the filehandle.
> which is very likely to B the solution with the
> ENCTYPE="multipart/form-data"?
> in the perl script?
I'm sorry I dont know what this has to do with it.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Fri, 28 May 1999 16:10:09 GMT
From: jknoll@my-deja.com
Subject: Thanks man....HOWS THIS?
Message-Id: <7imf4u$opr$1@nnrp1.deja.com>
Thanks man. I picked up a perl book yesterday, ask a question and now I
get this. What is this NG for if I cant get help?
I am getting my info from here:
http://www.free-ed.net/fr03/lfc/course%20030207_01/index.html
I'll try to make it easy for you:
When you are printing a SINGLE-QUOTED STRING LITERAL, how do you make it
look like this:
WORDSWORDS
WORDSWORDS
Instead of this:
WORDSWORDSWORDSWORDS
...and the same for DOUBLE-QUOTED STRING LITERALS, and BACK-QUOTED
STRING LITERALS.
(T)Thanks (I)In (A)Advance,
(J)Jesse (R)Richard (K)Knoll
I hope you can understand this. I will email you a picture if you cant.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Fri, 28 May 1999 10:54:27 -0600
From: Arne Jamtgaard <arnej@fc.hp.com>
Subject: Re: Thanks man....HOWS THIS?
Message-Id: <374ECA43.58EF@fc.hp.com>
jknoll@my-deja.com wrote:
> Thanks man. I picked up a perl book yesterday, ask a question and
> now I get this. What is this NG for if I cant get help?
> I am getting my info from here:
> http://www.free-ed.net/fr03/lfc/course%20030207_01/index.html
Okay, I looked at what you say you're reading.
> I'll try to make it easy for you:
> When you are printing a SINGLE-QUOTED STRING LITERAL, how do you
> make it look like this:
> WORDSWORDS
>
> WORDSWORDS
What part of this example from Chapter 2 is unclear?
-----
print 'Bill of Goods
Bread: $34.45
Fruit: $45.00
======
$79.45';
-----
I just tried this, and it worked fine.
> ...and the same for DOUBLE-QUOTED STRING LITERALS, and BACK-QUOTED
> STRING LITERALS.
If you read the rest of Chapter 2, you'd find the answers to these
as well.
> I hope you can understand this. I will email you a picture if
> you cant.
Oh, this is a great way to ask for help.
Look, the group has a tendency to want to help folks who are trying
and get stuck. You apparently aren't even trying. Why should we
help you, jrk?
Arne
------------------------------
Date: Fri, 28 May 1999 16:27:54 GMT
From: Denis.Haskin@bigfoot.com
Subject: Win32: using CPAN with Perl 5.005-03 and Cygnus tools?
Message-Id: <7img67$pkp$1@nnrp1.deja.com>
I'm having difficulty getting CPAN to install Bundle::libnet. It
complains about not finding a Bundle file in
Bundle-libnet-1.00.tar.gz.
I can find no evidence in newsgroups or FAQs that this is a known
problem.
Any help would be greatly appreciated!
This is Perl 5.005-03 on Win32, and I have cygnus tools installed.
Here's what happens (eventually):
<quote>
gzip.EXE: \.cpan\sources\authors\id\GBARR\Bundle-libnet-1.00.tar already
exists; do you wish to overwrite (y or n)? y
Uncompressed \.cpan\sources\authors\id\GBARR\Bundle-libnet-1.00.tar.gz
successfully
Bundle-libnet-1.00/
Bundle-libnet-1.00/Makefile.PL
Bundle-libnet-1.00/libnet.pm
Bundle-libnet-1.00/README
Bundle-libnet-1.00/MANIFEST
Untarred \.cpan\sources\authors\id\GBARR\Bundle-libnet-1.00.tar
successfully
Removing previously used \.cpan\build\Bundle-libnet-1.00\.
Couldn't find a Bundle file in \.cpan\build\Bundle-libnet-1.00\. at
C:\Perl\5.00
503\lib/CPAN.pm line 1717
</quote>
Here's what the CPAN config loks like:
<quote>
cpan> o conf
CPAN::Config options from C:\Perl\5.00503\lib/CPAN/Config.pm:
commit Commit changes to disk
defaults Reload defaults from disk
init Interactive setting of all options
build_cache 10
build_dir \.cpan\build\.
cpan_home \.cpan\.
ftp C:\WINNT\system32\ftp.EXE
ftp_proxy
getcwd cwd
gzip C:\cygnus\CYGWIN~1\H-I586~1\bin\gzip.EXE
http_proxy
inactivity_timeout 0
index_expire 1
inhibit_startup_message 0
keep_source_where \.cpan\sources\.
lynx
make C:\Program Files\Microsoft Visual
Studio\VC98\bin\nmake.EXE
make_arg
make_install_arg
makepl_arg
ncftp
ncftpget
no_proxy
pager C:\cygnus\CYGWIN~1\H-I586~1\bin\less.EXE
prerequisites_policy follow
scan_cache atstart
shell
tar C:\cygnus\CYGWIN~1\H-I586~1\bin\tar.EXE
unzip
urllist
ftp://ftp.iguide.com/pub/mirrors/packages/perl/CPAN/
ftp://ftp.ccs.neu.edu/net/mirrors/ftp.funet.fi/pub/languages/perl/CPAN/
ftp://ftp.digital.com/pub/plan/perl/CPAN/
wait_list
wait://ls6.informatik.uni-dortmund.de:1404
</quote>
and here's what perl -V reports:
<quote>
bash-2.02$ perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 03) configuration:
Platform:
osname=MSWin32, osvers=4.0, archname=MSWin32-x86
uname=''
hint=recommended, useposix=true, d_sigaction=undef
usethreads=undef useperlio=undef d_sfio=undef
Compiler:
cc='cl.exe', optimize='-Od -MD -DNDEBUG', gccversion=
cppflags='-DWIN32'
ccflags ='-Od -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT '
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=10
alignbytes=8, usemymalloc=n, prototype=define
Linker and Libraries:
ld='link', ldflags ='-nologo -nodefaultlib -release -machine:x86'
libpth=\lib
libs= oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.
lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib
uuid.lib wsock
32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib
PerlCRT.lib
libc=PerlCRT.lib, so=dll, useshrplib=yes, libperl=perl.lib
Dynamic Linking:
dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -release
-machine:x86'
Characteristics of this binary (from libperl):
Built under MSWin32
Compiled at Apr 27 1999 16:43:01
@INC:
C:\Perl\5.00503\lib/MSWin32-x86
C:\Perl\5.00503\lib
C:\Perl\site\5.00503\lib
.
</quote>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 5817
**************************************