[17634] in Perl-Users-Digest
Perl-Users Digest, Issue: 5054 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 7 11:05:35 2000
Date: Thu, 7 Dec 2000 08:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <976205110-v9-i5054@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 7 Dec 2000 Volume: 9 Number: 5054
Today's topics:
Re: Alternating Prints from Two Files <e.roselli@volusoft.com>
Re: Alternating Prints from Two Files <e.roselli@volusoft.com>
Re: Alternating Prints from Two Files (Rafael Garcia-Suarez)
Re: Alternating Prints from Two Files <schneider@xtewa.de>
Re: Apache on Linux - Error on scripts called thru brow <taboo@comcen.com.au>
Re: Apache on Linux - Error on scripts called thru brow (Rafael Garcia-Suarez)
Re: Apache on Linux - Error on scripts called thru brow <cmon_209@hotmail.com>
Re: Apache on Linux - Error on scripts called thru brow <cmon_209@hotmail.com>
Re: Comparing two folders then writing difference to fi <taboo@comcen.com.au>
Re: Getting file properties <cleon42@my-deja.com>
Re: Help with Globbing and File Handling (Tad McClellan)
Re: Help with Globbing and File Handling <e.roselli@volusoft.com>
Help with HttpSniffer <jdhunter@nitace.bsd.uchicago.edu>
How to Exit from Inner Loop ??? cwang9@yahoo.com
Re: How to Exit from Inner Loop ??? (Bernard El-Hagin)
Re: How to Exit from Inner Loop ??? <josef.moellers@fujitsu-siemens.com>
Re: How to Exit from Inner Loop ??? (Bernard El-Hagin)
Re: How to Exit from Inner Loop ??? <steven@ircnet.dk>
Re: IOT/Abort trap running using setuid wrapper AIX <ronr@my-deja.com>
IPC::ShareLite; No space left on device errors <steven@ircnet.dk>
IPC::ShareLite; No space left on device errors <steven@ircnet.dk>
Re: Making Perl output window on NT scrollable. <schneider@xtewa.de>
Re: Making Perl output window on NT scrollable. <somewhere@planet.earth>
Re: Making Perl output window on NT scrollable. (Markus Becker)
Modules in MS-DOS <keisari_@hotmail.com>
Re: Modules in MS-DOS <mkuin@globalrangers.com>
Re: Refreshing /reloading pages with perl <dgale@mailexcite.com>
Re: regex, s and m, dice and elephants <anthony@notsoevil.com>
Re: regex, s and m, dice and elephants (Bernard El-Hagin)
Re: regex, s and m, dice and elephants (Tad McClellan)
Re: regex, s and m, dice and elephants <anthony@notsoevil.com>
Regular expression question <matt_lechner@yahoo.com>
Re: Regular expression question <tick.toff@spam.com>
Re: Regular expression question (Bernard El-Hagin)
Re: Regular expression question <matt_lechner@yahoo.com>
Running gnuplot from a script <M.I.Planchant@ncl.ac.uk>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 7 Dec 2000 16:00:06 +0100
From: "Elisa Roselli" <e.roselli@volusoft.com>
Subject: Re: Alternating Prints from Two Files
Message-Id: <90o8m2$e1m$1@wanadoo.fr>
"Rafael Garcia-Suarez" <rgarciasuarez@free.fr> a écrit dans le message news:
slrn92v07q.drg.rgarciasuarez@rafael.kazibao.net...
> While you're at using Unix command-line tools, have you looked at
> paste(1) ?
Thanks for reminding me about paste. I'd quite forgotten, and with Perl
uninstalled on our Unix server, I had migrated all my files to Windows NT
where I could hit them with ActiveState.
Now I've migrated them all back and solved the problem with a little shell
using paste and some sed to get rid of the unwanted separators and
superflouous spaces.
Still, for the sake of the art, I would have liked to know why I couldn't
get the Perl programme to work.
>You're reading HEAFILE twice here.
How can I avoid re-invoking it and still get the corresponding line into a
variable?
Thanks again,
Elisa Francesca Roselli
------------------------------
Date: Thu, 7 Dec 2000 16:02:34 +0100
From: "Elisa Roselli" <e.roselli@volusoft.com>
Subject: Re: Alternating Prints from Two Files
Message-Id: <90o8qi$ck7$1@wanadoo.fr>
"Clyde Ingram" <cingram-at-pjocs-dot-demon-dot-co-dot-uk> a écrit dans le
message news: 976191152.5534.0.nnrp-04.9e98e5bc@news.demon.co.uk...
> $txtLine[0] = <HEAFILE>;
> chomp $txtline[0];
> $txtLine[1] = <CUTFILE>;
> print OUT $txtLine[0].$txtLine[1];
>
> Does that help?
I'm afraid I'm still getting the problem of it only taking alternating lines
from HEAFILE. I can't understand why, logically. But no matter, I've solved
the immediate issue in another way.
Thanks anyway,
Elisa Francesca Roselli
------------------------------
Date: Thu, 07 Dec 2000 15:11:53 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Alternating Prints from Two Files
Message-Id: <slrn92va7f.gda.rgarciasuarez@rafael.kazibao.net>
Elisa Roselli wrote in comp.lang.perl.misc:
>
> "Rafael Garcia-Suarez" <rgarciasuarez@free.fr> a écrit dans le message news:
> slrn92v07q.drg.rgarciasuarez@rafael.kazibao.net...
> > While you're at using Unix command-line tools, have you looked at
> > paste(1) ?
>
> Thanks for reminding me about paste. I'd quite forgotten, and with Perl
> uninstalled on our Unix server, I had migrated all my files to Windows NT
> where I could hit them with ActiveState.
>
> Now I've migrated them all back and solved the problem with a little shell
> using paste and some sed to get rid of the unwanted separators and
> superflouous spaces.
Remove unwanted spaces? I don't know which Unix you're using, but
paste -d \\0 file1 file2
works for me and doesn't output a separator (Linux and Solaris).
> Still, for the sake of the art, I would have liked to know why I couldn't
> get the Perl programme to work.
> >You're reading HEAFILE twice here.
> How can I avoid re-invoking it and still get the corresponding line into a
> variable?
I think it's already in $_.
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Thu, 07 Dec 2000 15:30:10 GMT
From: SimBean <schneider@xtewa.de>
Subject: Re: Alternating Prints from Two Files
Message-Id: <90oae4$gdn$1@nnrp1.deja.com>
> >You're reading HEAFILE twice here.
> How can I avoid re-invoking it and still get the corresponding line
into a
> variable?
[..]
my @txtLine
while (defined($txtLine[0] = <HEAFILE>)){
[..]
--
Ciao,
SimBean.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 8 Dec 2000 01:04:29 +1100
From: "Kiel Stirling" <taboo@comcen.com.au>
Subject: Re: Apache on Linux - Error on scripts called thru browser
Message-Id: <3a2f98ed$1@nexus.comcen.com.au>
CM <cmon_209@hotmail.com> wrote:
>Hi.
>
>I am running Perl on Apache .My scripts are running OK when called from
>the command prompt.
>
>However when I call them thru the browser I get these *two* messages on
>the error_log .
>
>
>[Thu Dec 7 04:42:31 2000] [error] (2)No such file or directory: exec
>of /home/httpd/cgi-bin/test.pl failed
>
>[Thu Dec 7 04:42:31 2000] [error] [client 192.168.100.132] Premature
>end of script headers: /home/httpd/cgi-bin/test.pl
>
>
>To clarify
>
>For the first error--> the file *does* exist in the specified directory.
>Forthe second error--> The Perl file does start with #!/usr/bin/perl.
>
>
>
>
>
>I have followed the guidelines in
>
>www.apache.org- 'Running CGI scripts on server' documentation
>
>
>and made sure that all the .conf files
>
>httpd.conf
>srm.conf
>access.conf
>
>are as per requirements.
>
>
>
>Since I am used to Perl on Windows I am finding it difficult to grasp
>the other parameters that are involved in Linux.
>
>I have been sitting on this for 5 hours now with two 10 minute
>breaks ....so I guess if somebody can help me out with this I will
>really *appreciate* it.
>
>[yawn] Thank you very much!!
Are you printing a content type ie,
print "Content-Type: text/html\n\n";
Regards,
Kiel Stirling
------------------------------
Date: Thu, 07 Dec 2000 14:06:36 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Apache on Linux - Error on scripts called thru browser
Message-Id: <slrn92v6d4.g3i.rgarciasuarez@rafael.kazibao.net>
CM wrote in comp.lang.perl.misc:
>
> I am running Perl on Apache .My scripts are running OK when called from
> the command prompt.
>
> However when I call them thru the browser I get these *two* messages on
> the error_log .
>
>
> [Thu Dec 7 04:42:31 2000] [error] (2)No such file or directory: exec
> of /home/httpd/cgi-bin/test.pl failed
>
> [Thu Dec 7 04:42:31 2000] [error] [client 192.168.100.132] Premature
> end of script headers: /home/httpd/cgi-bin/test.pl
>
> To clarify
>
> For the first error--> the file *does* exist in the specified directory.
> Forthe second error--> The Perl file does start with #!/usr/bin/perl.
And is perl in /usr/bin ? To execute a script file, the linux kernel
looks for the interpreter that's after the #! characters. The "No such
file or directory" error may referer to /usr/bin/perl. If you execute
your scripts from the command-line via 'perl test.pl' you won't notice
this error.
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Thu, 07 Dec 2000 14:28:44 GMT
From: CM <cmon_209@hotmail.com>
Subject: Re: Apache on Linux - Error on scripts called thru browser
Message-Id: <90o6ql$d5r$1@nnrp1.deja.com>
In article <3a2f98ed$1@nexus.comcen.com.au>,
"Kiel Stirling" <taboo@comcen.com.au> wrote:
>
> CM <cmon_209@hotmail.com> wrote:
> >Hi.
> >
> >I am running Perl on Apache .My scripts are running OK when called
from
> >the command prompt.
> >
> >However when I call them thru the browser I get these *two* messages
on
> >the error_log .
> >
> >
> >[Thu Dec 7 04:42:31 2000] [error] (2)No such file or directory: exec
> >of /home/httpd/cgi-bin/test.pl failed
> >
> >[Thu Dec 7 04:42:31 2000] [error] [client 192.168.100.132] Premature
> >end of script headers: /home/httpd/cgi-bin/test.pl
> >
> >
> >To clarify
> >
> >For the first error--> the file *does* exist in the specified
directory.
> >Forthe second error--> The Perl file does start with #!/usr/bin/perl.
> >
> >
> >
> >
> >
> >I have followed the guidelines in
> >
> >www.apache.org- 'Running CGI scripts on server' documentation
> >
> >
> >and made sure that all the .conf files
> >
> >httpd.conf
> >srm.conf
> >access.conf
> >
> >are as per requirements.
> >
> >
> >
> >Since I am used to Perl on Windows I am finding it difficult to grasp
> >the other parameters that are involved in Linux.
> >
> >I have been sitting on this for 5 hours now with two 10 minute
> >breaks ....so I guess if somebody can help me out with this I will
> >really *appreciate* it.
> >
> >[yawn] Thank you very much!!
> Are you printing a content type ie,
> print "Content-Type: text/html\n\n";
>
> Regards,
>
> Kiel Stirling
>
Yes I am printing those lines .
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 07 Dec 2000 14:31:47 GMT
From: CM <cmon_209@hotmail.com>
Subject: Re: Apache on Linux - Error on scripts called thru browser
Message-Id: <90o70j$dfr$1@nnrp1.deja.com>
In article <slrn92v6d4.g3i.rgarciasuarez@rafael.kazibao.net>,
rgarciasuarez@free.fr (Rafael Garcia-Suarez) wrote:
> CM wrote in comp.lang.perl.misc:
> >
> > I am running Perl on Apache .My scripts are running OK when called
from
> > the command prompt.
> >
> > However when I call them thru the browser I get these *two*
messages on
> > the error_log .
> >
> >
> > [Thu Dec 7 04:42:31 2000] [error] (2)No such file or directory:
exec
> > of /home/httpd/cgi-bin/test.pl failed
> >
> > [Thu Dec 7 04:42:31 2000] [error] [client 192.168.100.132]
Premature
> > end of script headers: /home/httpd/cgi-bin/test.pl
> >
> > To clarify
> >
> > For the first error--> the file *does* exist in the specified
directory.
> > Forthe second error--> The Perl file does start with
#!/usr/bin/perl.
>
> And is perl in /usr/bin ? To execute a script file, the linux kernel
> looks for the interpreter that's after the #! characters. The "No such
> file or directory" error may referer to /usr/bin/perl. If you execute
> your scripts from the command-line via 'perl test.pl' you won't notice
> this error.
>
> --
> # Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
>
Yes Perl is in the specified directory
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 8 Dec 2000 01:06:20 +1100
From: "Kiel Stirling" <taboo@comcen.com.au>
Subject: Re: Comparing two folders then writing difference to file.
Message-Id: <3a2f995c@nexus.comcen.com.au>
Stew Dean <stewart@webslave.dircon.co.uk> wrote:
>Hi,
>
>My perl is rusty so the more help I can get the better here. I'm
>looking for a application or script to compare two folders and then
>write these to a new folder. Idealy this should have a web front end to
>allow files to be over written.
>
>This is so that files altered localy can be zipped up and sent to the
>live server so I'd be very suprised if someone somewhere hasnt created
>such a tool.
>
>If you could email if you help I'd be very thankful.
>
>Cheers
>--
>Stewart Dean
>http://www.webslave.dircon.co.uk
Will you pay $$
------------------------------
Date: Thu, 07 Dec 2000 15:03:13 GMT
From: Adam Levenstein <cleon42@my-deja.com>
Subject: Re: Getting file properties
Message-Id: <90o8rc$f37$1@nnrp1.deja.com>
Thanks all...Now, next question in the same area:
My two lines read like this:
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks
= stat('/tmp/lock.content');
($fsec,$fmin,$fhour,$fmday,$fmon,$fyear,$fwday,$fyday,$fisdst) = $mtime;
Now, the simple question with the long answer - why doesn't this work?
$fsec returns a value, but nothing else ($fmin,$fhour, etc.) does.
I appreciate the help,
Adam
In article <90mq0a$n6v$1@hermes.nz.eds.com>,
"Peter Sundstrom" <peter.sundstrom@eds.com> wrote:
>
> Adam Levenstein <cleon42@my-deja.com> wrote in message
> news:90mlev$7m9$1@nnrp1.deja.com...
> > Hey all,
> >
> > Do you know of a way to get UNIX file properties through perl (other
> > than "ls -l >")? Specifically, I'm looking to figure out a way to get
> > the time/date a file was created.
>
> It is impossible to tell when a file is created under Unix. However, you
> can find out various info with stat()
>
> perldoc -f stat
>
>
--
-------------------------------------------------
Adam Levenstein
cleon42@my-deja.com
"Extraordinary claims require extraordinary evidence."
-- Carl Sagan
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 7 Dec 2000 07:46:02 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Help with Globbing and File Handling
Message-Id: <slrn92v1ka.u32.tadmc@magna.metronet.com>
Elisa Roselli <e.roselli@volusoft.com> wrote:
>I have several hundred files in a directory, in pairs with identical names
>and different suffixes, like "*.hea" and "*.cut". I wish to evoke both files
>of the pair with file-handles that would treat them recursively as input
^^^^^^^^^^^
I do not see any recursion in what you describe...?
>and output to a file with the same name as the other two, but without the
>suffix. What is the exact syntax for globbing and file handling in one go?
You cannot open multiple files in one open call.
>Can it be done?
Not in one go, but you can loop over them.
I also cannot recommend using glob().
#UNTESTED!
my $dir = 'E:/menu/en_menu';
opendir(DIR, $dir) || die "could not open '$dir' directory $!";
my @basenames = grep s/\.hea$//, readdir DIR;
closedir(DIR);
foreach my $fname ( @basenames ) {
open(HEA, "$dir/$fname.hea") || die ...
open(CUT, "$dir/$fname.cut") || die ...
open(OUT, ">$dir/$fname") || die ...
# do stuff
close(HEA);
close(CUT);
close(OUT);
}
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 7 Dec 2000 16:05:14 +0100
From: "Elisa Roselli" <e.roselli@volusoft.com>
Subject: Re: Help with Globbing and File Handling
Message-Id: <90o8vj$ek6$1@wanadoo.fr>
Thanks for showing me that. I'll take it into my corner and play with it
when I get a little breather.
Cheers,
Elisa Francesca Roselli
"Tad McClellan" <tadmc@metronet.com> a écrit dans le message news: >
#UNTESTED!
> my $dir = 'E:/menu/en_menu';
> opendir(DIR, $dir) || die "could not open '$dir' directory $!";
> my @basenames = grep s/\.hea$//, readdir DIR;
> closedir(DIR);
>
> foreach my $fname ( @basenames ) {
> open(HEA, "$dir/$fname.hea") || die ...
> open(CUT, "$dir/$fname.cut") || die ...
> open(OUT, ">$dir/$fname") || die ...
>
> # do stuff
>
> close(HEA);
> close(CUT);
> close(OUT);
> }
------------------------------
Date: 07 Dec 2000 09:54:29 -0600
From: John Hunter <jdhunter@nitace.bsd.uchicago.edu>
Subject: Help with HttpSniffer
Message-Id: <1r4s0gdy6i.fsf@video.bsd.uchicago.edu>
I am trying to use HttpSniffer to log the http headers in a dialog
between my browser and a remote server.
Specifically, I want to log all the outgoing http headers in the
following transaction:
From http://www.ncbi.nlm.nih.gov/PubMed/ I enter a search term in the
search box and click 'Go'. On the results page, there is a drop down
menu where one can choose a format. I choose 'Medline' and then click
'Display'.
Can HttpSniffer handle this for me without a proxy server installed
on my machine. I have tried starting HttpSniffer with
HttpSniffer -v -r 'www.ncbi.nlm.nih.gov:80'
HttpSniffer -v -r 'http://www.ncbi.nlm.nih.gov:80'
HttpSniffer -v -r 'http://www.ncbi.nlm.nih.gov'
HttpSniffer -v -r 'http://www.ncbi.nlm.nih.gov/PubMed/'
and the like but it just sits there do nothing while I browse away in
netscape, so clearly I am doing something wrong. If I use the verbose
flag, I just get the output
#### Made listening socket on 3
And then nothing happens.
If there is an easier/better way, I am very receptive.
Advise please,
John Hunter
------------------------------
Date: Thu, 07 Dec 2000 14:35:58 GMT
From: cwang9@yahoo.com
Subject: How to Exit from Inner Loop ???
Message-Id: <90o78e$djh$1@nnrp1.deja.com>
I have 2 while loop and one is as an inner loop.
Just could not find a way to exit the inner loop and
start the next round of outer one. Some function like
'continue' in C/C++ I am looking for.
I checked 2 Perl books I have so far,,,
Thanks,
Jack
Tampa, FL
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 7 Dec 2000 15:02:55 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: How to Exit from Inner Loop ???
Message-Id: <slrn92v9hp.9v.bernard.el-hagin@gdndev25.lido-tech>
On Thu, 07 Dec 2000 14:35:58 GMT, cwang9@yahoo.com <cwang9@yahoo.com>
wrote:
>I have 2 while loop and one is as an inner loop.
>
>Just could not find a way to exit the inner loop and
>start the next round of outer one. Some function like
>'continue' in C/C++ I am looking for.
Here's one way:
OUTER: while(something){
while(something_else){
if(i_want_to_leave){
next OUTER;
}
else{
#I'm staying;
}
}
#stuff for the outer while
}
Cheers,
Bernard
--
perl -le '$#="Just Another Perl Hacker"; print \Bernard'
------------------------------
Date: Thu, 07 Dec 2000 16:04:14 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: How to Exit from Inner Loop ???
Message-Id: <3A2FA6EE.842B21EE@fujitsu-siemens.com>
cwang9@yahoo.com wrote:
> =
> I have 2 while loop and one is as an inner loop.
> =
> Just could not find a way to exit the inner loop and
> start the next round of outer one. Some function like
> 'continue' in C/C++ I am looking for.
> =
> I checked 2 Perl books I have so far,,,
=2E.. but haven't found "next"!
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
------------------------------
Date: Thu, 7 Dec 2000 15:08:45 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: How to Exit from Inner Loop ???
Message-Id: <slrn92v9t2.9v.bernard.el-hagin@gdndev25.lido-tech>
On Thu, 7 Dec 2000 15:02:55 +0000 (UTC), Bernard El-Hagin
<bernard.el-hagin@lido-tech.net> wrote:
>On Thu, 07 Dec 2000 14:35:58 GMT, cwang9@yahoo.com <cwang9@yahoo.com>
>wrote:
>>I have 2 while loop and one is as an inner loop.
>>
>>Just could not find a way to exit the inner loop and
>>start the next round of outer one. Some function like
>>'continue' in C/C++ I am looking for.
>
>Here's one way:
>
>OUTER: while(something){
> while(something_else){
> if(i_want_to_leave){
> next OUTER;
> }
> else{
> #I'm staying;
> }
> }
> #stuff for the outer while
>}
I apologise for the weird indenting.
Cheers,
Bernard
--
perl -le '$#="Just Another Perl Hacker"; print \Bernard'
------------------------------
Date: Thu, 07 Dec 2000 15:21:20 GMT
From: steven <steven@ircnet.dk>
Subject: Re: How to Exit from Inner Loop ???
Message-Id: <90o9t8$g3k$1@nnrp1.deja.com>
In article <90o78e$djh$1@nnrp1.deja.com>,
cwang9@yahoo.com wrote:
> I have 2 while loop and one is as an inner loop.
>
> Just could not find a way to exit the inner loop and
> start the next round of outer one. Some function like
> 'continue' in C/C++ I am looking for.
>
> I checked 2 Perl books I have so far,,,
perldoc -f last
--
steven
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 07 Dec 2000 14:31:43 GMT
From: Ronald J.H. Rood <ronr@my-deja.com>
Subject: Re: IOT/Abort trap running using setuid wrapper AIX
Message-Id: <90o70g$dfq$1@nnrp1.deja.com>
In article <slrn92v1lq.20m.mgjv@martien.heliotrope.home>,
mgjv@tradingpost.com.au wrote:
> On Thu, 07 Dec 2000 12:16:19 GMT,
> Ronald J.H. Rood <ronr@my-deja.com> wrote:
> > In article <slrn92umoa.20m.mgjv@martien.heliotrope.home>,
> > mgjv@tradingpost.com.au wrote:
> >> On Thu, 07 Dec 2000 08:47:02 GMT,
> >> Ronald J.H. Rood <ronr@my-deja.com> wrote:
> >> > Hi,
> >> >
> >> > I made a little perl script that uses net::Ping to do icmp pings.
For
> >> > this reason it needs to use root privilege. So I made a little
binary,
> >> > made it setuid root:system to call my script.
> >> >
> >> > All I get is IOT/Abort trap
> >>
> >> But Perl isn't giving you any errors, is it? Migth it be your
system
> >> doing this? Might you be doing something wrong somewhere? Hard to
> > tell.
> >
> > Thanks for the reaction Martien,
> >
> > In the mean time I fixed part of the problem. The error went away
after
> > removing the -u flag. The icmp ping now works fine but ...
> > a new problem came in.
>
> You mean you were running perl with the -u flag and used undump to
> create the binary you talked about above? Or were you running perl
with
> -u all the time? If you do, perl will dump core after compiling the
> program, but before running it. That's the point of the flag.
>
> Did I misunderstand what you are saying, or did you misunderstand what
> -u does? I'm confused.
>
> dump/undump, IIRC, isn't always reliable anyway.
>
> > I heard of sudo but I am afraid the problem is hidden in my code. It
> > will have something to do with subroutines, parameters, scoping.
> > Debugging_mode=ON.
>
> yes, but sudo would allow you to write a program the normal way (I'd
> still use the -T flag), and rely on the sudo binary to do the right
> setuid things.
>
> Did you have a look at perlsec, as I suggested?
Yes, I did. A lot of words there, not much help for me. I got some taint
error. I think it was because I read the hostname from STDIN. I checked
the validity of the hostname by resolving it to an ip-address and vv.
I changed the code a little, now I do no longer need ping. Ofcourse it
give me a little less detail but for most cases it is just enough.
Perl is new for me and there is a lot to learn. It's mostlikely that I
do not understand the -u flag. The binary I made was just a little c
program that executes the perl script. The binary is setuid root.
The goal of the script was to see if a specific service was availlable
on a given host, passed via STDIN. The original idea was to ping the
host to see if it was running. If it was, open a telnet connection to
the port. It that succeeded, the service was there, if not, not.
Most hosts are configured to react on icmp pings only. The missing
detail now is that I don't know if just all services are down, or that
the complete host is down...
Learning_mode = ON.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 07 Dec 2000 14:57:32 GMT
From: steven <steven@ircnet.dk>
Subject: IPC::ShareLite; No space left on device errors
Message-Id: <90o8go$emh$1@nnrp1.deja.com>
Hi,
Environment: Solaris 7, Apache 1.3.12, Perl 5.6.0, mod_perl 1.24.
I have an authentication handler that's caching usernames and passwords
in shared memory using IPC::ShareLite 0.08 and Storable 0.73. Under some
light load I'm getting a lot of "No space left on device" errors,
although the shared segment isn't full (using the default of 64k). After
a little while (seemingly randomly) the errors aren't occuring, and all
is well, albeit for a very short while. Once I've had the segment
"disappear". I'm wondering:
Is there a limit on the number of processes that can have a handle on a
shared memory segment? I have about 15-20 httpd children all attempting
to access it.
Is constant accessing, thawing, changing, freezing and storing going to
cause that kind of problem? I'm locking when changing its contents.
Is there anything I'm missing in attempting to diagnose this problem?
ipcs doesn't tell me too much; either the error is misleading or I'm not
looking in the right place. Pointers?
Thanks.
--
steven
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 07 Dec 2000 14:58:18 GMT
From: steven <steven@ircnet.dk>
Subject: IPC::ShareLite; No space left on device errors
Message-Id: <90o8i7$en7$1@nnrp1.deja.com>
Hi,
Environment: Solaris 7, Apache 1.3.12, Perl 5.6.0, mod_perl 1.24.
I have an authentication handler that's caching usernames and passwords
in shared memory using IPC::ShareLite 0.08 and Storable 0.73. Under some
light load I'm getting a lot of "No space left on device" errors,
although the shared segment isn't full (using the default of 64k). After
a little while (seemingly randomly) the errors aren't occuring, and all
is well, albeit for a very short while. Once I've had the segment
"disappear". I'm wondering:
Is there a limit on the number of processes that can have a handle on a
shared memory segment? I have about 15-20 httpd children all attempting
to access it.
Is constant accessing, thawing, changing, freezing and storing going to
cause that kind of problem? I'm locking when changing its contents.
Is there anything I'm missing in attempting to diagnose this problem?
ipcs doesn't tell me too much; either the error is misleading or I'm not
looking in the right place. Pointers?
Thanks.
--
steven
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 07 Dec 2000 14:24:05 GMT
From: SimBean <schneider@xtewa.de>
Subject: Re: Making Perl output window on NT scrollable.
Message-Id: <90o6hu$d18$1@nnrp1.deja.com>
> Can anyone say how to add scrollbars and a nice long memory buffer to
this
> window?
AFAIK that's not possible: scrollbars are winGUI and I know no way to
scroll the window up.
Why not print the output into a file??
--
Ciao,
SimBean.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 7 Dec 2000 16:13:10 +0100
From: "Dimitri Gunsing" <somewhere@planet.earth>
Subject: Re: Making Perl output window on NT scrollable.
Message-Id: <90o9dq$und$1@list.pbnec.nl>
Yes, its easy....
Go to %WINNT%\profiles\<your login name>\startmenu\programs and rightclick
on 'Command prompt.pif'. Go to 'Layout' then look under 'Screen buffer size'
and change the 'height' value to 100 (or more, I believe the standard is
25). Click okay and your done.
The next time you start CMD.EXE you will be able to scroll 100 lines back
using the scroll bar on the right side.
I use the same trick :)
Clyde Ingram <cingram-at-pjocs-dot-demon-dot-co-dot-uk> wrote in message
news:976192969.6170.1.nnrp-04.9e98e5bc@news.demon.co.uk...
> I have a number of Perl scripts, on NT, which pop-up the usual window to
> trace STDOUT and STDERR output.
>
> They spew out shedload of useful trace information.
> Sadly, I cannot PageUp to look back at what has just scrolled out of view.
>
> Can anyone say how to add scrollbars and a nice long memory buffer to this
> window?
>
> Thank-you,
> Clyde
>
>
------------------------------
Date: 7 Dec 2000 16:53:12 +0100
From: becker@zess.uni-siegen.de (Markus Becker)
Subject: Re: Making Perl output window on NT scrollable.
Message-Id: <slrn92vcn2.85.becker@becker.zess.uni-siegen.de>
Am Thu, 7 Dec 2000 12:49:50 -0000 schrieb Clyde Ingram <cingram-at-pjocs-dot-demon-dot-co-dot-uk>:
>They spew out shedload of useful trace information.
>Sadly, I cannot PageUp to look back at what has just scrolled out of view.
>
>Can anyone say how to add scrollbars and a nice long memory buffer to this
>window?
When the script is running, right click on the title bar.
Select Properties/Layout, there you can adjust everything you
like. I usually use 1 to 2000 lines of buffer for a DOS-box.
Apply the changes "to all windows with the same name".
Markus
------------------------------
Date: Thu, 07 Dec 2000 17:13:53 +0200
From: joonas <keisari_@hotmail.com>
Subject: Modules in MS-DOS
Message-Id: <3A2FA931.575896EF@hotmail.com>
How can I install modules in MS-Dos.
Joonas.
------------------------------
Date: Thu, 7 Dec 2000 16:39:52 +0100
From: "Mark Kuin" <mkuin@globalrangers.com>
Subject: Re: Modules in MS-DOS
Message-Id: <90ob0d$8it$1@news1.xs4all.nl>
If you are using the Activestate perl, you can use ppm (perl package
manager).
"joonas" <keisari_@hotmail.com> wrote in message
news:3A2FA931.575896EF@hotmail.com...
> How can I install modules in MS-Dos.
>
> Joonas.
------------------------------
Date: Thu, 07 Dec 2000 15:37:30 GMT
From: "Doug Gale" <dgale@mailexcite.com>
Subject: Re: Refreshing /reloading pages with perl
Message-Id: <_8OX5.9895$7.370806@quark.idirect.com>
"Bob Smith" <gglackin@nospam.eircom.net> wrote in message
news:dbKX5.3913$Er5.2336@news.indigo.ie...
> I have a perl script that generates html and allows users to add/update
and
> delete records. Once the submit button is pressed the record is added and
I
> use the following perl line to
> redirect to the script for displaying the records
>
> print "Location: display_table.pl?username=$username&type= type\n\n";
^^ I am assuming that you meant ...&type=$type
>
> The problem is that updates are not displayed until you hit the refresh
> button. I have tried adding a no-cache in the Meta http-equiv tag, but
this
> doesnt work.
>
> Any Ideas??
>
Is the form a GET form? GET forms are cacheable, but POST forms are not. Try
changing to a POST type form, but make sure that the script supports POST
forms (look for "read(STDIN, $qs, $ENV{"CONTENT_LENGTH"});").
Ahhh, but you are using the ? to pass parameters, so a POST form is no good
when using "Location:".
However, you can still do it though, just generate a page uses hidden fields
on a form:
Just make a form with the values you want to pass in hidden fields, then use
JavaScript to submit the form.
Try something like this (untested):
------
print "Content-type: text/html\n\n";
# Get the page into a variable
$retpage = <<ENDOFHTML;
<html>
<head>
<title>Processing...</title>
</head>
<body>
<form action="/cgi-bin/display_table.pl" method="POST">
<input type="hidden" name="username" value="!!USERNAME!!">
<input type="hidden" name="type" value="!!TYPE!!">
</form>
<script language="Javascript"><!--
document.forms[0].submit();
// -->
</script>
</body>
</html>
ENDOFHTML
# Fill in values
$retpage =~ s/\!\!USERNAME\!\!/$username/;
$retpage =~ s/\!\!TYPE\!\!/$type/;
# Send page
print $retpage;
------
Doug
------------------------------
Date: Thu, 07 Dec 2000 14:23:56 GMT
From: Anthony Bouvier <anthony@notsoevil.com>
Subject: Re: regex, s and m, dice and elephants
Message-Id: <3958A819.8FBB56B5@notsoevil.com>
> Please do not send stealth Cc'd email, it can get you killfiled.
What the hell are you talking about? I did no such thing.
> "result set"?
>
> Most people would call that thingie "a string".
>
No, really? At least I didn't call it a 'thingie'. :P~
> >$message =~ s#//roll (\d{1,2} \d{1,2})#&RollDice($1)#ge;
> We cannot troubleshoot &RollDice if we are not given the
> code that implements &RollDice.
>
I was commenting, not asking for help with &RollDice. As you will notice in a
reply to my own message (timed before yours), it was merely a scope issue.
Though I do not know what your recent snippity attitude stems from, I do
appreciate your -earlier- assistance.
--
anthony bouvier
notsoevil philosopher
--
------------------------------
Date: Thu, 7 Dec 2000 14:40:02 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: regex, s and m, dice and elephants
Message-Id: <slrn92v878.9v.bernard.el-hagin@gdndev25.lido-tech>
On Thu, 07 Dec 2000 14:23:56 GMT, Anthony Bouvier
<anthony@notsoevil.com> wrote:
[snip]
>Though I do not know what your recent snippity attitude stems from, I do
>appreciate your -earlier- assistance.
You have a funny way of showing your appreciation to one of the most
helpful people in this NG.
Cheers,
Bernard
--
perl -le '$#="Just Another Perl Hacker"; print \Bernard'
------------------------------
Date: Thu, 7 Dec 2000 09:45:11 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: regex, s and m, dice and elephants
Message-Id: <slrn92v8jn.ugu.tadmc@magna.metronet.com>
[ defunct newsgroup removed from Newsgroups: ]
Anthony Bouvier <anthony@notsoevil.com> wrote:
>> Please do not send stealth Cc'd email, it can get you killfiled.
I now see what I should have done earlier.
s/ can / did /;
>What the hell are you talking about?
You sent me an email copy of a newsgroup posting without saying
in the body that you were doing so. That is a stealth Cc.
>I did no such thing.
And you most certainly did do that.
>As you will notice in a
>reply to my own message (timed before yours)
The order that things are written in has no correlation to the
order that they are read in. Can you tell when articles hit
my news server?
>Though I do not know what your recent snippity attitude stems from,
It isn't recent. Its at least 18 months old.
>I do
>appreciate your -earlier- assistance.
You're welcome, but that won't be happening again for a while.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 07 Dec 2000 16:01:19 GMT
From: Anthony Bouvier <anthony@notsoevil.com>
Subject: Re: regex, s and m, dice and elephants
Message-Id: <3958BED7.DE852B31@notsoevil.com>
Precisely how many times am I to say thank you for pointing out the /e
modifier?
Is there some prescribed amount that needs to take place?
Oh, I know, consult the docs: perldoc perlass --kiss ?
Bernard El-Hagin wrote:
>
> You have a funny way of showing your appreciation to one of the most
> helpful people in this NG.
>
And his earlier messages were -very- helpful. I pointed that out and said
thanks. But the last message jumped to accusing me of stealth cc'ing, and
critiquing me for simply saying 'result set' (which, I may point out, is
obviously a string -- called a result set because of its format of one or more
integers within a SET of parentheses).
Regardless, no need to create a flame war here. I do appreciate Tad's help.
--
anthony bouvier
notsoevil philosopher
--
------------------------------
Date: Thu, 07 Dec 2000 09:55:19 -0500
From: Matthew Lechner <matt_lechner@yahoo.com>
Subject: Regular expression question
Message-Id: <3A2FA4D7.FC236ECF@yahoo.com>
Hello, how can I construct a regular expression to solve the following
problem:
Given the following sentence:
The dog was dog tired.
How can I match "dog" only when it is not part of the phrase "dog
tired"? Thanks for your help.
Matt
matt_lechner@yahoo.com
------------------------------
Date: Thu, 07 Dec 2000 15:13:05 GMT
From: "SuperGumby" <tick.toff@spam.com>
Subject: Re: Regular expression question
Message-Id: <5ONX5.8258$xW4.68332@news-server.bigpond.net.au>
You're not after a regex, you're after an AI.
The specific case you mention could be programmed, but would not behave the
way I believe you require should it hit the sentence "The dog tired.".
I've been reading a bucket of posts and there's some smart cookies here, but
if someone can program a regex which handles the general case of finding a
word except when that word is part of a colloquial phrase I'll switch off
and start eating the 'puter.
Matthew Lechner wrote in message <3A2FA4D7.FC236ECF@yahoo.com>...
>Hello, how can I construct a regular expression to solve the following
>problem:
>
>Given the following sentence:
>
>The dog was dog tired.
>
>How can I match "dog" only when it is not part of the phrase "dog
>tired"? Thanks for your help.
>
>Matt
>matt_lechner@yahoo.com
>
------------------------------
Date: Thu, 7 Dec 2000 15:06:29 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Re: Regular expression question
Message-Id: <slrn92v9op.9v.bernard.el-hagin@gdndev25.lido-tech>
On Thu, 07 Dec 2000 09:55:19 -0500, Matthew Lechner
<matt_lechner@yahoo.com> wrote:
>Hello, how can I construct a regular expression to solve the following
>problem:
>
>Given the following sentence:
>
>The dog was dog tired.
>
>How can I match "dog" only when it is not part of the phrase "dog
>tired"? Thanks for your help.
m/dog(?! tired)/ #will match "dog" if not followed by
#a space followed by "tired"
Cheers,
Bernard
--
perl -le '$#="Just Another Perl Hacker"; print \Bernard'
------------------------------
Date: Thu, 07 Dec 2000 10:25:58 -0500
From: Matthew Lechner <matt_lechner@yahoo.com>
Subject: Re: Regular expression question
Message-Id: <3A2FAC06.68F4F3DD@yahoo.com>
Actually, the regex will do fine for my purposes. But you bring up an
interesting point...
Matt
------------------------------
Date: 7 Dec 2000 15:50:21 GMT
From: "M.I. Planchant" <M.I.Planchant@ncl.ac.uk>
Subject: Running gnuplot from a script
Message-Id: <90objt$jrh$1@ucsnew1.ncl.ac.uk>
How do I go about running gnuplot from a perl script? I have a file which
contains data which when given the command :
gnuplot <filename>
Creates several graphs.
How can I exectute gnuplot from inside a script and pass to it the file?
Cheers,
Matt.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 5054
**************************************