[13162] in Perl-Users-Digest
Perl-Users Digest, Issue: 572 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Aug 18 09:11:21 1999
Date: Wed, 18 Aug 1999 06:05:11 -0700 (PDT)
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, 18 Aug 1999 Volume: 9 Number: 572
Today's topics:
Re: Connecting to UNC share via Perl/CGI sandman69@my-deja.com
current dir in perl ? <jdupayrat@webraska.com>
Re: current dir in perl ? <tom.kralidis@ccrs.nrcanDOTgc.ca>
Joining Two Integers dave4000@my-deja.com
Re: Joining Two Integers <ghira@mistral.co.uk>
Re: Joining Two Integers <crt@kiski.net>
RE: Joining Two Integers <tmujak@wcom.co.uk>
Re: Joining Two Integers (David Alan Black)
mod_perl / DBI : looking for a simple exemple <bdolez@novecom.fr>
newbee vod@writemail.com
Re: newbee <jpeterson@office.colt.net>
Re: Parent/Child Relation with Win32::Process <carvdawg@patriot.net>
Re: PERL & EXCEL (Eduard Wulff)
Perl Mail Client is available for download (Sean McAfee)
Re: preventing multiple posts (Bart Lateur)
Problem running CGI script ksumi@my-deja.com
Re: Q:Two perl programs printing to one txt file (Anno Siegel)
Running perl script from HTML - Problem ksumi@my-deja.com
Re: Running perl script from HTML - Problem <jpeterson@office.colt.net>
shell script translation <argyrodes@sympatico.ca>
Re: shell script translation <tom.kralidis@ccrs.nrcanDOTgc.ca>
Re: SNMP module <carvdawg@patriot.net>
Sybperl and BCP (ErwanPia)
Tab range extension <aucar@netas.com.tr>
Re: what does eq do on lists? <nospam.newton@gmx.net>
Re: what does eq do on lists? (Bart Lateur)
Re: What editors are folks using for PerlScript develop jrt915@hotmail.com
Re: What editors are folks using for PerlScript develop dave4000@my-deja.com
Re: Working with Win32 Network API (Eduard Wulff)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 18 Aug 1999 12:22:04 GMT
From: sandman69@my-deja.com
Subject: Re: Connecting to UNC share via Perl/CGI
Message-Id: <7pe8h2$pqq$1@nnrp1.deja.com>
Yes that is definitely the case. But what permissions are needed on the
other server for a local IUSR account on a Web Server to Connect to the
share?
Currently the share on the File Server and NTFS perms have everyone
with Full Control.
Any ideas?
Shawn
In article <VWmu3.150$mH1.447@news.rdc1.ne.home.com>,
"Tim Bornholtz" <tbornhol@prioritytech.com> wrote:
> <sandman69@my-deja.com> wrote in message news:7pcf0n$gu4
$1@nnrp1.deja.com...
> > I am having problems connecting to an NT share on another
serverfrom a
> > Browser.
> > I have a form to allow servername, sharename and a test variable to
be
> > submitted to my perlscript.
> >
> > The webpage authenticates the connecting user using the NT PDC.
> ...
>
> > Things work perfectly if I send params to the script via a command
line
> > interface... not using param of course but reading in @ARGV.
>
> This is more than likely a permissions peroblem. When you run this
from the
> command line NT is using your permissions. When you run this through
the
> browser,
> the permissions are for the user account the web server runs under.
>
> hth,
> Tim Bornholtz
> tbornhol@prioritytech.com
>
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 18 Aug 1999 13:13:35 +0100
From: "JduPayrat" <jdupayrat@webraska.com>
Subject: current dir in perl ?
Message-Id: <7pe4bi$8ok$1@minus.oleane.net>
Hello,
I have upgraded recently from perl (Active state) to 5.003_07 to 5.005_03
and have CGI problems. When I try to execute a CGI perl complains:
Can't locate module myModule.pl at @INC (c:\perl\lib, c:\perl\lib\site, .)
I have to put:
use 'myDirectory';
to have perl find the module (the module is in the same dir than the CGI). I
thougth perl couldn't find the current directory but when I put these
lines in my script, it reports the rigth path:
open(LOG,'>myLog');
print LOG ,`cd` ; #I am on winNt
close LOG;
any ideas ?
ps: My web server is IIS 3.0 and I use perl ISAPI.
------------------------------
Date: Wed, 18 Aug 1999 08:47:06 -0400
From: Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca>
Subject: Re: current dir in perl ?
Message-Id: <37BAAB4A.9F020ADA@ccrs.nrcanDOTgc.ca>
Try:
#!/public/bin/perl -w
use Cwd;
$location = cwd();
print "$location\n";
..Tom
JduPayrat wrote:
>
> Hello,
>
> I have upgraded recently from perl (Active state) to 5.003_07 to 5.005_03
> and have CGI problems. When I try to execute a CGI perl complains:
> Can't locate module myModule.pl at @INC (c:\perl\lib, c:\perl\lib\site, .)
>
> I have to put:
> use 'myDirectory';
>
> to have perl find the module (the module is in the same dir than the CGI). I
> thougth perl couldn't find the current directory but when I put these
> lines in my script, it reports the rigth path:
>
> open(LOG,'>myLog');
> print LOG ,`cd` ; #I am on winNt
> close LOG;
>
> any ideas ?
>
> ps: My web server is IIS 3.0 and I use perl ISAPI.
--
-----------------------------------------------------------------------------------------
Tom Kralidis Geo-Spatial Technologist
Canada Centre for Remote Sensing Tel: (613) 947-1828
588 Booth Street , Room 241 Fax: (613) 947-1408
Ottawa , Ontario K1A 0Y7 http://www.ccrs.nrcan.gc.ca
-----------------------------------------------------------------------------------------
------------------------------
Date: Wed, 18 Aug 1999 10:36:44 GMT
From: dave4000@my-deja.com
Subject: Joining Two Integers
Message-Id: <7pe2bs$lo0$1@nnrp1.deja.com>
I have the following problem.
$number1=25;
$number2=26;
print "Enter the value of x: ";
$x = <>;
chop $x;
$temp = $number.$x;
print $temp;
I want the user to input the value of x and if 1 is input the value 25
will be displayed, if 2 is input then the value 26 is displayed.
I have tried concatinating the values but this only appears to
work for strings!!
Any help would be appreciated!
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 18 Aug 99 11:57:36 +0000
From: "Adam Atkinson" <ghira@mistral.co.uk>
Subject: Re: Joining Two Integers
Message-Id: <739.899T1808T7174749ghira@mistral.co.uk>
On 18-Aug-99 10:36:44, dave4000 said:
>$number1=25;
>$number2=26;
>print "Enter the value of x: ";
>$x = <>;
>chop $x;
>$temp = $number.$x;
$number is undefined. so $number.$x is the same as $x. which is what
you're getting
>I want the user to input the value of x and if 1 is input the value 25
>will be displayed, if 2 is input then the value 26 is displayed.
>I have tried concatinating the values but this only appears to
>work for strings!!
Concatenating the values of what??
You could do
$number[1]=25;
$number[2]=26;
...
$temp=$number[$x];
--
Adam Atkinson (ghira@mistral.co.uk)
Never attribute to malice that which is adequately explained by
incompetence.
------------------------------
Date: Wed, 18 Aug 1999 07:28:23 -0400
From: "Casey R. Tweten" <crt@kiski.net>
Subject: Re: Joining Two Integers
Message-Id: <Pine.OSF.4.10.9908180715420.7946-100000@home.kiski.net>
On Wed, 18 Aug 1999 dave4000@my-deja.com wrote:
[snip mangled code]
:I have tried concatinating the values but this only appears to
:work for strings!!
This is the only question I could find, so I would like to tell you that
there is no problem with concatination of intergers. To prove this, run
the following code, of corse changing the shebang if needed:
#!/usr/local/bin/perl -w
use strict;
print "Usage: $0 num1 num2 [num3 [num4 ...]]\n" and exit unless $#ARGV >= 1;
my $int;
$int .= shift while @ARGV;
print sqrt $int,
"\n";
--
Casey R. Tweten <joke> This
Web Developer is 100% certified
HighVision Associates virus and bug
crt@highvision.com free code. </joke>
------------------------------
Date: Wed, 18 Aug 1999 12:59:18 +0100
From: "Mujakporue, Trey" <tmujak@wcom.co.uk>
To: "'comp.lang.perl.misc@list.deja.com'" <comp.lang.perl.misc@list.deja.com>
Subject: RE: Joining Two Integers
Message-Id: <11020643E71FD311ACAA0008C7C563F3AF231A@gblon1c3ex1.wcom.co.uk>
I have the following problem.
[me] No shit you have a problem! don't we all!.
$number1=25;
$number2=26;
print "Enter the value of x: ";
$x = <>;
chop $x;
$temp = $number.$x;
print $temp;
I want the user to input the value of x and if 1 is input the value 25
will be displayed, if 2 is input then the value 26 is displayed.
[me]
Well if this is all you want to do then why the concatenation?? try this
hope its what you need!
$number1=25;
$number2=26;
print "Enter the value of x: \n";
$x = <STDIN>;
chomp $x ; # use chomp when you are only removing newline characters
#if there is no NL character it wont remove it
#chop will remove the last character on any line.
if ($x == 1) {
print "$number1\n"; }
elsif ($x == 2){
print "$number2\n" ; }
I have tried concatinating the values but this only appears to
work for strings!!
Any help would be appreciated!
[me] hope this is ok!
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
_____________________________________________________________
Deja.com: Share what you know. Learn what you don't.
http://www.deja.com/
* To modify or remove your subscription, go to
http://www.deja.com/edit_sub.xp?group=comp.lang.perl.misc
* Read this thread at
http://www.deja.com/thread/%3C7pe2bs%24lo0%241%40nnrp1.deja.com%3E
----------------------
CONFIDENTIALITY NOTICE
This communication contains information which is confidential and may also be
privileged. It is for the exclusive use of the intended recipient(s). If you
are not the intended recipient(s), please note that any distribution, copying
or use of this communication or the information in it is strictly prohibited.
If you have received this communication in error, please notify us immediately
by telephone on +44 171 675 5000 and then destroy the email and any copies of
it. This communication is from MCI WorldCom Limited whose registered office is
at 14 Gray's Inn Road, London WC1X 8HN. Registered number 2776038.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 18 Aug 1999 08:16:18 -0400
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: Joining Two Integers
Message-Id: <7pe86i$3m8$1@pilot.njin.net>
Hello -
dave4000@my-deja.com writes:
>I have the following problem.
>$number1=25;
>$number2=26;
>print "Enter the value of x: ";
>$x = <>;
>chop $x;
>$temp = $number.$x;
>print $temp;
>I want the user to input the value of x and if 1 is input the value 25
>will be displayed, if 2 is input then the value 26 is displayed.
>I have tried concatinating the values but this only appears to
>work for strings!!
if ($x == 1) { print 25 }
if ($x == 2) { print 26 }
Do you like it? I call it "Homage a` Abigail" :-)
Anyway...
What you're looking for are symbolic references. You'll find some very
informative reading on the reasons *not* to do this in the FAQ; see
http://language.perl.com/newdocs/pod/perlfaq7.html if you can't find it
on your system.
You'd be better off using a hash, which by design gives you the kind
of association you're looking for.
David Black
--
David Alan Black blackdav@shu.edu or dblack@pilot.njin.net
Associate Professor Seton Hall University
Department of Communication South Orange, NJ 07079
http://pirate.shu.edu/~blackdav includes Syllabus Markup Language (SyML)
------------------------------
Date: Wed, 18 Aug 1999 13:01:05 +0200
From: Benoit DOLEZ <bdolez@novecom.fr>
Subject: mod_perl / DBI : looking for a simple exemple
Message-Id: <37BA9271.2C0B9F20@novecom.fr>
Hi,
I work with Apache and MySQL.
I'm looking for an exemple of httpd.conf and perl cgi.
My current configuration does no work properly:
------------------------- httpd.conf ----------------------
.......
PerlModule Apache::DBI;
PerlModule Apache::DebugDBI;
.......
<Location />
SetHandler perl-script
PerlHandler Apache::Registry
Options All
PerlSendHeader On
</Location>
----------------------------------------------------------
------------- a required file : db.pl ------------------
use DBI;
sub TestConnect {
$DB = {};
eval { $DB->{dbh} = DBI->connect("DBI:mysql:Test")} || die ("Can't connect");
}
1;
-----------------------------------------------------------
---------------- index.cgi -------------------------------
# use strict;
use Apache;
use DBI;
require "db.pl";
# sub handler
{
&TestConnect();
my $r = Apache->request;
$r->content_type("text/html");
$r->send_http_header;
$$DB->{dbh}->prepare("SELECT * FROM Tests")
...
}
------------------------------------------------------------
Then, SOMETIMES, I have the Apache Error :
[Wed Aug 18 12:34:33 1999] [error] Undefined subroutine &Apache::ROOTtest::index.cgi::TestConnect called at ...
When I unquote the "use strict" directive and unquote the "sub handler" I ve the error
[Wed Aug 18 12:56:29 1999] [error] Undefined subroutine &Apache::ROOTtest::index_2ecgi::handler called at
/usr/lib/perl5/site_perl/Apache/Registry.pm line 135.
Thanks
Benoit
------------------------------
Date: Wed, 18 Aug 1999 11:51:48 GMT
From: vod@writemail.com
Subject: newbee
Message-Id: <7pe6og$oh8$1@nnrp1.deja.com>
i am new to perl i am trying to
run a perl script
but the prob is i cant connect the web server
and the script to act togather
i am working on a stand alone pc using win 95
using active perl 5. and omni httpd serer
is there a specific order i which u must intall
the perl 1st and them the server or it dosent matter
the thing is when i want the form to run the perl script
it just runs the script and not on a server.
the result is the the test page opens with all the
syntax on the top with it too
i also want to knoe where should i put the ip add i have
tried 127.0.0.1 in the url line still nothing
is happening
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 18 Aug 1999 12:51:27 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: newbee
Message-Id: <j%xu3.157$u07.1320@news.colt.net>
vod@writemail.com wrote:
> i am new to perl i am trying to
> run a perl script
> but the prob is i cant connect the web server
> and the script to act togather
> i am working on a stand alone pc using win 95
> using active perl 5. and omni httpd serer
You problem is with CGI the protocol used to make web servers and scripts talk
to each other nicely. Perl is not the problem here.
Your problem sounds so generic, that it really could be any of 1000 different
causes. I would suggest that at this stage, newsgroups are not going to give
you what you want. Look instead for indepth documentation both on CGI in
general, and the omni httpd server in specific. Hopefully, the omni server
has plenty of its own documentation, which should be your first step in
solving your problems.
As a final note, although I am loth to criticise what may not be your native
language, a post with no capitals, no correct punctuation, little grammar and
poor spelling is not going to encourage anyone to answer you :-|
The more time you spend thinking about what you write, the more time others
will spend in their replies.
------------------------------
Date: Wed, 18 Aug 1999 05:24:33 -0400
From: "Harlan Carvey, CISSP" <carvdawg@patriot.net>
Subject: Re: Parent/Child Relation with Win32::Process
Message-Id: <37BA7BD1.4F9997B5@patriot.net>
Have you thought about maybe using a named pipe?
C
------------------------------
Date: Wed, 18 Aug 1999 10:29:12 GMT
From: ewulff_no@spam_compuserve.com (Eduard Wulff)
Subject: Re: PERL & EXCEL
Message-Id: <37bb6d9b.7361645@news.compuserve.com>
kilimount <kilimount@earthling.net> wrote:
>I've been trying this code under windows NT, but being a very early
>beginner in Perl, I cannot figure out what's wrong.
...
>Perl Builder's debugger is returning this line :
>Can't call method "Worksheets" without a package or object reference at
>script line 19.
I have not tried your code. I rather edited a working snippet I tried
some days ago for Word (I use version 9 of Word and Excel).
I used the WIN32::OLE module that came with my ActiveState Perl (I use
build 519).
Your code seems to be correct - Excel wise.
Check the VBA-object model on Excel objects and their methods and
properties and the ActiveState documentation on Win32.
I recomment visible=on in the developing phase <g>
This works for me:
use strict;
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Excel';
my $xlfile =q(c:\filename.xls);
# Create OLE object - Excel Application Pointer
my $Excel = Win32::OLE->new('Excel.Application') || die $!;
# Set Application Visibility
# 0 = Not Visible
# 1 = Visible
$Excel->{'Visible'} = 1;
# Open Excel File
my $workbook = $Excel->Workbooks->Open($xlfile);
# setup active worksheet
my $worksheet = $workbook->Worksheets(1);
# retrieve value from worksheet
my $cellA1 = $worksheet->Range("A1")->{'Value'};
my $cellB1 = $worksheet->Range("B1")->{'Value'};
# Close It Up
$Excel->ActiveWorkbook->Close(0);
$Excel->Quit();
print "A1: $cellA1 B1: $cellB1\n";
------------------------------
Date: Wed, 18 Aug 1999 09:01:05 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Perl Mail Client is available for download
Message-Id: <lDuu3.2238$J72.417611@news.itd.umich.edu>
A short time ago I posted an article with a description of a mail-reading
program I'd been working on: pmc, short for "Perl Mail Client".
I've wrangled the code into a form I'm not completely ashamed to have
strangers look at, so please feel free to download and review it:
http://www-personal.umich.edu/~mcafee/perl/pmc.html
For those who missed by original article, I'm appending a reasonable
facsimile of it below (I had to unmangle DejaNews's formatting).
----------------------------------------------------------------------
I've written a Perl program for the reading and sending of e-mail. I
did this because none of the e-mail packages available do everything
exactly the way I'd like. For lack of a better name, I call it pmc,
for "Perl Mail Client". I'd like to release it to the public, so I
thought I'd see if there's any interest in such a thing.
It's somewhat feature-poor at present, but quite functional; I've been
using it exclusively to read and reply to e-mail for a couple of
months now.
Features include:
o Based on the Curses package
I wanted to be able to run the program over my relatively slow
modem link from home. Anyway, I consider text interfaces to be
generally superior to GUIs.
I've composed a few simple Curses widgets, like a dialog box, for
the entering of prompted input.
o Customizable
The file ~/.pmcrc is executed (with "do") on startup if it exists.
The user may put any desired Perl code into it, such as functions
which may later be used in sorting and filtering expressions.
(To prevent namespace collisions, user code is always evaluated in
package "User".)
o Simple interface to mail header data
Whenever a new mail header field is encountered, a parameterless
function of the same name is created which returns the contents
of that header field for the current message. Filtering criteria
are entered as snippets of Perl code which are eval-ed by pmc:
From =~ /my boss/
(To.Cc) =~ /mailing-list\@majordomo/;
str2time(Date) > str2time("00:00") # show messages sent since midnight
For sorting, additional parameterless functions are created for
every header field, but with "1" and "2" appended to the name.
_Filename1 <=> _Filename2
_Date2 <=> _Date1
Subject1 cmp Subject2
(_Filename is a header pseudo-field which holds the name
of the file containing the message under consideration.
_Date is another pseudo-field which contains the result of
Date::Parse::str2time(Date).)
o Advanced sorting
One of the features I wanted to incorporate was the ability to
easily sort messages according to arbitrarily complex rules.
In my case specifically, I belong to a number of mailing lists of
low-to-medium volume, and I didn't want to let procmail just plop
each list's messages into a different folder, as it's a hassle to
move between folders and I often forget to check them regularly.
So, I needed a sorting function that would group messages according
to the criteria I specified. After a bit of work, I wrote one,
and now I have something like the following in my .pmcrc file:
$DEFAULT_SORT = q{
group(
'DEFAULT',
'From =~ /Above the Crowd/',
'(To.Cc) =~ /advocacy/',
'(To.Cc) =~ /CYHIST\@/',
'(To.Cc) =~ /Red Rock Eater/',
'_Filename2 <=> _Filename1'
)
};
First come the messages which don't meet any of the other criteria,
then messages from each of four mailing lists. The final argument
specifies how messages should be sorted within each group.
Deficiencies include, but are not limited to:
o Very limited mailbox support
...Specifically, it can only read messages already arranged into folders
and given numerical filenames, such as what is done by the likes of
MH and procmail. This makes the "Client" part of the program's name
something of a misnomer. Ah well.
o No MIME support
This was actually one of my big original goals: multipart MIME messages
will eventually be displayed in a tree format, with handlers defined for
the various MIME types (for example, running MS-Word documents through
"strings"). Not that I'm all that fond of MIME, but I get work-related
e-mail with MIME attachments so often that I've got to handle it somehow.
If this sounds like a program you might want to use, let me know.
--
Sean McAfee mcafee@umich.edu
print eval eval eval eval eval eval eval eval eval eval eval eval eval eval
q!q@q#q$q%q^q&q*q-q=q+q|q~q:q? Just Another Perl Hacker ?:~|+=-*&^%$#@!
------------------------------
Date: Wed, 18 Aug 1999 10:05:17 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: preventing multiple posts
Message-Id: <37be7aeb.5426425@news.skynet.be>
Peter van Tienderen wrote:
>I am quite new to Perl. I am trying to prevent duplicate entries in a bbs,
>due to forms being submitted more than once.
>Sometimes a get 3-5 duplicates however, with no other messages in between.
>I suspect that it has to do with the $oldmessage being read from an old
>buffer of the previous dub file??
It could be that the people change just ONE character, and it's a
"different" post.
An approach I would take, is generate a unique session ID, encode it as
a hidden variable in the form, and only accept the post if the session
ID hasn't been used yet. For the session ID, try combining the current
date (in seconds) and the process ID $$, plus do sleep(1) on order to
hang on to that process ID for at least a second. Either temporarily
store it in a "database" on your server, so you can check if it's a real
session ID, or build in some checks (CRC, length, ...).
If people want a new post, they simply have to reload the form. It will
clear the contents, too.
> $dubfile = $pbbs."dub";
> open(DUB, "+<$dubfile") || die "Content-type: text/plain\n\n Could not open
>$dubfile\n";
> flock(DUB,2) || die "Content-type: text/plain\n\n Could not lock
>$dubfile\n";
> $oldmessage = <DUB>;
Is that the whole file? Or just one line?
> $newmessage = $FORM{'afzender'}.$FORM{'inhoud'};
> ¬published if $oldmessage eq $newmessage; # and exit
> seek(DUB, 0, 0); # probably not needed..
> truncate(DUB, 0);
It will clear the file, after you've read it. If you don't do it, the
new message will be appended to the old file.
> print DUB $newmessage;
> close DUB;
># and continue adding the message
If I understand correctly, you're using ONE file to check all
duplicates. What if two people post intermittantly? Will one's post
erase the other one's duplicate check?
Bart.
------------------------------
Date: Wed, 18 Aug 1999 12:40:11 GMT
From: ksumi@my-deja.com
Subject: Problem running CGI script
Message-Id: <7pe9j9$ql7$1@nnrp1.deja.com>
Hi world,
I am new to the perl world and I have problem in running my CGI script.
It goes this way.
I have a html program which has a aref link to a cgi script.
The cgi script is supposed to display a html file.
The problem is .html files are showing as HTMl source rather than being
formatted.
I am running MicrosoftPWS on windows 98.
My perl is under c:\per\bin ( frm activestate.com )
My script is under //localhost/cgi-bin ( which is c:
\inetpub\wwwroot\cgi-bin )
My calling HTML file is under //localhost ( c:\inetpub\wwwroot ).
Am I missing out something. I am able to run normal cgi scripts
( reading a file etc ) at the command prompt.
My first print statement in the script ofcourse says the mime-type
/text/html.
Do I need to set something in my web browser ( IE 4.0 ).
Kindly help.
Thanks
Sumathi
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 18 Aug 1999 11:15:34 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Q:Two perl programs printing to one txt file
Message-Id: <7pe4km$5s8$1@lublin.zrz.tu-berlin.de>
Larry Rosler <lr@hpl.hp.com> wrote in comp.lang.perl.misc:
>In article <7pco42$o5f$1@nnrp1.deja.com> on Tue, 17 Aug 1999 22:35:47
>GMT, danmex@my-deja.com <danmex@my-deja.com> says...
>...
>> I understand I must use some locking mechanism, and a new question
>> comes to mind: what is a good/correct way for one of the programs "to
>> wait" until the file is unlocked? A while-loop? A sleep?.
>
>`perldoc -f alarm` has a good example for how to wait with a timeout.
>
>> And another: Is there any way for the programs to "get in line"? I.E.:
>> Program 1 is writing, program 2 is waiting and enters a whileloop,
>> program 3 is also waiting and entes a whileloop. I'd like program 2 to
>> get at the file first, but the whileloop does not guarantee program 3
>> will let that happen?
>
>I can't think of a way without storing some sort of state information in
>the filesystem, which seems very expensive in a high-volume environment.
He might use a dedicated writer demon, fed either through SysV IPC
(whose message queues have a priority mechanism) or through sockets
(and do the prioritizing right there).
Anno
------------------------------
Date: Wed, 18 Aug 1999 12:24:42 GMT
From: ksumi@my-deja.com
Subject: Running perl script from HTML - Problem
Message-Id: <7pe8lv$q11$1@nnrp1.deja.com>
Hi World,
I am a novice for perl.
I have a html which has a aref to a perl script.
This perl script creates a simple html document
The script looks like this
printf("Content-type: text/html\n\n ");
<HTML>
<BODY>
Hello, World!</BODY></HTML>
Problem is : when the script is invoked by
clicking on the link , HTML doc is not creatd
instead the code is displayed as
a plain text in the browser.
I am using win 98 and have Microsoft PWS
installed.
My perl is in my c:\perl\bin
My script is in \\localhost\cgi-bin (which is
c:\inetpub\wwwroot )
The html program which has a reference to the
script is under \\localhost directory.
Please Help
Thanks
Sumathi
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 18 Aug 1999 12:58:11 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: Running perl script from HTML - Problem
Message-Id: <D5yu3.158$u07.1320@news.colt.net>
ksumi@my-deja.com wrote:
> I am a novice for perl.
> Problem is : when the script is invoked by
> clicking on the link , HTML doc is not creatd
> instead the code is displayed as
> a plain text in the browser.
This is a CGI problem, not a Perl problem. In fact, you Perl program never
runs at all. You should read the documentation for PWS, which should tell
you about CGI programs, and how to run programs such as your Perl script
from the web browser.
If you still can't get it working, you should search the internet for help
on Win98, PWS, and CGI, but not Perl. Only when your Perl program is being
run, and it gives you errors, then you need help with Perl :-)
------------------------------
Date: Wed, 18 Aug 1999 11:22:18 GMT
From: Norman Crooks <argyrodes@sympatico.ca>
Subject: shell script translation
Message-Id: <37BA9ADF.E731DFA9@sympatico.ca>
Hello Perl Group,
Can someone help me convert this short shell script into a perl script?
#!/bin/sh
echo "Content-Type: text/html\n\n"
HOME="/server/www/homepage"
export HOME
echo $HOME
echo "<h1>test\n\n</h1>"
/server/www/homepage/.pgpdir/pgp -eatw
/server/www/homepage/cgi-bin/filename.txt Stricker 2>&1
#/usr/local/bin/perl -e '`/server/www/homepage/.pgpdir/pgp -eatw
/server/www/homepage/cgi-bin/filename.txt Stricker`' 2>&1
echo
I know nothing about perl, but I do know that the pgp executable has to
know that it is in "/server/www/homepage" to be able to find all it's
files.
I thought the perl command for this should look like $ENV{HOME} =
"/server/www/homepage", but I couln't get this to work.
Any help much appreciated.
-Norm
argyrodes@nospamsympatico.ca
------------------------------
Date: Wed, 18 Aug 1999 08:43:53 -0400
From: Tom Kralidis <tom.kralidis@ccrs.nrcanDOTgc.ca>
Subject: Re: shell script translation
Message-Id: <37BAAA89.33C31181@ccrs.nrcanDOTgc.ca>
If you know nothing about Perl, why would you want to have this
converted? How would you be able to debug, etc.?
Advice: learn (something about) Perl, and give it a go, rather than dump
this to the group. You'll find that it's not that complicated to make
your script into Perl.
..Tom
Norman Crooks wrote:
>
> Hello Perl Group,
>
> Can someone help me convert this short shell script into a perl script?
>
> #!/bin/sh
> echo "Content-Type: text/html\n\n"
> HOME="/server/www/homepage"
> export HOME
> echo $HOME
> echo "<h1>test\n\n</h1>"
> /server/www/homepage/.pgpdir/pgp -eatw
> /server/www/homepage/cgi-bin/filename.txt Stricker 2>&1
> #/usr/local/bin/perl -e '`/server/www/homepage/.pgpdir/pgp -eatw
> /server/www/homepage/cgi-bin/filename.txt Stricker`' 2>&1
>
> echo
>
> I know nothing about perl, but I do know that the pgp executable has to
> know that it is in "/server/www/homepage" to be able to find all it's
> files.
>
> I thought the perl command for this should look like $ENV{HOME} =
> "/server/www/homepage", but I couln't get this to work.
>
> Any help much appreciated.
> -Norm
> argyrodes@nospamsympatico.ca
--
-----------------------------------------------------------------------------------------
Tom Kralidis Geo-Spatial Technologist
Canada Centre for Remote Sensing Tel: (613) 947-1828
588 Booth Street , Room 241 Fax: (613) 947-1408
Ottawa , Ontario K1A 0Y7 http://www.ccrs.nrcan.gc.ca
-----------------------------------------------------------------------------------------
------------------------------
Date: Wed, 18 Aug 1999 05:23:35 -0400
From: "Harlan Carvey, CISSP" <carvdawg@patriot.net>
Subject: Re: SNMP module
Message-Id: <37BA7B97.498F78A8@patriot.net>
Try using the Net::SNMP module from CPAN. It doesn't
require the snmp utils, and you don't have to 'make' anything.
C
------------------------------
Date: 18 Aug 1999 10:07:33 GMT
From: erwanpia@aol.com (ErwanPia)
Subject: Sybperl and BCP
Message-Id: <19990818060733.00343.00000986@ng-cg1.aol.com>
Hi,
We are using Sybase DBlib module for PERL 5.
We need to do a BCP from within PERL. It is easy but I haven't found out if
there is a function that performs a BCP straight from a file (as opposed to
from a PERL list or array), that would avoid the few lines that open and read
the file...
Is there such a magical function ?
Thanks everyone,
Erwan Pianezza, Dublin.
------------------------------
Date: Wed, 18 Aug 1999 14:20:32 +0200
From: Aydin Ucar <aucar@netas.com.tr>
Subject: Tab range extension
Message-Id: <37BAA510.DDDCA7AD@netas.com.tr>
Does anyone know how to manage tab extension, I tried to
extend tab character long as use double
\t\t; but didn't work. It jumped at when it is reached to fix 8
digits long as default...Wheras I want to use Tab as 12 character
long...
--
AydIn Ucar
SDE Support
ESN 882-2249
PHONE +90 216 5222249
------------------------------
Date: Wed, 18 Aug 1999 11:41:18 +0200
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
Subject: Re: what does eq do on lists?
Message-Id: <37BA7FBE.D5F2BC@gmx.net>
Sam Holden wrote:
>
> Or you could use join() to create the strings to compare, but
> then you have the problem of what to use as the first argument to
> join, so you don't get any collisions.
$; might be a value to start with, since \034 is unlikely to occur in
data.
Cheers,
Philip
------------------------------
Date: Wed, 18 Aug 1999 10:05:12 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: what does eq do on lists?
Message-Id: <37bd776c.4531367@news.skynet.be>
John M. Dlugosz wrote:
>The expression
> @a[0..3] eq @b
>doesn't do what I thought it would. It's not a compile-time error, either.
>So what does it do, if not compare all four strings?
"eq" forces a scalar context on the arguments. scalar @b is the number
of elements in @b, and scalar @a[0..3] is, er... $a[3] !?!? (Yeah, I
know, slice -> list). Those values are converted to strings, and those
are compared.
$\ ="\n";
@a = ('A'..'C', 4, 'D'..'Z');
@b = ('a'..'d');
print scalar @a[0..2];
print scalar @b;
print @a[0..3] eq @b?'same':'diff';
->
C
4
same
A trick that has been mentioned before is setting $" to a character that
isn't part of any string, and compare the arrays double-quoted:
$\ ="\n";
@a = ('A'..'Z');
@b = ('A'..'D');
$" = "\0";
print "@a[0..3]" eq "@b"?'same':'diff';
Bart.
------------------------------
Date: Wed, 18 Aug 1999 10:39:02 GMT
From: jrt915@hotmail.com
Subject: Re: What editors are folks using for PerlScript development?
Message-Id: <7pe2g5$loh$1@nnrp1.deja.com>
I use VIM for just about all text editing in windows. VIM is VI, only
with some extra bells and whistles - most of which I haven't explored a
whole lot yet.
I agree that VI is a bit tough to learn at the start, but once you learn
the keyboard shortcuts to all of its commands, you wonder what you ever
did without it.
The web site for VIM is http://www.vim.org.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 18 Aug 1999 10:57:28 GMT
From: dave4000@my-deja.com
Subject: Re: What editors are folks using for PerlScript development?
Message-Id: <7pe3il$mgs$1@nnrp1.deja.com>
In article <7pe2g5$loh$1@nnrp1.deja.com>,
jrt915@hotmail.com wrote:
> I use VIM for just about all text editing in windows. VIM is VI, only
> with some extra bells and whistles - most of which I haven't explored
a
> whole lot yet.
>
> I agree that VI is a bit tough to learn at the start, but once you
learn
> the keyboard shortcuts to all of its commands, you wonder what you
ever
> did without it.
>
> The web site for VIM is http://www.vim.org.
>
> I am currently using Winperl for Win32 (freeware)!
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 18 Aug 1999 10:29:12 GMT
From: ewulff_no@spam_compuserve.com (Eduard Wulff)
Subject: Re: Working with Win32 Network API
Message-Id: <37ba60b7.4061399@news.compuserve.com>
"End User" <kimntodd@dontspamus.execpc.com> wrote:
>Does anyone know where there is a "great" reference that deals with how to
>use the API from within perl?
> MCSE
MSDN
or
Dan Appleman "VB6 Guide to the Win32 API" for more cookbook like
approach
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 572
*************************************