[11968] in Perl-Users-Digest
Perl-Users Digest, Issue: 5568 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 5 09:07:22 1999
Date: Wed, 5 May 99 06:00:24 -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 Wed, 5 May 1999 Volume: 8 Number: 5568
Today's topics:
Re: "Text file busy" error (Bart Lateur)
Re: ASP & PERL <matt-news@sergeant.org>
Re: Creating a file on a different NT File Server <wyzelli@yahoo.com>
Re: Creating a file on a different NT File Server <c4jgurney@my-dejanews.com>
Creating a SSL socket connection? <dawntec@home.com>
DataBase jeffrey_f@my-dejanews.com
Re: having problems getting this script to work... (Bob Trieger)
Re: having problems getting this script to work... <Allan@due.net>
Re: Help Oraperl ? <scancm@biobase.dk>
Re: How can I make an auto-url with a search and replac (Adam Booth)
Re: How to flush CGI output? (I.J. Garlick)
I can not use cgi in my Hypermart account. (Austin Ming)
Re: ISPs that offer cgi space?? <webmaster@chatbase.com>
Re: Limit to number of if statements??? <gellyfish@gellyfish.com>
Re: Making executables from .pl files? <tchrist@mox.perl.com>
Re: Managing NT Workstations with PERL <carvdawg@patriot.net>
Re: Mapping Question (Michel Dalle)
mkdir on NT mcberio@my-dejanews.com
Re: need to encode a query string (Andrea L. Spinelli)
Re: Perl 5: The Complete Reference, Martin Brown (Damian Conway)
Perl vs Java <cnyap@imageres.com>
Re: question about Curses <jsolomon@stanford.edu>
Re: Question: Updating an Array... (Bart Lateur)
Reading extremely large files a chunk at a time <paxamr@unix.ccc.nottingham.ac.uk>
Re: sub for re-encoding a url <c4jgurney@my-dejanews.com>
Re: sub for re-encoding a url (Bart Lateur)
Re: sub for re-encoding a url <gellyfish@gellyfish.com>
Re: syswrite() lies <johan.schon@capgemini.se>
Re: syswrite() lies (Michel Dalle)
Re: syswrite() lies <tchrist@mox.perl.com>
The Perl Index Project <silver@silverchat.com>
Re: which UNIX should I use? <bogart@exis.net>
Win98 asscoiations <andrew@chateaux.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 05 May 1999 12:06:29 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: "Text file busy" error
Message-Id: <37302bb5.1393007@news.skynet.be>
Timothy Larson wrote:
>OK, I'm not trying to overwrite anything intentionally. All I know is that
>I will get one or two runs out of the script (from the command line or
>web hits, whatever) and then the "text file busy" errors start in. If I
>wait long enough they stop, and I can use the script a few more times. I'm
>admittedly a newbie to using Perl, but this doesn't happen with CGI's I
>have written in other languages. Is there something special I need to
>do in Perl to say "Hey, I'm done now" other than simple program termination?
>I can't very well have a CGI that only works half the time, now, can I?
>:)
Platform? I don't think you can get a "file busy" error on Unix. On
other platforms, yes, but that's because of implicit file locking. Unix
gladly lets multiple programs open a file for writing at the same time
(urgh!). Not so on Windows, DOS, or Mac, to name a few.
On those platforms, try making the script wait a while (see sleep()) and
then retry.
Maybe you're suffering from some sort of file caching problem. Explicit
flushing should then solve that. Close the file explicitely, that might
help.
Bart.
------------------------------
Date: Wed, 05 May 1999 10:10:35 +0100
From: Matt Sergeant <matt-news@sergeant.org>
Subject: Re: ASP & PERL
Message-Id: <37300B0B.29612DC0@sergeant.org>
Matt Curtin wrote:
>
> Dennis> Who knows good sites with ASP and PERL tutorials???
http://www.activestate.com/
http://come.to/fastnet - oh... that's my site.... :-)
--
<Matt email="msergeant@ndirect.co.uk" />
| Fastnet Software Ltd | Perl in Active Server Pages |
| Perl Consultancy, Web Development | Database Design | XML |
| http://come.to/fastnet | Information Consolidation |
------------------------------
Date: Wed, 5 May 1999 16:54:00 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Creating a file on a different NT File Server
Message-Id: <kmSX2.66$cb3.4542@vic.nntp.telstra.net>
chipa@nwlink.com wrote in message <7gooht$q6m$1@nnrp1.dejanews.com>...
>I'm trying to create a CGI/Perl script that creates a new file on a
different
>NT File Server over my LAN. The script works fine when I pass in a
directory
>on the local machine (i.e., "c:\test.txt") but fails when I use a network
>directory (i.e., "g:\test.txt"). I suspect its a NT permission thing but
I'm
>not sure where to set the proper settings. I tried granting "Full Access"
>permissions on the File share (G:) and the destination directory, but no
>luck. I guess I have to grant permission to "Perl" and/or my webserver
(IIS)
>but I'm stumped about where I do that.
>
>I realize this isn't exactly a Perl question but I'm hoping someone has run
>into this issue before and can post a quick solution.
>
>FWIW, This is using NT 4.0 Server (service pack 4), IIS 4.0, and ActivePerl
>509.
>
>Thanks in advance,
>Chip
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
You are right wrong ng.. but anyway..
The 'user' you need to assign the rights to is the IIS user typically named
something like !USR_(servername)
Beware of the security implications of allowing the browser user write
permissions to files and directories!
Wyzelli
------------------------------
Date: Wed, 05 May 1999 08:18:39 GMT
From: Jeremy Gurney <c4jgurney@my-dejanews.com>
Subject: Re: Creating a file on a different NT File Server
Message-Id: <7goust$vvh$1@nnrp1.dejanews.com>
In article <7gooht$q6m$1@nnrp1.dejanews.com>,
chipa@nwlink.com wrote:
> I'm trying to create a CGI/Perl script that creates a new file on a different
> NT File Server over my LAN. The script works fine when I pass in a directory
> on the local machine (i.e., "c:\test.txt") but fails when I use a network
> directory (i.e., "g:\test.txt"). I suspect its a NT permission thing but I'm
> not sure where to set the proper settings. I tried granting "Full Access"
> permissions on the File share (G:) and the destination directory, but no
> luck. I guess I have to grant permission to "Perl" and/or my webserver (IIS)
> but I'm stumped about where I do that.
Two things -
1) if you're writing a script which will be run by a user account other than
yourself _always_ change mapped drive paths to UNC paths (//nterver/path) -
you can't rely on a different account having the same mapping as yours.
2) server file permissions - if IIS is being run as a service then it may be
logged in under the localsystem account which has only guest privileges for
network connections - it may be better to have it logged in as a special user
set up with exactly the access it needs.
> I realize this isn't exactly a Perl question but I'm hoping someone has run
> into this issue before and can post a quick solution.
Yes this is a bit off topic but I guess if you'd asked in
comp.os.ms-windows.nt.misc they would have told you the same thing. This has
been asked here several times before.
Jeremy Gurney
SAS Programmer | Proteus Molecular Design Ltd.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 05 May 1999 12:09:00 GMT
From: Andrew Smith <dawntec@home.com>
Subject: Creating a SSL socket connection?
Message-Id: <3730362A.67DC8C41@home.com>
Does anyone know how to create an SSL socket connection?
Are there any modules that allow certificates to be used in the
creation of a client-side socket?
------------------------------
Date: Wed, 05 May 1999 12:05:29 GMT
From: jeffrey_f@my-dejanews.com
Subject: DataBase
Message-Id: <7gpc67$aki$1@nnrp1.dejanews.com>
Hello.
I need the following to happen.
A subroutine is executed. Now...it reads from a users.txt database. From
there..it splits the lines into $db_line (@db_lines). Then...it checks the
following condition FOR EACH $db_line (@db_lines).
if ($FORM{'1'} eq "1")
$FORM{'1'} is the text box posted to the form, which gets decoded.
If the condition is met for that record...it should update $number (@numbers)
for the record, which is set when it reads from the database.
Here is where I need help with.
Then it moves to the next $db_line (@db_lines). When its done, I need it to
rewrite the Database with the new information.
Help would be greatly appreciated!!!
Thanks!!
Jeff
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 05 May 1999 10:30:24 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: having problems getting this script to work...
Message-Id: <7gp5s2$j8h$1@oak.prod.itd.earthlink.net>
"Hawkwynd" <hawkwynd@adelphia.net> wrote:
>I've begun reading all I can get my eyeballs onto, and still come up with a
>headache, and a full ashtray.
Nothing wrong with a full ashtray. Take out the butts and pour it onto
your compost heap.
>Note: This is run on Perl for windows, Active perl
You aren't trying to do anything where it matters which OS you are
using.
>Next step, is to be able to open each text file listed in the array, to
>perform a search and replace:
>
>foreach (@myarray) {
>
>Open the file, for read, and assign the data in that file to a variable:
>
>open(INF," $Iamlosthere")
where are you defining that variable?
You gotta check for a failing status on the open!!
>Basically, I'm trying to be able to read the files one by one in a
>directory, which are all .txt files. Within each file contains two
>characters that have to be removed, afterwards, saving each file without the
>..TXT extension and trimming off the 1st 3 letters of the filename.
>
>Example:
>
>in the dir are:
>
>33_1234.txt
>33_1235.txt
>33_1236.txt
>and so on...
>
>Open file, and remove ascii char 13 and 14, which appear as the male sex
>symbol in ASCII editor, and the note character.
>Then save the file like:
>
>1234
>1235
>1236
>
>This is killing me, as I usually write perl scripts for my web site, and
>somehow I'm losing touch here.
>
>Back to the books, and I appreciate any pointers you might have..
I think the second question in PerlFAQ5 will answer this.
How do I change one line in a file/delete a line in a
file/insert a line in the middle of a file/append to the
beginning of a file?
------------------------------
Date: Wed, 5 May 1999 08:44:25 -0400
From: "Allan M. Due" <Allan@due.net>
Subject: Re: having problems getting this script to work...
Message-Id: <7gpdt0$ua6$1@nntp8.atl.mindspring.net>
Hawkwynd wrote in message ...
:
:Bob Trieger wrote in message <7gobjr$bvg$1@birch.prod.itd.earthlink.net>...
:>[ courtesy cc sent by mail if address not munged ]
:>[ alt.perl removed from newsgroup line ]
:
:>Looks like you gave it an honest. But please use a more accurate subject
:>line from now on. Preferably one that doesn't include that
:>fingernails-across-the-blackboard word "newbie".
:
:Point well taken, thanks. No more nails on the blackboard.
:
:>This code was a mess, which is just what you expect from somebody new.
:>But, you need to slow down and take it one step at a time. Learn the
:>syntax for one function before moving on to the next and don't try and
:>learn everything at once.
:I've begun reading all I can get my eyeballs onto, and still come up with a
:headache, and a full ashtray.
:Note: This is run on Perl for windows, Active perl
:Here's what I understand so far:
:
:#!c:/perl -w
:$file_dir = "C:/wp";
:opendir DIR,$file_dir or die "Error: unable to open $file_dir:$!";
:# Open the directory
:my @myarray = (readdir(DIR));
:# Get my array list of files in dir
:print map {"$_\n" } @myarray;
Not that it really matters but replacing that map with a foreach should be
quicker.
for current perl just use:
print "$_\n" foreach @myarray;
or for older perl:
foreach (@myarray) {
print "$_\n";
}
HTH
AmD
--random quote --
Arithmetical proofs of theorems that do not have arithmetical bases prove
nothing.
- Ashley-Perry Statistical Axioms[5]
------------------------------
Date: 5 May 1999 08:47:18 GMT
From: Christian Mondrup <scancm@biobase.dk>
Subject: Re: Help Oraperl ?
Message-Id: <7gp0im$nus$1@news.net.uni-c.dk>
Eliab Tarkghen <aster@wam.umd.edu> wrote:
: Hello
: Can someone help show me hot to create a view in oraperl.....
: I tried the following, but did not work
: $csr = &ora_open($lda, 'create view Q1 as select * from xxxxx
: where yyyy = :1 and zzzz = :2');
If you had put an error handler into your statement:
$csr = &ora_open($lda,
"create view Q1 as select *
from xxxxx
where yyyy = :1
and zzzz = :2") || die "$ora_errstr\n";
You would have been told the reason:
ORA-01027: bind variables not allowed for data definition operations
What you could do was to replace your bind variable with the current content
of the variable:
&ora_do($lda,
"create view Q1 as select *
from xxxxx
where yyyy = 'yy'
and zzzz = 'zz'") || die "$ora_errstr\n"
&ora_do is a convenient shortcut for &ora_open followed by &ora_close;
: Also is there a good reference page regarding Oraperl.
Look into the DBD/DBI distributiuon.
: Eliab.
Regards
--
Christian Mondrup, Computer Programmer
Scandiatransplant, Skejby Hospital, University Hospital of Aarhus
Brendstrupgaardsvej, DK 8200 Aarhus N, Denmark
Phone: +45 89 49 53 01, Telefax: +45 89 49 60 07
------------------------------
Date: Wed, 05 May 99 07:05:42 GMT
From: heywood@zip.com.au (Adam Booth)
Subject: Re: How can I make an auto-url with a search and replace?
Message-Id: <7gou93$npp$1@the-fly.zip.com.au>
In article <7g58gv$gca$1@nnrp1.dejanews.com>, scraig@my-dejanews.com wrote:
>In article <7g4mpo$6hl$1@dinkel.civ.utwente.nl>,
> "Albert Brand" <rtficial@dds.nl> wrote:
>> Let's take this string:
>>
>> "Go to http://come.to/inf-inity "
>>
>> And i would like to have it converted to:
>>
>> "Go to <a href="http://come.to/inf-inity">come.to/inf-inity</a> "
>
>$string =~ s#(http://)(\S*)#<a href="$1$2">$2</a>#;
It took me quite sometime last night to come up with a solution very similar
to this one - I kind of wish I found this snippet before hand but at least I
have an understanding on how it works.
The problem that I have now, is that I'm trying to go one step further and
seeing if there is a fullstop (. character) directly behind the url and moving
it past it getting rid of it in the href=" " part
$line =~ s#(http://)(\S*)(\.?)/#<A href="$1$2"\>$2\<\/A\>$3#g;
doesn't appear to behave as I think it should when I put the input string as
$line = "I found it at http://www.elephant.com/peanuts."
the output is
I found it at <A href="http://www.elephant.com">www.elephant.com</A>peanuts.
Could someone please advise on a way to fix this?
Regards,
Adam
------------------------------
Date: Wed, 5 May 1999 09:01:22 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
Subject: Re: How to flush CGI output?
Message-Id: <FB952B.I3u@csc.liv.ac.uk>
In article <FB78ty.K99@csc.liv.ac.uk>,
ijg@csc.liv.ac.uk (I.J. Garlick) writes:
> In article <7gev8n$2o7$1@gellyfish.btinternet.com>,
> Jonathan Stowe <gellyfish@gellyfish.com> writes:
>>
>> $| = 1;
>>
Whoops. Sorry everyone and especially Jonathan. Yesterday I wrote:-
> Yep you are. It doesn't work like that (let me qualify that, according to
> the camel it should but it doesn't in a CGI environment). I think I am
> begining to realise that David Efflandt is correct something is cacheing
> the output. I have tried $| = 1 just about everywhere in my CGI scripts
> and it deosn't cause the browser to display as I call print.
Err... Ther's no easy way to put this but I was wrong (doing that a bit
lately in this NG) $| does flush the output as described.
>
> And yes I do understand HTML, all of my tables and images are sized
> finished etc... so theoretically accoriding to all percieved wisdom it
> should display as it's creating the page but it doesn't. In fact I can get
> it to work if I save the page and covert to a static HTML page.
I apparently don't understand things as well as I thought. The tables I
was using where displaying to fast. I put a truly humongous table in later
on and the first couple displayed very quickly, while the 3rd was being
built.
I am mucho happy now :-)
--
Ian J. Garlick
ijg@csc.liv.ac.uk
If people concentrated on the really important things in life,
there'd be a shortage of fishing poles.
-- Doug Larson
------------------------------
Date: 5 May 1999 12:14:38 GMT
From: austin95002887@yahoo.com (Austin Ming)
Subject: I can not use cgi in my Hypermart account.
Message-Id: <7gpcne$hpe$2@justice.csc.cuhk.edu.hk>
I can not use cgi in my Hypermart account.
I do not know if i do the wrong procedure or not.
1,) i create cgi-bin directory by using FTP,
2.) i upload html.pl to cgi-bin directory by using FTP.
3.) i chmod of cgi-bin directory to 755 by using FTP
4.) i chmod of html.pl file to 755 using FTP
file: html.pl
----------------------------------------
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<HTML>\n<HEAD></HEAD>\n<BODY BGCOLOR=\"WHITE\">\nTesting\n";
print "</BODY>\n</HTML>";
----------------------------------------
But, I can not run the cgi.
http://heshe.hypermart.net/cgi-bin/html.pl
What's wrong ? Can anyone help me ?
------------------------------
Date: Wed, 05 May 1999 00:36:12 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
To: BBlackmoor <bblackmoor@my-dejanews.com>
Subject: Re: ISPs that offer cgi space??
Message-Id: <372FF4EC.A5FC65E@chatbase.com>
> Blackmoor wrote:
>
>
> Hash: SHA1
>
> In article <372EA152.D8B1FCA6@chatbase.com>,
> webmaster@chatbase.com wrote:
> > Mike Flaherty wrote:
> > >
> > > I haven't looked yet but this seems like to best place to start.
> >
> > Well, it's actually not the best place to start, being this NG is
> > dedicated and geared towards Perl. Which your question has nothing
> to do
> > with.
>
> That's absurd:
Oh?
> you want him to start comp.lang.perl.isp
That'd be a GREAT idea! Then we can start comp.lang.perl.actinglessons
and comp.lang.perl.crafts! Perl WILL take over the world! :-)
> just to ask
> one question?
Well, if he wants to get an answer he's looking for (that has something
to do with his question), then yes. Why doesn't that make sense to you?
Just because it's one question, doesn't mean people should start asking
about Tcl or Python in a Perl NG! If anything, he'll get more help an d
it doesn't clutter *this* NG with off-topic subjects.
> Of course this newsgroup is an appropriate place to ask
> his question.
No it's not.
> I don't have an answer for him, unfortunately. I wish I did.
So you posted this, just to bitch to me about something you've naive
about? If so, take it into private emails -- where flames belong, not to
waste bandwidth and annoy everyone else in this NG!
--
Regards,
Tim Greer: chatmaster@chatbase.com / software@linkworm.com
The Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software & The Link Worm: http://www.linkworm.com
Custom chat server scripts, CGI scripting in Perl/C, Trouble shooting,
Security, Modify & Debug, Freelance Scripting and more!
------------------------------
Date: 5 May 1999 10:37:18 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Limit to number of if statements???
Message-Id: <3730114e@newsread3.dircon.co.uk>
Tad McClellan <tadmc@metronet.com> wrote:
> Larry Rosler (lr@hpl.hp.com) wrote:
>
> : [Posted and a courtesy copy mailed.]
>
>
> Talking to yourself Larry?
>
> heh, heh
>
He came over all iffy after reading the original post
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: 5 May 1999 05:19:13 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Making executables from .pl files?
Message-Id: <37302931@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
smnayeem@my-dejanews.com writes:
:But say what if i want to send a copy of my file to someone who doesnt have
:perl installed. With the present way of distributing i have to go to every
:place and install perl (or have them install it) before my program can be of
:any use. isnt that like making it cause too much of an overhead?
And what if you want to send someone a program that uses X11, but
they don't have it?
And what if you want to send someone a program that uses Tk, but
they don't have it?
And what if you want to send someone a program that uses Oracle, but
they don't have it?
And what if you want to send someone a program that uses Windows, but
they don't have it?
Eh?
--tom
--
"Patriotism is an arbitrary veneration of real estate above principles."
------------------------------
Date: Wed, 05 May 1999 05:24:43 +0100
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Re: Managing NT Workstations with PERL
Message-Id: <372FC80B.AFD4718B@patriot.net>
I'm not too clear on what you're looking for in the first question, but the
second question is fairly simple. Just have a list of machine names, OR you
can use AdminMisc to find the machines by type, and then have the script
go out an make the Registry change...
mclaughlinj@leaders.ccl.org wrote:
> Okay, I don't get it. I've read the manual including tie:registry, search the
> perl ring and must be totally missing it.
>
> How do I run a Perl script on 300 workstations as each user logs in? I want to
> somehow hook the login script to call the perl script and have it run.
>
> -or-
>
> How do I remotely manage NT workstations including registry changes and
> general administration using Perl?
>
> dazed and confused ... jeff
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 05 May 1999 10:50:04 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Mapping Question
Message-Id: <7gp7nm$a7p$2@news.mch.sbs.de>
In article <FB7vu2.3n2@news.boeing.com>, "news.boeing.com" <jim.ray@west.boeing.com> wrote:
>I have 2 computers. Computer is the IIS Server with all my CGIs and HTMLS,
>the other is where the data is stored. I can now create a dynamic page of
>the files on the data server but I can not figure out how to do the URL
>links.
>
>Example.
>
>Server.
>"http://myserver.com/index.cgi?DirecotryName" will produce a list of files
>of "DirectoryName"
>
>Data Server
>"//NT-SERVER/Dir1/DirectoryName"
>
>When I create the link to the other server, how does the URL read.
>http://???? or is it file://????
>
>Thanks for the help.
>
Try comp.infosystems.www.authoring.cgi (or somewhere in microsoft.public.* ?)
Michel.
Anyway, the answer, my friend, is blowing in the Wind ...ows. :o
What browsers are you using, and what do they say when you TYPE :
file://NT_SERVER/Dir1/Directory/Name
or even :
\\NT_SERVER\Dir1\Directory\Name (redirected to file:////NT_SERVER/ etc.)
Just make sure every PC has access to the NT server...and forget about
that nice little CGI you wrote. You'll notice you don't need it anymore :-)
--
aWebVisit - extracts visitor information from WWW logfiles and shows
the top entry, transit, exit and 'hit&run' pages, the links followed
inside your website, the time spent per page, the visit duration etc.
For more details, see http://gallery.uunet.be/Michel.Dalle/awv.html
------------------------------
Date: Wed, 05 May 1999 12:04:55 GMT
From: mcberio@my-dejanews.com
Subject: mkdir on NT
Message-Id: <7gpc55$ahm$1@nnrp1.dejanews.com>
Hi,
I have a UNIX script which makes a directory, copies a template into it and
fills it with user-input. I now want to run the script on NT with ActivePerl.
I have code like:
#####
open(NEWDIR,"|mkdir $newdir") || print &Error('Sorry, cannot make directory');
print NEWDIR $newdir;
close(NEWDIR);
chmod(0777,"$newdir");
#####
Is the pipeline in the open command the problem?
Any help would be great !!
thanks
McB
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 05 May 1999 08:55:23 GMT
From: aspinelli@ismes.it (Andrea L. Spinelli)
Subject: Re: need to encode a query string
Message-Id: <373006a6.2005755@news.inet.it>
On Sat, 1 May 1999 00:20:57 -0600, "Aaron Propst"
<abp@holly.colostate.edu.spamm> wrote:
>I need to write a part of a script that can create a query string from a
>text string.
...
>Anyone know of a simple way to do this?
use CGI;
my $encoded = CGI::escape( 'my string goes here!! and/or here?' );
print "$encoded\n";
This not a FAQ, it is a Quite FAQ!
A.
--
Andrea Spinelli, Ismes SpA, Via Pastrengo 9, 24068 Seriate BG, Italy
e-mail: aspinelli@ismes.it Phone: +39-035-307209 Fax: +39-035-302999
------------------------------
Date: 5 May 1999 07:05:31 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: Perl 5: The Complete Reference, Martin Brown
Message-Id: <7goqjr$rmi$1@towncrier.cc.monash.edu.au>
lr@hpl.hp.com (Larry Rosler) writes:
>Mr. Winston Churchill was once publicly reprimanded for ending a
>sentence with a preposition.
>"Madame," he replied, "that is a rule up with which I shall not put."
>[Authoratative citation not available. :-]
Churchill actually stole it from Fowler, whose 1926 entry on the subject
in "Modern Usage" concludes:
If the 'preposition' is in fact the adverbial participle of a
phrasal verb, no choice is open to us; it cannot be wrested from
its partner. Not even Dryden [a famous proponent of the "no
terminal preposition" rule] could have altered "which I will
not put up with" to "up with which I will not put".
Damian
------------------------------
Date: Wed, 05 May 1999 11:23:59 +0100
From: cnyap <cnyap@imageres.com>
Subject: Perl vs Java
Message-Id: <37301C3F.AE4B70BF@imageres.com>
Hi there,
I am a newbie on Perl and I wish to get some advices from you guys.
I am working on a project that involves an object-oriented database.
Unfortunately, this database could only talk to either a C++ or Java
application. I have implemented a Java application for it.
The problem now is I am using Perl to do my CGI scripts. I want to
know is it possible to make my CGI scripts to communicate with
that Java application in order to access the database. If the answer
is yes, can you briefly tell me how, it will be even better if you can
show me some examples.
Your help is very much appreciated. Thank you.
Chih Nam Yap
------------------------------
Date: 05 May 1999 00:05:33 -0700
From: Jeff Solomon <jsolomon@stanford.edu>
Subject: Re: question about Curses
Message-Id: <w4du2tsatdu.fsf@mrclean.Stanford.EDU>
dennis@info4.csie.nctu.edu.tw (GEMINI) writes:
> I am using Curses to create a box that will display
> messages. I can use addstr to add a string to the window,
> but it will not scroll up automatically when the
> content reaches the bottom of window. I tried to use
> scroll function to scroll up one line, but it has no
> effect at all. Even it works, I have to keep track of the
> cursor position to know when it reaches the bottom.
> So how can I use the window just like the normal console
> screen?
I wrote a Perl/Curses program a while ago so my memory isn't the best,
but the code for it shows that I when I wanted to print something to
a scrollable window, I had to make sure to call refresh() to see and
effect. Here is the code that adds any number of @lines to a screen
named $scrollWin:
foreach my $line (@lines ) {
if( $scroll >= $rows ) {
scroll($scrollWin);
addstr($scrollWin, $rows, 0, $line);
} else {
addstr($scrollWin, $scroll++, 0, $line);
}
}
refresh($scrollWin);
$rows is set to the number of rows in the window and $scroll is
initialized to zero. Once $scroll == $rows, you'll always be adding to
the bottom of the window unless the screen is cleared etc.
I seem to recall having the same problem you are. The key is to call
refresh(), good luck.
Jeff
------------------------------
Date: Wed, 05 May 1999 09:43:54 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Question: Updating an Array...
Message-Id: <37300bfd.281051@news.skynet.be>
David Salvador Flores wrote:
>Now, I know from "Learning Perl" that the push, pop, shift and unshift
>functions allow you to update the "left" or "right" end of an array.
>But is there a simple way of stuffing new values into the middle of
>an array without overwriting a previous value?
"splice". It's a bit hard to grab a hold of at first ;-) but it does
exactly what you want. And more. In fact, you can emulate any of the
functions you mention using it. Here's some quick boot code:
@ary = qw(a b c);
splice @ary,1,1, 1..3; # replace ('b') with (1,2,3)
print "@ary\n";
Now do "perldoc -f splice" and discover what else it can do for you.
Bart.
------------------------------
Date: Wed, 5 May 1999 13:15:41 +0100
From: adam moore <paxamr@unix.ccc.nottingham.ac.uk>
Subject: Reading extremely large files a chunk at a time
Message-Id: <Pine.SOL.4.05.9905051303380.541-100000@granby>
Greetings!
I have written a script to convert single files from a large flat file
database into XML. Now I want to convert the whole database at one go.
Each record is a series of lines 80 chars or less with a two letter ID tag
at the start. The end of each record is given by "//" on a line on it's
own (It's the SwissProt files http://www.expasy.ch, if you want to know).
The individual file parser uses @inbuff=<INPUT> to read the file and then
processes each line / group of lines with the same ID. The whole database
is >200Mb, so I obviously can't use that any more. Is there any way to
read each file up to "//" into @inbuff, then move on? My apologies if
this is obvious/simple - I have done extensive web searching and can't
seem to find an answer.
For those of you interested in what and why I'm doing see the Project
website: http://www.vsms.nottingham.ac.uk/biodom/. I admit to being a
perl hacker rather than a guru - all help greatly appreciated!
TIA
Adam Moore
Virtual School of Molecular Sciences
School of Pharmaceutical Science, University of Nottingham
http://www.vsms.nottingham.ac.uk/vsms/
Personal Page:http://www.ccc.nottingham.ac.uk/~paxamr/
------------------------------
Date: Wed, 05 May 1999 08:25:36 GMT
From: Jeremy Gurney <c4jgurney@my-dejanews.com>
Subject: Re: sub for re-encoding a url
Message-Id: <7gov9t$eg$1@nnrp1.dejanews.com>
In article <372f7ee4$0$223@nntp1.ba.best.com>,
"Alex Black" <enigma@turingstudio.com> wrote:
> hi,
>
> I've got a url that's been decoded, i.e. from:
>
> file%3A%2F%2F%2Fconnaught%2Fsite%2Fimages%2Fshared%2F
> to
> file:///connaught/site/images/shared
>
> as you can see, that requires an encoded url.. $enc_dir
Check out URI::Escape
It came as part of the as perl distribution on my machine (AS 509).
Jeremy Gurney
SAS Programmer | Proteus Molecular Design Ltd.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 05 May 1999 09:43:55 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: sub for re-encoding a url
Message-Id: <37310eb8.980026@news.skynet.be>
Alex Black wrote:
>I can't find a lib that will encode urls... which kind of surprise me. I
>went looking and I couldn't find much.
It exists, but it's in a rather unobvious (to me ;-) space... I think
it's URI::Escape.pm which is part of libwww. (Having to download a 220k
archive for a 2.5k text module is a bit silly, I'd say...)
>The following is something I found,
>but it's damaged. I have a feeling the ~s lines would do it, but I can't
>quite arrange them correctly to fix it.
>
>sub url_encode {
> $dirline = $data{'dir'};
> $dirline = ~s/\?/%3f/g;
> $dirline = ~s/\&/%26/g;
> $dirline = ~s/\+/%2b/g;
> $dirline = ~s/([\000-\037\177-\377 ])/"%".sprintf("%2.2x",ord($1))/ge;
> }
> return $dirline;
>}
As others said: replace "= ~" with "=~" everywhere. You can try a one
line substitution, by including the "special cases" in the final
replacement:
$dirline =~ s/([%+?\000-\037\177-\377])/sprintf('%%%02x',ord($1))/ge;
but I think the list of unsafe characters isn't complete.
Bart.
------------------------------
Date: 5 May 1999 11:05:09 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: sub for re-encoding a url
Message-Id: <373017d5@newsread3.dircon.co.uk>
Larry Rosler <lr@hpl.hp.com> wrote:
> In article <slrn7iv45b.kl.sholden@pgrad.cs.usyd.edu.au> on 5 May 1999
> 00:28:27 GMT, Sam Holden <sholden@pgrad.cs.usyd.edu.au> says...
>> On Tue, 04 May 1999 16:43:40 -0700, Alex Black <enigma@turingstudio.com> wrote:
>> >sub url_encode {
>> > $dirline = ~s/\?/%3f/g;
>> > $dirline = ~s/\&/%26/g;
>> > $dirline = ~s/\+/%2b/g;
>> > $dirline = ~s/([\000-\037\177-\377 ])/"%".sprintf("%2.2x",ord($1))/ge;
>> ^^^
>>
>> I'm pretty positive that doesn't do anything like what you expect it to.
>>
>> Perl isn't as white space sensitive as Python, but you can't just chuck in
>> white space wherever you feel like. Especially not in the middle of an
>> operator.
>>
>> Do you really want to bitwise negation. I doubt it.
>
> And even after that's fixed, why do you want to hard-code hex values
> into your code? Include the '?' '&' and '+' into the character class,
> as you did the space. And don't forget '%'! Are there any others?
>
>From rfc1738 :
Thus, only alphanumerics, the special characters "$-_.+!*'(),", and
reserved characters used for their reserved purposes may be used
unencoded within a URL.
On the other hand, characters that are not required to be encoded
(including alphanumerics) may be encoded within the scheme-specific
part of a URL, as long as they are not being used for a reserved
purpose.
So it would appear that if one were so inclined one could have the whole
lot encoded ;-}
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Wed, 5 May 1999 09:40:21 +0200
From: "johan schoen" <johan.schon@capgemini.se>
Subject: Re: syswrite() lies
Message-Id: <7gosfk$5nb$1@news.capgemini.se>
Dear Rob,
Try reading the online doc:
perldoc -f open
perldoc -f binmode
# schoen
elderr@us.ibm.com wrote in message ...
>
>A nasty little portability problem. Works as expected in UNIX. The value
>syswrite returns is _not_ the number of bytes written to a file in NT.
>Some code:
>
[ some code and other text deleted ]
>
>Does any one know how to stop the mangling of the buffer? It should just
>read in a buffer and write it without scanning the whole thing to add ^Ms
>everywhere (if you ask me.) I'm using 5.005_2 on NT.
>
>Reply via news please.
>
>Thanks,
>
>Rob
------------------------------
Date: Wed, 05 May 1999 10:54:03 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: syswrite() lies
Message-Id: <7gp7v6$a7p$3@news.mch.sbs.de>
In article <aevktk2h.fsf@us.ibm.com>, elderr@us.ibm.com wrote:
[snip]
>However NT likes to add control Ms to every line of text so that I get more
>than a 2048 byte file (2073 bytes) even though it reports it wrote 2048KB.
>Does any one know how to stop the mangling of the buffer? It should just
>read in a buffer and write it without scanning the whole thing to add ^Ms
>everywhere (if you ask me.) I'm using 5.005_2 on NT.
binmode(OUTFILE) would help.
Don't blame NT, they'll get there...eventually.
Michel.
--
aWebVisit - extracts visitor information from WWW logfiles and shows
the top entry, transit, exit and 'hit&run' pages, the links followed
inside your website, the time spent per page, the visit duration etc.
For more details, see http://gallery.uunet.be/Michel.Dalle/awv.html
------------------------------
Date: 5 May 1999 05:22:30 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: syswrite() lies
Message-Id: <373029f6@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
elderr@us.ibm.com writes:
:
:A nasty little portability problem. Works as expected in UNIX. The value
:syswrite returns is _not_ the number of bytes written to a file in NT.
syswrite doesn't lie -- Microsoft lies. They're trapped in CP/M idiocy.
Billscrew sucks --- you're cursed. Did you forget to collect your free
lobotomy that now comes bundled with all Microsoft products?
Oh, and go read perlopentut.
--tom
--
Comments on data are usually much more helpful than on algorithms. --Rob Pike
------------------------------
Date: Wed, 05 May 1999 01:39:11 -0500
From: silver <silver@silverchat.com>
Subject: The Perl Index Project
Message-Id: <372FE78F.45461BBD@silverchat.com>
http://www.silverchat.com/~silver/perlindex
The Perl Index Project
= Goal =
Provide a place where you can look up a language construct, or a concept,
and get an index across as many useful references as the net can get its
hands on. Theoretically making you much more likely to be able to find
the right book the first time, or help you read as much as possible about
something.
= Plan =
The Perl Index Project is a four phase plan.
Phase 1: Proof of Concept
Because this project relies on data entry, I need a very concise and
easy to type data format. I'm working on that. I'll also need to write
a "format->html" converter, but Perl makes that an easy Joy.
Once that is done, I'll type the indexable material from a few dozen pages of
the venerated Camel book, to demonstrate my own dedication to the project, and
to work the bugs out of the format and html converter.
Phase 2: Permission
I need to write to the publishers of the various books and make sure
they're "okay" with it. I don't really see why not, since it is in essence
free advertising and a way to make their books more useful, but you never
know how corporate minds are. It might be more sane to do this before phase 1,
but if the project languishes and dies in phase 1, then I don't want to hassle
them. Currently, this means contacting O'Reilly, Addison-Wesley, and
Readable Publications.
Phase 3: The Boring Part
Then I start typing. A lot. And hopefully get contributions from the
net. I'll have a little CGI set up on this page to allow people to "claim"
pages - at first a few per person, but frequent contributors will be
"trusted" to claim more. Woo. hopefully, this will only take a few months,
I really have no idea what the volunteer response will be, since it's
bloody tedious work.
Phase 4: Search Engine and Maintenance
Either I or someone much more clever than I will then install a search
engine, and the whole thing will be "done" until the next book or TPJ issue
comes out. And hopefully my poor little server will be able to keep up
with the usage load.
= Books and Publications =
So far, my plans are to index: the Camel book, the Panther book, the Ram book,
Perl in a Nutshell, and Learning Perl/Tk, all published by O'Reilly;
Effective Perl Programming, published by Addison Wesley; all issues of
The Perl Journal, published by Readable Publications; and the Perl FAQs and
pods online. Any other books recommended (like by getting five camels from Tom
Christiansen) will be considered once "some progress" has been made.
= What I want in an Entry =
Right up at top, I want, in bold, page numbers for the "canonical definition".
Then the various subheadings and whatnot, and finally a pile of concrete
usage examples - often a construct is used in sample code elsewhere in a book,
and it's never indexed. Right now I'm considering the "no entry is too
obscure" rule, though then the data format would have to be modified to
allow "ratings" of entries for value, and ... well, that's why I'm still
working on the data entry format.
= Progress =
I have a preliminary format, but it's very, very preliminary. So this is still
in "early phase 1."
= What do you Think? =
Would you use this? Would you contribute? Do you think it's a good idea, or
the dumbest thing you've ever heard? Am I being redundant with an existing
project? Do you know of any reason phase 2 would fail, making this pointless
right off the bat?
Let me know, thanks.
--
--silver Harloe-- http://www.silverchat.com/~silver (updated May 5, 1999)
"I am the soul of honor, kindness, mercy, and goodness.
Trust me in all things."
------------------------------
Date: Wed, 05 May 1999 08:34:35 -0500
From: Ed Bogart <bogart@exis.net>
Subject: Re: which UNIX should I use?
Message-Id: <373048EA.DECC21C1@exis.net>
Scott McMahan wrote:
>
> For Perl development, I recommend Red Hat 5.2. I've been doing some heavy
> Perl stuff on it, and really love it. It's UNIX-ish, has all the bells
> and whistles (even the man pages work, which is more than I can say for
> most of the commercial UNIXes I've used! -- I can M-x man in Emacs and
> get the man pages!), and will run on just about anything.
>
> For web development, if you are a UNIX admin who knows what you're doing,
> a Linux box can't be beat -- especially if you know DNS and can set up all
> your web sites on one box using Apache 1.3's non-IP virtual domains. I
> have all the web sites I develop on a single Linux box this way, and
> they look and feel like they do online. I can even cross-link them.
>
> Scott
Thanks to all of you who gave suggestions. I've decided to go with RedHat Linux 5.2.
An apology to those who didn't understand my request and how it had anything to
do with Perl. What I meant to say was that I am currently using Perl at work and
would like to set up a Perl development environment at home where I can run Perl
scripts and develop Perl CGIs. I needed advice on which os would provide a Perl
development environment that was most like the Perl environment that I have been
Perl in.
Ed 'casting Perls before swine' Bogart
------------------------------
Date: Wed, 5 May 1999 11:31:05 +0100
From: "Andrew Brown" <andrew@chateaux.com>
Subject: Win98 asscoiations
Message-Id: <925900270.10971.0.nnrp-03.9e983a8c@news.demon.co.uk>
I have correctly associated .pl to be run by perl.exe as per the docs from
Activestate but I still get the problem of the browser trying to download my
script instead of running it.
I'm using Win98 and MS Personal web server.
Anyone know what I am doing wrong ?
tia,
------------------------------
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 5568
**************************************