[24812] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 6965 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 6 00:06:16 2004

Date: Sun, 5 Sep 2004 21:05:07 -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           Sun, 5 Sep 2004     Volume: 10 Number: 6965

Today's topics:
    Re: Dynamic hash names <ebohlman@omsdev.com>
    Re: Dynamic hash names <zebee@zip.com.au>
    Re: Dynamic hash names <noreply@gunnar.cc>
    Re: Dynamic hash names <joericochuyt@msn.com>
    Re: Dynamic hash names <sbryce@scottbryce.com>
    Re: Dynamic hash names <sbryce@scottbryce.com>
    Re: Dynamic hash names <tadmc@augustmail.com>
    Re: net::ftp errors <ebohlman@omsdev.com>
    Re: net::ftp errors <tadmc@augustmail.com>
    Re: net::ftp errors <noreply@nowhere.com>
        Newb requires help with javascript submit <javanoob@dejavuder.com>
    Re: Newb requires help with javascript submit <sbryce@scottbryce.com>
    Re: Newb requires help with javascript submit <Joe.Smith@inwap.com>
    Re: Newb requires help with javascript submit <pinyaj@rpi.edu>
    Re: packing floats? (J. Romano)
    Re: Sipering with javascript. a@b.com
    Re: Sipering with javascript. <jwkenne@attglobal.net>
    Re: Sipering with javascript. <jwkenne@attglobal.net>
    Re: Temporarily redirecting STDOUT <Joe.Smith@inwap.com>
    Re: two's compliment? <bigal187@invalid.rx.eastcoasttfc.com>
    Re: Update multiple lines in a flat file from array <bill@hotmail.com>
    Re: Xah Lee's Unixism <ipmonger@comcast.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 5 Sep 2004 22:25:14 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: Dynamic hash names
Message-Id: <Xns955BB216C173Debohlmanomsdevcom@130.133.1.4>

"yusufdestina" <joericochuyt@msn.com> wrote in 
news:06392a5164efd1a62c1eacef184634da@localhost.talkaboutprogramming.com:

> Hi all,
> I'm a php man bussy learning Perl...
> I found the following problem. I'm getting some filenames from a
> directory. Those names are stored in a array
> @files = ('test1','test2','test3');
> Each file has 3 lines of content.
> name=>'blablabla'
> age=>'blablabla'
> score=>'blalala'

So far, so good.

> I want to make hashes witch have the names of @files
> ex. %test1 %test2 %test3
> and store the content of that file in the hash.

Oops, now you've stumbled a bit.  You *think* you want named hashes, but 
you really don't.

What you really want is an array of hash references, colloquially if a 
little bit inaccurately known as a "list of hashes" (LOH).  perldoc perldsc 
(the "data structures cookbook") will show you how to do that; if you don't 
understand it, then try perldoc perlref for some background, and if you 
still don't get it, try perldoc perlreftut.

> -----------------------------------------------------------
> $count = scalar(@files);

'scalar' is unnecessary here since the assignment is in scalar context.

Now you want:

my @profiles;

>   for ($i=0; $i< $count; $i++){

Most Perl programmers would prefer

  foreach my $i (0..$count) {

to a C-style loop in circumstances like this.

>   open (PROFILE, @files[$i]);

Always, yes *always*, check to see that an attempt to open a file was 
successful before trying to do anything with the file.

The syntax for an individual element of an array is $array[$index] rather 
than @array[$index].  In some cases perl will do the conversion for you, 
but in other cases it won't and you'll have a hard-to-find bug.  Get in the 
habit of doing it right early on.

So that should be:

  open PROFILE,$files[$i] or die "Couldn't open $files[$i]: $!";

and then add:

  my %temp;
>   while(<PROFILE>){
>   push("@profile.$i", $_);#WRONG

replace the push with:

chomp;
my ($key,$val)=split(/=>/,$_,2);
$temp{$key}=$val;

>   print "$_";
>   }
>   close (PROFILE);

add:

push(@profiles,\%temp);
>   }

Now $profiles[0] will be a reference to a (anonymous) hash containing the 
information for the first file, $profiles[0]{name} will be the name 
associated with the first file, and so on.

If you don't understand any of this, *please* read the documents I 
mentioned earlier before asking further questions here.



------------------------------

Date: Sun, 05 Sep 2004 22:36:03 GMT
From: Zebee Johnstone <zebee@zip.com.au>
Subject: Re: Dynamic hash names
Message-Id: <slrncjn4rm.neg.zebee@zeus.zipworld.com.au>

In comp.lang.perl.misc on Sun, 05 Sep 2004 17:48:29 -0400
yusufdestina <joericochuyt@msn.com> wrote:
> I found the following problem. I'm getting some filenames from a
> directory. Those names are stored in a array
> @files = ('test1','test2','test3');
> Each file has 3 lines of content.
> name=>'blablabla'
> age=>'blablabla'
> score=>'blalala'
> I want to make hashes witch have the names of @files
> ex. %test1 %test2 %test3
> and store the content of that file in the hash.

Not quite sure why you want to do that... explaining why they need to be
named in that way might help.

You could do it with references: 
(note, I'm a shellscripter, my perl looks like shell.  there are no
doubt many much more perl ways to do this)

#!/usr/bin/perl -w
use strict;
my $info;
for my $file (@files) {
	open (DATA,$file) || die "can't open $file for reading $!\n";
	while (<DATA>) {
		chomp;
		# get your data, however it works.  perhaps	
		my ($type,$value) = /^(\w+)=\>'(\w+)'/;
		# although the regexp will almost certainly need
		# tweaking depending on your data.  

		my $info->{$file}->{$type} = $value;
	}
}

To get at the age stored in test1 you say
	$info->{'test1'}->{'age'};

The advantage of using refs over named hashes is that it doesn't matter
how many there are, and you can iterate over them to find things. 

Reading perldoc perlreftut and perldoc perlref would probably be of use.
The doco on data structures might be too, perldoc perldsc

References make life much much easier when you are setting up sets of
data.

Zebee


------------------------------

Date: Mon, 06 Sep 2004 00:43:24 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Dynamic hash names
Message-Id: <2q1jdtFpo1m1U1@uni-berlin.de>

yusufdestina wrote:
> I'm getting some filenames from a
> directory. Those names are stored in a array
> @files = ('test1','test2','test3');
> Each file has 3 lines of content.
> name=>'blablabla'
> age=>'blablabla'
> score=>'blalala'
> I want to make hashes witch have the names of @files
> ex. %test1 %test2 %test3
> and store the content of that file in the hash.

You should probably want to create a hash of hashes instead:

     #!/usr/bin/perl
     use strict;
     use warnings;
     use Data::Dumper;
     my %HoH;

     my @files = qw(test1 test2 test3);

     for my $file (@files) {
         open my $profile, $file or die "Couldn't open $file: $!";
         %{ $HoH{$file} } = map { chomp; eval } <$profile>;
     }

     print Dumper %HoH;

However, using eval() on external data that way may not be advisable. 
This would be a more secure way to populate %HoH:

     for my $file (@files) {
         open my $profile, $file or die "Couldn't open $file: $!";
         while (<$profile>) {
             if ( /^(\w+)=>'([^']+)'/ ) {
                 $HoH{$file}->{$1} = $2;
             } else {
                 die "Unexpected data";
             }
         }
     }

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


------------------------------

Date: Sun, 05 Sep 2004 19:16:13 -0400
From: "yusufdestina" <joericochuyt@msn.com>
Subject: Re: Dynamic hash names
Message-Id: <6f561533c37fde0a80d70239c2f5981d@localhost.talkaboutprogramming.com>

Tnx a lot m8, I'm going to buy some books :)



------------------------------

Date: Sun, 05 Sep 2004 17:45:57 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Dynamic hash names
Message-Id: <10jn993m9s5sj3f@corp.supernews.com>

yusufdestina wrote:
> Tnx a lot m8, I'm going to buy some books :)

English is not the first language for many of the regulars here. It is 
best to use correct English if you want to be understood.



------------------------------

Date: Sun, 05 Sep 2004 17:55:33 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Dynamic hash names
Message-Id: <10jn9r31npufh44@corp.supernews.com>

Eric Bohlman wrote:

> "yusufdestina" <joericochuyt@msn.com> wrote in 

>>  for ($i=0; $i< $count; $i++){
> 
> 
> Most Perl programmers would prefer
> 
>   foreach my $i (0..$count) {
> 
> to a C-style loop in circumstances like this.

I think they would prefer

      foreach my $i (0..$count - 1) {

to avoid looping one time too many.



------------------------------

Date: Sun, 5 Sep 2004 19:42:09 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Dynamic hash names
Message-Id: <slrncjncj1.upj.tadmc@magna.augustmail.com>

yusufdestina <joericochuyt@msn.com> wrote:

>   open (PROFILE, @files[$i]);


You should always enable warnings when developing Perl code.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: 5 Sep 2004 22:09:18 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: net::ftp errors
Message-Id: <Xns955BAF6352DF1ebohlmanomsdevcom@130.133.1.4>

Shailesh Humbad <noreply@nowhere.com> wrote in 
news:hHL_c.306151$fv.146522@fe2.columbus.rr.com:

> Yeah, I just found it.  Unfortunately, I had been using Google to get 
> the documentation, and the page I ended up at was old.  Search for 
> "perldoc net::ftp" in Google and click on the first link, and you will 
> see no mention of the $ftp->message variable.  It is the perldoc site, 
> which one would think is authoritative.  Finally, I found a link to 
> the better CPAN docs through another link in experts-exchange.
> 
> So what is the best site for perl documentation?

Your own hard drive.  'perldoc Net::FTP' at your own command prompt will 
give you the docs for whatever version of Net::FTP you have installed.  If 
you really want it to act like a Web site, you can always install 
Pod::Webserver and run it at startup; you just point your browser at one of 
your local ports and off you go.

Failing all those, there's always <http://www.perldoc.com>.


------------------------------

Date: Sun, 5 Sep 2004 20:06:27 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: net::ftp errors
Message-Id: <slrncjne0j.upj.tadmc@magna.augustmail.com>

Shailesh Humbad <noreply@nowhere.com> wrote:

> I had been using Google to get 
> the documentation,


> It is the perldoc site, 
> which one would think is authoritative.  


Provided its docs are for the same version of perl that
you happen to be using.


> So what is the best site for perl documentation?


There is none (if by "site" you mean "web site").

The best perl docs are the ones for your version of perl.

They are on your very own hard disk somewhere (they come with
the perl distribution).


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Mon, 06 Sep 2004 03:28:50 GMT
From: Shailesh Humbad <noreply@nowhere.com>
Subject: Re: net::ftp errors
Message-Id: <SPQ_c.20414$8.401@fe1.columbus.rr.com>

Tad McClellan wrote:
> Shailesh Humbad <noreply@nowhere.com> wrote:
> 
> 
>>I had been using Google to get 
>>the documentation,
> 
> 
> 
>>It is the perldoc site, 
>>which one would think is authoritative.  
> 
> 
> 
> Provided its docs are for the same version of perl that
> you happen to be using.
> 
> 
> 
>>So what is the best site for perl documentation?
> 
> 
> 
> There is none (if by "site" you mean "web site").
> 
> The best perl docs are the ones for your version of perl.
> 
> They are on your very own hard disk somewhere (they come with
> the perl distribution).
> 
> 

I thought Google was never wrong! :)  I didn't notice I landed at a 
documentation page for an old version of net::ftp.  I am a very casual 
perl programmer, and I don't have good documentation lookup habits 
with it.

But I can say one thing, using perldoc from a command-line is like 
driving down the highway on a tricycle.  Sure it works great for a 
terminal, but I can't think of a slower or more antiquated way to 
lookup documentation on an PC with a GUI.  I just tried 
Pod::Webserver, but it doesn't have search and I would have to run 
another app. on my computer.  I wish there was a neat, indexed, free 
Windows help file for Perl documentation.  Ooh, I just found one:

http://htmlhelp.berlios.de/books/chm.php

Now I'm all set, thanks.


------------------------------

Date: Mon, 6 Sep 2004 12:53:14 +1200
From: "javascript_noob12" <javanoob@dejavuder.com>
Subject: Newb requires help with javascript submit
Message-Id: <chgcdi$g75$1@lust.ihug.co.nz>

Hi.

I am trying to create a CGI script that will use Perl to read a text file to
get a list of values, then turn that list into a menu on a website. The menu
will be a form with a JavaScript "submit" function. . When someone selects a
menu-item, the form will submit the value of that list-entry to another CGI
page.

The problem I'm encountering is that the script I've written submits every
value of the form rather than the one specific menu item's value. This means
that, on the receiving CGI page, I'm unable to tell which one value has been
selected because I've received them all.

As near as I can tell, the flaw in my scripting is in the JS line (but just
in case I'm wrong, I've CC'd this to PERL.MISC).

I am very new to JS and am having a very difficult time comprehending it.
Before I display the code I've written, I'd like to also ask for
recommendations for good beginner-guide-books for JS. Is O'Reilly's  "Rhino"
book a good starting place?

Regards and thanks.

Here's the relevant code:


print "<FORM ACTION='/cgi-bin/sub_cat_view.cgi' NAME='myform' METHOD=
'get' target='splash'>";
open (CATDAT, "<categories.dat");

        while (<CATDAT>){
        @categories = split /#/, "$_";
        $cat_length = @categories;
        $loop=0;
        print "<H4>";

        while ($loop < $cat_length){
                print "<A
HREF='javascript:document.myform.submit()'>$categories
[$loop]</A><BR>";
                print "<INPUT TYPE='hidden' NAME='$categories[$loop]'
VALUE='cat
egory'>";
                $loop++;
                }
        }
close (CATDAT);
print "</FORM>";




------------------------------

Date: Sun, 05 Sep 2004 19:58:46 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Newb requires help with javascript submit
Message-Id: <10jnh24ecoglnae@corp.supernews.com>

javascript_noob12 wrote:

> As near as I can tell, the flaw in my scripting is in the JS line

You are probably right. But the code you posted is Perl.

What you should do, if you want an answer to your question, is post the 
HTML/JavaScript that the Perl script produces to comp.lang.javascript. 
Make sure you follow whatever posting guidelines comp.lang.javascript has.



------------------------------

Date: Mon, 06 Sep 2004 03:53:11 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Newb requires help with javascript submit
Message-Id: <HaR_c.39469$3l3.7899@attbi_s03>

javascript_noob12 wrote:

> The problem I'm encountering is that the script I've written submits every
> value of the form rather than the one specific menu item's value.

That's the way a submit button works.
You could modify your perl program to output many "<FORM ACTION=" lines
instead of just one.
	-Joe


------------------------------

Date: Mon, 6 Sep 2004 00:01:26 -0400
From: Jeff 'japhy' Pinyan <pinyaj@rpi.edu>
To: javascript_noob12 <javanoob@dejavuder.com>
Subject: Re: Newb requires help with javascript submit
Message-Id: <Pine.SGI.3.96.1040905235413.303731A-100000@vcmr-64.server.rpi.edu>

[posted & mailed]

On Mon, 6 Sep 2004, javascript_noob12 wrote:

>The problem I'm encountering is that the script I've written submits
>every value of the form rather than the one specific menu item's value.
>This means that, on the receiving CGI page, I'm unable to tell which one
>value has been selected because I've received them all. 

>        while ($loop < $cat_length){
>                print "<A
>HREF='javascript:document.myform.submit()'>$categories
>[$loop]</A><BR>";
>                print "<INPUT TYPE='hidden' NAME='$categories[$loop]'
>VALUE='cat
>egory'>";
>                $loop++;
>                }

As a Perl note, I'd suggest rewriting that as a for statement:

  for my $cat (@categories) {
    print qq{
<a href="javascript:document.myform.submit()">$cat</a><br>
<input type="hidden" name="$cat" value="category">
    };
  }

Your probably is half JS, half HTML.  A form will submit *all* the data in
it.  You either need to make a separate form for EACH link (which I do NOT
suggest), or else come up with a new mechanism for submitting the
appropriate data.

I don't understand why you make the *name* of the field to be passed
variable, and the value constant.  Here's how I'd do it:

  print qq{
    <form method="..." action="something.cgi" name="myform">
    <input type="hidden" name="cat" value="">
  };

  for my $cat (@categories) {
    print qq{
      <a href="javascript:document.myform.cat.value='$cat';
               document.myform.submit()">$cat</a><br>
    };
  }

Now, when you click on a link, it sets the value of the 'cat' hidden
field, and then submits the form.

I'm not sure why you *need* a form, when you can just make links like

  <a href="something.cgi?cat=$cat">$cat</a>

but maybe there's more you're not telling us.     

--
Jeff "japhy" Pinyan         %  How can we ever be the sold short or
RPI Acacia Brother #734     %  the cheated, we who for every service
  Senior Dean, Fall 2004    %  have long ago been overpaid?
RPI Corporation Secretary   %
http://japhy.perlmonk.org/  %    -- Meister Eckhart




------------------------------

Date: 5 Sep 2004 17:44:11 -0700
From: jl_post@hotmail.com (J. Romano)
Subject: Re: packing floats?
Message-Id: <b893f5d4.0409051644.38fdbcdd@posting.google.com>

Mike <mikee@mikee.ath.cx> wrote in message news:<10jkh48312jqr61@corp.supernews.com>...
> 
> What I'm looking for is equal to:
> 
> int i;
> float f[18];
> for(i = 0; i < 18; i++) {
> 	f[i] = genome[i];
> }
> 
> ....
> 
> int individualCompare(Individual a, Individual b)
> {
> 	return memcmp(a->genome, b->genome, 18 * sizeof(float));
> }
> 
> ....
> 
> Individual population[100];
> 
> ...
> 
> int i, j;
> for(i = 0; i < 99; i++) {
> 	for(j = i + 1; j < 100; j++) {
> 		if(individualCompare(population[i], population[j])) {
> 			(void) printf("individuals are different\n");
> 		}
> 	}
> }


Dear Mike,

   What exactly is an "Individual"?  Is it typedef-ed to "float[18]",
as if there were a line like:

      typdef float[18] Individual;

?

   If you want to see if two arrays are identical, here are two ways
to do it.  But be warned!  If even one bit of one entry is different
between the two arrays, they will not be treated as equivalent.

   Anyway, one of these functions uses a packstring to serialize the
arrays; the other uses the Data::Dumper module (which is part of the
standard distribution of modules and therefore you should already have
it) to serialize the arrays.  Once the arrays are serialized, their
cmp value is returned.

# Implemented using the "f*" packstring
sub arrayCompare (\@\@)
{
   # Returns zero if the arrays are identical.
   # Returns non-zero if the arrays are different.

   my $string1 = pack "f*", @{$_[0]};
   my $string2 = pack "f*", @{$_[1]};

   return $string1 cmp $string2;
}

# Implemented using the Data::Dumper module
sub arrayCompare (\@\@)
{
   # Returns zero if the arrays are identical.
   # Returns non-zero if the arrays are different.

   use Data::Dumper;

   my $string1 = Dumper $_[0];
   my $string2 = Dumper $_[1];

   return $string1 cmp $string2;
}


   Both these subroutines are called like this:

      if ( arrayCompare(@array1, @array2) )
      {
         print "\@array1 and \@array2 are not identical.\n";
      }
      else
      {
         print "\@array1 and \@array2 are the same.\n";
      }


   Here is another warning:  normally when programming, floating point
numbers are not checked for exact equality (because if they were, then
1.0/10.0 would not always equal 0.1).  Instead, the absolute value of
their difference is compared to some really tiny epsilon value.  If it
is smaller than the epsilon value, then the two numbers are considered
to be the same.

   The two arrayCompare() functions I just gave you do not account for
this, so use them ONLY IF you understand what I'm talking about in the
last paragraph and you are absolutely sure that it will not be a
problem for you.

   I hope this helps, Mike.

   -- Jean-Luc


------------------------------

Date: 5 Sep 2004 19:46:43 -0500
From: a@b.com
Subject: Re: Sipering with javascript.
Message-Id: <413bb373$1_2@corp.newsgroups.com>

> Thaddeus L. Olczyk, PhD

Hmmm. What was your major? African American Studies? This
is comp.lang.perl.misc, you dolt.


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 100,000 Newsgroups - 19 Different Servers! =-----


------------------------------

Date: Mon, 06 Sep 2004 01:37:07 GMT
From: "John W. Kennedy" <jwkenne@attglobal.net>
Subject: Re: Sipering with javascript.
Message-Id: <7bP_c.25848$lv3.8597993@news4.srv.hcvlny.cv.net>

Sniveling coward "a@b.com" wrote:
> Hmmm. What was your major? African American Studies?

Eat your Luger and burn in Hell, Nazi-boy.  We have no time for your 
used nightmares.

-- 
John W. Kennedy
"The bright critics assembled in this volume will doubtless show, in 
their sophisticated and ingenious new ways, that, just as /Pooh/ is 
suffused with humanism, our humanism itself, at this late date, has 
become full of /Pooh./"
   -- Frederick Crews.  "Postmodern Pooh", Preface


------------------------------

Date: Mon, 06 Sep 2004 01:42:23 GMT
From: "John W. Kennedy" <jwkenne@attglobal.net>
Subject: Re: Sipering with javascript.
Message-Id: <3gP_c.25849$lv3.8610784@news4.srv.hcvlny.cv.net>

TLOlczyk wrote:

> I'd like to write a program to spider certain websites
> which contain javascript.
> One example is a local newspaper providing tv listings.
> The page is set up in the following way, it brings up
> the listing for half of todays channels for the next
> three hours in a grid certain buttons advance the
> grid by executing javascript commands ( advance previous
> scroll etc, ) Rather than sit there wait half a minute for the next
> page to load I thought I would write a script that searches for
> the shows and extracts the pages with the shows I want on it.
> 
> Another example almost anyone can understand, is the "Look inside
> feature " of amazon, where three or four pages of the book plus
> toc and index are put on the site. You then use scroll buttons
> to move back and forth, and of course they call javascript.
> 
> What I've read about spidering with javascript is confusing.
> Can anyone help?

In order to do that, you first have to have a Perl module that can read 
JavaScript code and execute it.  See 
<URL:http://www.cpan.org/modules/by-module/JavaScript/JavaScript-0.52.readme> 
for starters.

I suspect that solving the problem may, in the end, not be worth the effort.

-- 
John W. Kennedy
"The poor have sometimes objected to being governed badly; the rich have 
always objected to being governed at all."
   -- G. K. Chesterton.  "The Man Who Was Thursday"


------------------------------

Date: Mon, 06 Sep 2004 03:40:24 GMT
From: Joe Smith <Joe.Smith@inwap.com>
Subject: Re: Temporarily redirecting STDOUT
Message-Id: <I_Q_c.137807$mD.57710@attbi_s02>

Fil wrote:

> I'm really interested here in learning to redirect STDOUT and of
> course recover it afterwards.

I take it that you have not attempted to use perldoc to find your answer.  Try
    C:\>perldoc -f open
and look at the section marked "Here is a script that saves,
redirects, and restores "STDOUT" and "STDERR" using various methods".

	-Joe


------------------------------

Date: Sun, 5 Sep 2004 16:25:41 -0700
From: "187" <bigal187@invalid.rx.eastcoasttfc.com>
Subject: Re: two's compliment?
Message-Id: <2q1lniFq4pq9U1@uni-berlin.de>

Randal L. Schwartz wrote:
> *** post for FREE via your newsreader at post.newsfeed.com ***
>
>>>>>> "187" == 187  <1.8.7@nodomain.com> writes:
>
>>> People like you not understanding Usenet operating procedure.
>
>> I really don't think you're correct here. Usenet is not about
>> sending  email, it's about exchanging information *in* *news
>> groups*. Standard "operating procedure" has always been this,

[Note: I meant UseNet has always bene abotu echanging information, but I
admit I may have impied *only* in new groups, which may be the core of
UseNet, but not the only way of exchanging information.]

> For some version of "always".  Mine apparently predates yours.  You
> speak like someone relatively new to Usenet, probably not coming until
> the post-spam era.
>
> In the pre-spam days, it was common courtesy to always include an
> email address that worked, so that you could curse in private, but
> bless in public.  Nobody seems to have courtesy here any more.


Once again, I understand your point, but I think you've once again
mis-understood me. I have been around, I know *exactly* what you are
talking about :-) But right now *is* the post-spam, not the pre-spam
era. Spam has forced many of us to munge our emails.

Also, I feel I didn't explain this correctly. I did have a valid email
address (munged) in my header of my original post, but had forgotten to
update it. It hadn't been a problem 'til your response. I have updated
my header now though, with a munged version of my current email.

So please don't get me wrong. I know you're a great and respected person
in the programming field, and I know you've taken part in writing some
good books (some reside on my shelf - camel/llama/alpaca(objects)...),
and I respect you too, and like you, I do miss the "good 'ol days" of
UseNet.

Bottom line though: If you can't reach me by demunging my header's email
address, just ask in a post and I'll be more than happy to provide the
correct one, as I did in my previous reply to you :-)




------------------------------

Date: Mon, 06 Sep 2004 01:09:18 GMT
From: "blnukem" <bill@hotmail.com>
Subject: Re: Update multiple lines in a flat file from array
Message-Id: <2NO_c.25809$lv3.8528924@news4.srv.hcvlny.cv.net>


"Eric Bohlman" <ebohlman@omsdev.com> wrote in message
news:Xns955BAE75BB06Febohlmanomsdevcom@130.133.1.4...
> botfood@yahoo.com (dan baker) wrote in
> news:13685ef8.0409051058.4a813363@posting.google.com:
>
> > "blnukem" <bill@hotmail.com> wrote in message
> > news:<Y2i_c.5572$lv3.3194761@news4.srv.hcvlny.cv.net>...
> >> Hi All
> >>
> >> I looking for a simple way to update multiple lines in a flat file
> >> from incoming array with multiple values the file structure goes like
> >> this: Part-number | Name | Quantity
> >>
> >> The file looks like this:
> >>
> >> 123456|headlamp|6
> >> -----------------------------------------
> >
> > this looks like a pretty good candidate to use a tie()ed hash DBfile
> > rather than a flat text file read in and out.... Be a lot faster and
> > use less memory probably.
> >
> > If you insist on a flat text file, and its not *huge* I guess you
> > could read it all into a hash in memory, do your thing, and then write
> > it all back out (overwriting the old file).
>
> It also looks like a good candidate for DBD::CSV, which wouldn't require
> any changes to the file format and which has the insert/delete/select
> functionality already written.  But if that's overkill, then Tie::File
> (which is included with the standard Perl distribution) would probably be
> helpful.


I got it working.




------------------------------

Date: Sun, 05 Sep 2004 20:30:03 -0400
From: Jon Boone <ipmonger@comcast.net>
Subject: Re: Xah Lee's Unixism
Message-Id: <BD6127CB.220DF%ipmonger@comcast.net>

On 2004-09-05 05:42, in article 413af268$0$19706$61fed72c@news.rcn.com,
"jmfbahciv@aol.com" <jmfbahciv@aol.com> wrote:

> Sigh!  If CMU had it, I would have assumed it got hornshoed into
> VMS.
> 
>> ..or
>> Wollongong universities.  Then, of course, there was what many regarded
>> as the best TCP/IP stack for VMS, MultiNet from TGV (Two Guys and a VAX).
>> That product also included a working NFS implementation.

  By the late 1980s and early 1990s, the remaining VMS machines at CMU
seemed to mostly run TGV MultiNet, which was an absolutely awesome TCP/IP
implementation.  All of the VMS admins I had contact with (I had to admin a
single VMS machine) seemed to use MultiNet.

--jon



------------------------------

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 6965
***************************************


home help back first fref pref prev next nref lref last post