[10190] in Perl-Users-Digest
Perl-Users Digest, Issue: 3783 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 22 09:07:14 1998
Date: Tue, 22 Sep 98 06:00:22 -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 Tue, 22 Sep 1998 Volume: 8 Number: 3783
Today's topics:
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
already made binaries for DEC_ALPHA? <milkman@dave-world.net>
Re: can MSWord and Adobe PDF docs be read for indexing? scott@softbase.com
Re: can MSWord and Adobe PDF docs be read for indexing? scott@softbase.com
Re: copy a file? <paaa@uic.nnov.ru>
Double Quotes?? <benderle@mindspring.com>
Re: Error 405: Method Not Allowed <paaa@uic.nnov.ru>
Re: even/odd numbers (Bart Lateur)
Re: even/odd numbers (Sam Holden)
Re: Getting the "key" for a hash <paaa@uic.nnov.ru>
Re: grep difficulties <paaa@uic.nnov.ru>
Re: Help! - Perl & win95 IE 4.0. Run perls program from Kresimir.Puskaric@aiemens.at
Re: Help! - Perl & win95 IE 4.0. Run perls program from Kresimir.Puskaric@siemens.at
Re: Help! - Perl & win95 IE 4.0. Run perls program from <gp@gpsoft.de>
Re: Help! - Perl & win95 IE 4.0. Run perls program from <gp@gpsoft.de>
Re: How to combine hash %b to hash %a? (union) <paaa@uic.nnov.ru>
how to output loop-results into templates? <gg@energy.nacamar.de>
Re: how to output loop-results into templates? Kresimir.Puskaric@siemens.at
measure memory usage dwiesel@my-dejanews.com
Re: measure memory usage (David Cantrell)
Re: My perl script does not open files.... <paaa@uic.nnov.ru>
Re: perl & activeX?? <zenin@bawdycaste.org>
Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
question cgi <miro@rain.fr>
Re: Question from newbie, Executing DOS commands from P dave@mag-sol.com
Re: Questions about Perl <paaa@uic.nnov.ru>
Re: Using templates... <paaa@uic.nnov.ru>
Re: Value of RANDBITS from within perl? (Tom Grydeland)
Re: Value of RANDBITS from within perl? <jhi@alpha.hut.fi>
Re: where is Date::Parse? <zenin@bawdycaste.org>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 22 Sep 1998 10:24:01 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage906459841.21576@news.teleport.com>
Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 10 Sep 1998
[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Summer of
1998; of course, ongoing updates are made as needed. ]
For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).
http://cpan.perl.org/doc/FAQs/
Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.
perldoc perlfaq
man perlfaq
If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.
If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.
http://cpan.perl.org/
http://www.perl.com/CPAN/
http://cpan.perl.org/doc/FAQs/FAQ/html/
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/
You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)
California ftp://ftp.cdrom.com/pub/perl/CPAN/
Texas ftp://ftp.metronet.com/pub/perl/
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
Australia ftp://cpan.topend.com.au/pub/CPAN/
Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:
setdir usenet-by-group/news.announce.newusers
send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 22 Sep 1998 05:19:16 -0700
From: "Kurt Lange" <milkman@dave-world.net>
Subject: already made binaries for DEC_ALPHA?
Message-Id: <360779c1.0@nt.dave-world.net>
My company is looking for the binaries that are already made for DBI and the
DEC_ALPHA running vms 7.1. My company does not want to buy a C Compliler.
They are not cheap, we are just selling a product in which we don't want to
require the customer to buy a C Compliler, just to run Perl DBI. If there
is someone out there willing to give or sell it to us(depending on the
price), we would greatly appreciate. Or maybe there is a free C Compliler
for the DEC_ALPHA that we don't know about. If anyone knows of a free or
cheap C Compliler, we would appreciate knowing about it.
Please reply by newsgroup(because someone out there might want to know
also), but if it's a bother, don't worry about it. However, I would like to
be emailed at BOTH of the following email address...
dmackin@gte.net
milkman@dave-world.net
Thank you very much.
Desperate Internet Programmer
------------------------------
Date: 22 Sep 1998 12:56:07 GMT
From: scott@softbase.com
Subject: Re: can MSWord and Adobe PDF docs be read for indexing?
Message-Id: <36079e67.0@news.new-era.net>
Pat Trainor (ptrainor@bbn.com) wrote:
First, PDF is a variation on PostScript and can probably be read by
anything that reads PostScript, *BUT* -- PostScript is definitely a
"write-only" language. GhostScript is the only attempt to use
PostScript outside of a printer that I've ever seen. There's nothing
simple about it.
> Read msword, excel, or pdf files for textual indexing for a search engine.
> They will be residing on a unix box and at my mercy.
> What methods exist to read/catalogue the text in them? "strings"? There has
> to be a better answer, eh?! :)
The problem with Word, Excel, etc is the data is in an OLE storage
object saved to disk, not in any kind of coherent form. For example,
Word saves "quick changes" in their own stream within the object
discontiguously from the main document. The whole thing would be
very hard to read because it is in a binary format. It is not a matter
of converting "reveal codes" in-stream or stripping out formatting
codes. The data organization is more complex than that.
Your best bet is to convert these documents to a neutral format
like HTML before they leave where ever they start and go to the
UNIX box.
> What is required (even for $$$) that enables perl to write data in msword,
> excel, pdf formats?
You can get the file format descriptions for free, *BUT*, the file
format is defined in terms of an OLE storage. You'd have to reimplement
the storage subsystem of OLE in C on UNIX and use it to open the file.
It isn't just plain data.
Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more.
------------------------------
Date: 22 Sep 1998 12:56:44 GMT
From: scott@softbase.com
Subject: Re: can MSWord and Adobe PDF docs be read for indexing?
Message-Id: <36079e8c.0@news.new-era.net>
James T. Vradelis (jvradelis@mediaone.net) wrote:
> Pat Trainor wrote:
> > They will be residing on a unix box and at my mercy.
> You can write msword and excel files using the Win32::OLE module.
Not on UNIX!
Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more.
------------------------------
Date: Tue, 22 Sep 1998 16:18:30 +0400
From: "Aleksey A. Pavlov" <paaa@uic.nnov.ru>
Subject: Re: copy a file?
Message-Id: <36079596.E0046C8B@uic.nnov.ru>
Eva-Lena wrote:
>
> Hi!
>
> I have been looking for how to copy a file in a perl 5.0 script, but
> haven't successed. Have tried to guess some commands like
>
> copy("$existingfile", "$newfile");
> copy $existingfile $newfile; or
> cp $existingfile $newfile;
>
> etc, but it doesn't work and I can't find out the proper one. Maybe one
> can't do this? (I want to use a standard file (existing one) and write into
> its copy when it has been created)
>
> Thanks a lot in advance for some tips! :=)
> Eva-Lena, eva-lena@geocities.com
system 'cp' ," $oldfile $newfile";
is shortest way...:) i use it.
------------------------------
Date: Tue, 22 Sep 1998 08:11:16 -0400
From: Brian Enderle <benderle@mindspring.com>
Subject: Double Quotes??
Message-Id: <360793E4.20187970@mindspring.com>
When I use double quotes in a form and the information is passed to my
cgi script for writing to a file, everything after the first double
quote is lost. Example;
input:
This entire "line" should be written to the file.
written to file:
This entire
I thought the &ReadParse function would take care of characters which
require URI encoding.
Brian Enderle
------------------------------
Date: Tue, 22 Sep 1998 15:59:26 +0400
From: "Aleksey A. Pavlov" <paaa@uic.nnov.ru>
Subject: Re: Error 405: Method Not Allowed
Message-Id: <3607911E.9ACAC6D1@uic.nnov.ru>
sw wrote:
>
> i am trying to put a form request on my company's website.
> can anyone please help me with the error message below:
>
> 405 Method Not Allowed
>
> The method specified in the Request Line is not allowed for the resource
> identified by the request. Please ensure that you have the proper MIME type
> set up for the resource you are requesting.
>
> when method="post" i get the above error message.
> when method="get" the browser actually tries to download the *.pl file
> itself instead of running.
>
> i purchased a cgi/perl cookbook and changed all the required feilds (i
> think) for the script.
> yet no matter what i try i keep getting the same error message.
>
> is this an error in MY code, either *.htm or *.pl, or something that must be
> fixed by the server administrator (winNT web server)?
>
> thank you for your time.
>
> -sloan
On some servers its important to ext ".cgi" for cgi-scripts,also you
should
on some servers put cgi- scripts in special directory "cgi-bin",
for example "http://www.uic.nnov.ru/~paaa/cgi-bin/guestbook.cgi"
Read server documentation for this details or try to
experimentation......
Lesha.
------------------------------
Date: Tue, 22 Sep 1998 09:05:11 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: even/odd numbers
Message-Id: <360867cb.4859709@news.ping.be>
Sam Holden wrote:
>> printf "Number $n is %s\n", $n & 1 ? "odd":"even" ;
>>is much easier and more straightforward, not to mention obvious.
>
>Only if you know that numbers are stored in binary.
Nope. Numbers do not need to be STORED in binary for it to work. "Binary
and" is a mathematical function, the results are independent of internal
representation.
To be able to manually work out the results, representing the operands
in binary certainly does help. But, for example, doing this in HEX is
quite easy, too.
Unless you think of ever representing the numbers in binary, the result
will look like pure nonsense, I grant you that.
Bart.
------------------------------
Date: 22 Sep 1998 08:24:15 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: even/odd numbers
Message-Id: <slrn70enlf.gsg.sholden@pgrad.cs.usyd.edu.au>
On Tue, 22 Sep 1998 09:05:11 GMT, Bart Lateur <bart.mediamind@ping.be> wrote:
>Sam Holden wrote:
>
>>> printf "Number $n is %s\n", $n & 1 ? "odd":"even" ;
>>>is much easier and more straightforward, not to mention obvious.
>>
>>Only if you know that numbers are stored in binary.
>
>Nope. Numbers do not need to be STORED in binary for it to work. "Binary
>and" is a mathematical function, the results are independent of internal
>representation.
OK OK... you need to know about binary format as opposed to decimal format.
Which I grant you most programmers will know... however, those who have only
used VB and the like might not.
--
Sam
testing? What's that? If it compiles, it is good, if it boots up it is
perfect.
--Linus Torvalds
------------------------------
Date: Tue, 22 Sep 1998 15:43:06 +0400
From: "Aleksey A. Pavlov" <paaa@uic.nnov.ru>
Subject: Re: Getting the "key" for a hash
Message-Id: <36078D4A.344005A4@uic.nnov.ru>
Greg Coit wrote:
>
> OK, I'm running through a hash using this slice of code:
>
> foreach $some_hash (sort { $a ?=? $b } %SOME_HASH)
> { (some stuff that I want to happen to each value in the hash)
> }
>
> What I want to do is grab the value of the key of the particular
> key-value pair being evaluated within the foreach loop. I've checked
> all the books I have (camel, lama, and the ram) with no luck.
>
> Thanks,
> --
> Greg Coit
> gbc1@axe.humboldt.edu
use function keys,which returns list of hash keys :
foreach $var (sort {$a<=>$b} keys %SOME_HASH){
#do something.....
}
Lesha.
paaa@uic.nnov.ru
q_doomer@yahoo.com
------------------------------
Date: Tue, 22 Sep 1998 16:06:39 +0400
From: "Aleksey A. Pavlov" <paaa@uic.nnov.ru>
Subject: Re: grep difficulties
Message-Id: <360792CF.630079E3@uic.nnov.ru>
Jeff Hunter wrote:
>
> Can someone explain why this doesn't work:
>
> #!/usr/bin/perl
>
> $host=`uname -n`;
> $uic=`grep "$host" /path/to/somefile.txt`;
> print "$uic \n";
>
> I get the host variable, but the the grep doesn't work. Something to do
> with variables
> not being exported to the shell? I tried single and no quotes around
> $host, no joy. I read the FAQ and two O'Reilly books on perl, nothing
> that clearly addresses grep with a variable found.
> How can I make this work?
>
> Jeff
try this :
$host=`uname -n`;
open GREP,"grep \"$host\" /path/to/somefile.txt|" ||die "It dosnt work
$!\n";
$uic=<GREP>;
close GREP;
Lesha.
------------------------------
Date: Tue, 22 Sep 1998 11:58:30 GMT
From: Kresimir.Puskaric@aiemens.at
Subject: Re: Help! - Perl & win95 IE 4.0. Run perls program from IE.
Message-Id: <1103_906465510@TK32142KP>
------------------------------
Date: Tue, 22 Sep 1998 12:10:09 GMT
From: Kresimir.Puskaric@siemens.at
Subject: Re: Help! - Perl & win95 IE 4.0. Run perls program from IE.
Message-Id: <1104_906466209@TK32142KP>
Sorry!
I just noticed that my E-mail address was wrong.
This one is correct.
------------------------------
Date: Tue, 22 Sep 1998 14:18:46 +0100
From: Guenther Pewny <gp@gpsoft.de>
Subject: Re: Help! - Perl & win95 IE 4.0. Run perls program from IE.
Message-Id: <3607A3B6.C2520919@gpsoft.de>
What is your goal?
To write a CGI script (running on the web server) or
writing an application which runs on the client as a
standalone program? What interaction if IE4 shall
be performed?
G|nther Pewny
wpa schrieb:
> Hi, All!
> Sorry, my english is very bad.
>
> How working Perl in Windows 95?
>
> I make file associate *.pl to perl.exe
> From Internet Explorer 4.0 run programm xxxx.pl,
> Starting "Perl.exe xxxx.pl" in new window like msdos-mode,
> and Perl working with STDIN-STDOUT in this window, Perls environments
> variables are zero.
> May be must use DDE, but I don't know how.
>
> ---
> P.W.
------------------------------
Date: Tue, 22 Sep 1998 14:22:21 +0100
From: Guenther Pewny <gp@gpsoft.de>
Subject: Re: Help! - Perl & win95 IE 4.0. Run perls program from IE.
Message-Id: <3607A48D.BC243EFA@gpsoft.de>
Sorry - in my last msg please do a $msg =~ s/if/with/;
G|nther
------------------------------
Date: Tue, 22 Sep 1998 16:34:34 +0400
From: "Aleksey A. Pavlov" <paaa@uic.nnov.ru>
Subject: Re: How to combine hash %b to hash %a? (union)
Message-Id: <3607995A.B59CEF87@uic.nnov.ru>
Jari Aalto+mail.perl wrote:
>
> I feel little stupid because I can't figure out the
>
> %a{%b}
>
> syntax to add hash %b into existing hash %a
>
> %a = ( aa =? 11, bb =? 22 );
> %b = ( a =? 1, b =? 2 );
>
> I found only one match for "union" from perl 04.04 faq4, but
> that dealt with arrays. I know I can write map or for loop for
> this, but I was wondering if I can do it with variable
> assignment method somehow.
>
> I assume this is faq material....
>
> jari
>
foreach(keys %b){$a{$_}=$b{$_};}
Lesha.
------------------------------
Date: Tue, 22 Sep 1998 13:45:17 +0200
From: "Guido Grigat" <gg@energy.nacamar.de>
Subject: how to output loop-results into templates?
Message-Id: <6u82mn$bpg$1@black.news.nacamar.net>
Hello fellows!
First of all, please excuse my sad english and lack of knowledge
concerning cgi.
I do have a problem which I can't solve.. seems very tricky to me.
I have to write a script where I need to use a html-template, what,
after all, is no problem.
But, when it comes to this point (see script below), what shall I do
to get rid of the html in the script?
Any html-tags should allways stay in the template, to be available for
the designer (who uses an editor..)...
Is it possible?
Hopefully my question isn't THAT stupid...
I would like to thank you very much now.
Cheerio, Guido
Uhhh. the template now looks: ... <table><tr><td></td></tr> $tabelle
</table> ....
and here the important parts of the script...
(this is read out of a data-file... ((@vars=split) line for line....))
foreach $nr (sort sortsub keys %sortkrit) {
next if (!$sortkrit{$nr});
$tabelle .= "<tr><td>$whatever1{$nr} $whatever2{$nr}</td></tr>";
$tabelle .= "<tr><td>$whatever3{$nr}</td></tr>";
$tabelle .= "<tr><td>$whatever4{$nr} $whatever5{$nr}</td></tr>";
$tabelle .= "<tr><td>$whatever6{$nr}</td></tr>";
$tabelle .= "<tr><td><a
href=\"mailto:$email{$nr}\">-->email</a></td></tr>";
$tabelle .= "<tr><td><a href=\"$url{$nr}\">-->home</a></td></tr>";
$tabelle .= "<tr><td><hr noshade size=1></td></tr>";
}
as i said. i would like to get rid of the <td>...stuff... would like
to put it in the template...
?
--
ICQ 15082793
23:40 [ http://www.iecs.de/2340/index.htm ]
------------------------------
Date: Tue, 22 Sep 1998 12:50:20 GMT
From: Kresimir.Puskaric@siemens.at
Subject: Re: how to output loop-results into templates?
Message-Id: <1105_906468620@TK32142KP>
Hello Guido,
I had a similar (if not same) problem.
I had to insert data from a file (access log) which has (of course) always the same data.
So I decided to do the following:
1) To make a template with specific text fields in the places where the actual data has to be inserted
For instance:
If you have the fields DATE, URL and IP in your source file you could use something like GUIDO_DATE, GUIDO_URL ...
The only important thing is that this words DO NOT OCCURR anywhere else.
2) The perl program reads the whole template into an array.
You know how to do this.
3) Then it takes the source (data) file line by line and replaces the text fields with actual data in ALL template lines:
while ( $row = <SOURCE> ) {
# split the row into fields
foreach $i ( 0 .. $#template) {
if ( $template[$i] =~ /GUIDO_DATE/ ) {
$template[$i] =~ s/GUIDO_DATE/$date/g ;
last;
}
}
}
4) Then prints the modified template.
The only thing you have to consider is:
If you use exactly this way you have to create a template with the maximum number of lines that can occurr in your souce file.
Also, this can get very slow if there is a lot of data.
If this is imposible, you should consider defining a kind of language that will say to your script which lines of the template are to
be repeated for each line of the source file, like:
# script
<!-- REPEAT -->
# the part of the script to be repeated for each line, like
<TR><TD>GUIDO_DATE</TD><TD>GUIDO_URL</TD></TR>
<!-- ENDREPEAT -->
# script
(note that the markers I suggest are HTML comments and therefore they will not be shown in the generated page)
If you want to use this way, you should:
1) read (and print) the template until you run into a command of your language
2) then read the line(s) to be repeated into a variable
3) open the source file
4) substitute the text fields with their values and print them
5) continue with the template
As you see, this way could be also usefull to you.
That's all.
Let me know (via E-mail) if you find any of this useful.
P.S.:
You could also put the field-names (GUIDO_DATA, GUIDO_URL, ...) into the first line of the source file and avoid their explicit
usage in the script. In this way you could make an universal script for substituting any number of fields from any file, the only
condition is that you define a standard character that you will use as an delimiter for the split command.
------------------------------
Date: Tue, 22 Sep 1998 10:12:48 GMT
From: dwiesel@my-dejanews.com
Subject: measure memory usage
Message-Id: <6u7t6u$aa4$1@nnrp1.dejanews.com>
Hi,
How can I measure how much memory (RAM) my perl program is using?
// Daniel
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 22 Sep 1998 12:23:09 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: measure memory usage
Message-Id: <36079640.69581593@thunder>
On Tue, 22 Sep 1998 10:12:48 GMT,
dwiesel@my-dejanews.com enlightened us thusly:
>Hi,
>
>How can I measure how much memory (RAM) my perl program is using?
First, take a complete snapshot of your computer's memory whilst perl
is NOT running. This is easiest if you stop all other programs as
well. Then, start your perl program, pause it, and take another
snapshot of your computer's memory.
Compare the two snapshots and count the number of bytes which have
changed. This will give you an approximate amount of RAM used by the
program.
Alternatively, use top.
--
David Cantrell, part-time NT/java/SQL techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Tue, 22 Sep 1998 16:32:13 +0400
From: "Aleksey A. Pavlov" <paaa@uic.nnov.ru>
Subject: Re: My perl script does not open files....
Message-Id: <360798CD.8C114AD2@uic.nnov.ru>
Russ Allbery wrote:
>
> Wolfie ?wolfie@wolfie.ml.org? writes:
>
> ? I was translating some unix perl scripts to a NT perl code. The problem
> ? is that i couldn't get it to open any file correctly. I will send my
> ? code, can anyone tell me where is the problem?
>
> ? $arq = 'c:\\perl\\temp';
>
> You can just write:
>
> $arq = 'c:/perl/temp';
>
> The rest of the operating system isn't quite as braindead as the command
> line parser.
>
> ? open (ARQ, $arq) || die "can't open $arq";
> ? print ARQ "test of script\n";
>
> I'm betting that the problem is that you're trying to write to a file that
> you opened for reading.
>
> --
> #!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
> $^=q;@!?~|{?krw?yn{u?$$?[~||?Juukn{=,?S~|}?Jwx}qn{?Yn{u?Qjltn{ ? 0gFzD gD,
> 00Fz, 0,,( 0hF 0g)F/=, 0? "L$/GEIFewe{,$/ 0C$~? "@=,m,|,(e 0.), 01,pnn,y{
> rw} ?;,$0=q,$,,($_=$^)=~y,$/ C-~??@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
Try open(ARQ,">$arq")|| die; #open for writing
print ARQ "It works!!!";
------------------------------
Date: 22 Sep 1998 08:03:16 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: perl & activeX??
Message-Id: <906451374.442367@thrush.omix.com>
GEMINI <dennis@info4.csie.nctu.edu.tw> wrote:
: hi all,
: There's a Win32::GUI module that can let us develop
: GUI based AP on win32. however, I am wondering if there
: is any way to use ActiveX controls (that are widely used in
: VB & Web application) in our Perl script??
Hmm, me thinks maybe through the OLE modules? Not sure really,
as I've never tried it, but that would be my first guess.
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: 22 Sep 1998 08:43:02 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906453753.547519@thrush.omix.com>
Raj Subramani <raj.subramani@citicorp.com> wrote:
>snip<
: However I am not a very keen Tk fan and hence the GUI bit is lacking.
I like Tk for one it is; a basic interface toolkit. It is quite
blocky and limited, I'll admit. The Gtk bindings look promising
however, with both a much better look and quite a bit more
flexibility. Now, if only they where documented... :-)
: The Java GUI is of course quite good but most RAD tools today come with
: very good built-in Net modules which offers good competition.
:
: I suppose I shall remian an enthusiastic sceptic of Java for a while
: yet.
JPL (Java-Perl Language) The best of both worlds! ;-)
Info somewhere on www.ora.com
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Tue, 22 Sep 1998 10:31:17 +0200
From: zaliko <miro@rain.fr>
Subject: question cgi
Message-Id: <36076055.EB8A84E6@rain.fr>
bonjour
comment tester en local des cgi et programme perl avec mon navigateur
sans activer un serveur http sur ma machine
est ce possible ,et comment faire !
Merci pour la reponse
------------------------------
Date: Tue, 22 Sep 1998 08:40:55 GMT
From: dave@mag-sol.com
Subject: Re: Question from newbie, Executing DOS commands from PERL
Message-Id: <6u7nqt$4tb$1@nnrp1.dejanews.com>
In article <6u70e8$et2$1@holly.prod.itd.earthlink.net>,
"djones" <dcjones3@earthlink.com> wrote:
> I'm trying to delete the contents of a directory.
>
> This is what I have tried:
>
> $delete = "command /C del *.* /Q";
> $i=1;
>
> if($i=1) {
> chdir "c:\anydir";
> system $delete;
> }
Maybe you should look at the 'unlink' function.
Dave...
--
dave@mag-sol.com
London Perl M[ou]ngers: <http://www.mag-sol.com/London.pm/>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Tue, 22 Sep 1998 16:11:55 +0400
From: "Aleksey A. Pavlov" <paaa@uic.nnov.ru>
Subject: Re: Questions about Perl
Message-Id: <3607940B.226997C6@uic.nnov.ru>
Twan Kogels wrote:
>
> Hi,
>
> I'm planning to learn pearl, i have experience with c, c++, java and
> the win32 API. I have some questions about pearl, here they come :
>
> 1) i want to test my perl script locally, do i need a server? and
> which server is the best. I'm using win95
> 2) which version of perl should i use?
> 3) are there any good online tutorials?
> 4) are there any free IDE's or just handy editors for perl?
>
> Many thanks for any reply's,
>
> Twan
> Email : Remove ALL 8's to obtain my valid email address
> Website : http://twan.hypermart.net
1)use Perl for Win32 by Actiware
2)5 or high
3)Thre is good documentation with perl
4)you can use any editor (I use Qedit ,because it quite fast)
Lesha.
------------------------------
Date: Tue, 22 Sep 1998 16:22:36 +0400
From: "Aleksey A. Pavlov" <paaa@uic.nnov.ru>
Subject: Re: Using templates...
Message-Id: <3607968C.A688B6A3@uic.nnov.ru>
Wyatt Draggoo wrote:
>
> I know there are several CGI modules out there, but I don't like using a
> module until I know what is going on inside of it. That said, here is
> my question:
>
> If I read a line from a file, say:
>
> You are using: ?$ENV{'HTTP_USER_AGENT'}?
>
> and put it in $temp, how do I evaluate $temp to replace the ?$...? tags
> with the contents of the variable?
>
> I think I am close with:
>
> $temp =~ s/?(\$[^?]*)?/$1/eeg
>
> But it returns a 'Use of unitialized variable' error even though I know
> that the variable exists - I send it to STDERR and looked at the logs.
>
> Any ideas?
>
> Thanks,
> Wyatt
Try $temp=~s/.../eval($1)/eg;
Lesha.
------------------------------
Date: 22 Sep 1998 09:04:44 GMT
From: Tom.Grydeland@phys.uit.no (Tom Grydeland)
Subject: Re: Value of RANDBITS from within perl?
Message-Id: <slrn70eq1d.jhp.Tom.Grydeland@mitra.phys.uit.no>
On Tue, 22 Sep 1998 16:49:54 +1000,
Benjamin Low <b.d.low@unsw.edu.au> wrote:
> (How) can I find the value of RANDBITS from within a perl script?
> (short of processing a `$^X -V` call :-)
use Config;
print $Config{randbits};
> (I've read the FAQs, Prog Perl and searched Dejanews)
Good.
> Benjamin Low, BEng (Elec)
--
//Tom Grydeland <Tom.Grydeland@phys.uit.no>
------------------------------
Date: 22 Sep 1998 14:15:41 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: Value of RANDBITS from within perl?
Message-Id: <oeezpbs8kki.fsf@alpha.hut.fi>
perl -MConfig -lwe 'print $Config{randbits}'
perldoc Config
--
$jhi++; # http://www.iki.fi/~jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen
------------------------------
Date: 22 Sep 1998 08:17:46 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: where is Date::Parse?
Message-Id: <906452101.248560@thrush.omix.com>
Abigail <abigail@fnx.com> wrote:
>snip<
: Is it a good idea to have CPAN in the default installation, but
: not having Net::FTP in there?
Hmm, CDROM access? NFS access to CPAN mirror?
: Often, if a module needs compiling, compiling and/or linking will
: fail.
I haven't had this problem except for funky modules like DBD
drivers, which is to be expected.
: It won't discover dependancies untill "make test".
: "Checking to see if your kit is complete" (well, that's from perl Makefile.PL)
: always thinks your kit is complete. But it won't discover dependencies.
That's not CPAN.pm's fault, it's the fault of the particular module
author for not setting PREREQ_PM properly in Makefile.PL.
: perl -MCPAN -eshell uses bold and underline by default.
Ok, -1 for style. It's still a very useful utility for most of
us.
: It's a piece of crapware.
Got anything better you'd like to share?
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3783
**************************************