[25851] in Perl-Users-Digest
Perl-Users Digest, Issue: 8086 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 16 21:05:28 2005
Date: Mon, 16 May 2005 18:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 16 May 2005 Volume: 10 Number: 8086
Today's topics:
Inline::C and binary incompatibility xhoster@gmail.com
No line editing within perl -d on RedHat <vdheuv.losetheMouse@kabelMickeyfoon.nl>
Re: Perl generated navigation menu <spam@noreply.org>
system problem <ccarpenter@erols.com>
Re: system problem <1usa@llenroc.ude.invalid>
Re: system problem <noreply@gunnar.cc>
Re: system problem <ccarpenter@erols.com>
Re: system problem <abigail@abigail.nl>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 May 2005 00:01:09 GMT
From: xhoster@gmail.com
Subject: Inline::C and binary incompatibility
Message-Id: <20050516200109.340$MO@newsreader.com>
I have some programs on network storage which use Inline::C. The storage
is mounted by several different systems, all of which desire to run the
programs, but not all of which are binary-compatible. This leads to
conflicts over the contents of the Inline build directories.
One solution I found is to set Inline's DIRECTORY configuration option to
be a string including the machine name (from `uname -n`) so that every
computer gets its own directory, but this is non-portable, it requires
extra work to make sure the derived directory name already exists, it
really makes a mess of the directory structure, and it leads to a lot of
lost productivity when a grid/cluster of 200 binary-compatible machines all
need to independently compile the code that just one of them might have
needed to.
So to make a long story short, is there an easy way to ask Perl for a
string which is different for binary incompatibly instances of perl and the
same for binary compatible instances?
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Mon, 16 May 2005 23:53:45 +0200
From: "Theo van den Heuvel" <vdheuv.losetheMouse@kabelMickeyfoon.nl>
Subject: No line editing within perl -d on RedHat
Message-Id: <42891661$0$19778$58c7af7e@news.kabelfoon.nl>
Hi,
Line editing doesn't work when debugging on my
RedHat Linux machine.
For example, I cannot edit/repeat previous commands.
According to the Camel Book, I need to have
Term::ReadKey and Term::ReadLine installed.
I tested both, and they seem to work allright.
Does anybody have an idea what I am missing?
Thanks,
Theo van den Heuvel
------------------------------
Date: Mon, 16 May 2005 20:54:42 +0000
From: michael <spam@noreply.org>
Subject: Re: Perl generated navigation menu
Message-Id: <d6aq9e$toi$01$1@news.t-online.com>
> <li class="this_URL"><b>Pretty Fish</b></li>
This is of course correct, and in fact what I would ultimately do.
> accessing a URL, it is the case of creating a file that will
> become the target of a URL.
Sounds right too. I found that $ENV{"DOCUMENT_NAME"} does what I need.
> It is simple: use a for() loop to generate your html.
Yes I realise. I'm working on it....
Michael
--
You will live a long, healthy, happy life and make bags of money.
------------------------------
Date: Mon, 16 May 2005 19:35:14 -0400
From: "Chip" <ccarpenter@erols.com>
Subject: system problem
Message-Id: <cqednb4QNYIgsBTfRVn-uQ@adelphia.com>
Thanks in advance for your help.
I am trying to fill an array by using grep
so I can print out only the lines with ip
addresses in them.
The following prints the system call on
the screen but does not fill the array.
I don't want the system call to print on
the screen, and I want to fill the array.
#!/usr/bin/perl -w
use strict;
my @array = system("ps ax | grep sendmail");
foreach (@array) {
if ($_ =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/) {
print "$_ \n";
}
}
Any and all help is appreciated.
Chip
------------------------------
Date: Mon, 16 May 2005 23:43:47 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: system problem
Message-Id: <Xns9658C88D4120Dasu1cornelledu@127.0.0.1>
"Chip" <ccarpenter@erols.com> wrote in news:cqednb4QNYIgsBTfRVn-uQ@adelphia.com:
> The following prints the system call on
> the screen but does not fill the array.
>
> I don't want the system call to print on
> the screen, and I want to fill the array.
Then you should read the documentation:
perldoc -f system
> #!/usr/bin/perl -w
use warnings;
is preferable. Read more about it in
perldoc warnings
perldoc perllexwarn
> use strict;
> my @array = system("ps ax | grep sendmail");
Once you have read about the backtick operator (see above),
you might still want to avoid spawning the grep above, and
instead use a pipe open to ps, and process the output of the
command line by line. See:
perldoc -f open
> foreach (@array) {
> if ($_ =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/) {
That would match things other than IP addresses as well.
See
<URL: http://search.cpan.org/dist/Regexp-Common/lib/Regexp/Common/net.pm>
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Tue, 17 May 2005 01:42:37 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: system problem
Message-Id: <3espghF4r02fU1@individual.net>
Chip wrote:
> The following prints the system call on
> the screen but does not fill the array.
>
> I don't want the system call to print on
> the screen, and I want to fill the array.
>
> #!/usr/bin/perl -w
> use strict;
> my @array = system("ps ax | grep sendmail");
Then don't use system(). The docs explain why and what to use instead:
perldoc -f system
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Mon, 16 May 2005 20:30:51 -0400
From: "Chip" <ccarpenter@erols.com>
Subject: Re: system problem
Message-Id: <LrqdnSf7WJBapxTfRVn-og@adelphia.com>
Thanks for your help.
#!/usr/bin/perl
use strict;
use warnings;
my $ps = `ps ax | grep sendmail`;
my @array = split /\n/, $ps;
foreach (@array) {
if ($_ =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/) {
print "$_ \n";
}
}
Seems to work ok for me.
Chip
"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
news:Xns9658C88D4120Dasu1cornelledu@127.0.0.1...
> "Chip" <ccarpenter@erols.com> wrote in
news:cqednb4QNYIgsBTfRVn-uQ@adelphia.com:
>
> > The following prints the system call on
> > the screen but does not fill the array.
> >
> > I don't want the system call to print on
> > the screen, and I want to fill the array.
>
> Then you should read the documentation:
>
> perldoc -f system
>
> > #!/usr/bin/perl -w
>
> use warnings;
>
> is preferable. Read more about it in
>
> perldoc warnings
> perldoc perllexwarn
>
> > use strict;
> > my @array = system("ps ax | grep sendmail");
>
> Once you have read about the backtick operator (see above),
> you might still want to avoid spawning the grep above, and
> instead use a pipe open to ps, and process the output of the
> command line by line. See:
>
> perldoc -f open
>
> > foreach (@array) {
> > if ($_ =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/) {
>
> That would match things other than IP addresses as well.
>
> See
>
> <URL: http://search.cpan.org/dist/Regexp-Common/lib/Regexp/Common/net.pm>
>
> Sinan
>
> --
> A. Sinan Unur <1usa@llenroc.ude.invalid>
> (reverse each component and remove .invalid for email address)
>
> comp.lang.perl.misc guidelines on the WWW:
> http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: 17 May 2005 00:41:10 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: system problem
Message-Id: <slrnd8ifd6.4nh.abigail@alexandra.abigail.nl>
Chip (ccarpenter@erols.com) wrote on MMMMCCLXXVII September MCMXCIII in
<URL:news:LrqdnSf7WJBapxTfRVn-og@adelphia.com>:
''
'' my $ps = `ps ax | grep sendmail`;
'' my @array = split /\n/, $ps;
@array = `ps ax | grep sendmail`;
And don't top-post.
Abigail
--
sub _ {$_ = shift and y/b-yB-Y/a-yB-Y/ xor !@ _?
exit print :
print and push @_ => shift and goto &{(caller (0)) [3]}}
split // => "KsvQtbuf fbsodpmu\ni flsI " xor & _
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 8086
***************************************