John, thanks for the perl approach. Mustn't forget about that!
deb
At 20:59:59, on 01.02.04:
Cracks in my tinfoil beanie
allowed John W. Krahn to seep these bits into my brain:,
Deb wrote:
I want to run a command inside a script. From the shell, here's the command:
% ps -ef | /bin
going as far as dropping off the grep (grep -v),
and never executing the awk '{print $2}'. I've tried this with
the system() call, with the same results.
Please, what am I missing? :-(
deb
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http
?0:08 /usr/lib/sendmail -bd -q15m
We have sendmail
Thanks for any help,
deb
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
so much
for pointing that out.
deb
--
o _ _ _
_o /\_ _ \\o (_)\__/o (_)
_ \_ _(_) (_)/_\_| \ _|/' \/
(_)(_) (_)(_) (_)(_)' _\o_
http://zapatopi.net/afdb.html
--
To unsubscribe, e-mail
for the better regexp,
deb
--
o _ _ _
_o /\_ _ \\o (_)\__/o (_)
_ \_ _(_) (_)/_\_| \ _|/' \/
(_)(_) (_)(_) (_)(_)' _\o_
http://zapatopi.net/afdb.html
--
To unsubscribe, e-mail: [EMAIL PROTECTED
Please see response, inline:
At 17:26:25, on 12.31.03:
Cracks in my tinfoil beanie
allowed Rob Dixon to seep these bits into my brain:,
Hi Deb.
Hi Rob!
Perl is trying to expand $2 in your string. Since Perl's $2 is undefined it
gives you the warning (full marks for using -w but 'use strict
, and not doing the
awk '{print $2}'. I've tried this with the system() call, with the same
results.
What am I missing? :-(
deb
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
Here's some test code I'm working with:
## begin ##
while ($name = DATA) {
$name =~ /(\w*)\.*/;
$name{$1}++;
$name =~ /(\w+)/;
print $ \n;
}
__DATA__
tibor.test.net
mars.test.net
moon-bx-r.test.net
moon-bs-d.test.net
moon-bt-321.test.net
## end ##
This
At 10:17:47, on 11.25.03:
Cracks in my tinfoil beanie
allowed Brian Gerard to seep these bits into my brain:,
And the clouds parted, and deb said...
What am I missing?
Two things:
1) The regex you're looking for is likely /[-\w]+/, which says match one
or more dashes or word characters
Hi Rob,
At 18:44:10, on 11.25.03:
Cracks in my tinfoil beanie
allowed Rob Dixon to seep these bits into my brain:,
Deb wrote:
What am I missing?
Hi Deb.
You're missing the hyphen from the character class. The \w class
is the same as [0-9A-Za-z_], and what you need is all of those
$opt_h to initialize the variable, but then that just
overwrites the setting from the commandline, as you might expect.
What should I do to rid myself of the complaint? As far as I can tell, It's
used only once, and that's all I need. So, what am I missing?
Thanks,
deb
PS- I'm on the digest
Thanks! I get it now!
deb
At 21:37:06, on 07.10.03:
Cracks in my tinfoil beanie allowed Rob Dixon to seep these bits into my brain:,
Deb wrote:
Rob, you were very helpful in showing me how the split and join
work, but
since I wasn't looking to change anything in $line except to
replace
No problem, Charles. :-) Thanks for responding, though!
deb
At 19:34:15, on 07.09.03:
Cracks in my tinfoil beanie allowed Charles K. Clarkson to seep these bits into my
brain:,
[snipped code]
Holy Cow!
Deb, I apologize. After reading Rob's answer, I
re-read your message and I
',', @addrs;
$line = $units . = . $tmpline . \n;
This accomplishes the task, but I'm using a lot of temporary variables. Is
there a better way?
Thanks,
deb
At 00:29:16, on 07.10.03:
Cracks in my tinfoil beanie allowed Rob Dixon to seep these bits into my brain:,
Deb wrote:
Rob
Try this (untested):
#The variable $fh is not a filehandlie - you need to assign that:
my $fh = somefile;
open (FILE, $fh test) || die $!; # Open file for writing
while (FILE) {
print FILE Hello\n;
}
close (FILE);
Some would say you don't need to do the close. Some say you do. I usually
Please see correction, below:
At 13:14:50, on 07.10.03:
Cracks in my tinfoil beanie allowed deb to seep these bits into my brain:,
Try this (untested):
#The variable $fh is not a filehandlie - you need to assign that:
my $fh = somefile;
This line isn't quite right:
open (FILE, $fh test
the comma. Only the comma is necessary.
I can't seem to find the right incantation to replace just those spaces.
HELP! :-)
deb
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
the comma. Only the comma is necessary.
I can't seem to find the right incantation to replace just those spaces.
HELP! :-)
deb
--
o _ _ _
_o /\_ _ \\o (_)\__/o
split
a lot, but not join. I appreciate you giving an example.
deb
At 23:47:28, on 07.09.03:
Hi Deb.
Here's the way I'd do it. First check that the line starts with
'units' - whitespace - '=' - whitespace and strip it off in one
statement. Then you seem to be left with a number
care of
block and non-blocking I/O. Methinks it may be simpler just to stick with
printing directly to $log and not the FH, LOG.
Any advise is welcome!
deb
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
a filehandle instead? Seems I'd have to take care of
block and non-blocking I/O. Methinks it may be simpler just to stick with
printing directly to $log and not the FH, LOG.
Any advise is welcome!
deb
--
o _ _ _
_o /\_ _ \\o (_)\__/o
Cool. I didn't know about the IPC::Open3 module. Will look at it.
Thanks for the pointer!
deb
At 15:04:25, on 06.23.03:
Cracks in my tinfoil beanie allowed John W. Krahn to seep these bits into my brain:,
Deb wrote:
I've got a script which opens a filehandle to write print statments
the debugger, but the font did not change in the code pane.
But, if I run an xterm with xterm -fn 9x12 the xterm is displayed with
the correct font size.
Has anyone been able to manipulate the font size using this module? If so,
what did you do to change the font size?
Thanks,
deb
PS: I'm
Jeff Westman [EMAIL PROTECTED] had this to say,
Have you tried exporting PTKDB_CODE_FONT ?
Not really - I should have said that I use tcsh, and environmental variables
take effect immediately...
Thanks for the response, though.
deb
--
To unsubscribe, e-mail: [EMAIL PROTECTED
-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
This is not equivalent to 9x15, but that's okay, because it looks just fine.
Thanks,
deb
I have been using the Devel::ptkdb module on SunOS, which is a really fine
tool. However, the text in the code pane is extremely small
Doh, you're sooo right.
Thanks,
d
John W. Krahn [EMAIL PROTECTED] had this to say,
Deb wrote:
Wait. Using this construct, I can't seem to get the change to write out to
the file, like I can to stdout.
while (IN) {
if ( /^That_Text\s=\s2/ ) {
$_ .= $addText
Hi,
I am modifying a file and replacing a string that I find, which works just
fine. However, sometimes there is already a string there that I don't want to
replace, but instead append something to it.
Here's what I've got so far: (obligatory use statements not included here)
while (IN) {
Kewl! I didn't know you could do that,
$_ .= $sometext;
That's just what I needed. Beats the heck out of the search and replace I was
doing when I didn't need to.
Thanks all!
d
Wags had this to say,
if ( /^That_Text\s=\s2/ ) {
$_ .= $addText;
}else
Wait. Using this construct, I can't seem to get the change to write out to
the file, like I can to stdout.
while (IN) {
if ( /^That_Text\s=\s2/ ) {
$_ .= $addText;
}else {
s/^This_Text.*$/That_Text = 2/;
}
You don't need the $_ since this is the
the 1st edition even dreamed about including.
(set me back $50, but in the long run should be well worth it)
The only thing left now is to be able to add new key, values to the %Lists
hash, as my program comes across them.
deb
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands
Does anyone know of a searchable archive for the [EMAIL PROTECTED] list?
The archives I've located don't seem to be searchable...
Thanks,
d
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
,
deb
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I'm not sure what you're saying. Since this is an anonymous hash assignment,
how do I pull out the $listkey? Do I need to pre-assign it? For example,
I tried this, added to the previous program,
foreach $listname (sort keys %Lists) {
print $listname:\n;
foreach $key (sort keys %Lists)
to pull it out of annonymous
hashes, if you *don't* want to use a literal to obtain a key,
$xKey = $hash{'-x'}
to then iterate over the hash to get the value. Yuck.
Still chewing on the bones...
deb
Steve Grazzini [EMAIL PROTECTED] had this to say,
Don't mean to thump the FM
Still struggling with multilevel hashes. Below is my code snippet, obligatory
use statments are in effect. I don't understand the error. Line 52 refers
to the line %hrLists assignment -
Where did I go wrong?
Thanks,
deb
while (DATA) {
chomp;
($listname, $field) = split
are not lettying me tayp; fdsa
right nows.)
Tnx!
Steve Grazzini [EMAIL PROTECTED] had this to say,
Deb [EMAIL PROTECTED] writes:
Still struggling with multilevel hashes.
snip
=20
while (DATA) {
chomp;
($listname, $field) =3D split(/:/, $_);
print \nListname is $listname,\nField
the info I'm looking for!
G'Day,
deb
Deb sez,
Thanks for the quick reply...
Okay, I could use Data::Dumper, but what do you mean by empty
leading field? Am I dense? (probably!)
I don't really want to use D::D module, so what would I do to
alleviate this? Ensure no leading white space? I'll
urllist push ftp://myurl/'
Could not fetch authors/id/A/AN/ANDK/CPAN-1.63.tar.gz
Giving up on '/home/deb/.cpan/sources/authors/id/A/AN/ANDK/CPAN-1.63.tar.gz'
Note: Current database in memory was generated on Sun, 20 Oct 2002 21:52:34 GMT
cpan
Well, Duh. v1.63 has been superceded by v1.70 - so
of thoughts, HTH,
Thanks,
deb
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
There are 010 types of people in the world:
those who understand binary, and those who don't.
ô¿ô 111,111,111 x 111,111,111 = 12,345,678,987,654,321 (decimal
! That did the trick.
I didn't know about cpanplus. Will have to look into that when my current
project is complete. Thanks for the tip!
deb
--
Contrary to popular opinion, Unix is user friendly, It just happens to be
very selective about who it makes friends with.
--
To unsubscribe
Why not use a foreach, test the element, then undef it when found?
Or, use foreach, test the element, if != '0', then push it onto
another array?
David Gilden [EMAIL PROTECTED] had this to say,
Hi,
I would like to remove elements from an array that are eq to string '0'
The following does
think. In other words, keep on trucking...!
Thanks to everyone who offered their expertise.
deb
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I'm no expert, but this sounds like a buffering problem. You might want to
read,
http://perl.plover.com/FAQs/Buffering.html
deb
[EMAIL PROTECTED] [EMAIL PROTECTED] had this to say,
Is there an issue running perl under linux xinetd where xinetd is
listening for connections on a UDP port
Okay, I'm still struggling. sigh I just cannot seem to get my mind to
stop, look, and listen. Here's some code I'm working on:
- 8-
use strict;
my %cmdLine;
my $DBG = 1;
while (DATA) {
chomp;
my ($adx,
explain very
well. I hope I explained more completely in my posting just previous
to this one.
Thanks,
deb
John W. Krahn [EMAIL PROTECTED] had this to say,
Deb wrote:
Hi Guys,
I have an array in which each element is a line commandline data. It looks
something like this -
@Array
Here's the modified script. I made some changes, as suggested, but there
was no change in the output. I've included my entire script. My head is
getting mighty flat from banging it against the wall. Oh, and I added use
warnings; and I haven't got a clue what I need to do to fix those. sigh
(H, this should have been posted, but I don't see it - sorry if this
actually becomes a double-posting...)
Here's the modified script. I made some changes, as suggested, but there
was no change in the output. I've included my entire script. My head is
getting mighty flat from banging it
, and I've got to get
up in about 5 hours).
I'll post again how it goes.
(Although, I'm still in the same misery as far as the while loop and
creating the hashes. I've really got to work that out too.)
Thanks again,
deb
The secret of the universe is @*^^^ NO CARRIER
Did anyone see my lost
into the above approach - which is probably more
elegant, but difficult for me to see how to do in practice.
deb
R. Joseph Newton [EMAIL PROTECTED] had this to say,
Deb wrote:
Hi Guys,
I have an array in which each element is a line commandline data. It looks
something like
that
for the $x = (shift), how can I be efficient to check again for -r, which I
still haven't found?
Is this making any sense?
Thanks,
deb
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
There are 010 types of people in the world:
those who
Thanks, I know how to use split (I think). Since the data comes in
any order, and I have to corellate it, I can't think of a way that split
will fix me up - Maybe I'm missing something. Can you give me an example?
deb
Dan Muey [EMAIL PROTECTED] had this to say,
perldoc -f split
Will fic
Thanks, everyone. Looks like the approach is to determine how
long I'm willing to wait, then count down from there. I especially
like John's example of using time.
deb
John W. Krahn [EMAIL PROTECTED] had this to say,
Maybe something like this will work for you?
my $start = time;
my
with some error.
Any pearls of wisdom out there? I could use a boost...
Thanks,
deb
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
this out?
Since it works as expected, and I don't want the complaint to stdout/stderr,
how would I write this such that perl will not complain?
Thanks,
deb
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
There are 010 types of people in the world
Hmmm, that's a useful work-around.
I may use it, but I'm really interested in finding out what the correct
invocaton of map EXPR, LIST would be.
Anyone know?
Thanks,
deb
Kipp, James [EMAIL PROTECTED] had this to say,
if you wanted to keep the use warnings pragma in there you could use
.
deb
Paul [EMAIL PROTECTED] had this to say,
--- Deb [EMAIL PROTECTED] wrote:
Hmmm, that's a useful work-around.
I may use it, but I'm really interested in finding out what the
correct invocaton of map EXPR, LIST would be.
Anyone know?
Thanks,
deb
The problem in the stuff after
Paul Johnson [EMAIL PROTECTED] had this to say,
Bang tcgrep into google and see if that brings you any joy.
Checking it out. Thanks for the reference (I forgot there was something
in the Cookbook...)
deb
from the commandline takes a long, long time. I even re-niced the
command -10 as root, but it still takes hours.
Would perl be able to optimize the search and grep better than what I am
currently doing?
Ideas, jokes and rants are appreciated...
:-)
deb
always up for a good util...
deb
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
There are 010 types of people in the world:
those that understand binary, and those that don't.
ô¿ô
~
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
Hello!
From the commandline, what is the output of
% /usr/sbin/sendmail -bv [EMAIL PROTECTED]
on the server which you cannot send anything?
Also useful, would be any error output that was generated... Hard to
say if this is a perl problem or sendmail, or...???
deb
Johnstone, Colin
head quit hurting so much!
deb
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
There are 010 types of people in the world:
those that understand binary, and those that don't.
ô¿ô
~
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
, as I
said before, I think I understand hashes, just not what it takes to
manipulate them. But I'm too tired right now to form a good question.
I'll give this some thought and then post some questions.
Again, thanks!
deb
#!/usr/local/bin/perl
use strict;
use warnings;
my $fileout
to discover
that before issuing the df cmd, methinks. I suppose I could check
the log for error messages, but that is frought with other problems.
Guess I'll need to keep mulling; maybe that ah-ha! moment will come
to me soon...
Thanks,
deb
--
If it dies, it's biology. If it blows up, it's chemistry
of the script. Short of totally re-writing the script (it's not mine,
to begin with), I would like to modify it. It's a simple system command
being used:
system (/usr/sbin/df -kl);
Ideas?
Thanks,
deb
it to send plain text.
Thanks,
deb
Meanwhile, David T-G says:
|
| --0lgBsWZvwbEqroRZ
| Content-Type: text/plain; charset=us-ascii
| Content-Disposition: inline
| Content-Transfer-Encoding: quoted-printable
|
| Janek, et al --
|
| =2E..and then Janek Schleicher said...
| %=20
| % David T-G
wherein lies
the problem. Any and all help would be appreciated, or even
pointers to the appropriate email list(s).
Thanks,
deb
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Meanwhile, =?iso-8859-1?q?Jonathan=20E.=20Paton?= says:
|
| --- Deb [EMAIL PROTECTED] wrote:
| Hello,
|
| Hiya!
:-) Thanks for the swift reply.
| I installed perl module Text::Reflow on perl v5.6.1 for Solaris.
|
| It built fine, but make test fails in that it hangs on the
| first
Answering myself here - found out it was the perl
binary. For some reason the binary compiled for 64-bit
execution would not make this module properly, but
the 32-bit does. Go figure.
Someone else is looking into why this might be the case.
For now, I'm happy to use the 32-bit version.
deb
on the other server? (I already made sure
that the LWP module was installed.)
- Deb Thompson
Civil Environmental Consultants
800-365-2324
www.cecinc.com
Tracking #: E51A87A7A965D511954600508BC28C5A9B439FC9
69 matches
Mail list logo