[16802] in Perl-Users-Digest
Perl-Users Digest, Issue: 4214 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 3 09:10:42 2000
Date: Sun, 3 Sep 2000 06:10:29 -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: <967986626-v9-i4214@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 3 Sep 2000 Volume: 9 Number: 4214
Today's topics:
Re: module install questions (RH) <gellyfish@gellyfish.com>
Re: net::smtp error (Colin Keith)
Newbie Questions, Gurus Help !! reg_exp@my-deja.com
OT: Re: Setup Factory for Linux? <admin@salvador.venice.ca.us>
Re: Parsing MySQL TEXT field <rlmuller@msn.deletethis.com>
Re: Parsing text file not working properly (Colin Keith)
Re: perl regex to strip out anything other than a lette (Craig Berry)
Re: perl regex to strip out anything other than a lette <anmcguire@ce.mediaone.net>
Perl version question <rlmuller@msn.deletethis.com>
Re: Perl version question <rlmuller@msn.deletethis.com>
Re: Programming Ethics (Soren Andersen)
Re: Re: Setup Factory for Linux? <m0thra@home.com>
Re: Re: Setup Factory for Linux? (Martien Verbruggen)
Re: Return-value of open of nonexisting pipe (Avast)
Re: Return-value of open of nonexisting pipe (Abigail)
Re: Return-value of open of nonexisting pipe <anmcguire@ce.mediaone.net>
Re: script problems <nab$@hotmail.com>
Re: Self-extracting program (Colin Keith)
Submitting form twice fails <reevehotNOSPAM@hotmail.com>
Thinking in Perl reg_exp@my-deja.com
Re: url correcting help? (Colin Keith)
Re: What the joke, no host!? paceman97@aol.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 3 Sep 2000 12:30:49 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: module install questions (RH)
Message-Id: <8otcp9$711$1@orpheus.gellyfish.com>
On Sat, 02 Sep 2000 16:33:23 GMT Jeff Thies wrote:
>> In article <39B091DA.9C979933@sprintmail.com>, Jeff Thies <cyberjeff@sprintmail.com> wrote:
>> >/usr/bin/ld: cannot open -lgdbm: No such file or directory
>>
>> You either don't have libgdbm installed, or the system doesn't know where to
>> find it.
>
> Is this a common file that should be on the OS already, or is it one
> that the module installs?
Skipping ahead in your post and seeing that you are using Red Hat 6.1 then
yes you should have :
/usr/lib/libgdbm.so.2
/usr/lib/libgdbm.so.2.0.0
/usr/lib/libgdbm.a
/usr/lib/libgdbm.la
/usr/lib/libgdbm.so
You should check that these exist and that you have read permission to
them, if they do and you do then there is probably something wrong with
your C compilation system which you should take up with your system admin.
If they dont then they have probably been removed and you will either need
to install it yourself or get the administrator to do so.
/J\
--
yapc::Europe in assocation with the Institute Of Contemporary Arts
<http://www.yapc.org/Europe/> <http://www.ica.org.uk>
------------------------------
Date: Sun, 03 Sep 2000 10:27:18 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: net::smtp error
Message-Id: <bIps5.3894$6A2.381238@nnrp4.clara.net>
In article <8omhi9$frl$1@nnrp1.deja.com>, nosrep@my-deja.com wrote:
>[Thu Aug 31 17:07:39 2000] SMTP.pm: Can't locate Net/SMTP.pm in @INC
>(@INC contains: (normal path stuff here)
Normal path stuff obviously doesn't contain Net::SMTP.pm then. If you can
compile the same script on the cmd line (or run if its using require) then
@INC is different between running under the web server and running under the
command line. Maybe you've set the PERL5LIB env var or some such. Anyway, find
out where the module has been installed to and check that that is on the @INC
of your program when run as a CGI script. If it isn't try the "use lib"
pragma to add it.
If it is on the path, make sure you can read it. Write a script that tries to
read from the file and tells you why it fails, see if that gives you any clues
as to why it can't be found.
I had something similar once ... because some donkey had chmod'ed
/usr/local/lib to 7750 or something extremely stupid :p
Col.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Sun, 03 Sep 2000 12:28:57 GMT
From: reg_exp@my-deja.com
Subject: Newbie Questions, Gurus Help !!
Message-Id: <8otg63$28m$1@nnrp1.deja.com>
Hi,
Can you help me out with these questions please:
1) I have a loop like this :
while ($workunit =~ m/thisandthat/gs) {
...
... code to modify $workunit here
...
}
the problem of course is that once the $workunit gets modified, the
position of the match is reset to the beginning - how can i modify the
regular expression within the loop as well as find all occurences of
the pattern ? can i use the pos function for this ??
2) I have a sequence file which I want to update every time my script
is run. The way I do it presently is tedious :
$seq = `cat ./seq` + 1;
open (F,">./seq");
print $seq F;
close F;
how do i improve this code ?? anything with IN_PLACE_EDIT ?? help...
3) If I pass a file handle to a sub-routine, is the position of the
FILEHANLDE maintained with the routine, or does it get reset to the
start of the file ?? I have problems while doing this, can you comment
on the code as well as the use of foreach and whether this looks too
much like C (theres a post in the group for code that looks like C, I
suffer from this malady too....)
sub main {
open (F,"file");
while ($workunit = get_workunit_from_file(\F)) {
...
... do something with $workunit
...
}
sub get_workunit_from_file() {
$fh = shift;
foreach (<$fh> {
.. do something ..
}
return $workunit or 0;
}
4) How can I create static variables withing a sub routine in Perl ? Or
is this the wrong question, and should i be asking "How do I do
<something> in Perl that may require static variables in C" ??
Thanks for the help,
- reg_exp
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sat, 02 Sep 2000 18:32:07 -0700
From: Pan <admin@salvador.venice.ca.us>
Subject: OT: Re: Setup Factory for Linux?
Message-Id: <39B1AA17.F2695824@salvador.venice.ca.us>
Well, this was on-topic ( i guess ) when you posted it, even if this
response is not. But Linux is Linux, and AFAIK, RPM works on any
version of linux that it is installed on. It also works on:
Linux - Sparc/Intel/PowerPC/Alpha/m68k/SGI
OS/2
Solaris - Sparc/Intel, solaris2.4
Hewlett-Packard HP-UX 10.20
SCO OpenServer 5.0.2
osf3.2
SunOS 4.1.3
sinix5.42
HP-UX 9.04
AIX 3.2.5
AIX 4.1.4
cygwin-B20
LynxOS 3.0.1
MachTen
IRIX
ncr-sysv4.3
FreeBSD
NetBSD
Mint
AmigaOS (with GeekGadgets)
Beos (with GeekGadgets)
So i'm guessing that you have been beaten to the punch.
Brad B wrote:
>
> Pan wrote:
>
> > Ever hear of RPM?
>
> Perhaps you missed the concept. I said "for Linux", not "for Redhat (and
> the other's that happen to support RPM's)" (and actually, as Abigail pointed
> out, and what I really intended/should have said was *nix). The ultimate goal
> would be for this program to be independent of Linux distribution or Unix
> variant.
--
Salvador Peralta
admin@salvador.venice.ca.us
http://www.la-online.com
------------------------------
Date: Sun, 3 Sep 2000 06:16:50 -0400
From: "Richard Muller" <rlmuller@msn.deletethis.com>
Subject: Re: Parsing MySQL TEXT field
Message-Id: <OwXdx#YFAHA.328@cpmsnbbsa09>
> Line1\cM\cJLine2\cM\JLine3\cM\cJ
>
> which seems to be CR/LF fields.
I agree.
It looks to me like "\cM" is intended to signify Ctrl-M, which in DOS and
Windows contexts is "Carriage Return", or in C and Perl contexts, "\r".
Likewise, "\cJ" looks to me like Ctrl-J is "Line Feed" or "\n".
I don't know Perl well enough to be able to know what to do about it.
HTH,
Richard
------------------------------
Date: Sun, 03 Sep 2000 11:29:23 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: Parsing text file not working properly
Message-Id: <nCqs5.3996$6A2.385741@nnrp4.clara.net>
[ Ref to c.l.p snipped. This group doesn't exist ]
In article <39AEE444.A98D0BED@smart.net>, Rick Nakroshis <nakroshis@smart.net>
wrote:
>What am I doing wrong? When I run this program, it prints "BB AA 111"
>on three seperate lines, when I was expecting "BB BB 222". What am I
:) Its simple, if you don't mind I'll pull your code apart and show you .. :)
>#!/usr/bin/perl -w
Good :) use strict; is also a good idea.
>$search = "BB";
Double quotation marks (") make perl look for any parameters to replace. You
should use ''s by default and " where you're embedding variables. It makes
something like:
$def_mail_addr = 'root@localhost';
Less cluttered than: $def_mail_addr = "root\@localhost";
>open (DATAFILE, "data.dat") or die "Can't open the data file: $!";
>while (<DATAFILE>) {
> if (index (<DATAFILE>, $search) eq 0) {
This is your problem line.
<DATAFILE> reads a line from the filehandle into $_, except that you read one
in the while() and then read another one in index(), because you're using it
in index() it doesn't overwrite $_ so before this line $_ = "AA,111", but your
call to index() uses "BB,222" which matches according to your condition.
When you move into the expression $_ = "AA,111", so that's what you see
printed, search (BB) field1 (AA) and field2 (111).
I'd suggest you don't do it in that fashion though. This is Perl, you should
make use of its features and styles:
eq is a string comparison operator, == is the numerical form.
Writing if( ... == 0) is over detailed when you can just write if(! ... )
If you want to compact all of this:
#!/usr/bin/perl -w
use strict;
$, = $\ = "\n";
open(X, "<x") || die "Keboom - $!";
my($search) = 'BB';
/^$search,(\d+)/ && print $search, $1 for(<X>);
Col.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Sun, 03 Sep 2000 01:18:11 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: perl regex to strip out anything other than a letter or a numb
Message-Id: <sr39mj6qc5d126@corp.supernews.com>
sung (sungfung@yahoo.com) wrote:
: I'm trying to strip out anything other than a letter or a number from
: a scalar, here's the regex I have:
:
: $test =~ s/[^[a-zA-Z]\d]//g;
:
: It doesn't work. I think it has to do with putting a character class
: in an anti character class? I'm not sure.
You can't nest classes like that; perl is parsing it as a class consisting
of anythin no a left bracket or a letter, with the \d and the second right
bracket being seen as ordinary regex pattern characters. Since your $test
string likely doesn't contain a lot of string matching that, the
substitution ends up not happening.
If you are happy with narrowing your match criterion from 'letters'
(potentially locale-dependent) to 'English language, ASCII letters' (like
in your attempt above, this is most readily done using tr/// like this:
$test =~ tr/A-Za-z0-9//cd;
The 'c' modifier causes the match set to be complemented, becoming 'any
character which is *not* a letter or number'.
If you want it to be locale-safe, and are willing to accept underscore _
as well as letters and numbers, this very simple form works:
$test =~ s/\W//g;
If you need to exclude _ as well, alternation can be added:
$test =~ s/\W|_//g;
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "Every force evolves a form."
| - Shriekback
------------------------------
Date: Sun, 3 Sep 2000 01:54:37 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: perl regex to strip out anything other than a letter or a numb
Message-Id: <Pine.LNX.4.21.0009030150470.742-100000@hawk.ce.mediaone.net>
On Sat, 2 Sep 2000, sung quoth:
~~ Date: Sat, 02 Sep 2000 22:17:31 GMT
~~ From: sung <sungfung@yahoo.com>
~~ Newsgroups: comp.lang.perl.misc
~~ Subject: perl regex to strip out anything other than a letter or a numb
~~
~~ Dear all,
~~
~~ I'm trying to strip out anything other than a letter or a number from
~~ a scalar, here's the regex I have:
~~
~~ $test =~ s/[^[a-zA-Z]\d]//g;
~~
~~ It doesn't work. I think it has to do with putting a character class
~~ in an anti character class? I'm not sure.
#!/usr/bin/perl -w
use strict;
my $str = 'test =+-)*@#%&!@$#_ ing,-123/,.~\[]}';
$str =~ y~a-zA-Z0-9~~cd; # Faster than s///
print "$str\n";
__END__
perldoc perlop # for details
anm
--
Andrew N. McGuire
anmcguire@ce.mediaone.net
perl -le'print map?"(.*)"?&&($_=$1)&&s](\w+)]\u$1]g&&$_=>`perldoc -qj`'
------------------------------
Date: Sun, 3 Sep 2000 06:26:55 -0400
From: "Richard Muller" <rlmuller@msn.deletethis.com>
Subject: Perl version question
Message-Id: <u$fiBKZFAHA.320@cpmsnbbsa09>
Hi All,
I just downloaded and installed ActiveState Perl 5.6.
When I run it with the -v switch, it announces version 5.6.0. But is that
version # really the "distribution" version, as opposed to the version of
the underlying Perl interpreter?
Looking around on NGs, etc., I get the impression that the current Perl
interpreter version is something like 5.005.
What's the scoop?
Regards,
Richard Muller
------------------------------
Date: Sun, 3 Sep 2000 07:11:23 -0400
From: "Richard Muller" <rlmuller@msn.deletethis.com>
Subject: Re: Perl version question
Message-Id: <e4GGQdZFAHA.250@cpmsnbbsa09>
I just looked at http://www.perl.org/perl6/ and discovered Perl 6 is under
development. Then I found in comp.lang.perl.announce that Perl 5.7.0 has
just been released, but that 5.6.0 is the current stable release, with 5.6.1
expected to be a stable upgrade.
So my question is answered.
Regards,
Richard
"Richard Muller" <rlmuller@msn.deletethis.com> wrote in message
news:u$fiBKZFAHA.320@cpmsnbbsa09...
> Hi All,
>
> I just downloaded and installed ActiveState Perl 5.6.
>
> When I run it with the -v switch, it announces version 5.6.0. But is that
> version # really the "distribution" version, as opposed to the version of
> the underlying Perl interpreter?
>
> Looking around on NGs, etc., I get the impression that the current Perl
> interpreter version is something like 5.005.
>
> What's the scoop?
>
> Regards,
> Richard Muller
>
>
------------------------------
Date: 3 Sep 2000 12:50:23 GMT
From: soren@spmfoiler.removethat.wonderstorm.com (Soren Andersen)
Subject: Re: Programming Ethics
Message-Id: <8othef$ong$1@slb6.atl.mindspring.net>
tim@degree.ath.cx (Tim Hammerquist) wrote in
<slrn8q7h2b.66a.tim@degree.ath.cx>:
>My meaning is that, to some degree, all of us might me disqualified
>due to the fact that we are all (at times) egomaniac talking heads
>making philosophical speeches about the right and wrong of a purely
>subjective field.
>
>It was also a joke. =)
>
>Sorry for any misunderstanding.
Thanks for clarifying that. Joke or not, though, it contains a valid (if
obvious .. to me at least) point. The 'Net makes it possible for anyone to
set up a tree stump, clamber atop it, and begin to rail. However that
wasn't really what I was talking about. I had in mind more the electronic
media, that great passive server push-technology that we now use as the
all-purpose baby-sitter, tranquilizer and low-grade stimulant, TV. ("We" in
a general sense, as in, most N. American households have one and most
people use it for hours and hours each day ..). I fully agree with one
particular school of pundits who say that on the whole it (TV) is making us
stupider: it has cut our attention-span off at the knees, made us less
capable of critical thought and discernment .. the readership of this
newsgroup is likely to contain numerous exceptions, again utterly
obviously; this isn't an "average" cross-section of society but instead a
selection based on gifts that go into making a programmer -- which includes
at least the ability to sustain concentration for a good little while.
My point was that even when people think they are watching something
"intellectual" like TV news commentary (think 'Nightline' or along those
lines) they are still very much disposed to accept the assumption that the
figures they roll out to babble about the topic of the moment are specially
qualified to do so (or that the anchorperson 'spinning' the headlines of
the day are qualified to do such sly interpretive manipulation of the
news they present). And given the info overload of the times it's hard to
blame anybody for that in specific circumstances.
Possibly dead horse, beaten: people must not surrender their obligation to
think for themselves to so-called "experts" selected for them by news
organizations who drag the streets looking for ex-political operatives and
that ilk .. who have created this lucrative category of personal enrichment
schemes for cynical hacks to add to what they've drawn from the public
trough. One looks at what these people have for "credentials" and the sense
of disbelief grows every day ..
Best,
soren andersen
--
Using PNG-format images as Web BACKGROUNDs without
"breaking your Site" for silly older browsers:
http://www.wonderstorm.com/techstuff/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------
Date: Sun, 03 Sep 2000 04:42:34 GMT
From: "m0thra" <m0thra@home.com>
Subject: Re: Re: Setup Factory for Linux?
Message-Id: <_Eks5.11027$a5.101933@news1.rdc1.mb.home.com>
"Pan" <admin@salvador.venice.ca.us> wrote in message
news:39B1AA17.F2695824@salvador.venice.ca.us...
> Well, this was on-topic ( i guess ) when you posted it, even if this
> response is not. But Linux is Linux, and AFAIK, RPM works on any
> version of linux that it is installed on. It also works on:
>
<snip the big long irrelevant list that you somehow think aided in proving
your point>
With RPM's unmet dependencies are still unmet dependencies. That is, you
_can_ still --force the install, but it won't necessarily make the program
work. If you had read the URL I had posted you would see that SF5 virtually
guarantees that THERE ARE NO unmet dependencies, and makes it as easy as
possible for the _programmer_ (keyword, for the _programmer_) to create such
an installation mechanism for ease of distribution of their programs.
As another example, the wonderful apt-get tool for Debian is a nice
package management tool. But again, a.) apt-get doesn't work on every Linux,
and b.) _apt-get_ is the program that resolves dependency issues during the
package installation rather than incorporating this into the .deb's
themselves.
In conclusion, I'm not trying to suggest that my idea is actually
feasible, only inquiring to see what other Perl programmers think of it. It
may turn out that this idea is incredibly dumb (admittedly, "automatically
installing" certain required files could cause severe problems in other
applications and a way around that would have to be considered).
But please grasp the concept before posting "answers" that completely
miss the point.
</off_topic_reply_to_off_topic_reply>
Brad
------------------------------
Date: Sun, 3 Sep 2000 23:20:03 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Re: Setup Factory for Linux?
Message-Id: <slrn8r4gfj.ucf.mgjv@martien.heliotrope.home>
[NOTE: followups set]
\begin{offtopic}
On Sun, 03 Sep 2000 04:42:34 GMT,
m0thra <m0thra@home.com> wrote:
>
> "Pan" <admin@salvador.venice.ca.us> wrote in message
> news:39B1AA17.F2695824@salvador.venice.ca.us...
> > Well, this was on-topic ( i guess ) when you posted it, even if this
> > response is not. But Linux is Linux, and AFAIK, RPM works on any
> > version of linux that it is installed on. It also works on:
> >
> <snip the big long irrelevant list that you somehow think aided in proving
> your point>
I don't agree it was irrelevant, especially since you made the point
earlier that rpm only works on a few linuxes. Go back and read your own
post, if you don't believe it. The R in RPM is for RedHat, but that
doesn't mean the software won't work anywhere else. It's not written in
Redmond.
> With RPM's unmet dependencies are still unmet dependencies. That is, you
> _can_ still --force the install, but it won't necessarily make the program
If you force the installation, then you break the contract. You either
use RPM or you don't. If you don't, or if you 'abuse' a package manager,
then you become responsible. RPM does what it is supposed to do. It
informs you of prerequisites and versions thereof for any package you
install. It also informs you about other sorts of dependencies, and does
many other things besides that.
> work. If you had read the URL I had posted you would see that SF5 virtually
> guarantees that THERE ARE NO unmet dependencies, and makes it as easy as
> possible for the _programmer_ (keyword, for the _programmer_) to create such
> an installation mechanism for ease of distribution of their programs.
Before you start screaming at me: I haven't read that URL you posted,
and I won't. I'm here to spend time on Perl, not on this issue. I'm just
spending time on it now, in the hope that it will convince you that
you're talking to the wrong people.\
> As another example, the wonderful apt-get tool for Debian is a nice
> package management tool. But again, a.) apt-get doesn't work on every Linux,
> and b.) _apt-get_ is the program that resolves dependency issues during the
> package installation rather than incorporating this into the .deb's
> themselves.
>
> In conclusion, I'm not trying to suggest that my idea is actually
> feasible, only inquiring to see what other Perl programmers think of it. It
> may turn out that this idea is incredibly dumb (admittedly, "automatically
> installing" certain required files could cause severe problems in other
> applications and a way around that would have to be considered).
>
> But please grasp the concept before posting "answers" that completely
> miss the point.
I don't think the point was missed at all.
I think the largest objection against what you are proposing is that
that only would be possible if each software packager would package
_all_ prerequisites in one bundle. That quickly leads to enormous
version incompatibility problems (see MS Windows). This point has
already been made in this thread.
If you try to get out of that by saying that instead of everyone
packaging everything, but working with interpackage dependencies, then
you are talking about rpm, or Solaris's pkg* set of commands, or any
package managing mechanism.
I think that your idea is laudable, but I'm afraid you haven't really
thought it through yet. As far as I can tell, you are either duplicating
RPM or equivalents, or you are creating something like the horrible
install programs that exist on Microsoft platforms. The first thing is
a waste of time, and the second would be evil.
Note that I have not said anything new in this post. I've just attempted
to summarise things already said. The reason for this is that I hope it
will kill this offtopic thread, and maybe I can point you to start a new
one on a newsgroup where it is more appropriate, something like
comp.unix.sysadmin, or thereabouts. While you may be thinking of Perl as
the base of this new package, it is irrelevant to the pros and cons of
the software itself.
Talk to the Unix professionals on their turf. Ask them what they think.
Perl programmers are sometimes unix admins, but more often not. And
sometimes they _think_ they are, and get into discussions like these,
getting totally on the wrong track. Discuss things where they are most
likely to attract the largest amount of expert criticism.
\end{offtopic}
Martien
--
Martien Verbruggen |
Interactive Media Division | System Administration is a dirty
Commercial Dynamics Pty. Ltd. | job, but someone said I have to do
NSW, Australia | it.
------------------------------
Date: Sun, 03 Sep 2000 03:36:30 GMT
From: avast@hortonsbay.com (Avast)
Subject: Re: Return-value of open of nonexisting pipe
Message-Id: <39b1c6f5.50293970@news.accesstoledo.com>
On 02 Sep 2000 19:19:18 EDT, abigail@foad.org (Abigail) wrote:
>Martin H.Ludwig (Martin.H.Ludwig@ing-buero-ludwig.de) wrote on MMDLIX
>September MCMXCIII in <URL:news:20000902.21445100@biggy.ma.net>:
>## Hello,
>##
>## I want to use the open-command to open a pipe and to test if the program
>## exists. Strange to say open results with a defined return-value even if
>## the pipe-command does not exists!
>##
>##
>## #!/usr/bin/perl
>##
>## $Empf="Martin.H.Ludwig\@ing-buero-ludwig.de";
>## $mailprog="/usr/sbin/sendmailXX";
>## $|=1;
>##
>## $xpid = open (MAIL, "| $mailprog $Empf");
>##
>## if ( defined( $xpid ) ) {
>## print "Open OK\n";
>## } else {
>## print "Open-Error\n";
>## }
>##
>##
>##
>## results everytime [SCARY CHARACTER]Open OK[SCARY CHARACTER], although /usr/sb
>## exist. $xpid is the PID des Perl-program. Whats wrong?
>
>Your reading ability.
perldoc perlstyle | grep -i nice
Avast
------------------------------
Date: 03 Sep 2000 01:00:06 EDT
From: abigail@foad.org (Abigail)
Subject: Re: Return-value of open of nonexisting pipe
Message-Id: <slrn8r3ml1.8ac.abigail@alexandra.foad.org>
Avast (avast@hortonsbay.com) wrote on MMDLX September MCMXCIII in
<URL:news:39b1c6f5.50293970@news.accesstoledo.com>:
&& On 02 Sep 2000 19:19:18 EDT, abigail@foad.org (Abigail) wrote:
&&
&& perldoc perlstyle | grep -i nice
Whatever.
Bye.
A.
--
------------------------------
Date: Sun, 3 Sep 2000 01:26:03 -0500
From: "Andrew N. McGuire " <anmcguire@ce.mediaone.net>
Subject: Re: Return-value of open of nonexisting pipe
Message-Id: <Pine.LNX.4.21.0009030124240.742-100000@hawk.ce.mediaone.net>
On Sun, 3 Sep 2000, Avast quoth:
~~ Date: Sun, 03 Sep 2000 03:36:30 GMT
~~ From: Avast <avast@hortonsbay.com>
~~ Newsgroups: comp.lang.perl.misc
~~ Subject: Re: Return-value of open of nonexisting pipe
~~
~~ On 02 Sep 2000 19:19:18 EDT, abigail@foad.org (Abigail) wrote:
~~
~~ >Martin H.Ludwig (Martin.H.Ludwig@ing-buero-ludwig.de) wrote on MMDLIX
~~ >September MCMXCIII in <URL:news:20000902.21445100@biggy.ma.net>:
~~ >## Hello,
~~ >##
~~ >## I want to use the open-command to open a pipe and to test if the program
~~ >## exists. Strange to say open results with a defined return-value even if
~~ >## the pipe-command does not exists!
~~ >##
~~ >##
~~ >## #!/usr/bin/perl
~~ >##
~~ >## $Empf="Martin.H.Ludwig\@ing-buero-ludwig.de";
~~ >## $mailprog="/usr/sbin/sendmailXX";
~~ >## $|=1;
~~ >##
~~ >## $xpid = open (MAIL, "| $mailprog $Empf");
~~ >##
~~ >## if ( defined( $xpid ) ) {
~~ >## print "Open OK\n";
~~ >## } else {
~~ >## print "Open-Error\n";
~~ >## }
~~ >##
~~ >##
~~ >##
~~ >## results everytime [SCARY CHARACTER]Open OK[SCARY CHARACTER], although /usr/sb
~~ >## exist. $xpid is the PID des Perl-program. Whats wrong?
~~ >
~~ >Your reading ability.
~~
~~ perldoc perlstyle | grep -i nice
as Abigail said:
perldoc perldata | perl -wne 'm~@(\w+) = \(\);~ && print "\u$1.\n"'
Now:
perldoc perlstyle | perl -wne 's~nice~*plonked*~ && print'
anm
--
Andrew N. McGuire
anmcguire@ce.mediaone.net
perl -le'print map?"(.*)"?&&($_=$1)&&s](\w+)]\u$1]g&&$_=>`perldoc -qj`'
------------------------------
Date: Sun, 3 Sep 2000 13:14:57 -0700
From: "Nabonida$" <nab$@hotmail.com>
Subject: Re: script problems
Message-Id: <Kars5.34549$rq2.33696@news2-hme0>
i have lots of scripts that work fine on the same server.
the script itself is writes an ip address, entered in the form, to a file.
Nab$
Heikki Simperi <trio@surffi.saunalahti.fi> wrote in message
news:39b1629b.10236288@news.saunalahti.fi...
> There are something wrong in your httpd server´s ( Apache?) config
> files. Server doesn´t reconice that extension´s files should drive
> under perl-debugger before sending output to user´s browser.
>
> In Apache
> -----------------
>
> Check does you have this line in your http.conf file, in default it is
> commented with #, remove # from start of line:
>
> AddHandler cgi-script .cgi
>
> Any help?
>
>
> Heikki Simperi
> trio@surffi.saunalahti.fi
>
>
> On Sat, 2 Sep 2000 14:17:22 -0700, "Nabonida$" <nab$@hotmail.com>
> wrote:
>
> >every time i try to run one of my scripts i get a the "do you want to
> >download this file" message box. the permissions are correct, using post
> >from a form.
> >never had this problem with any of my other scripts.
> >can anyone help me.
> >Nab$
> >
> >
>
------------------------------
Date: Sun, 03 Sep 2000 12:47:38 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: Self-extracting program
Message-Id: <KLrs5.4026$6A2.391430@nnrp4.clara.net>
In article <8oo4jm$8u7$1@nnrp1.deja.com>, tltt@my-deja.com wrote:
>single program which when ran extracts from itself all the files that
>constitute the system and installs them in the right places after
maia% cat x
#!/usr/bin/perl -w
use strict;
use Shell;
open(OUT, ">/tmp/test.ttf.gz") || die "Can't open tmp file - $!";
print OUT while(<DATA>);
gzip( qw(-d /tmp/test.ttf.gz));
print "Data decompressed okay.\n" if(!$?);
__DATA__
maia% cat x test.ttf.gz > y
maia% perl ./y
maia% file /tmp/test.ttf
/tmp/test.ttf: raw G3 data, byte-padded
(Though I just changed all the filenames that I was using, so that's probably
broken it :) But basically anything after __DATA__ (and before __END__) is
accessible via the filehandle DATA, so just write your installer and when you
want to distribute it, stick the tarball/zip/gz/picnic basket on the end with
cat, and away you go, just execute it :)
Thx btw, I've wondered for a while if this was possible, but hadn't had any
pressing need to try it .. but I figured someone asking was a good time to see
if my curiousity was correct :)
Col.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Sun, 3 Sep 2000 21:29:30 +1000
From: "James R" <reevehotNOSPAM@hotmail.com>
Subject: Submitting form twice fails
Message-Id: <dIps5.7831$cr3.228231@ozemail.com.au>
I have a pretty standard Perl script for converting form to mail (using Blat
and NT).
When I submit the form contents once, it works fine, but when I submit it
again, even with some minor changes, it fails to write the temp file and
send the email.
My thoughts are that it may have something to do with localised variables
carrying over to the second run, or the original temp-file not closing.
Should I reset variables at the end?
Should I "exit", rather than leaving the script to end itself?
Anyone got any thoughts?
------------------------------
Date: Sun, 03 Sep 2000 12:35:15 GMT
From: reg_exp@my-deja.com
Subject: Thinking in Perl
Message-Id: <8otgi3$2j2$1@nnrp1.deja.com>
Hi,
I'm a Perl newbie.... simple question : "How do I think in Perl" ?
By this I mean :
a) How can I learn to use the Perl idioms better ?
b) How should I think of OOP in Perl ?
c) How can I use hashes more effectively ?
d) Can I reuse the idioms learnt in other languages in Perl, or should
I discard them ??
Thanks,
- reg_exp
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 03 Sep 2000 10:37:58 GMT
From: newsgroups@ckeith.clara.net (Colin Keith)
Subject: Re: url correcting help?
Message-Id: <aSps5.3896$6A2.382063@nnrp4.clara.net>
In article <8omn96$mo0$1@nnrp1.deja.com>, ptomsic@my-deja.com wrote:
>so could someone please point me in the direction of something that
>would run thru a directory tree, find URLS that are not full-urls'
The HTML::Parser module (bundle) from CPAN will allow you to parse HTML files.
Col.
---
Colin Keith
Systems Administrator
Network Operations Team
ClaraNET (UK) Ltd. NOC
------------------------------
Date: Sat, 02 Sep 2000 23:39:33 -0400
From: paceman97@aol.com
Subject: Re: What the joke, no host!?
Message-Id: <39B1C7F5.CE5F102@aol.com>
http://www.webprovider.com/
Tom Fotheringham wrote:
> I love it, but I need to love it more. What I really want is to get some
> Perl powered web sites up on the web.
>
> Can somebody please tell me where I can get free CGI-BIN hosting. I know
> theres one in the UK somewhere and that its linux based but I can remember
> where I read it.
>
> Thanks
> Tom F
------------------------------
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 4214
**************************************