[13275] in Perl-Users-Digest
Perl-Users Digest, Issue: 685 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 31 07:09:52 1999
Date: Tue, 31 Aug 1999 04:05:08 -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 Tue, 31 Aug 1999 Volume: 9 Number: 685
Today's topics:
Re: Beginner question <dave@dave.org.uk>
Re: Developer: Web & SGML (Brighton, UK) <michiel.verhoef@wkap.nl>
Re: essentially; making a long file name into a 8.3 fil <kin@0011.com>
Re: essentially; making a long file name into a 8.3 fil <kin@0011.com>
Re: essentially; making a long file name into a 8.3 fil <wyzelli@yahoo.com>
Re: File listing (Sam Holden)
Re: HASH ? (Sam Holden)
Re: Help! Redirection problem <rolf.raven@quantis.nl>
how can i run a exe thru' perl cgi thru' html..?. kalakala@my-deja.com
Re: in very need of help with MySQL module <eyounes@aol.com>
Re: Need "Universal" exporter.pm File <jrmaiocchi@home.com>
newbie : POST <sebastian@netgallery.net>
Re: Perl Y2K Bugs on the Internet (Bart Lateur)
Re: regex bug: (?:\d{3})+ loses count (Bart Lateur)
Re: Request for Comments: www.perl.com (David Cantrell)
Re: Searching with 2 input fields <kistler@gmx.net>
shmget - is locking required? <eivind@solbors.no>
Simple question about if statement <mboertien@my-deja.com>
Re: Simple question about if statement <Mark@Mark.Com>
Re: Sockets et al (Lars Gregersen)
Re: Sockets et al <kistler@gmx.net>
System command runs from command line, not from browser rocknclint@my-deja.com
Re: System command runs from command line, not from bro (Sam Holden)
test, please ignore <peterw@innate.co.uk>
test, please ignore <peterw@innate.co.uk>
Re: write to a file in a loop (Anno Siegel)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 31 Aug 1999 10:28:27 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Beginner question
Message-Id: <IaDLN6ItxlG7EI3pR9FYe6RXO6dg@4ax.com>
On Tue, 31 Aug 1999 08:01:48 +0200, "Koopa One"
<koopa1@unforgettable.com> wrote:
>Im new to Perl and CGI, so here's a question for you professionals:
>
>My ISP doe not allow CGI or PERL Scripts on the Server. He told me to use
>the program perl2exe, it compiles Scripts to executeable files.
>
>But how do i use this program ?
>How do i have to modify the scripts ?
You should seriously consider changing your ISP.
Dave...
--
Dave Cross <dave@dave.org.uk>
<http://www.dave.org.uk>
------------------------------
Date: Tue, 31 Aug 1999 12:53:20 +0200
From: Michiel Verhoef <michiel.verhoef@wkap.nl>
Subject: Re: Developer: Web & SGML (Brighton, UK)
Message-Id: <37CBB420.5E35DBC2@wkap.nl>
> Richard Padley wrote:
> >
> > Here are RDP Computing (http://www.macpress.co.uk) we are currently
>
> doh! either he's a very fast web designer or maybe should have checked
> if the Url works first!
That's why they needed the developer :-D
Cheers,
Michiel
------------------------------
Date: Tue, 31 Aug 1999 01:18:09 -0700
From: Kin Lum <kin@0011.com>
Subject: Re: essentially; making a long file name into a 8.3 filename..
Message-Id: <37CB8FC1.1FFCD08@0011.com>
Wyzelli wrote:
> what about :
> thislongfilehello
> thislongfilehell0
> thislongfilehello1
>
> etc?
well? so what about them? what is it on your mind?
I tried them and they worked. Note that this is
not supposed to handle filename conflicts, in case
two or more filenames, after converting, collide.
Is this what you are thinking about? I think it is
more polite if you address your concern at least with
a bit detail.
------------------------------
Date: Tue, 31 Aug 1999 01:37:18 -0700
From: Kin Lum <kin@0011.com>
Subject: Re: essentially; making a long file name into a 8.3 filename..
Message-Id: <37CB943E.30C574EE@0011.com>
Larry Rosler wrote:
> > thislongfilehello => thislong.llo
>
> Using the last three characters as the extension makes more sense to me
> than using the ninth through the eleventh characters.
Hm, i guess in this case, it depends. like
thislong.fil probably conveys more than thislong.llo
does.
> > hello => he.llo
>
> For creating 8.3 where there is no extension, why should a shorter name
> be treated differently from one with nine or more characters?
Because I think the intention is to preserve the
filenames, as original as possible. Only if the
filenames are too long should we "tweak it". If
it is describable by 8.3, why change it?
> > .c => .c
> > .cshrc => _cs.hrc
> > .cshrc123456789 => _cshrc12.789
>
> It now produces '.csh' for the last two above.
Yes, i think it depends on the interpretation.
To me, _cshrc would make more sense in preserving
the hidden files' names.
Nice meeting you Larry.
------------------------------
Date: Tue, 31 Aug 1999 18:56:32 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: essentially; making a long file name into a 8.3 filename..
Message-Id: <bdNy3.3$Mc5.433@vic.nntp.telstra.net>
Kin Lum <kin@0011.com> wrote in message news:37CB8FC1.1FFCD08@0011.com...
> Wyzelli wrote:
> > what about :
> > thislongfilehello
> > thislongfilehell0
> > thislongfilehello1
> >
> > etc?
>
> well? so what about them? what is it on your mind?
> I tried them and they worked. Note that this is
> not supposed to handle filename conflicts, in case
> two or more filenames, after converting, collide.
>
> Is this what you are thinking about? I think it is
> more polite if you address your concern at least with
> a bit detail.
Well if you think it would be a good practice to parse a directory which
contained several different versions of a file, and rename them all to the
same thing, well that is your lookout, but how do you know which version is
the one you have left?
At least I got you thinking.
Wyzelli
(look.. no syntactically incorrect sig!)
------------------------------
Date: 31 Aug 1999 07:18:47 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: File listing
Message-Id: <slrn7sn0g0.1mm.sholden@pgrad.cs.usyd.edu.au>
On 31 Aug 1999 02:04:10 -0400, meow <meowing@banet.net> wrote:
>Abigail <abigail@delanet.com> wrote:
>
>
>> {} opendir(DIR, $dirtosearch) or die $!;
>> {} my @messofiles = grep { /$findwhat/ && -f "$dirtosearch/$_" } readdir(DIR);
>> {} closedir(DIR);
>
>> The problem with that is that it will return files with names like
>> ".foo.txt", which aren't matched by the shell "*.txt" wildcard.
>
>There's definitely not consensus on whether dot-files should be left
>out by default. It doesn't even hold across Unix versions, let alone
>the other stuff out there.
Which version of sh included dot-files in a * wild-card expansion?
>> specially not in this case, where the obvious Perl alternative is
>> wrong.
>
>It's not at all clear that dot files should be hidden.
It is to most unix users, who would be amazed to find the dozens of
files they have gathered in their home directory over the years without
realising it...
Shell globbing ignores them, ls ignores them by default. Under unix you
aren't going to see them without trying...
--
Sam
I would like to tell you that Perl is simple in its complexity. But some
people won't understand that. So pretend I didn't say that, unless you
do. --Larry Wall
------------------------------
Date: 31 Aug 1999 07:15:00 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: HASH ?
Message-Id: <slrn7sn08u.1mm.sholden@pgrad.cs.usyd.edu.au>
On Tue, 31 Aug 1999 05:43:16 GMT, tvn007@my-deja.com <tvn007@my-deja.com> wrote:
>Hello,
>
>I am new to PERL, and not sure how to solve this problem.
>Would someone please give me some hints ?
>Here is the problem:
>I have a file called "FILE1"
>with the following data in it:
>
>Name Formula1 Formula2
>
>A "x+y" "x+1"
>C "z+y" "y+2"
>
>and other file call "FILE2"
>with the follwoing data in it:
>
>x 2
>y 5
>z 3
>
>The question I have is:
>What technique should I use so that I can have the output :
>
>Name Formula1 Formula2
>
>A 7 3
>C 8 7
Parse the formula file creating an expression tree... Sub the values
into the expression tree, and walk it. I would suggest looking up any
reasonable compiler text-book (just the first few chapters should
cover this).
Alternatively write the Formula as chunks of perl code and eval them. You
could use s// to replace simple values - though it won't scale well.
--
Sam
I for one can hardly wait for that blessed day: 0/1/100. :-)
-- Tom Christiansen in <374b4a3f@cs.colorado.edu>
------------------------------
Date: Tue, 31 Aug 1999 11:16:32 +0200
From: Rolf Raven <rolf.raven@quantis.nl>
Subject: Re: Help! Redirection problem
Message-Id: <37CB9D70.2FAF3E65@quantis.nl>
Daphne Lim wrote:
>
> Hi, i have a perl script that captures data from an html page (a form),
> after which i need to post the collected data to another perl script,
>
> META HTTP-EQUIV='Refresh'
> CONTENT='2;URL=http://blah.blah.blah/myperl.perl'
What this META tag does, is change the location of the browser. What
you want, is the form to be submitted. Your form should include a
submit button, or at least a Submit() function.
<form method="post" action="myperl.pl">
<input type="text" name="blah">
<input type="submit">
</form>
------------------------------
Date: Tue, 31 Aug 1999 10:05:38 GMT
From: kalakala@my-deja.com
Subject: how can i run a exe thru' perl cgi thru' html..?.
Message-Id: <7qg9de$avu$1@nnrp1.deja.com>
Hello all,
Already i posted a question asking a doubt that how can i create a o/p
file thru' web.
Actually i've a 'C' program for some calculation and finally it
has to create a output file with the result.I made it as a exe file and
now i want to call the c exe from the perl cgi program.
for that i wrote
......
......
open (PRG, "|a.out") || die "content-type:text/plain\n\nError:$!
\n";
print "Opened a pipe to a.out\n";
#the following four lines are the input values to the c exe.
print PRG "1\n";
print PRG "samp\n";
print PRG "1\n";
print PRG "test.out\n";
close (PRG);
print "Done!";
......
......
and named the file as call.cgi
If i run the call.cgi from the prompt by giving
perl call.cgi
means it is nicely executing the C exe and create the output file in
the
current dir.
but if i call that cgi program from a html it doesn't execute
the
C exe,also it doesn't show any errors.
Actually i run this program with root access and i changed the
file mode as 777 ie, executed by all.But still it is not working.
I've done the C prgm. successfully,b'cos of that problem my
project is incomplete.
So kindly help me.
If i get the reply i'll be thankful to you.
Awaiting for ur reply.
-kala
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 31 Aug 1999 10:23:58 +0200
From: "Ysteric's" <eyounes@aol.com>
Subject: Re: in very need of help with MySQL module
Message-Id: <7qg3a8$m31@news.vtcom.fr>
Just download it from CPAN
gunzip, tar xvf ...
perl Makefile.PL
make
make test
make install
that's all
Eric
------------------------------
Date: Tue, 31 Aug 1999 08:18:42 GMT
From: "John R. Maiocchi" <jrmaiocchi@home.com>
Subject: Re: Need "Universal" exporter.pm File
Message-Id: <37CB908E.7309E44C@home.com>
This is a multi-part message in MIME format.
--------------8A6A5BC1ACCD7B2CAF7B72A7
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Thanks for replying so quickly to my message. I will consult with my friend
as I must have gotten something wrong. Thanks again.
John
Eric Bohlman wrote:
> John R. Maiocchi (jrmaiocchi@home.com) wrote:
> : Looking for exporter.pm file. For a friend and I don't know what
> : version. Needs to have security that will enable IP banning?
>
> Huh? exporter.pm is part of the standard Perl distribution; any machine
> that doesn't have it has a broken installation. But it has nothing
> remotely to do with anything like "IP banning"; it's concerned with
> making variables declared in one package visible in other packages.
--------------8A6A5BC1ACCD7B2CAF7B72A7
Content-Type: text/x-vcard; charset=us-ascii;
name="jrmaiocchi.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for John R. Maiocchi
Content-Disposition: attachment;
filename="jrmaiocchi.vcf"
begin:vcard
n:Maiocchi;John R.
tel;pager:(714)506-9772
tel;work:(714)998-1111 xt.2725
x-mozilla-html:FALSE
url:http://www.smscorp.com
org:SMS Software Solutions / First American Financial Corp.;Support Development
adr:;;1004 West Taft Avenue;Orange;CA;92865-4121;USA
version:2.1
email;internet:jrmaiocchi@home.com
title:Manager, Support Services and Technologies
fn:John R. Maiocchi (Home)
end:vcard
--------------8A6A5BC1ACCD7B2CAF7B72A7--
------------------------------
Date: Tue, 31 Aug 1999 12:18:42 +0200
From: "Sebastian" <sebastian@netgallery.net>
Subject: newbie : POST
Message-Id: <7qgafu$16$1@serv1.iunet.it>
Hello,
I need a script that gets some data from an HTML page (via POST), proccess
it and send this data to an ASP page (via POST) situated in another server.
The problem is that the script work must not be seen. I mean :
the user clicks submit in the first page -
(the script is executed - it gets the posted data - it proccess the
data - it post the new data to the server where the ASP page exits)
the user sees the ASP page -
(the ASP proccess the data and calls an HTML page defined by me (it send
via GET some info telling me if it's all ok or not) - the ASP page can be
viewed only if I pass to it (via post) the correct data)
my questions:
0- Is it possible to POST data from one script to another ?
1- Is it possible to POST data to a page and load it in the browser without
user intervention ?
2- Am I a terrible english-speaker? YES.
Grazie!
------------------------------
Date: Tue, 31 Aug 1999 07:50:19 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl Y2K Bugs on the Internet
Message-Id: <37d08911.3122925@news.skynet.be>
Larry Rosler wrote:
> The structure definition in the <time.h> header file is:
>
> struct tm {
> ...
> int tm_year; /* year - 1900 */
> ...
>
>Comments on the selected lines:
>tm_year: I have no evidence to support Bart's dismissive statement
>about 'nonsense is nothing but a backward compatible patch.' I know of
>no document that shows 'tm_year was intended to return the year in 2
>digits.' Accusing Dennis Ritchie and Ken Thompson of short-sighted
>dumbness -- and the rest of us of chicanery -- is rather offensive, and
>perhaps an apology is in order.
Perhaps.
I can only think of three reasons for making tm_year behave that way.
* Trying to make tm_year fit into a byte. I've never heard of a C where
int is a byte.
* Trying to fit the year in two characters. That's what the Y2K
troubles with Cobol are related to.
* Trying to return the year in two digits.
I vote for #3.
What would you rather have me accuse people of, dumbness, or
maliciousness? That they did it just to annoy us? Your comment on tm_mon
seems to point towards some dumbness, too.
Let's just call it a buggy design, shall we? Unfortunate, in any way.
And I must admit that this hack is a very clever one.
--
Bart.
------------------------------
Date: Tue, 31 Aug 1999 07:04:11 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: regex bug: (?:\d{3})+ loses count
Message-Id: <37cc7d40.98150@news.skynet.be>
Bart Lateur wrote:
> ($good = $_) =~ s/(\d)(?=(?:\d\d\d)+(?!\d))/$1,/g;
> print "Good: $good\n";
> ($bad = $_) =~ s/(\d)(?=(?:\d{3})+(?!\d))/$1,/g;
> print "Bad: $bad\n";
>-->
> Good: 1,234,567,890
> Bad: 1,2,3,4,5,6,7,8,9,0
Apparently, my "latest" Perl versions are not so recent. I only upgraded
a few months ago. Bloody upgraditis!
Both my DOS and Activestate perls are 5.00502. In the meantime, I've
tried it on a few other systems as well, and the bug show up in 5.00502
on Solaris as well.
From the responses, I gather that it must have been fixed. Oh, and I've
tried a few 5.004's, including 5.00404 on BSD, and the "latest" MacPerl
(also 5.004 something :-/), and it doesn't happen there.
So, it's a recent bug, and a shortlived one.
--
Bart.
------------------------------
Date: Tue, 31 Aug 1999 09:01:39 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Request for Comments: www.perl.com
Message-Id: <37cb996d.316544757@news.insnet.net>
On Fri, 27 Aug 1999 15:34:21 GMT, pudge@pobox.com (Chris Nandor) said:
>Regardless of how useful it would be, there is such a thing as a private
>news server. It doesn't have to be available to all of Usenet to be a
>newsgroup.
Private news servers are a Bad Idea, as many commonly used news
clients are a right pain in the backside to configure for using more
than one server*. Yeah, I know, that situation sucks, but that's the
way it is.
* - one of the commonest, Netscape, is a pain to configure for just
ONE news server ... :-)
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Mon, 30 Aug 1999 23:45:21 +0200
From: Per Kistler <kistler@gmx.net>
Subject: Re: Searching with 2 input fields
Message-Id: <37CAFB71.2586041F@gmx.net>
>$searchstr = "$in{'year'}, $in{'model'}";
>....
>@results = grep(/$searchstr/,@mydata);
>$found = 0;
>if ($#results >= 0) {
> foreach $i (@results) {
> chomp($i);
> ($year,$model,$num,$width) = split(/\|/,$i);
> if ($year, $model =~ $searchstr) {
Hi
The last match seems to be strange. For example it
could be:
$weHave = "$year, $model";
if ( $weHave =~ /$searchstr/ )
or
if( $weHave =~ /\Q$searchstr/ ) # if it's taken to be literal
or why not:
if( $in{'year'} eq $year and
$in{'model'} eq $model ){
}
I hope this helps, Per.
--
Per Kistler kistler@fnmail.com / kistler@gmx.net
------------------------------------------------------------
------------------------------
Date: Tue, 31 Aug 1999 10:27:30 +0200
From: Eivind Trondsen <eivind@solbors.no>
Subject: shmget - is locking required?
Message-Id: <37CB91F2.CC0687D3@solbors.no>
Hi all
I have some code that write chuncs to shared memory via SystemV IPC, the
shmget and shmread system calls. The data I read is up to 128K in size,
and I have implemented some sort of locking using semaphores. My
question is this;
Is locking really necessary? What will happen if two processes read and
write the same segment at the same time. I have been starting to wonder
wether shmread is an atomic operation, in which case I can trash all my
semaphores and get rid of a lot of headaches.
Any insight much welcome.
--
Eivind Trondsen SOL Børs AS
Systemansvarlig http://www.solbors.no
Tlf 22 11 35 14 Fax 22 11 35 13 Mob 970 44 324
------------------------------
Date: Tue, 31 Aug 1999 09:24:51 GMT
From: Nostradamus <mboertien@my-deja.com>
Subject: Simple question about if statement
Message-Id: <7qg70t$9c4$1@nnrp1.deja.com>
I have a small question. I have a certain code which i want to check
for different values but i don't want to write the following :
if ($code == 10 || $code==20 || $code==30 etc.....)
So i was wondering if it is possible to do this an easier way
(similair like code IN (10,20,30) in sql or something (if perl has
something like that)
Thanks in advance
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 31 Aug 1999 11:42:23 +0100
From: Mark <Mark@Mark.Com>
Subject: Re: Simple question about if statement
Message-Id: <37CBB18F.79BA6D9C@Mark.Com>
>
> So i was wondering if it is possible to do this an easier way
> (similair like code IN (10,20,30) in sql or something (if perl has
> something like that)
>
Try
perldoc perlfaq4 and look for:
How can I tell whether an array contains a certain element?
The tiny_prime example is the one you want:
Essentially you create a hash with the range variables you want as
keys and their values equal to one, you check the values
to see if the key has been 'defined'
------------------------------
Date: Tue, 31 Aug 1999 07:39:14 GMT
From: lg@kt.dtu.dk (Lars Gregersen)
Subject: Re: Sockets et al
Message-Id: <37cb8635.687369452@news.dtu.dk>
On Mon, 30 Aug 1999 17:02:07 -0400, "Alex R.M. Turner"
<musicmaker@armt.yi.org> wrote:
> This message is in MIME format. The first part should be readable text,
> while the remaining parts are likely unreadable without MIME-aware tools.
Why don't you simply stick with readable text and skip the unreadable
part as it adds nothing to your post (except extra bytes).
>Let me ask a simple question... Is it possible to write a TCP based server
>in PERL without recoding the wheel that deals with multiple sockets and
>uses the same variable base. Forking is fine, but how do I access the
>variables in the parent process? Is there a good answer to this? I would
>be fine just polling the damn things, but my file handle seems to go out
>of scope and get GCed or something because the socket closes right away.
Look at the examples in IO::Select
Lars
------------------------------
Lars Gregersen (lg@kt.dtu.dk)
http://www.gbar.dtu.dk/~matlg
------------------------------
Date: Mon, 30 Aug 1999 23:50:41 +0200
From: Per Kistler <kistler@gmx.net>
Subject: Re: Sockets et al
Message-Id: <37CAFCB1.DC628EAC@gmx.net>
Hi Alex
A perl server is quite easy, if you use the right modules. There
is no need for forking. Here part of a server, to get the idea.
Basically it's from the book "Advanced Perl Programming", O'Reilly.
use strict;
use Carp;
use IO::Socket;
use IO::Select;
use Fcntl;
# Start server
# ------------
$server = IO::Socket::INET->new(
LocalHost => $localhost,
LocalPort => $server_port,
Type => $data_type,
Reuse => $reuse,
Proto => $proto,
Listen => $listen )
or confess "Could not start server on $server_port: $!";
$selector = new IO::Select;
$selector->add($server);
my $client;
while(1){
my $new_sock;
my @readables;
my $readable;
if( @readables = $selector->can_read($timeout) ){
READABLE: for $readable ( @readables ){
if( $readable == $server ){
# Accept new connection
# ---------------------
$new_sock = $server->accept();
# Autoflush and nonblocking
# -------------------------
$new_sock->autoflush();
fcntl($new_sock,F_SETFL,$flags);
# Add to selector list
# --------------------
$selector->add($new_sock);
$new_sock->print($prompt);
$dat{$new_sock}->{'inProg'} = 0; # in
gmdrapi
$dat{$new_sock}->{'getMode'} = 0; #
_cmd: GET mo
print "Added new connection $new_sock\n"
if $debug;
} else {
# Deal with client
# ----------------
processClient \$readable;
}
}
} else {
next;
}
}
close($server);
-Per.
"Alex R.M. Turner" wrote:
>
> Let me ask a simple question... Is it possible to write a TCP based server
> in PERL without recoding the wheel that deals with multiple sockets and
> uses the same variable base. Forking is fine, but how do I access the
> variables in the parent process? Is there a good answer to this? I would
> be fine just polling the damn things, but my file handle seems to go out
> of scope and get GCed or something because the socket closes right away.
--
Per Kistler kistler@fnmail.com / kistler@gmx.net
------------------------------------------------------------
------------------------------
Date: Tue, 31 Aug 1999 07:48:35 GMT
From: rocknclint@my-deja.com
Subject: System command runs from command line, not from browser.
Message-Id: <7qg1cg$5u2$1@nnrp1.deja.com>
Please help. I have a script which needs to run an alpha-numeric paging
program on the system and include parameters for the recipient and the
message. The script runs correctly when I run it from the command line
typing "perl scriptname". However when I invoke it using a browser it
fails. The server is configured correctly and executes all other scripts
perfectly. The details of the Perl version, OS, and script code are as
follows:
Perl version 5.005_03 built for MSWin32-x86-object
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-1999, Larry Wall
Binary build 518 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 13:14:00 Jun 24 1999
5.0 patchlevel 5 subversion 03
OS: WindowsNT Version 4.0 (build 1381: Service Pack 3)
Following code works from the command line, not when run from browser:
CODE:
#!/usr/local/bin/perl -w
$arg1 = "Mypager\;"; #recipient with semicolon as command line parameter
delimiter
$arg2 = "Test message..."; #pager message
$args = "$arg1 $arg2";
system (ddecmd, $args);
# prints variable values to browser for troubleshooting.
print "<html>";
print "<body>";
print " ";
print "\$? = $?\n\n \$! = $!";
print "</body></html>";
When run from the browser, the following variable values are displayed:
$? = 0 $! =
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 31 Aug 1999 08:14:06 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: System command runs from command line, not from browser.
Message-Id: <slrn7sn3no.7o2.sholden@pgrad.cs.usyd.edu.au>
On Tue, 31 Aug 1999 07:48:35 GMT, rocknclint@my-deja.com wrote:
>Following code works from the command line, not when run from browser:
>
>CODE:
>#!/usr/local/bin/perl -w
>
>$arg1 = "Mypager\;"; #recipient with semicolon as command line parameter
>delimiter
>
>$arg2 = "Test message..."; #pager message
>$args = "$arg1 $arg2";
>system (ddecmd, $args);
>
># prints variable values to browser for troubleshooting.
>
>print "<html>";
I can guess your probem from here... but this is not the correct newsgroup to
ask. This it will not be answered here.
Maybe one with 'www' and 'cgi' in its name...
Ask in a newsgroup that talks about web stuff maybe one with 'www' and 'cgi'
in its name.
--
Sam
I guess I really am an optimist. A paranoid optimist, true, but an
optimist nonetheless.
-- Larry Wall
------------------------------
Date: Tue, 31 Aug 1999 11:46:27 +0100
From: "Peter Wilkinson" <peterw@innate.co.uk>
Subject: test, please ignore
Message-Id: <936096656.6184.0.nnrp-10.c3ada081@news.demon.co.uk>
--
Peter Wilkinson
Innate
http://www.innateus.com http://www.innate.co.uk
------------------------------
Date: Tue, 31 Aug 1999 11:54:32 +0100
From: "Peter Wilkinson" <peterw@innate.co.uk>
Subject: test, please ignore
Message-Id: <936097141.6382.0.nnrp-10.c3ada081@news.demon.co.uk>
--
Peter Wilkinson
Innate
http://www.innateus.com http://www.innate.co.uk
------------------------------
Date: 31 Aug 1999 10:49:27 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: write to a file in a loop
Message-Id: <7qgbvn$qv5$1@lublin.zrz.tu-berlin.de>
Lakmal Jinadasa <lakmal@ml.com> wrote in comp.lang.perl.misc:
>Hi,
>
>I have the following problem.
>
>I open a file within a foreach loop
>then try to write some data to the file.
>
>everything goes fine except the data is not in the file.
>
>Part of the program is as follows
>
>foreach $key1(@list1)
> foreach $key2 (@list2) {
> open DAT ">File_Name";
You are not checking the result of open(). *Always* do that.
> @arr = output_of _a function;
> print DAT @arr;
> }
>close (DAT);
>}
>
>Seperate file is created for each key1.key2
>
>The files are there with 0 byte length.
It looks like @arr contains nothing, or undefined values. There's no
way of telling.
Just as a general rule, you should switch on warnings with -w and
use strict in your programs, especially when they give you trouble.
Anno
------------------------------
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 685
*************************************