[19506] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1701 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 6 00:05:40 2001

Date: Wed, 5 Sep 2001 21:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <999749107-v10-i1701@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 5 Sep 2001     Volume: 10 Number: 1701

Today's topics:
        ANNOUNCE: Module::MetaInfo - meta information about per (Michael De La Rue)
    Re: bad header <Crazydj@web.de>
    Re: capture output from all pages of top? <ronh@iainc.com>
    Re: cgi.pm cookie function - am I missing something? (David Efflandt)
        Compiling Scripts to DOS EXEs (Graham W. Boyes)
        Getting CPU load from remote computers <citykid@nospam.edu>
    Re: Getting CPU load from remote computers (Logan Shaw)
    Re: How can I find the PID's of my children? <krahnj@acm.org>
    Re: Low Priority File Copy - Slow Links (Jason)
    Re: Low Priority File Copy - Slow Links (Chris Fedde)
    Re: Netscape Server / iPlanet caching Perl programs (Joel)
    Re: object & fork (Logan Shaw)
    Re: object & fork (Mark Jason Dominus)
    Re: OT: Re: Recommendations for a PERL editor (Tim Hammerquist)
    Re: Perl 5.005_03 under Solaris 2.7 (Logan Shaw)
    Re: Perl 5.005_03 under Solaris 2.7 <showie@uoguelph.ca>
    Re: Perl Commands Not Working (BUCK NAKED1)
    Re: perl training (Logan Shaw)
    Re: problem when execute query from windows to Unix (Abigail)
    Re: Programming with pipes and fork (Chris Fedde)
    Re: Programming with pipes and fork <davidhilseenews@yahoo.com>
    Re: Recommendations for a PERL editor <AHALL5@nc.rr.com>
        Redirect stderr to stdout w/ Perl under Unix? <gncbrown@adelphia.net>
    Re: Redirect stderr to stdout w/ Perl under Unix? <theaney@toadmail.toad.net>
    Re: Redirect stderr to stdout w/ Perl under Unix? <davidhilseenews@yahoo.com>
    Re: Undef'ing multiple variables (Abigail)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 5 Sep 2001 21:35:49 GMT
From: mikedlr@tardis.ed.ac.uk (Michael De La Rue)
Subject: ANNOUNCE: Module::MetaInfo - meta information about perl modules
Message-Id: <tpda2l7iv5onf8@corp.supernews.com>
Keywords: perl module meta information automatic

I have just uploaded Module-MetaInfo-0.03.tar.gz to pause and it
should soon appear at

       http://www.cpan.org/modules/by-authors/Michael_De_La_Rue/

This is a perl module which is designed to give meta information
about other perl modules.  

The current version is works and does useful things for building RPMs
of perl modules but is mainly for comment.  Please download, read the
documentation test and comment back to my CPAN address or to
comp.lang.perl.modules.  

One mechanism for meta information included is to have a directory in
the perl module distribution file (PkgData) which will allow easy
retrofitting of meta-information to the current perl module format.
Any comments about that would be particularly appreciated.  

    Michael




------------------------------

Date: Thu, 06 Sep 2001 00:41:05 +0200
From: Crazydj <Crazydj@web.de>
Subject: Re: bad header
Message-Id: <3B96AA01.23D033FD@web.de>

Matt Carey schrieb:

> I have a perl program which accepts input from an html form where a user
> can enter comments in a text area.(using Apache,Linux)
> When the form is submitted, the perl program stores the user input in a
> variable($parameter) and then executes a shell command passing the
> variable to a perl program on another machine(HP-UNIX) where the data
> gets written out to a file.
>

First bad idea: Don't pass variables written by nay user to your perl
program without qouting "dangerous commands"!!

>
> $runcommand = "rsh machine /usr/bin/nsperl
> /u/data/CONSAC/SRC.PERL/runuvprog.pl $parameter";
> system ($runcommand);
>

Second mistake: Do not run rsh!!! AND DO NOT run it on a webserver
executing commands that a user can specify!!!
Also quote and check the inputs before running a system() call.

>
> When the shell command returns the perl program reads in an html
> page(stating that the form has been received) from a file and prints it
> out to the browser.
>
> sub print_page{
>  print "Content-type: text/html\n\n";
>  open(INFILE, "<$infile");
>   while(<INFILE>){
>     print;
>     }
>  close(INFILE);
> }
>
> This works fine when only one line of text has been input in the text
> area. When I submit the form after having entered more than one line of
> comments in the text area(and the text has wrapped) then I get an error
> message:
>
> The server encountered an internal error or misconfiguration and was
> unable to complete your request.
>
> The server error log says:
> [Wed Sep  5 09:27:10 2001] [error] [client 131.2.4.203] malformed header
> from script. Bad header=Attempted READ of record ID la:
> /home/httpd/cgi-bin/peer.pl
>
> Although I get an error message, the data($parameter) always gets passed
> via the rsh command and written out to file correctly.
>
> I'm trying to find out how the wrapping of the text in the text area
> would cause the perl program to generate the error message. I've tried
> stripping out carraige returns and line feeds which didn't seem to help
> any.
> Thanks for any suggestions.

Afterall: Just use a perl script! It should look like this:

#!/usr/bin/perl

use CGI;

my $cgi = new CGI;

$textbox  = $cgi->param($name_of_the_textarea);

print $cgi->header;
print $cgi->start_html;
print "You have typed the following:<br>";
print $textbox;
$cgi->end_html;


Greets

Bastian Ballmann

--
Djz rule the world! ...and some other staff ;-p Find out at http://www.crazydj.de





------------------------------

Date: Wed, 05 Sep 2001 22:28:17 GMT
From: "Ron Hartikka" <ronh@iainc.com>
Subject: Re: capture output from all pages of top?
Message-Id: <5Gxl7.56364$Hm.547708@typhoon.mw.mediaone.net>

thank y'all. I'll try the various suggestions.

"gnari" <gnarinn@hotmail.com> wrote in message
news:999636704.886150201316923.gnarinn@hotmail.com...
> In article <7d3dfb10.0109040635.2a260da4@posting.google.com>,
> Ron Hartikka <ronh@iainc.com> wrote:
> >Hi Group,
> >
> >I'd like to run top from perl and capture all the output. This...
> >
> >print `top -d 1`;
> >
> >...gives me (HPUX, perl 5.6) only page 1 of top's output.
> >
> >Any ideas on how to get the contents of the subsequent pages into perl?
>
> first: are you sure that top on HPUX does do more that one page, when not
> outputting to terminal?
> you should try for the command line:
>   top -d 1 > top.out
>
> on linux this works as you expect, with top.out growing endlessly.
>
> second: even if top behaved that way, your
>   print `top -d 1`;
> would probably not work as you expect, i expect :-)
> consider what happens:
>   a) perl executes shell command 'top -d 1' and grabs all output
>   b) perl waits for command to exit
>   c) perl prints grabbed output
>
> if you expect top to continue, how long will b) take?
>
> if you want perl to process the output as it comes, you
> probably want to open() with a pipe
> see
>   perldoc -f open
>   perldoc  perlopentut
>   perldoc perlipc
>
>
> one thought just occurred to me: you *are* terminating  the
> 'top' command by pressing 'q', and wonder why the print only prints
> one page. in that case the answer is that it prints all the pages,
> but form-feeding in between, and doing it so fast that you see only
> the last page
> this can be demonstrated by just waiting an obscenely long time before
> pressing 'q', or changing the command to 'top -d 0.1', or both
>
> hope this helped
> gnari




------------------------------

Date: Thu, 6 Sep 2001 03:10:06 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: cgi.pm cookie function - am I missing something?
Message-Id: <slrn9pdq8d.enp.efflandt@typhoon.xnet.com>

On 5 Sep 2001 09:54:17 -0700, Jennifer <jennlee.2@eudoramail.com> wrote:
> 
> So both cookies are there but not sure why cgi.pm cookies function
> cannot find the 'CoStore' one.  I don't think its expired because it
> was set for +7D which I think is corect for 7 days in the future.

It is actually called CGI.pm (unless your OS is case insensitive) and if
you read 'perldoc CGI' you would see that 'd' is for days.  Not sure if
that is case sensitive, but m certainly is (m=minute, M=month).

Not sure if this is your problem, but often upper or lower case does
matter.

-- 
David Efflandt - All spam is ignored - http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


------------------------------

Date: 5 Sep 2001 17:48:29 -0700
From: thepro@toao.net (Graham W. Boyes)
Subject: Compiling Scripts to DOS EXEs
Message-Id: <e9503d3c.0109051648.bc8b635@posting.google.com>

Hi folks

Reading the usenet archives I've found a lot of folks use Perl2EXE for
compiling their scripts.  However my script needs to be run off a
Windows 98 boot disk.  Perl2EXE's compiler told me that my script
needed to be run under Microsoft Windows.

Suggestions?  I could get Perl for DOS but would rather have a single
executable.  Speed and size are not really a factor.

Graham W. Boyes


------------------------------

Date: Wed, 5 Sep 2001 17:37:18 -0700
From: Les Ander <citykid@nospam.edu>
Subject: Getting CPU load from remote computers
Message-Id: <Pine.LNX.4.33.0109051729180.19771-100000@schewanella.stanford.edu>

Hi,
I would like to get information on cpu type, make and number of
processors, as well as get the cpu load
information by executing the  "uptime" command on various computers
on our network. All of these computers are intel PCs and are
running Redhat 6.2/7.1. All of them allow incoming rlogin,
ssh  and telnet connections.
I can do this for my localhost using CGI and Linux::Cpuinfo modules,
but don't have a clue how i can do this on remote computers.
Can someone give me an example?
thankyou
les



------------------------------

Date: 5 Sep 2001 19:51:01 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Getting CPU load from remote computers
Message-Id: <9n6h9l$93s$1@charity.cs.utexas.edu>

In article <Pine.LNX.4.33.0109051729180.19771-100000@schewanella.stanford.edu>,
Les Ander  <citykid@nospam.edu> wrote:
>I would like to get information on cpu type, make and number of
>processors, as well as get the cpu load
>information by executing the  "uptime" command on various computers
>on our network. All of these computers are intel PCs and are
>running Redhat 6.2/7.1. All of them allow incoming rlogin,
>ssh  and telnet connections.
>I can do this for my localhost using CGI and Linux::Cpuinfo modules,
>but don't have a clue how i can do this on remote computers.

Here's an example for a local system:

	$uptime = `uptime`;

And for a remote system:

	$uptime = `rsh -n remote-system-name uptime`;

Of course, you've got to set up your .rhosts files and all that so that
"rsh" works without a password, but that's a Unix/Linux question, not a
Perl one.  (You can also have passwordless authentication with "ssh" if
you want.)

  - Logan
-- 
"Our grandkids love that we get Roadrunner and digital cable."
(Advertisement for Time Warner cable TV and internet access, July 2001)


------------------------------

Date: Thu, 06 Sep 2001 00:23:34 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: How can I find the PID's of my children?
Message-Id: <3B96C27A.CE943E5B@acm.org>

Ilja Tabachniks wrote:
> 
> "John W. Krahn" <krahnj@acm.org> wrote in message news:<3B95F5D0.47AF2099@acm.org>...
> 
> ...skipped...
> 
> > my $command = 'ps -eo ppid,pid,command';
> > my @children = grep {
> >             chomp( my @x = split " ", $_, 3 );
> >             $x[0] == $$ and $x[2] ne $command and $_ = $x[1]
> >             } `$command`;
> >
> >
> 
> OK, I understand your intentions. Just some warnings:
> 
> 1. The 'command' format for ps(1) is not so portable (say AFAIK on Solaris
>    you'd use 'args' instead).

Tell me about it. DG/UX uses nps for user defined formats.


> 2. The implementation of ps(1) may truncate the resulting 'command' string,
>    and therefore $x[2] ne $command will be true when unexpected.

Depends on the total line length, the length of the command string and
the COLUMNS on your terminal (IIRC). And of course on the OS
implementation. YMMV.


> IMHO the more robust solution would include a manual fork()/exec().
> This way we will know the exact pid of ps(1) process and will be able to
> filter it out from listing.



John
-- 
use Perl;
program
fulfillment


------------------------------

Date: 5 Sep 2001 18:27:29 -0700
From: jpierce512@hotmail.com (Jason)
Subject: Re: Low Priority File Copy - Slow Links
Message-Id: <40e297b.0109051727.7676d8dd@posting.google.com>

cfedde@fedde.littleton.co.us (Chris Fedde) wrote in message news:<zEgl7.124$Owe.171088896@news.frii.net>...
> It'd be straight forward to write a client server pair that put
> any kind of delay that was desirable between writes or reads on a
> socket.  Another idea would be to put a web server like micro-httpd
> on the source machine and write a client using IO::Socket and a
> sleep. Or you could use thttpd and it's throttle option to control
> the bandwidth at the server.
> It's possible to write a throttled HTTP client if you use the
> callback form of the LWP::UserAgent::request method and strategically
> placing a sleep  sleep somewhere in the callback.

Ok, I have been able to write the client server pair, but I am having
problems doing the write read process. Do I need to convert the data
into binary or can I just write it to the socket connection. Is it
possible for me to use Net::FTP and specify a packet size. I am a
newbie to perl.

Thanks for the Help


------------------------------

Date: Thu, 06 Sep 2001 01:34:30 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Low Priority File Copy - Slow Links
Message-Id: <GoAl7.145$Owe.207015424@news.frii.net>

In article <40e297b.0109051727.7676d8dd@posting.google.com>,
Jason <jpierce512@hotmail.com> wrote:
>cfedde@fedde.littleton.co.us (Chris Fedde) wrote in message
>news:<zEgl7.124$Owe.171088896@news.frii.net>...
>> It'd be straight forward to write a client server pair that put
>> any kind of delay that was desirable between writes or reads on a
>
>Ok, I have been able to write the client server pair, but I am having
>problems doing the write read process. Do I need to convert the data
>into binary or can I just write it to the socket connection. Is it
>possible for me to use Net::FTP and specify a packet size. I am a
>newbie to perl.
>

Net::FTP is mostly about hiding the details from you. You don't get much
control over the low level TCP options from it.
-- 
    This space intentionally left blank


------------------------------

Date: 5 Sep 2001 19:32:37 -0700
From: plotkin@ejournalpress.com (Joel)
Subject: Re: Netscape Server / iPlanet caching Perl programs
Message-Id: <40d256b3.0109051832.693c0a75@posting.google.com>

We have actually ported our code to IIS w/ PerlEx and Apache mod_perl-
but we have a client who insists on using Netscape Server / iPlanet-

fast-cgi would be GREAT- but as far as I can tell- the only company
who provides it for iPlanet stopped selling it- or maybe I'm missing
something-

The performance issue has to deal with not having to intrepet the
scripts for every web hit and allowing persistent database
connections-

Joel


"Jonathan" <jonathan@bakerbates.SPAMGONE.com> wrote in message news:<9mjmi5$nao$1@uranium.btinternet.com>...
> I think fast-cgi is supported by iPlanet, but I'm afraid the real answer
> might be that if you're worried about the performance of CGI scripts, and
> you're running iPlanet, then you really should be looking at another way to
> handle server-side applications.
> 
> In my experience, most people who run iPlanet, as oppsosed to Apache, do so
> for a specific reason - can I ask what your reason is?
> 
> Jonathan
> 
> 
> "Joel" <plotkin@ejournalpress.com> wrote in message
> news:40d256b3.0108290802.5e80a314@posting.google.com...
> > Hi,
> >
> > Label me clueless- but is there a way for iPlanet / Netscape
> > Enterprise Server (running on Solaris) to cache Perl cgi programs?
> >
> > 1) to save time via persistent database connections; and
> > 2) not have to re-compile the perl code on every web hit?
> >
> > Something like mod_perl, Appache::Registry, PerlEx, or fast-cgi?
> >
> > I looked at nsapi- but it doesn't compile under Linux (our test
> > machine) and doesn't look too well supported.
> >
> > Fast.serv  looked good- but it does not appear to be available...
> >
> > Any ideas?  The more the better.
> >
> > Many thanks,
> >
> > Joel


------------------------------

Date: 5 Sep 2001 19:34:33 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: object & fork
Message-Id: <9n6gap$8s3$1@charity.cs.utexas.edu>

In article <3b96615e.5433$10c@news.op.net>,
Mark Jason Dominus <mjd@plover.com> wrote:
>You misunderstand fork().  fork() makes a new process which is a
>*copy* of the old process.  No memory is shared between the two processes.

Unless you're on a modern operating system on modern hardware, in which
case the two cleverly conspire to give you an extremely convincing
*illusion* that no memory is shared between the processes.  :-)

  - Logan
-- 
"Our grandkids love that we get Roadrunner and digital cable."
(Advertisement for Time Warner cable TV and internet access, July 2001)


------------------------------

Date: Thu, 06 Sep 2001 00:52:24 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: object & fork
Message-Id: <3b96c8c8.5dde$208@news.op.net>

In article <9n6gap$8s3$1@charity.cs.utexas.edu>,
Logan Shaw <logan@cs.utexas.edu> wrote:
>In article <3b96615e.5433$10c@news.op.net>,
>Mark Jason Dominus <mjd@plover.com> wrote:
>>You misunderstand fork().  fork() makes a new process which is a
>>*copy* of the old process.  No memory is shared between the two processes.
>
>Unless you're on a modern operating system on modern hardware, in which
>case the two cleverly conspire to give you an extremely convincing
>*illusion* that no memory is shared between the processes.  :-)

Even on old hardware that's true.  THere's no difference between the
illusion and the reality.
-- 
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print


------------------------------

Date: Thu, 06 Sep 2001 03:01:30 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Re: OT: Re: Recommendations for a PERL editor
Message-Id: <slrn9pdqeu.37k.tim@vegeta.ath.cx>

Me parece que Jonadab the Unsightly One <jonadab@bright.net> dijo:
> tim@vegeta.ath.cx (Tim Hammerquist) wrote:
> 
> > One word: mutt. 
> 
> Err, no.  A lot of the same people who recommend mutt 
> also suggest pine and slrn...

Not to be stereotyped, but I recommend slrn too. ;)

> [Looks at mutt website anyway.]
> 
> In particular, mutt appears to leave filtering to the mail 
> transfer system (procmail or whatever), which doesn't allow 
> for enough flexibility.

[ snipped ]

Don't think that it doesn't have filtering ability.  It has builtin
support for mailing lists, and extensive filtering commands.

Like most *nix utilities, mutt isn't as automated as most Win32
software.  While I don't quite understand all your seemingly reasonable
demands, I'm sure mutt could do anything you asked easily.

> *If* I were going to switch from Pegasus, it would have 
> to be to Gnus, that's the only other thing with all the
> features I need.  Problem is, Gnus is a serious pain to 
> get configured, not to mention learning to use it.  I 
> want to learn to use Gnus for usenet anyway, but I'm 
> waiting for Emacs 21...  and I wouldn't trust it with
> my mail until I'd been using it for usenet for months
> and *know* I understand how its storage and filtering 
> work.

I'll have a look at Gnus.

> > Forget WINE. 
> 
> That's pretty much what I'm doing.  

Wine could only run two Win32 programs consistently (but not stably):
Notepad and UltraEdit-32.  Others seemed to rely too much on external
DLLs that Wine apparently can't handle yet.

> FWIW, mutt appears, from the feature list on the website, to be
> so much better than NS Messenger that there's no comparison.
> But it's also not a replacement for Pegasus, not for me.

Fair enough. :)

-- 
Is there any person in the world who does not dream?
Who does not contain within them worlds unimagined?
    -- Narrator, The Sandman


------------------------------

Date: 5 Sep 2001 19:43:34 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Perl 5.005_03 under Solaris 2.7
Message-Id: <9n6grm$92c$1@charity.cs.utexas.edu>

In article <9n5vqd$gm0$1@testinfo.cs.uoguelph.ca>,
Steve Howie  <showie@uoguelph.ca> wrote:
>Having problems reading and writing to files >2Gb. in size on a Solaris 2.7 
>filesystem using Perl 5.005_03. I understand it's something to do with 
>the Perl malloc() routines barf'ing.

Why?  You said you were trying to work with big files, not big
amounts of memory.

> Is there a quick fix/recommended 
>workaround, or should I upgrade to a newer version of Perl?
> 
>The stat() Perl system call also returns totally messed-up results.

Have you built a version of Perl that knows how to use the large file
API?  Not all programs, just by virtue of running on a recent version
of Solaris, can use large files.  They need to be compiled especially
to do so, and they need to support that.  You can either do that by
taking advantage of the large file API, or by building a 64-bit
version of Perl (if on SPARC).  That's why you notice a list of things
that do/don't support large files when you do "man largefile".

Unfortunately, I haven't dealt directly with this myself, so I can't
tell you which versions of Perl are amenable to being compiled with
large file support or as a 64-bit executable under Solaris.

  - Logan
-- 
"Our grandkids love that we get Roadrunner and digital cable."
(Advertisement for Time Warner cable TV and internet access, July 2001)


------------------------------

Date: 6 Sep 2001 01:53:53 GMT
From: Steve Howie <showie@uoguelph.ca>
Subject: Re: Perl 5.005_03 under Solaris 2.7
Message-Id: <9n6kvh$jms$1@testinfo.cs.uoguelph.ca>

Logan Shaw <logan@cs.utexas.edu> wrote:
> In article <9n5vqd$gm0$1@testinfo.cs.uoguelph.ca>,
> Steve Howie  <showie@uoguelph.ca> wrote:
>>Having problems reading and writing to files >2Gb. in size on a Solaris 2.7 
>>filesystem using Perl 5.005_03. I understand it's something to do with 
>>the Perl malloc() routines barf'ing.

> Why?  You said you were trying to work with big files, not big
> amounts of memory.

My apologies - I was looking at the wrong hit returned by google - the
2gb. was inreference to memory, not files.

>> Is there a quick fix/recommended 
>>workaround, or should I upgrade to a newer version of Perl?
>> 
>>The stat() Perl system call also returns totally messed-up results.

> Have you built a version of Perl that knows how to use the large file
> API?  Not all programs, just by virtue of running on a recent version
> of Solaris, can use large files.  They need to be compiled especially
> to do so, and they need to support that.  You can either do that by
> taking advantage of the large file API, or by building a 64-bit
> version of Perl (if on SPARC).  That's why you notice a list of things
> that do/don't support large files when you do "man largefile".

Actually I tried version 5.6.1 and it has an option in the Configure step
which explicitly asks if you wish to support large files >2gb. if
you come across them. I said yes, and the new version of perl works
fine with large files. Problem solved! 

Scotty
-- 
Steve Howie					root@127.0.0.1
Netnews and Listserv Admin			519 824-4120 x2556
University of Guelph			
"If it's not Scottish it's CRRRRAAAAAAAPPPPPP!"


------------------------------

Date: Wed, 5 Sep 2001 21:30:37 -0500 (CDT)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Re: Perl Commands Not Working
Message-Id: <14102-3B96DFCD-60@storefull-242.iap.bryant.webtv.net>

Thanks for all of your responses. My server told me they just installed
Perl 2.6... so I was just quoting them. A perl -v showed me that It is
5.6.1 that they just upgraded to.

Yes, I did error checking. Sorry, I forgot to post the results. I
learned a long time ago from this group to always use $! to check for
errors. The errors returned say "Permission Denied" or "Operation Not
Permitted".

The directory that the script is in, is chmodded to 755, and the script
is chmodded to 755. The files the script works on to change chmod values
are chmodded at 644, 666, and 755. Also, I am running as my username
"blah", not as "nobody". I'm using the same permissions that I used on
other servers where I also ran as "user" and I had no problem with a
perl script being able to write to other files there.

What could be the difference? I'm wondering if they have something in
Apache set differently than my previous webhost.

Is there anything I can do to fix this or override my servers block of
writing to files. I've been reading about chown, sticky bit, suid and
execSUID; but it appears that you have to be the superuser to use
those... and I don't think I am. I just have my domain at this webhost.

Thanks. Sorry, I did post this to the cgi ng; but that group is having
trouble posting right now; and most of this is also perl-related, so
hopefully this post isn't too far off-topic.

Regards,
Dennis (aka whataman@home.com) 



------------------------------

Date: 5 Sep 2001 19:38:13 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: perl training
Message-Id: <9n6ghl$8us$1@charity.cs.utexas.edu>

In article <3b965883@news.victoria.tc.ca>,
Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> wrote:
>	google: [perl tutorial]
  :
  :
>	google: [perl tutorial savage]

At first I thought you were proposing an extension to the URL syntax
and I was going to propose

	google://web/perl+tutorial

instead.  :-)

  - Logan

(As opposed to "google://usenet/perl+tutorial/", that is.)
-- 
"Our grandkids love that we get Roadrunner and digital cable."
(Advertisement for Time Warner cable TV and internet access, July 2001)


------------------------------

Date: 5 Sep 2001 22:13:45 GMT
From: abigail@foad.org (Abigail)
Subject: Re: problem when execute query from windows to Unix
Message-Id: <slrn9pd8si.hk3.abigail@alexandra.xs4all.nl>

Valentin763 (valentin763@aol.com) wrote on MMCMXXV September MCMXCIII in
<URL:news:20010903182517.13186.00005260@mb-ms.aol.com>:
)) Hi,
)) 
)) I want to execute a script from windows on a Unix Machine.It works with a
)) script whithout parameters but not in the following script....
)) 
)) require "Telnet.pm";
)) $telnet = new Telnet (timeout=>10,Errmode=>'die');
)) $telnet->open('55.1.4.223');
)) $telnet->waitfor('/Connexion :$/i');
)) $telnet->print('pgexp0');
)) $telnet->waitfor('/Mot de passe de pgexp0 : $/i');
)) $telnet->print('pgexp0');
)) $telnet->waitfor('/\> $/i'); # > -> dernier char du prompt
)) 
)) #@lines = $telnet->cmd("/progres/appdir/cliexp"); #work
)) @lines = $telnet->cmd("/progres/appdir/cliexp -d 20010828 > jmfool");#doesn't
)) work
)) print @lines;
)) 
)) do u see what is wrong ?


You don't specify what the problem is, just "doesn't work".

I am guessing that you expect @lines to contain the output of the executed
command. However, the 'cliexp' program is doing a redirect of its standard
output to a file, so of the command you execute (which is the entire line)
there is no ouput at all.

Which is most likely exactly what you see. So, the problem isn't with the
code, the problem is with the expection you have the code will be doing.



Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
__END__
The Lone Merchant near // the beach. A Bishop dies beside // a pond. Bankei.


------------------------------

Date: Thu, 06 Sep 2001 01:23:29 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Programming with pipes and fork
Message-Id: <leAl7.144$Owe.170734592@news.frii.net>

In article <3B968591.E22AF45F@web.de>, Crazydj  <Crazydj@web.de> wrote:
>Hi @ll!!! =)
>I have tried to program a little script that commiunicates via pipes
>between a father and a child process, but I have a got a problem with
>it. The father cannot talk to his son over the pipe! :-(
>Here is the script mybe you could help be debugging it :-p
>

After looking your code over I'd recomend that you take some time and look
at the perlipc manual page.  It has a section on bi-directional
communication that has some great examples.
-- 
    This space intentionally left blank


------------------------------

Date: Thu, 06 Sep 2001 01:39:22 GMT
From: "David Hilsee" <davidhilseenews@yahoo.com>
Subject: Re: Programming with pipes and fork
Message-Id: <etAl7.67928$hT4.17739403@news1.rdc1.md.home.com>


"Crazydj" <Crazydj@web.de> wrote in message news:3B968591.E22AF45F@web.de...
> Hi @ll!!! =)
> I have tried to program a little script that commiunicates via pipes
> between a father and a child process, but I have a got a problem with
> it. The father cannot talk to his son over the pipe! :-(
> Here is the script mybe you could help be debugging it :-p

<snip>

The code needs to be rewritten.

Start small.  Read the docs (even the close() calls are incorrect).  Most
importantly, always turn on warnings (and use strict is good too) when you
are using something that you aren't familiar with.  If you don't, perl's not
going to tell you when you make silly mistakes.

#!/usr/bin/perl -w

David Hilsee




------------------------------

Date: Wed, 05 Sep 2001 23:11:31 GMT
From: "Antoine Hall" <AHALL5@nc.rr.com>
Subject: Re: Recommendations for a PERL editor
Message-Id: <Diyl7.238935$J37.61288288@typhoon.southeast.rr.com>

You can use Ultraedit at www.ultraedit.com  it's, pretty powerful and has
macros and all that good stuff..

==
'Toine


"RoJo" <rojo@mindspring.com> wrote in message
news:3b926160.358347636@news.mindspring.com...
>
> I'm new to PERL.  I keep getting "The page cannot be displayed" when I
> use Windows 2000's Notepad to edit my scripts.  An ISP support person
> tells me it has syntax errors that are introduced by the editor.
>
> Can someone recommend to me a reliable Windows-based editor that WON'T
> create these problems for me ???
>
> My email address is rojo@mindspring.com




------------------------------

Date: Thu, 06 Sep 2001 02:14:04 GMT
From: George Brown <gncbrown@adelphia.net>
Subject: Redirect stderr to stdout w/ Perl under Unix?
Message-Id: <3B96DB7E.5020603@adelphia.net>

When exec-ing, how can I redirect stderr to stdout so that all output can be 
captured into a variable with back ticks?

-- 
George and Cindy Brown       e-mail: gncbrown@adelphia.net
4 Frederick Drive
New Hartford, NY  13413



------------------------------

Date: 05 Sep 2001 22:39:34 -0400
From: Tim Heaney <theaney@toadmail.toad.net>
Subject: Re: Redirect stderr to stdout w/ Perl under Unix?
Message-Id: <m2pu95avq1.fsf@mrbun.watterson>

George Brown <gncbrown@adelphia.net> writes:

> When exec-ing, how can I redirect stderr to stdout so that all output can be 
> captured into a variable with back ticks?

You can find this in the FAQ, either on your machine

  perldoc -q stderr

or online

  http://www.perldoc.com/perl5.6/pod/perlfaq8.html#How%20can%20I%20capture%20STDERR%20from%20an%20external%20command%3f

The short answer is, do it just as you would in Bourne shell:

  $output = `$cmd 2>&1`;

I hope this helps,

Tim


------------------------------

Date: Thu, 06 Sep 2001 02:35:57 GMT
From: "David Hilsee" <davidhilseenews@yahoo.com>
Subject: Re: Redirect stderr to stdout w/ Perl under Unix?
Message-Id: <hiBl7.68065$hT4.17807284@news1.rdc1.md.home.com>


"George Brown" <gncbrown@adelphia.net> wrote in message
news:3B96DB7E.5020603@adelphia.net...
> When exec-ing, how can I redirect stderr to stdout so that all output can
be
> captured into a variable with back ticks?
>
> --
> George and Cindy Brown       e-mail: gncbrown@adelphia.net
> 4 Frederick Drive
> New Hartford, NY  13413
>

perldoc -q stderr

"How can I capture STDERR from an external command?"

David Hilsee




------------------------------

Date: 5 Sep 2001 22:06:13 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Undef'ing multiple variables
Message-Id: <slrn9pd8ee.hk3.abigail@alexandra.xs4all.nl>

Damian Conway (damian@cs.monash.edu.au) wrote on MMCMXXVII September
MCMXCIII in <URL:news:9n4q4a$e2a$1@towncrier.cc.monash.edu.au>:
!! Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de> writes:
!! 
!!        >> So is there, or isn't there, a way to undef multiple variables
!!        >> at once?
!! 
!!        > Don't know any such built-in function. You can do:
!! 
!!        > map { undef $_ } ($a, $b, @c);
!! 
!! Some people don't like to use C<map> in a void context.

Silly people.

!! An alternative would be:
!! 
!!         undef $_ for $a, $b, @c;


Yeah, except that doesn't undef @c - just its elements.


An alternative would be to start all the variables you want to undef
with a particular letter, say U. No other variables should start with U.
Also, the variables should be package variables.

Then you can undefine them using the little known function reset:

     reset "U";


Abigail
-- 
#!/opt/perl/bin/perl -w
$\ = $"; $; = $$; END {$: and print $:} $SIG {TERM} = sub {$ := $_}; kill 15 =>
fork and ($; == getppid and exit or wait) foreach qw /Just another Perl Hacker/


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.

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 V10 Issue 1701
***************************************


home help back first fref pref prev next nref lref last post