[17212] in Perl-Users-Digest
Perl-Users Digest, Issue: 4634 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 16 21:05:40 2000
Date: Mon, 16 Oct 2000 18:05:17 -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: <971744717-v9-i4634@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 16 Oct 2000 Volume: 9 Number: 4634
Today's topics:
Re: "Lite" Perl book required <chahn@peregrine.com>
Re: "Lite" Perl book required (Martien Verbruggen)
Re: Bytemanipulating <mjcarman@home.com>
Re: Bytemanipulating <ren.maddox@tivoli.com>
Re: Convert Text to HTML <ianb@ot.com.au>
Re: Create a copy of a variable <ddjones@speakeasy.org>
Re: Create a copy of a variable <ddjones@speakeasy.org>
Re: Create a copy of a variable <lr@hpl.hp.com>
Executing PERL scripts from Linux <president@webticker.com>
filtering with a script <cyrille@ktaland.com>
Re: HELP- CGI <peter.sundstrom@eds.com>
Re: My hash ref prototype doesn't work (Gary E. Ansok)
Re: My hash ref prototype doesn't work <ren.maddox@tivoli.com>
newbie String problem <hhkohls@gmx.de>
Re: newbie String problem <tony_curtis32@yahoo.com>
Packing multiple strings into one string <phr-n2000@nightsong.com>
Re: Parsing binary files <brondsem@my-deja.com>
Re: Parsing binary files <ren.maddox@tivoli.com>
Re: Parsing binary files (Colin Watson)
Re: Passing arguments <ren.maddox@tivoli.com>
ping and netping (beginner) <jcipale@hotmail.com>
Re: Posting Form (Martien Verbruggen)
Re: Posting Form <jeff@vpservices.com>
Re: Problem assigning keys/values in hashes. <lr@hpl.hp.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 16 Oct 2000 15:59:37 -0700
From: Christopher K Hahn <chahn@peregrine.com>
Subject: Re: "Lite" Perl book required
Message-Id: <39EB8859.45B897@peregrine.com>
Hello,
I would also put a vote in for "Learning Perl".
Christopher
Bernard El-Hagin wrote:
> On Mon, 16 Oct 2000 08:34:03 GMT, Garbage <the_garbage@yahoo.com> wrote:
> >Hi,
> >
> >I'm just about to start learning Perl. I would like a recommended
> >"lite" book to start with, nothing heavy, and not a door stop. After
> >learning the basics, I will then invest in a quality door stop. Any
> >suggestions for something "lite"?
>
> The ultimate "lite" Perl book is, in my opinion, "Learning Perl" by
> Randal Schwartz.
>
> Cheers,
> Bernard
> --
> perl -le '$#="Just Another Perl Hacker"; print \Bernard'
------------------------------
Date: Mon, 16 Oct 2000 23:35:06 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: "Lite" Perl book required
Message-Id: <slrn8un453.a0g.mgjv@verbruggen.comdyn.com.au>
On 16 Oct 2000 05:34:40 -0700,
Randal L. Schwartz <merlyn@stonehenge.com> wrote:
> >>>>> "Martien" == Martien Verbruggen <mgjv@tradingpost.com.au> writes:
>
> >> Elements of Programming Perl by Stephen Johnson, available from Manning
> >> Books
>
> Martien> Andrew L. Johnson
>
> Martien> and I agree :)
>
> For non-programmers, I also agree. Andrew targeted the non-programmer
> audience well, teaching both elements of programming and an
> introduction to programming in Perl.
>
> However, for programmers already versed in language such as C or awk,
> you probably could skip all the parts of that redundancy, and spend
> your first 40 hours concentrating on just Perl. I think I know a book
> or two that does that, and rather effectively I'm told. :)
I have heard nothing but good about at least one of the books you so
modestly don't mention here, but I, unfortunately, haven't had the
pleasure, personally, of reading it, because I don't own a copy :)
I wasn't trying to say that Andrew's book is so good you never will
need another one. Or that there are no other good books. The pedant in
me just couldn't stop himself from correcting the name, and the
opinion-freak couldn't stop himself from adding another two cents.
Now, if I could just get all of these guys under control, I might get
some work done.
Martien
--
Martien Verbruggen |
Interactive Media Division | The four horsemen of the apocalypse
Commercial Dynamics Pty. Ltd. | are called Abort, Retry, Ignore and
NSW, Australia | Fail.
------------------------------
Date: Mon, 16 Oct 2000 16:40:58 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Bytemanipulating
Message-Id: <39EB75EA.9705F4B7@home.com>
Joe wrote:
>
> I need to know how I can manipulate a byte. I need to set the first
> three bits of a byte independent to the last five bits.
>
> Can anyone tell me how i can do this?
Use the bitwise and/or operators (& and |) with an appropriate mask to
get at the bits you want.
e.g.
my ($data, $value, $mask);
$data = <something>;
$mask = 7; # 2#111#
$value = $data & $mask;
retrieves whatever is in the lower three bits of $data. To set those
bits, you'ld need to first clear them (bitwise and with 0's for bits 1 -
3 and 1's for all others) then set them (bitwise or to inject the value
you want).
The bitshift operators (<< and >>) may prove useful to you as well.
HTH
-mjc
------------------------------
Date: 16 Oct 2000 16:10:47 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Bytemanipulating
Message-Id: <m3itqsv6eg.fsf@dhcp11-177.support.tivoli.com>
Joe <josef.zellner@aon.at> writes:
> Hi all!
> I need to know how I can manipulate a byte. I need to set the first
> three bits of a byte independent to the last five bits.
Take a look at the vec function. Also, pack (and unpack).
perldoc -f vec
perldoc -f pack
perldoc -f unpack
Actually,
perldoc -q bits
gives you a pretty good starting point.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Tue, 17 Oct 2000 10:29:23 +1100
From: Ian Boreham <ianb@ot.com.au>
Subject: Re: Convert Text to HTML
Message-Id: <39EB8F53.AB1E91D8@ot.com.au>
Peter Sundstrom wrote:>
> > Well, for one thing, the plain text file might contain things like the
> > "<" and ">" symbols, and these mean something in HTML. So, they'll
> > need to be escaped.
>
> Not using the example above. cat will not interpret any special characters.
But the browser will. It is not a problem with cat. If the text file contained
something like:
1 < 2
5 > 4
...then the browser is going to try to turn < 2\n\n5 > into a tag. These
characters and also ampersands need to be escaped.
Ian
------------------------------
Date: Mon, 16 Oct 2000 18:27:37 -0400
From: Daniel Jones <ddjones@speakeasy.org>
Subject: Re: Create a copy of a variable
Message-Id: <puumusov32eg8dqej7st9knqmai2nn12ju@4ax.com>
On Sun, 15 Oct 2000 22:35:26 GMT, tjla@guvfybir.qlaqaf.bet
(Gwyn Judd) wrote:
Given a hash of references to arrays:
>You want to dereference after you got the key so you enclose that in
>'{}':
>
>@instructors = @{$classlist{$class}};
@instructors appears to be a copy of the array referenced in
the hash. Modifying the array @instructors does not change
the array whose reference is stored in the hash.
Here's what I'm trying to do:
sub RemoveInstructor {
my($Name, $Class) = @_;
my @Instructors = @{$ClassRoster{$Class}};
for(my $i = 0; $i < @Instructors; $i++) {
if ($Instructors[$i] eq $Name) {
splice(@Instructors, $i, 1);
last;
}
}
}
This doesn't remove $Name from the array whose reference is
in the hash. It does remove it from @Instructors within the
sub itself. I could forgo the @Instructors variable
altogether and use the full dereferencing syntax each time I
access the array, but that seems cumbersome, difficult to
read and error prone, particularly in other parts of the
code where I expect to be doing a great deal of manipulation
to the arrays. Alternatively, I could modify the array,
then store a reference to the modified array back into the
hash. This seems inefficient and defeats the purpose of
storing references in the hash in the first place. So how
do I extract and use the reference itself rather than
extracting a copy of the array?
(Also, if there's a way to delete the name that's better
than my for() loop, I'd be happy to hear it.)
Thanks in advance for any assistance,
Dan
------------------------------
Date: Mon, 16 Oct 2000 23:40:13 GMT
From: Daniel Jones <ddjones@speakeasy.org>
Subject: Re: Create a copy of a variable
Message-Id: <l24nusobc2mv02pvbl4lhjg3jofu91bu59@4ax.com>
>Given a hash of references to arrays:
>
>>You want to dereference after you got the key so you enclose that in
>>'{}':
>>
>>@instructors = @{$classlist{$class}};
>
>@instructors appears to be a copy of the array referenced in
>the hash. Modifying the array @instructors does not change
>the array whose reference is stored in the hash.
>
>Here's what I'm trying to do:
>
>sub RemoveInstructor {
> my($Name, $Class) = @_;
>
> my @Instructors = @{$ClassRoster{$Class}};
>
> for(my $i = 0; $i < @Instructors; $i++) {
> if ($Instructors[$i] eq $Name) {
> splice(@Instructors, $i, 1);
> last;
> }
> }
>}
What's the best way to solve a problem? Post a question on
it to the newsgroup. The answer will occur to you just as
you hit the send button. <G> This seems to work:
sub RemoveInstructor {
my($Name, $Class) = @_;
my $Instructors = $ClassRoster{$Class};
for(my $i = 0; $i < @$Instructors; $i++) {
if (${@$Instructors}[$i] eq $Name) {
splice(@$Instructors, $i, 1);
last;
}
}
}
This syntax:
${@$Instructors}[$i]
was a bit tricky, but I got it. Comments or criticisms on
the code are still welcome, however.
Dan
------------------------------
Date: Mon, 16 Oct 2000 17:12:10 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Create a copy of a variable
Message-Id: <MPG.14553939b0a8d55d98ae36@nntp.hpl.hp.com>
In article <t2ekus810sbgdvuettgmnd1itj2gfov3j8@4ax.com> on Sun, 15 Oct
2000 23:15:31 GMT, Daniel Jones <ddjones@speakeasy.org> says...
> On Sun, 15 Oct 2000 22:35:26 GMT, tjla@guvfybir.qlaqaf.bet
> (Gwyn Judd) wrote:
>
> >>The line
> >>$/ = ";
> >>causes syntax errors. The error message says that they
>
> >You didn't copy and paste my code did you? I typed '' (that is, two
> >single quotes). What you have is a single double-quote. If you can't see
> >the difference then you need to change your font. Quite often single
> >quotes are better than double quotes as they do not interpolate what is
> >inside them (so long as that is what you want). I try to use them
> >wherever possible as they make the code clearer.
>
> Doh! I can see the difference when they're side by side.
This is why I make an exception to the usual practice of using single-
quotes for simple string literals for the special case of the empty
string. Four 'hen scratches'
""
are much clearer than two:
''
no matter what font is being used.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 17 Oct 2000 01:03:02 GMT
From: Julian Cook/Sherab Gyatso <president@webticker.com>
Subject: Executing PERL scripts from Linux
Message-Id: <39EBA562.2C134C20@webticker.com>
Hello again folks.
I am running Red Hat Linux 6.1 and Perl 5.6
My perl is located at /usr/local/bin/perl
Everytime I have created a PERL script,
I have always tested it with
"perl testprogram.cgi"
(where the script name is testprogram.cgi obviously)
I start every script with
#!/usr/local/bin/perl/
I "chmod u+x testprogram.cgi"
and when I try to run it straight from the command
line by typing "testprogram.cgi", I get
"bash: testprogram.cgi: command not found"
When I do test with "perl testprogram.cgi"
it works fine.
I thought that as long as a script was executable
and the first line contained the hash bang, then
it would run. Then again, I am not a Linux
pro, admittedly.
Does anyone have any idea on how to correct this so
it runs from the command line when chmod u+x?
I am setting this script up as a cron job and I am
referencing it by the script name.
Many thanks in advance.
Julian Cook
president_at_webticker_dot_com
-------------------------------
Flames go to /dev/null
------------------------------
Date: Tue, 17 Oct 2000 00:29:04 +0200
From: Cyrille <cyrille@ktaland.com>
Subject: filtering with a script
Message-Id: <39EB8130.78CC396A@ktaland.com>
Hi,
I try to filtering mail with à script, but it doesn't work.
My script is reading STDIN and it is in the alias file, but no things
seam to appends ...
To be shure, I add my email in the 'test' alias, and I receive well mail
writed to test@domain but there is no trace of the file I write in the
srcipt 'myout.txt'
---------------------------------------------
the alias file : /etc/vmail/aliases.domain.com :
cyrille: cyrille@ktaland.com
test: "| /home/domain/www/work/procmail_inscription.pl" ,cyrille
---------------------------------------------
the script :
#!/usr/local/bin/perl
use strict;
open( OUT, '>/home/domain/www/work/myout.txt');
print OUT "running\n";
my $line;
while( $line=<STDIN> ){
print OUT $line;
}
close(OUT);
--
------------------------------
Date: Tue, 17 Oct 2000 11:17:48 +1300
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: HELP- CGI
Message-Id: <8sfv18$4l2$1@hermes.nz.eds.com>
Fraser <r.fraser@student.murdoch.edu.au> wrote in message
news:39EB05E1.B97339@student.murdoch.edu.au...
> Hi can someone help?
> Trying to write a Perl CGI script on a UNIX system so people could log
> onto a URL using a browser, enter a name and sort direction, to sort the
> /etc/passwd file on the unix system and return the passwd file sorted in
> the appropriate direction (Up or Down) in a html page and information
> about name entered- logged to a file on system.
And what happened?
------------------------------
Date: 16 Oct 2000 22:32:23 GMT
From: ansok@alumni.caltech.edu (Gary E. Ansok)
Subject: Re: My hash ref prototype doesn't work
Message-Id: <8sfvln$p58@gap.cco.caltech.edu>
In article <Pine.SOL.4.21.0010162206430.24573-100000@mimosa.csv.warwick.ac.uk>,
John J. Lee <phrxy@csv.warwick.ac.uk> wrote:
>The following script prints:
>Use of uninitialised value at E:\Perl\site\bin\trial.pl line 17 (#1)
>
>#!/usr/bin/perl -w
>
>use diagnostics;
>use strict;
>use vars qw(%hash);
>
>sub foo (\%$$) {
> my %foo = %{shift()};
> my $bar = shift;
> my $baz = shift;
> $foo{$bar} = $baz;
> print $foo{123}."\n";
>}
>
>foo(%hash, 123, 1);
>
>print $hash{123}."\n";
The problem here is that the %foo = %{shift()} makes a copy
of the referenced hash, and assigns it to %foo. Since that
copy is never propagated back out to the main routine, the
original undef value is not changed.
You need to change the hash using the passed-in reference:
my $foo = shift;
# ... snip ...
$foo->{$bar} = $baz;
-- Gary Ansok
------------------------------
Date: 16 Oct 2000 16:28:06 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: My hash ref prototype doesn't work
Message-Id: <m3n1g4tr15.fsf@dhcp11-177.support.tivoli.com>
"John J. Lee" <phrxy@csv.warwick.ac.uk> writes:
> #!/usr/bin/perl -w
>
> use diagnostics;
> use strict;
> use vars qw(%hash);
>
> sub foo (\%$$) {
> my %foo = %{shift()};
You just copied the entire hash into %foo. Any modifications to %foo
will not affect the original hash. Change it to:
my $foo = shift;
and then change...
> my $bar = shift;
> my $baz = shift;
these two lines:
> $foo{$bar} = $baz;
> print $foo{123}."\n";
to:
$foo->{$bar} = $baz;
print $foo->{123}."\n";
> }
>
> foo(%hash, 123, 1);
>
> print $hash{123}."\n";
HTH,
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Tue, 17 Oct 2000 00:57:24 +0200
From: Hans-Helmut Kohls <hhkohls@gmx.de>
Subject: newbie String problem
Message-Id: <39EB87D3.19F366F7@gmx.de>
Hi, I need to get the 13th character of each line of a file, I am using
the following command:
while (<FIN>)
{
chomp;
if (@_[13] eq ".") #I have tried $_[13] as well, but did not
change a thing.
{
print FOUT $_;
}
}
I get an error called "use of uninitialized value at line 63"
I have not found any command to get a single char out of a string and
thought id just try, what have I done wrong, or how can I get that char
value?
thanks for patience and help
Hans
------------------------------
Date: 16 Oct 2000 18:30:38 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: newbie String problem
Message-Id: <87u2acbbz5.fsf@limey.hpcc.uh.edu>
>> On Tue, 17 Oct 2000 00:57:24 +0200,
>> Hans-Helmut Kohls <hhkohls@gmx.de> said:
> Hi, I need to get the 13th character of each line of a
> file,
perldoc -f substr
hth
t
--
Eih bennek, eih blavek.
------------------------------
Date: 16 Oct 2000 17:23:42 -0700
From: Paul Rubin <phr-n2000@nightsong.com>
Subject: Packing multiple strings into one string
Message-Id: <7xitqsgvsh.fsf_-_@ruckus.brouhaha.com>
I'm wondering if Perl has a good way to pack multiple arbitrary
strings into a single string, and want to suggest a way if there's
none already. By an arbitrary string I mean a binary string that can
contain any characters including nulls.
The Camel book says to use the join and split functions and a
delimiter, but that doesn't seem any good to me, since you then have
to worry about the delimiter appearing inside the strings, etc. So it
seems to me that Perl still has the C disease of specially delimited
strings. I'm not a Perl whiz so if someone has a good solution I'd
like to hear about it.
If there's not something better already, here's my proposal: add a new
format letter, "D" (for "datum", the structure that dbm/gdbm uses), to
the pack and unpack functions. This means a string specified as a
length (BER-compressed integer) followed by that many bytes. So to
pack two strings $s1 and $s2 into a new string $s, you'd just say
$s = pack ("DD", $s1, $s2);
and to unpack them,
($s1, $s2) = unpack ("DD", $s);
Note that you can simulate the packing function:
$s = pack ("wPwP", length($s1), $s1, length ($s2), $s2);
But I don't see any way to do the unpacking that's not a lot clumsier
(since the BER-compressed lengths are themselves of variable length).
This makes life a lot easier if you're trying to use dbm as a database
with arbitrary structures in the records.
Comments?
------------------------------
Date: Mon, 16 Oct 2000 22:32:05 GMT
From: Dave Brondsema <brondsem@my-deja.com>
Subject: Re: Parsing binary files
Message-Id: <8sfvl5$9cm$1@nnrp1.deja.com>
In article <8sfs3l$676$1@nnrp1.deja.com>,
Ajai Khattri <ajai@netscape.net> wrote:
> I am trying to parse a file where the characters \n\n^A^A are the
> delimiters between each record. The <> operator by default reads one
> line at a time - I wish to read multiple lines until I hit a
delimiter.
> Can't figure this out - any ideas?
I think this will work (untested)
open (FILE, "file.txt");
@file = <FILE>;
@file = split(/\n\n^A^A/, join ('', @file));
foreach $record (@file)
{
# do something with $record
}
simplified (again untested):
foreach $record (split(/\n\n^A^A/, join ('', <FILE>)))
{
# do something with $record
}
> --
> Aj. (ajai@netscape.net)
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
--
Dave Brondsema
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Oct 2000 16:43:00 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Parsing binary files
Message-Id: <m3r95gsbrv.fsf@dhcp11-177.support.tivoli.com>
Ajai Khattri <ajai@netscape.net> writes:
> I am trying to parse a file where the characters \n\n^A^A are the
> delimiters between each record. The <> operator by default reads one
> line at a time - I wish to read multiple lines until I hit a delimiter.
> Can't figure this out - any ideas?
perldoc perlvar
Look for the section on "$/".
You probably want:
$/="\n\n\001\001";
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: 17 Oct 2000 00:42:26 GMT
From: cjw44@flatline.org.uk (Colin Watson)
Subject: Re: Parsing binary files
Message-Id: <8sg79i$a8r$1@riva.ucam.org>
Ajai Khattri <ajai@netscape.net> wrote:
>I am trying to parse a file where the characters \n\n^A^A are the
>delimiters between each record. The <> operator by default reads one
>line at a time - I wish to read multiple lines until I hit a delimiter.
>Can't figure this out - any ideas?
Set the input record separator variable $/ to "\n\n\001\001".
HTH,
--
Colin Watson [cjw44@flatline.org.uk]
"I see people didn't read the smiley I didn't include."
------------------------------
Date: 16 Oct 2000 16:19:43 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Passing arguments
Message-Id: <m33dhwv5zk.fsf@dhcp11-177.support.tivoli.com>
tjla@guvfybir.qlaqaf.bet (Gwyn Judd) writes:
> The '[]' operator creates a reference to an anonymous array, copying
> it's contents. This may be less efficient than just doing @values = keys
> %lengths since it has to extract the keys and then copy them. hmmm
> indeed it is unless I made a mistake somewhere, benchmarking being the
> black art that it is
As far as I can see, the only mistake you made was in interpreting the
output. Based on the results given (and recreated), the anonymous
array is slightly faster. You seem to be saying the opposite in the
above paragraph, though I expect you just misstated what you meant.
Of course, if the copy is needed later on, then that changes
everything. Adding a second call to dummy with the same arguments,
but without recreating @values, leads to the expected performance
swing significantly in favor of the named array. As always, the moral
is that a benchmark is only good for the specific case benchmarked.
> #!/usr/bin/perl -w
> use Benchmark;
>
> %lengths = qw(the rain in spain falls mainly on the spaniards heads);
>
> sub dummy
> {
> $_[0];
> }
>
> timethese(1<<16, {
> 'strict' => sub {my @values = keys %lengths; dummy \@values},
> 'anon' => sub {dummy [keys %lengths]},
> });
> __END__
> Benchmark: timing 65536 iterations of anon, strict...
> anon: 1 wallclock secs ( 1.83 usr + 0.00 sys = 1.83 CPU) @
> 35812.02/s (n=65536)
> strict: 3 wallclock secs ( 2.08 usr + 0.01 sys = 2.09 CPU) @
> 31356.94/s (n=65536)
For completeness and to match the numbers below, here are my results
for your benchmark:
Benchmark: timing 65536 iterations of anon, strict...
anon: 3 wallclock secs ( 2.10 usr + 0.00 sys = 2.10 CPU) @ 31207.62/s (n=65536)
strict: 3 wallclock secs ( 2.49 usr + 0.00 sys = 2.49 CPU) @ 26319.68/s (n=65536)
Here it is again modified to show the savings of a saved copy:
#!/usr/bin/perl -w
use Benchmark;
%lengths = qw(the rain in spain falls mainly on the spaniards heads);
sub dummy
{
$_[0];
}
timethese(1<<16, {
'strict' => sub {my @values = keys %lengths; dummy \@values; dummy \@values},
'anon' => sub {dummy [keys %lengths]; dummy [keys %lengths]},
});
__END__
Benchmark: timing 65536 iterations of anon, strict...
anon: 5 wallclock secs ( 4.02 usr + 0.00 sys = 4.02 CPU) @ 16302.49/s (n=65536)
strict: 3 wallclock secs ( 2.73 usr + 0.00 sys = 2.73 CPU) @ 24005.86/s (n=65536)
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Mon, 16 Oct 2000 15:25:37 -0700
From: "joe cipale" <jcipale@hotmail.com>
Subject: ping and netping (beginner)
Message-Id: <8sfv92$pma@news.or.intel.com>
I am new to this forum. I have a question regarding the use of ping (Unix
system) and netping.
I have a set of networked hosts throughout my company that I would like to
have the status displayed
on a regular basis.
When a user checks the status of all hosts on a webpage, they should see
either a green light ('Active') or
a red light ('In-Active'). this is the result of sending a 'ping' command
from within my cgi script. The problem
is this: My Unix hosts can be pinged, either from ping or netping without a
problem. But, I have a handful of VAX hosts that always fail to return from
the CGI. If I perform the ping operation as part of a perl script and use
the system ping, the VAX hosts respond. The VAX host do not respond to a
netping() query.
Is there a secret handshake or special incantation that must be performed to
get VAX hosts to respond to CGI?
Joe Cipale
Intel Corporation
------------------------------
Date: Mon, 16 Oct 2000 23:44:57 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Posting Form
Message-Id: <slrn8un4ni.a0g.mgjv@verbruggen.comdyn.com.au>
On Mon, 16 Oct 2000 00:28:17 -0500,
Andrew N. McGuire <anmcguire@ce.mediaone.net> wrote:
>
> ANM> There are no scroll bars in Perl. :-)
> ANM> Check out the Tk/CGI[1] newsgroups, they will be more helpful.
> ANM>
> ANM> [1] Depending on what type of "scroll bar" you are talking about.
>
> Ahem, eh, whoops. It is obvious from the subject you are not
> talking about Tk, sorry.
Not obvious. It can be guessed, with varying confidence that that is
most likely what is being asked. However, the OP might have been
talking about an application that displays an interface to a program
that designs meadow fencing for farm animals. This introduces, as every
programmer knows, the fencepost problem. Since the advent of GUIs, the
fencepost problem has been solved by introducing 'scrollbars'. Instead
of fixing the corner of the meadow that is missing a fencepost, one
takes the scrollbar, and vertically inserts it into the soil, after
which the wire (barbed or plain) can be attached to said scrollbar,
_as if it is another post_.
alternatively, you just scroll to a part of the GUI that doesn't
display the problem, print that, and use it in a glossy marketing
brochure.
Problem fixed.
Martien
--
Martien Verbruggen |
Interactive Media Division | That's not a lie, it's a
Commercial Dynamics Pty. Ltd. | terminological inexactitude.
NSW, Australia |
------------------------------
Date: Mon, 16 Oct 2000 16:57:50 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Posting Form
Message-Id: <39EB95FE.48A20138@vpservices.com>
Martien Verbruggen wrote:
>
> On Mon, 16 Oct 2000 00:28:17 -0500,
> Andrew N. McGuire <anmcguire@ce.mediaone.net> wrote:
> >
> > ANM> There are no scroll bars in Perl. :-)
> > ANM> Check out the Tk/CGI[1] newsgroups, they will be more helpful.
> > ANM>
> > ANM> [1] Depending on what type of "scroll bar" you are talking about.
> >
> > Ahem, eh, whoops. It is obvious from the subject you are not
> > talking about Tk, sorry.
>
> Not obvious. It can be guessed, with varying confidence that that is
> most likely what is being asked. However, the OP might have been
> talking about an application that displays an interface to a program
> that designs meadow fencing for farm animals.
Yeah, that's the ticket. He probably wanted to keep his copy of the
_Egyptian Book of the Dead_ in a scroll box on top of the fence post.
--
Jeff
------------------------------
Date: Mon, 16 Oct 2000 17:22:01 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Problem assigning keys/values in hashes.
Message-Id: <MPG.14553b812679fd3e98ae37@nntp.hpl.hp.com>
In article <Pine.LNX.4.21.0010152114490.24401-
100000@hawk.ce.mediaone.net> on Sun, 15 Oct 2000 21:16:19 -0500, Andrew
N. McGuire <anmcguire@ce.mediaone.net> says...
...
> my $form = @_; # $form contains length of @_ ( 1 ).
> my $form = shift; # $form contains HASH ref.
Alternatively (one keystroke shorter :-):
my ($form) = @_; # $form contains HASH ref.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
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 4634
**************************************