[11779] in Perl-Users-Digest
Perl-Users Digest, Issue: 5379 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 14 07:07:24 1999
Date: Wed, 14 Apr 99 04:00:21 -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, 14 Apr 1999 Volume: 8 Number: 5379
Today's topics:
Another beginner question <ibrew@voyager.net>
Re: Another beginner question <gellyfish@gellyfish.com>
Anyone Have the INGROUP.EXE ? bennith@iname.com
Re: Anyone Have the INGROUP.EXE ? <gellyfish@gellyfish.com>
Best books to use... <not@gonna.tell>
CGI / IIS problem <parpaille@chez.com>
Concurrent FTP Transfers <abc@abc.com>
Re: Count Linenumber <Philip.Newton@datenrevision.de>
Re: does this directory exist <Philip.Newton@datenrevision.de>
Re: Examples of slow regexes? <staffan@ngb.se>
Re: Examples of slow regexes? (Bart Lateur)
HELP Needed with CGI-PERL on apache 1.3.3 <heroux@iutc3.unicaen.fr>
MUA with Perl <jacob_siu@cyberlink.com.tw>
Re: MUA with Perl <gellyfish@gellyfish.com>
Re: No echo on a socket connection (Christopher Allene)
Re: osdep.o source file ijg@csc.liv.ac.uk
Perl and MS Access <goesmann@do.isst.fhg.de>
Question: How to create a logfile? daniel.mueller@rsd.rsd.de
Re: Question: How to create a logfile? <gellyfish@gellyfish.com>
Re: Question: How to create a logfile? <Philip.Newton@datenrevision.de>
Re: regex - camel and llama cannot help (Eric Smith)
Registry Information <arogers@rational.com>
Re: Registry Information <gellyfish@gellyfish.com>
Re: simple perl variable assigning qu <Philip.Newton@datenrevision.de>
Re: SQL using the ODBC module chatswood@my-dejanews.com
Re: What Kind of Program should i first make? (Ran)
Whats wrong with this? billy_collins@my-dejanews.com
Re: Whats wrong with this? <gellyfish@gellyfish.com>
Re: Writing to socket from Win95 and Perl 5 (Lars Gregersen)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 12 Apr 1999 21:57:54 -0400
From: "ibrew" <ibrew@voyager.net>
Subject: Another beginner question
Message-Id: <7eu81v$sip@newsops.execpc.com>
I get an error on the following chunck of code taken directly from the
"Learning Perl" book, pages 8-9
!#c:/perl/bin/perl
@words = qw(camel llama alpaca);
I get a compile error on the second statement;
"Can't modify not in scalar assignment on line two..."
i would be thankful for any help.
------------------------------
Date: 14 Apr 1999 11:35:43 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Another beginner question
Message-Id: <37146f7f.0@newsread3.dircon.co.uk>
ibrew <ibrew@voyager.net> wrote:
> I get an error on the following chunck of code taken directly from the
> "Learning Perl" book, pages 8-9
>
> !#c:/perl/bin/perl
> @words = qw(camel llama alpaca);
>
> I get a compile error on the second statement;
> "Can't modify not in scalar assignment on line two..."
Notice the order you have the bang and the hash in the shebang line ...
! is 'not' in this context.
I dont believe they are in this order in the book.
/J\
------------------------------
Date: Wed, 14 Apr 1999 08:47:59 GMT
From: bennith@iname.com
Subject: Anyone Have the INGROUP.EXE ?
Message-Id: <7f1knu$ost$1@nnrp1.dejanews.com>
HELLO ALL, Does anyone have the INGROUP.EXE utility? this is the old Lan
manager utility, work for windows 95, for verify the the user is belongs to
particular NT domain group. If anyone have this one, pls. e-mail to me.
Greatly Appreciated
Bennith.
bennith@mail.com
bennith@iname.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 14 Apr 1999 11:14:35 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Anyone Have the INGROUP.EXE ?
Message-Id: <37146a8b.0@newsread3.dircon.co.uk>
bennith@iname.com wrote:
> HELLO ALL, Does anyone have the INGROUP.EXE utility? this is the old Lan
> manager utility, work for windows 95, for verify the the user is belongs to
> particular NT domain group. If anyone have this one, pls. e-mail to me.
>
Pray tell - I am intrigued as to what relevance this has to Perl ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Wed, 14 Apr 1999 06:17:40 -0400
From: "Doug Crabtree" <not@gonna.tell>
Subject: Best books to use...
Message-Id: <7f1q17$17c$1@camel18.mindspring.com>
I am new to perl, and am wondering where to start. I have bought a book
called "Perl5 by example (David Medinets)". It seems to be a book that will
give me a good foundation for basic use. I have heard good things and bad
things about Randall's "Learning Perl (2nd ed.)".
What is a good secondary book to get to become a more advanced programmer in
perl? Is it Randall's book?
TIA,
Dug (no use for redundant lettering)
------------------------------
Date: Wed, 14 Apr 1999 12:06:25 +0200
From: bernard menez <parpaille@chez.com>
Subject: CGI / IIS problem
Message-Id: <371468A1.EC4ACEC0@chez.com>
hi all, I'm working on a website prototype. I have a client (Win95) and
a server using WinNT and IIS.
I wrote a few CGI scripts in Perl, but can't get them to work properly :
the POST method returns a 501 http
error (not implemented), whereas the GET method returns the .PL file's
source code.
Seems like IIS does not understand how PL files are to be used.
The HTML and Perl code is not to blame, since I know everything was
working fine on a similar platform
(WinNT/IIS server) that I did not configure.
Does anybody have an idea ? Please help, I'm definitely stuck.
------------------------------
Date: Wed, 14 Apr 1999 11:27:00 +0100
From: "Richard Gordon" <abc@abc.com>
Subject: Concurrent FTP Transfers
Message-Id: <37146d7b.0@nnrp1.news.uk.psi.net>
I am using the libnet module to automate FTP transfers between different
servers on the internet. This works fine but I only transfer one file at a
time. I was wondering if anybody could help me out with any suggestions on
the best way to change my script to handle concurrent FTP transfers.
Thanks in advance
Richard Gordon
------------------------------
Date: Wed, 14 Apr 1999 11:17:27 +0200
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Count Linenumber
Message-Id: <37145D27.D500F660@datenrevision.de>
David Cassell wrote:
>
> Philip Newton wrote:
> >
> > Abigail wrote:
> > >
> > > This is the shortest code I can think of:
> > >
> > > perl -wlpe '}{$_=$.' file
> >
> > Clever. Took me a bit to figure out how it works.
>
> Yeah, the first time I saw Abigail post this line, my cerebrum
> exploded. I didn't have a Perl with debugging handy, so it took a bit
> to work it out.
I didn't use the debugger or anything because I'm not too familiar with
it. I just looked up -p in perlrun and tried to imagine what would
happen if I substitute Abigail's code for "your code goes here". Plays
*very* strange games with -p, though.
> My question: given the way this works, is it liable to become broken
> with future changes in the way Perl implelements -p ?
Not as long as it's compatible with the way it's now described in
perlrun. I was surprised it'd work, though; I assumed that the perlrun
documentation is schematic and that you couldn't necessarily take
advantage of the actual code there (e.g., inserting closing braces and
thus putting the print() outside the while(<>) loop etc.)
Cheers,
Philip
------------------------------
Date: Wed, 14 Apr 1999 11:42:21 +0200
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: does this directory exist
Message-Id: <371462FD.CE857386@datenrevision.de>
jewing@eng.utoledo.edu wrote:
>
> I found an answer, but if there is a shorter way could someone post it
> please
> John
Others have already told you about -d. Perhaps a few comments about
coding style, then.
>
> #------------------------------------------------------------------
> # This subroutin checks to see if the file past is a directory
> # It returns 1 if it is and 0 if it is not.
> #------------------------------------------------------------------
> sub check_if_dir
> {
> local ($file_name) = @_;
Do you know the difference between my() and local()? Nearly always, my()
is what you really want -- such as with all the variables here.
> open(infile, "$file_name") or &error_open_file($file_name);
It's a convention to have filehandles all-uppercase. IIRC, -w will also
mumble something to that effect.
> local (@filedata) = stat(infile);
> local ($file_type_mode) = $filedata[2];
> local ($dir_flag)=0;
> $dir_flag = 0;
No need to set $dir_flag to zero twice. And -- personal preference --
when I have exactly one my() or local() variable on a line, I leave off
the parentheses, as in: my $dir_flag = 0; .
> if ($file_type_mode >= 16000 && $file_type_mode < 17000){
> $dir_flag = 1;
> }
> return "$dir_flag";
The quotes around $dir_flag are superfluous and can even be wrong in
rare cases (with numbers that get stringized and later have & and |
operate on them).
> }
Cheers,
Philip
------------------------------
Date: Wed, 14 Apr 1999 12:09:27 +0200
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: Examples of slow regexes?
Message-Id: <37146957.6F23CDA0@ngb.se>
Kai Henningsen wrote:
>
> Once you include counting and then using those counts (like a certain
> prime number detector), or modifying your data from inside the pattern (as
> in Snobol), you get in trouble. That's because what you're doing is no
> longer equivalent to a finite automaton, but a stack automaton or even a
> full touring machine. Then all bets are off.
^^^^^^^
And where is it going for its tour? Do you by any chance mean Turing?
:)
Staffan
------------------------------
Date: Wed, 14 Apr 1999 10:08:05 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Examples of slow regexes?
Message-Id: <371763d6.1690756@news.skynet.be>
Kai Henningsen wrote:
>> Slightly more complicated examples, such as /[ab]*[ac]*[ab]*[ac]*/ come
>> to mind. /[ab]*[ac]*/ must be equivalent to /[ab]*(?:c[ac]*)?/, which
>> *looks* like it should be more efficient, but it isn't. In fact, it's a
>> bit slower.
>
>That doesn't seem right - your second one fails to accept "cb", does it
>not?
I can't see how /[ab]*[ac]*/ could ever match "cb", either. :-)
You must have confused it with the first regex, the one the four
subpatterns. This one is nothing but twice the second regex.
So, if /[ab]*[ac]*/ matches the same stuff in the same manner as
/[ab]*(?:c[ac]*)?/ (i.e. it is "equivalent"), then the whole pattern is
equivalent to /[ab]*(?:c[ac]*)?[ab]*(?:c[ac]*)?/. This one DOES match
"cb".
Bart.
------------------------------
Date: Wed, 14 Apr 1999 11:35:48 +0200
From: Xavier HEROULT <heroux@iutc3.unicaen.fr>
Subject: HELP Needed with CGI-PERL on apache 1.3.3
Message-Id: <37146174.586BAE80@iutc3.unicaen.fr>
Hi,
there is one thing I can't understand:
Like said before, single CGI scripts (which don't need the famous
"CGI.pm") like screening date and hour work.
But, I've got another script which uses "CGI.pm". Off Line (according to
PERL), by typing "perl5.00404 add.pl", it works. I've got to manually
type : name=Something
email=nothing@nowhere.com....
then I simulate an EOF ("ctrl D"), and fields are written at the end
of a file.
And this, doesn't work on a web browser:
- I've got an HTML page with a form
containing different fields to fill and this action :
ACTION="http://ganp175.in2p3.fr/cgi-bin/add.pl",
and this method :METHOD=POST.
When I click the submit button an Internal Server Error appears.
here it is :
"The server encountered an internal error or misconfiguration and
was unable to complete your request.
Please contact the server administrator, Xavier@ganp175.in2p3.fr
and inform them of the time the error occurred, and anything you
might have done that may have caused the error.
Premature end of script headers: /home/httpd/cgi-bin/add.pl"
Please, Ireally need some help. Couldn't it be my server (apache 1.3.3
on Linux-Mandrake 5.3) refusing POST method ? Then does anyone knows
what can I do to fix it ? Is it a path to add somewhere or ... I don't
kow...
Any suggestion is welcome...
thanks in advance...
--
Xavier HEROULT
------------------------------
Date: 14 Apr 1999 08:33:38 GMT
From: "jacob_siu" <jacob_siu@cyberlink.com.tw>
Subject: MUA with Perl
Message-Id: <7f1jt2$nc2$1@news.seed.net.tw>
Dear Sir,
I'm working on a perl script to send mail through sendmail.
All my attached file convert to txt. Can help to solve the problem ?
Is it MIME problem ?
May smtp.pm from CPAN can help ?
--Thks
------------------------------
Date: 14 Apr 1999 11:13:18 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: MUA with Perl
Message-Id: <37146a3e.0@newsread3.dircon.co.uk>
jacob_siu <jacob_siu@cyberlink.com.tw> wrote:
> Dear Sir,
> I'm working on a perl script to send mail through sendmail.
> All my attached file convert to txt. Can help to solve the problem ?
> Is it MIME problem ?
> May smtp.pm from CPAN can help ?
No what you need is probably at the simplest the MIME::Lite module from
CPAN this will enable to create E-Mails with attachments and send them
using sendmail.
Also check perlfaq9
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Wed, 14 Apr 1999 12:43:42 +0100
From: cwis@dial.oleane.com (Christopher Allene)
Subject: Re: No echo on a socket connection
Message-Id: <1dq94ml.irewlx1t3bh9tN@[192.168.1.2]>
<kevin_collins@my-dejanews.com> wrote:
> The 1st bit works like a charm, but the second print causes a "+ over a -"
> character to display. Any help on that?
Maybe you forgot to swap the \n and \r -- the correct line is:
> print $handle "\377\374\001\r\n";
On Unixes.
If you did swap them, I see no reason why the escape sequence is not
recognized.
--
cw|s
------------------------------
Date: Wed, 14 Apr 1999 08:30:21 GMT
From: ijg@csc.liv.ac.uk
Subject: Re: osdep.o source file
Message-Id: <7f1jmt$o2t$1@nnrp1.dejanews.com>
In article <7evpgm$5hp$1@nnrp1.dejanews.com>,
ijg@csc.liv.ac.uk wrote:
>
>
> Hi all,
>
> Anyone know what the osdep.c/osdep.o library does?
>
> The Cclient.pm module seems to use it to do a remsh (Lord alone knows why it
> needs to). I can't read all of the source here at work and I suspect it has
> something to do with the Perl source code (could be wrong though).
>
I was right, I am wrong. This has nothing to do with Perl folks, please
ignore. It's buried deep in the c-client imap client/server code.
Now what news group should this goto? Hmmmmm....
--
Ian J. Garlick
<ijg@csc.liv.ac.uk>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 14 Apr 1999 12:37:17 +0100
From: Thomas Goesmann <goesmann@do.isst.fhg.de>
Subject: Perl and MS Access
Message-Id: <37147DED.59334939@do.isst.fhg.de>
Hi,
this is maybe a very simple question:
How can I access a MS Access database in Perl?
The most important requirement is to keep it really SIMPLE.
What modules are needed?
Can anybody give me a link to corresponding web resources/examples?
Thank you very much in advance. Please reply by mail to the adress given
below.
Regards,
Thomas Goesmann
------------------------------
Date: Wed, 14 Apr 1999 00:52:17 -0800
From: daniel.mueller@rsd.rsd.de
Subject: Question: How to create a logfile?
Message-Id: <BMYQ2.3046$36.860379@WReNphoon2>
Hi everybody,
I have a problem to create a logfile? How can I manage it, that my programm
writes simultaniously
to my STDOUT and a file. I believe I have to use a pipe, but i could not
find any reference, which
explains how to do this.
Tahnaks for any help,
Daniel M|ller
**** Posted from RemarQ - http://www.remarq.com - Discussions Start Here (tm) ****
------------------------------
Date: 14 Apr 1999 11:26:04 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Question: How to create a logfile?
Message-Id: <37146d3c.0@newsread3.dircon.co.uk>
daniel.mueller@rsd.rsd.de wrote:
> Hi everybody,
> I have a problem to create a logfile? How can I manage it, that my programm
> writes simultaniously
> to my STDOUT and a file. I believe I have to use a pipe, but i could not
> find any reference, which
> explains how to do this.
>
I vote for 'tee' - of course you would have to be on Unix for this to work
in most cases.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Wed, 14 Apr 1999 12:31:10 +0200
From: Philip Newton <Philip.Newton@datenrevision.de>
To: daniel.mueller@rsd.rsd.de
Subject: Re: Question: How to create a logfile?
Message-Id: <37146E6E.91D9C8F0@datenrevision.de>
[Posted and a courtesy copy sent]
daniel.mueller@rsd.rsd.de wrote:
>
> Hi everybody,
> I have a problem to create a logfile? How can I manage it, that my
> programm writes simultaniously to my STDOUT and a file. I believe I
> have to use a pipe, but i could not find any reference, which explains
> how to do this.
Try: perldoc -q 'more than one file' , especially the bit after the "Or
even:". That should point you in the right direction. (NB: this assumes
you have the Unixish utility tee(1) available; however, there is a
pointer to a script written all in Perl as well.)
Cheers,
Philip
------------------------------
Date: 14 Apr 1999 08:42:26 GMT
From: eric@fruitcom.com (Eric Smith)
Subject: Re: regex - camel and llama cannot help
Message-Id: <slrn7h8m8b.e2q.eric@plum.fruitcom.com>
therzog@knotech.com (Tim Herzog):
> In article <slrn7h7iv7.e2q.eric@plum.fruitcom.com>, eric@fruitcom.com wrote:
>
>
> Will this work?
>
> $_ = "ericnot";
>
> if( /(.*)not$/ ) {
> # $1 ends in "not"
> print "$1\n";
> }
> else {
> $ it doesn't
> }
>
gr8
Simplest way is always the best - I think this will do the trick.
BTW - in my original pot I made a silly contradiction for which I
apologise. To confirm - I want a match on `ericnot' but no match on
`ericno' or `ericn' and the string to be returned in $1 is the `eric'.
Thanx all :)
> --
> Two Bits Worth
> 778 Hague Avenue
> Saint Paul, MN 55104
> Phone/Fax: 1 (612) 227-2920
> therzog@knotech.com
--
Eric Smith
<eric@fruitcom.com>
Tel. 021 236 111
------------------------------
Date: Wed, 14 Apr 1999 10:23:27 -0700
From: alan rogers <arogers@rational.com>
Subject: Registry Information
Message-Id: <3714CF0F.EC9B248C@rational.com>
Hi,
I wonder if anybody out there could help me.
I need to get information from the NT Registry and pass it into a
variable so I use in my program
This is the registry information is this
HKEY_LOCAL_MACHINE\SOFTWARE\ATRIA\ClearCase\CurrentVersion\ProductHome
If any body can help thank you
Best Regards
Alan rogers
------------------------------
Date: 14 Apr 1999 11:31:00 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Registry Information
Message-Id: <37146e64.0@newsread3.dircon.co.uk>
alan rogers <arogers@rational.com> wrote:
> Hi,
>
> I wonder if anybody out there could help me.
> I need to get information from the NT Registry and pass it into a
> variable so I use in my program
> This is the registry information is this
> HKEY_LOCAL_MACHINE\SOFTWARE\ATRIA\ClearCase\CurrentVersion\ProductHome
>
Would you believe there is a module Win32::Registry that comes with the
ActivePerl distribution.
/J\
------------------------------
Date: Wed, 14 Apr 1999 12:22:20 +0200
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: simple perl variable assigning qu
Message-Id: <37146C5C.8FEDD8F0@datenrevision.de>
Nina Hung wrote:
>
> what can i do when i have a variable storing a name, which i want to
> make it as the array's name?
You read http://www.plover.com/~mjd/perl/varvarname.html to find out why
this is generally not such a good idea. As Tom C suggest, you probably
want to use a hash.
Cheers,
Philip
------------------------------
Date: Wed, 14 Apr 1999 08:24:35 GMT
From: chatswood@my-dejanews.com
Subject: Re: SQL using the ODBC module
Message-Id: <7f1jbt$nt1$1@nnrp1.dejanews.com>
In article <37136b28.45230277@news.earthlink.net>,
spg@quokka.com (Gus) wrote:
> First guess is you have a problem with quotes, but without seeing
> sample code, it's just a wild guess.
Sorry I haven't got the code itself with me (my own PC isn't networked). I've
tried it with and without quotes, but what I'd really like to get is any sort
of error message. Unfortunately I don't get any...
My line is
$db->sql('....') or die "...";
or thereabouts, but the thing isn't dying. The fact that I'm doing it through
CGI doesn't make a difference as I've tested it from the DOS Prompt. All I'm
doing is creating a new ODBC connection, the performing the sql statement, and
then closing the connection. Am I missing anything?
The fact that it isn't dying - does that suggest that as far as Perl is
concerned the operation is a success? That I guess would point to the ODBC
DSN, but I've checked that it is writable. I haven't checked if the database
itself is read only, but I presume that since I can read/write within Access
(where the SQL does work) suggests that the DB is writeable.
Thanks for your help
Maurice Kelly
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 14 Apr 1999 08:35:51 GMT
From: ran@netgate.net (Ran)
Subject: Re: What Kind of Program should i first make?
Message-Id: <924078951.181.100@news.remarQ.com>
In <3713BEFE.990B3172@nettaxi.com>, Raymond Yu <WizeGuy@nettaxi.com> writes:
>I'm starting Perl, and I don't know what program I should start out to
>make. Can you give me any starters' programs?
The customary progression is something like this:
First, you write a program that just outputs a single message, and
exits. Something like "Hello, world! This is my first Perl program!"
will do nicely, and this particular beginner's example is often called
the "'Hello, world' program".
Next, you write a program that reads a bunch of input, and does
something like count all the lines and print out a message telling you
how many lines there were.
Finally, you write a progam that reads a bunch of input, and outputs a
modified copy of *each* line. Like, say, making it all uppercase.
Most of the programs you'll write will be some variation on one of these
"themes". Some will probably be *much* more elaborate, but most will
still be something along these lines of "automate some button=pushing",
"summarize the input", or "transform the input".
Now you have an idea of how to do each kind, so start looking for the
sort of "I wish I had..."s that Tim mentioned in his reply, and make
one that seems simple. Then make another, and another, and eventually
you, too, will be able to amaze your friends at parties by saying
"I used to have that problem with my computer, but then I wrote a
program to solve it for me." ;-)
Throughout this process, make sure that every program includes a
use strict;
near the beginning, and that you run perl with the "-w" option, so it
will catch more mistakes. You'll make lots of them, and it helps to
fill your quota as soon as possible, so they don't turn up later, in a
program you've already handed over to someone else ;-)
Ran
------------------------------
Date: Wed, 14 Apr 1999 09:37:28 GMT
From: billy_collins@my-dejanews.com
Subject: Whats wrong with this?
Message-Id: <7f1nkn$r6u$1@nnrp1.dejanews.com>
Hi all, can someone tell me whats wrong with this code!
______ <SNIP> _____
#!/usr/local/bin/perl5
$n = `man pico`;
print "Content-type: text/html\n\n";
print <<EndOfHtml;
<html><body>
$n
</body></html>
EndOfHtml
______ </SNIP> _____
Is it that the output of UNIX command cannot be printed? But then, instead of
having 'man pico' if I have 'ping www.yahoo.com' (which is a UNIX command as
well), it works!
Or is it that the server does not permit such a thing or something?
Please help!
Bill
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 14 Apr 1999 11:24:38 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Whats wrong with this?
Message-Id: <37146ce6.0@newsread3.dircon.co.uk>
billy_collins@my-dejanews.com wrote:
> Hi all, can someone tell me whats wrong with this code!
>
>
There is nothing wrong with your code except the missing -w on the
shebang line and no 'use strict'
>
> #!/usr/local/bin/perl5
> $n = `man pico`;
>
> print "Content-type: text/html\n\n";
> print <<EndOfHtml;
> <html><body>
> $n
> </body></html>
> EndOfHtml
>
> Is it that the output of UNIX command cannot be printed? But then, instead of
> having 'man pico' if I have 'ping www.yahoo.com' (which is a UNIX command as
> well), it works!
>
Does it work when you run this at the command line ?
Certainly
$blah = `man ls`;
print $blah;
behaves entirely as expected on my system.
> Or is it that the server does not permit such a thing or something?
>
It is certainly *something* - and that something is almost certainly to do
with the environment that your program finds itself running when run on
a server as opposed to the command line and if that is the case then you will
need to discover what the differences are and remedy them.
Anyhow it is not a Perl related problem.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Wed, 14 Apr 1999 08:51:54 GMT
From: lg@kt.dtu.dk (Lars Gregersen)
Subject: Re: Writing to socket from Win95 and Perl 5
Message-Id: <371455f6.172957690@news.dtu.dk>
On Tue, 13 Apr 1999 15:55:36 -0400, Brian Yoder
<beyoder@raleigh.ibm.com> wrote:
>Using the docs and examples from "Learning Perl on Win32
>Systems", I created a socket-based client for our Unix gateway
>server. The Perl script works perfectly.... on Unix. But not on
>Win95.
I've found that the examples in IO::Socket and IO::Select works
perfectly on Unix and Win32 (including Win95) except for the examples
that use fork. It doesn't hurt to read about the socket related
functions in perlfunc.
Use $sock.>send() and $sock->recv() when sending and receiving.
Lars
------------------------------
Lars Gregersen (lg@kt.dtu.dk)
http://www.gbar.dtu.dk/~matlg
------------------------------
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 5379
**************************************