[6615] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 240 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 5 23:17:29 1997

Date: Sat, 5 Apr 97 20:04:13 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 5 Apr 1997     Volume: 8 Number: 240

Today's topics:
     Sorting a text file? (Burt Lewis)
     Re: Sorting a text file? (Eric Bohlman)
     Re: Sorting a text file? <jong@mrc-lmb.cam.ac.uk>
     Splitting Hairs, or strings, rather (Joshua J. Kugler)
     Re: Splitting Hairs, or strings, rather <jong@mrc-lmb.cam.ac.uk>
     Re: symbolic reference doesn't work with arrays? <rootbeer@teleport.com>
     Trouble t with a 2D array! <info@purco.qc.ca>
     Re: Trouble t with a 2D array! (Tad McClellan)
     Re: Trouble t with a 2D array! (Bill)
     Re: Trouble t with a 2D array! <rootbeer@teleport.com>
     Re: Unix and ease of use  (WAS: Who makes more ...) (Tom Wheeley)
     Re: Unix and ease of use (WAS: Who makes more ...)  <meconlen@intnet.net>
     Re: Unix and ease of use (WAS: Who makes more ...) (Leslie Mikesell)
     unlink on NT (KNIT1PURL1)
     Re: unlink on NT (Nathan V. Patwardhan)
     Re: Using Perl with MS-Access <rothd@roth.netX>
     Re: Using Perl with MS-Access <rothd@roth.netX>
     VMS mail archive to Unix mbox format script? <erich@powerwareintl.com>
     Re: Win32 DDE module? <rothd@roth.netX>
     Win32::NetAdmin & Win32::AdminMisc (Betty Kainz)
     Re: Win32::NetAdmin & Win32::AdminMisc <rothd@roth.netX>
     Windows95 and Perl for Win32s <steve@laverstoke.demon.co.uk>
     Re: Writing a routine the works like 'open' <roderick@argon.org>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 3 Apr 1997 00:49:25 GMT
From: burt@ici.net (Burt Lewis)
Subject: Sorting a text file?
Message-Id: <5huuql$1d5$1@bashir.ici.net>

Hi,

I have a text file that for example looks something like this:



   1 ABINGTON               T       5    363    1     14,467   16,379     
   2 ACTON                  T       2    360    3     18,371   25,792     
   3 ACUSHNET               T       5    354    3      9,904   14,040     
   4 ADAMS                  T       5    353    4      9,072   12,790     
   5 AGAWAM                 C       3    358    2     27,572   16,111    

This part of my code works fine, I just can't get sorting by specific column.
In other words, right now this is sorted by the 2nd column, I want to be able 
to sort this file by any other column.

open( FILE,"$infile" ) || die "can't open $indexurl: $!\n";
while($line = <FILE>)
{
$town=substr($line,5,23);
$towncode=substr($line,28,1);
$towncode =~ tr/t/T/;
if ($towncode eq "T") 
{
$towncode="Town";
}
}

Appreciate any help.

Thank you to everyone who responded to my other question.

Burt Lewis
burt@ici.net



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

Date: Sat, 5 Apr 1997 15:26:57 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Sorting a text file?
Message-Id: <ebohlmanE8688x.2uv@netcom.com>

Burt Lewis (burt@ici.net) wrote:
: while($line = <FILE>)
: {
: $town=substr($line,5,23);
: $towncode=substr($line,28,1);

Just a side comment, but when splitting up records that consist of 
fixed-length fields, you should seriously consider using unpack rather 
that a bunch of substr's, because it's more robust: if in the future 
there's a change in field lengths, you'll only have to change *one* line 
of code.  With the multiple-substr method, you'll have to change the 
arguments to all the substr's that come after the field that got changed, 
and it's trivially easy to miss one; this can cause some *very* 
hard-to-track-down bugs.



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

Date: Sat, 05 Apr 1997 21:16:36 +0100
From: "Park J. H." <jong@mrc-lmb.cam.ac.uk>
To: Burt Lewis <burt@ici.net>
Subject: Re: Sorting a text file?
Message-Id: <3346B324.59E2@mrc-lmb.cam.ac.uk>

Burt Lewis wrote:
> 
> Hi,

You can use map function for this kind of sorting.

There are good examples around. Also in new
camel book. I think there are web page made by
Tom(also by Randall's UNIX column I guess)
 on this problem. Please check.


@sorted = map{ $_->[0] } sort {$a->[1] cmp $b->[1]}
	    map {/^\S+ +\S+ +(\S+) +\S+ +\S+/ && [$_, $1] } @lines;

print @sorted;

What the lines does is;

1) read @lines,
2) pattern match each line and if matched return [$_, $1] . 
    As && makes the transition.
3) sort the returned array ref by its second element 
4) the first map now returns the whole line ($_->[0]) returned and
   sorted.

You can choose any column you want to sort. Also you can do multi level
sort if you put 'or'.

 like;

@sorted = map{ $_->[0] } sort {$a->[1] cmp $b->[1] or $a->[2] cmp
$b->[2] }
	    map {/^\S+ +\S+ +(\S+) +(\S+) +\S+/ && [$_, $1, $2] } @lines;

Jong


 
> I have a text file that for example looks something like this:
> 
>    1 ABINGTON               T       5    363    1     14,467   16,379
>    2 ACTON                  T       2    360    3     18,371   25,792
>    3 ACUSHNET               T       5    354    3      9,904   14,040
>    4 ADAMS                  T       5    353    4      9,072   12,790
>    5 AGAWAM                 C       3    358    2     27,572   16,111
> 
> This part of my code works fine, I just can't get sorting by specific column.
> In other words, right now this is sorted by the 2nd column, I want to be able
> to sort this file by any other column.
> 
> open( FILE,"$infile" ) || die "can't open $indexurl: $!\n";
> while($line = <FILE>)
> {
> $town=substr($line,5,23);
> $towncode=substr($line,28,1);
> $towncode =~ tr/t/T/;
> if ($towncode eq "T")
> {
> $towncode="Town";
> }
> }
> 
> Appreciate any help.
> 
> Thank you to everyone who responded to my other question.
> 
> Burt Lewis
> burt@ici.net

-- 
 I support Perl, Linux ...

With OVER SIX MILLION USERS, up from only ten or so a very few years
ago, Linux has taken it's place as the world's #3 computer operating
system overall. And Linux is breathing down the neck of #2 for very good
reasons. If growth rate to date continues, Linux will be the #1 computer
operating system by late '98 or '99. Are YOU ready?

	  ) Linux Newsletter

http://www.smli.com/people/john.ousterhout/scripting.html


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

Date: Sat, 05 Apr 1997 23:19:29 GMT
From: jkugler@inreach.com (Joshua J. Kugler)
Subject: Splitting Hairs, or strings, rather
Message-Id: <3346dc89.16327060@news.inreach.com>

Hi.  I am looking for some efficient code to split strings in to 100
character sub strings.  I was given some, and have been concocting
some of my own, but I have gotten only garbled output.  I would like
to be able to give the code snippet a string and have it return an
array, like so:

@arr = &splitter($var)

Any help would be great.

Oh, and if post to the news group, please respond via e-mail as well,
because my ISP's news server is behaving rather weirdly.

Thanks!

j----- k-----

Joshua J. Kugler
Computer Consultant--Web Developer
jkugler@inreach.com
http://www.cwebpages.com/jkugler
Every knee shall bow, and every tongue confess, in heaven, on earth, and under the earth, that Jesus Christ is LORD -- Count on it!


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

Date: Sun, 06 Apr 1997 04:12:02 +0100
From: "Park J. H." <jong@mrc-lmb.cam.ac.uk>
To: "Joshua J. Kugler" <jkugler@inreach.com>
Subject: Re: Splitting Hairs, or strings, rather
Message-Id: <33471482.41C6@mrc-lmb.cam.ac.uk>

Joshua J. Kugler wrote:
> 
> Hi.  I am looking for some efficient code to split strings in to 100
> character sub strings.  I was given some, and have been concocting
> some of my own, but I have gotten only garbled output.  I would like
> to be able to give the code snippet a string and have it return an
> array, like so:
> 
> @arr = &splitter($var)

@arr = $string=~/.{0,100}/g; 

Above will chop any string into 100 char pieces and
the last one will be the remnant char string if your
string is not exact.

Pattern match (multiple by 'g' opt) returns all the
matched fragments to @arr.

Jong


> 
> Any help would be great.
> 
> Oh, and if post to the news group, please respond via e-mail as well,
> because my ISP's news server is behaving rather weirdly.
> 
> Thanks!
>



 
> j----- k-----
> 
> Joshua J. Kugler
> Computer Consultant--Web Developer
> jkugler@inreach.com
> http://www.cwebpages.com/jkugler
> Every knee shall bow, and every tongue confess, in heaven, on earth, and under the earth, that Jesus Christ is LORD -- Count on it!

-- 
 I support Perl, Linux ...

With OVER SIX MILLION USERS, up from only ten or so a very few years
ago, Linux has taken it's place as the world's #3 computer operating
system overall. And Linux is breathing down the neck of #2 for very good
reasons. If growth rate to date continues, Linux will be the #1 computer
operating system by late '98 or '99. Are YOU ready?

	  ) Linux Newsletter

http://www.smli.com/people/john.ousterhout/scripting.html


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

Date: Sat, 5 Apr 1997 05:03:13 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Brett Denner <Brett.W.Denner@lmtas.lmco.com>
Subject: Re: symbolic reference doesn't work with arrays?
Message-Id: <Pine.GSO.3.96.970405050146.2974G-100000@kelly.teleport.com>

On Fri, 4 Apr 1997, Brett Denner wrote:

> I am trying to use a symbolic reference to change array elements
> as follows:
> 
>   my @one = ('a');

Ah, but 'my' variables aren't stored in a symbol table. Thus, symbolic
references can't access them. Maybe you want to use real (hard) references
instead. perlref(1) has the details. Hope this helps! 

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Fri, 04 Apr 1997 20:24:00 -0800
From: "Leon Stepanian - Purco Inc." <info@purco.qc.ca>
Subject: Trouble t with a 2D array!
Message-Id: <3345D3E0.7530@purco.qc.ca>

Hello,

I've been going crazy trying to make this 2D test array work as it
should, as it will be the basis ffor a larger 2D array later on.

The code works fine if the 2D array is included in the perl code, but if
the array is in a separate file, it won't work.

I'm using Perl5 for Dos and it works O.K. on all the scripts I have
written so far, (OK except this one). Can anyone please help. All the
files are in the USR\BIN\PERl directory, although this should not affect
anyting since this is in my path.

The 2D array is in a file called "final.txt"  and contains;
	(
	[3,11,12,14,41,43,13,12,6,1982,1],
	[8,33,36,37,39,41,9,19,6,1982,2],
	[1,6,23,24,27,39,34,26,6,1982,3],
	[3,9,10,13,20,43,34,3,7,1982,4],
	[5,14,21,31,34,47,45,10,7,1982,5],
	[8,20,21,25,31,41,33,17,7,1982,6],
	[18,25,28,33,36,42,7,24,7,1982,7],
	[7,16,17,31,40,48,26,31,7,1982,8],
	[5,10,23,27,37,38,33,7,8,1982,9],
	[4,15,30,37,46,48,3,14,8,1982,10]
	)

My Perl test code QUADDATA.pl is as follows. But it does not work?



#!C:\usr\bin\perl   #This works on all my other scripts becasue I'm on
Dos

print ("This is stage 1 of QUADDATA.PL before opening the final.txt
file!\n");

if (open(QUADDATA, "final.txt")) {
	print ("final.txt now open!\n"); #This prints out to confirm file is
opened.
	}

@line = <QUADDATA>; 		#Is this O.K.
$size = $count = 0;

print (@line); #This test print does in fact print out the array
final.txt.

print ("\n\nThis is a test of value at \$line[3][10] $line[3]->[7]\n"); 
# This test does not work. It should print the integer 34.

while ($line[$size]->[$count] ne "") { 
	print ("In the while loop \$size = $size, \$count = $count\n");
	print ($line[$size]->[$count]);
	$size++;
	$count++;
	}
# This whole while test statement does not work. It shuld do the same
thing as the
# print (@line) statement above and is the basis for the type of search
and controls
# I am looking to write later, if this simple test can work out.

print ("\nOut of while loop \$size = $size, \$count = $count\n"); #This
works

As I said, the above works if the array is integrated in the QUADDATA.pl
code, but once it is placed in a separate file, which is more convenient
to update, it does not work.

Any assistance would be greatly appreciated.

Leon Stepanian
info@purco.qc.ca


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

Date: Fri, 4 Apr 1997 22:26:50 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Trouble t with a 2D array!
Message-Id: <aak4i5.jfr.ln@localhost>

Leon Stepanian - Purco Inc. (info@purco.qc.ca) wrote:
: Hello,

: I've been going crazy trying to make this 2D test array work as it
: should, as it will be the basis ffor a larger 2D array later on.

: The code works fine if the 2D array is included in the perl code, but if
: the array is in a separate file, it won't work.
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Because the perl compiler never parses it!

It is just a plain old data file.

If you cannot influence the file into correct perl syntax, then
you will need to parse and store the values yourself.

If you can chang the file you could do something like:


---- final.txt ----
@line = (
        [3,11,12,14,41,43,13,12,6,1982,1],
        [8,33,36,37,39,41,9,19,6,1982,2],
        [1,6,23,24,27,39,34,26,6,1982,3],
        [3,9,10,13,20,43,34,3,7,1982,4],
        [5,14,21,31,34,47,45,10,7,1982,5],
        [8,20,21,25,31,41,33,17,7,1982,6],
        [18,25,28,33,36,42,7,24,7,1982,7],
        [7,16,17,31,40,48,26,31,7,1982,8],
        [5,10,23,27,37,38,33,7,8,1982,9],
        [4,15,30,37,46,48,3,14,8,1982,10]
        );
1;
-----------------------



--------- main --------
#!/usr/bin/perl

require "final.txt";

print "$line[3]->[7]\n";  #  3
print "$line[2]->[6]\n";  # 34
print "$line[3]->[6]\n";  # 34
------------------------


: The 2D array is in a file called "final.txt"  and contains;
: 	(
: 	[3,11,12,14,41,43,13,12,6,1982,1],
: 	[8,33,36,37,39,41,9,19,6,1982,2],
: 	[1,6,23,24,27,39,34,26,6,1982,3],
: 	[3,9,10,13,20,43,34,3,7,1982,4],
                            ^              there is element [3][7]
: 	[5,14,21,31,34,47,45,10,7,1982,5],
: 	[8,20,21,25,31,41,33,17,7,1982,6],
: 	[18,25,28,33,36,42,7,24,7,1982,7],
: 	[7,16,17,31,40,48,26,31,7,1982,8],
: 	[5,10,23,27,37,38,33,7,8,1982,9],
: 	[4,15,30,37,46,48,3,14,8,1982,10]
: 	)

: My Perl test code QUADDATA.pl is as follows. But it does not work?





: if (open(QUADDATA, "final.txt")) {
: 	print ("final.txt now open!\n"); #This prints out to confirm file is
: opened.
: 	}

: @line = <QUADDATA>; 		#Is this O.K.
                                 ^^^^^^^^^^^^

Nope.

@line is a normal (one dimensional) array with 12 elements
[0-11, perl starts counting with 0, unless you tell it not to]

$line[0] contains the _string_ "       ("

$line[1] contains the _string_ "       [3,11,12,14,41,43,13,12,6,1982,1],"

You have only a dozen strings. The fact that some of the strings
look like anonymous arrays won't make them be treated as such.


: $size = $count = 0;

: print (@line); #This test print does in fact print out the array
: final.txt.


That is just a happy coincidence. It is not printing a 2D array.

It is just printing the 12 strings contained in a normal array.


: print ("\n\nThis is a test of value at \$line[3][10] $line[3]->[7]\n"); 
: # This test does not work. It should print the integer 34.
                                                         ^^

Do you want [3][10] or [3][7]?

Or do you want the tenth element of the third line?
(that would be [2][9])

seventh of the third?  ([2][6])

There is more than one '34' in the array.

All of that combines to convince me that I don't know what
you wanted here...



: As I said, the above works if the array is integrated in the QUADDATA.pl
: code, but once it is placed in a separate file, which is more convenient
: to update, it does not work.

: Any assistance would be greatly appreciated.


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 5 Apr 1997 06:08:00 GMT
From: bill@sover.net.no.junkmail (Bill)
Subject: Re: Trouble t with a 2D array!
Message-Id: <slrn5kbr20.lcr.bill@granite.sover.net>

Newsgroups: comp.lang.perl.misc
Subject: Re: Trouble t with a 2D array!
References: <3345D3E0.7530@purco.qc.ca>
Organization: No junk email please.
Followup-To: 

In article <3345D3E0.7530@purco.qc.ca>, Leon Stepanian - Purco Inc. wrote:
>Hello,
>
>I've been going crazy trying to make this 2D test array work as it
>should, as it will be the basis ffor a larger 2D array later on.
>
>The code works fine if the 2D array is included in the perl code, but if
>the array is in a separate file, it won't work.
>
>I'm using Perl5 for Dos and it works O.K. on all the scripts I have
>written so far, (OK except this one). Can anyone please help. All the
>files are in the USR\BIN\PERl directory, although this should not affect
>anyting since this is in my path.
>
>The 2D array is in a file called "final.txt"  and contains;
>	(
>	[3,11,12,14,41,43,13,12,6,1982,1],
>	[8,33,36,37,39,41,9,19,6,1982,2],
>	[1,6,23,24,27,39,34,26,6,1982,3],
>	[3,9,10,13,20,43,34,3,7,1982,4],
>	[5,14,21,31,34,47,45,10,7,1982,5],
>	[8,20,21,25,31,41,33,17,7,1982,6],
>	[18,25,28,33,36,42,7,24,7,1982,7],
>	[7,16,17,31,40,48,26,31,7,1982,8],
>	[5,10,23,27,37,38,33,7,8,1982,9],
>	[4,15,30,37,46,48,3,14,8,1982,10]
>	)
>
>My Perl test code QUADDATA.pl is as follows. But it does not work?

   The above works fine since it creates an array of references to 
anonymous arrays, if that makes any sense. This is what you'll want to 
try to do on the fly too.

>#!C:\usr\bin\perl   #This works on all my other scripts becasue I'm on
>Dos
>
>print ("This is stage 1 of QUADDATA.PL before opening the final.txt
>file!\n");
>
>if (open(QUADDATA, "final.txt")) {
>	print ("final.txt now open!\n"); #This prints out to confirm file is
>opened.
>	}

   You might want to print out an error if something goes wrong rather 
than a confirmation when things work, but this is a minor point and a 
style call more than anything.

>@line = <QUADDATA>; 		#Is this O.K.
>$size = $count = 0;

   @array = <FILEHANDLE>; is fine if you want to read the entire file 
into memory, but you may not want to take this approach; see below.

>print (@line); #This test print does in fact print out the array
>final.txt.
>print ("\n\nThis is a test of value at \$line[3][10] $line[3]->[7]\n"); 
># This test does not work. It should print the integer 34.
>
   Nope.  At this point @line is an array of scalars, which happen to be 
the lines of the file you just read.  The lines are contains as actual 
scalars, and not references to anything, so trying to dereference them 
naturally doesn't give anything useful.  You have to build your array by 
adding references to anonymous arrays to it as you read the data in.

[remainder of code deleted]

Ok, as you probably understand, doing something like

  $arrayref = [ "one", "two", "three" ];

creates an anonymous array, which is a fancy way of saying it's just like 
a regular variable, except that there is no entry in the symbol table for 
it.  The above assignment stores a reference to the array in the scalar 
$arrayref.  Now, as you probably also know, multi-dimensional arrays in 
Perl are really just arrays of references pointing to other arrays.  If 
you want to create an array from the following data stored in a file (I'll 
use an easier example than yours for simplicity), you could do:

Datafile.txt:

1 2 3 4
5 6 7 8
9 1 2 3

#!/usr/bin/perl -w

  open(DATA, 'datafile.txt') or die "Couldn't open data file: $!\n";

  # Loop through lines in the file
  while (<DATA>) {   
      chomp;  # Remove newline
      push(@array, [ split(/\s/) ]);
      # The above line splits on a whitespace character and returns a
      # list of data.  The [ ] create an anonymous array containing
      # the same data, and the push takes the reference to that array
      # and adds it to the array.
  }
  close(DATA);
  # For each reference in the array...
  foreach (@array) {
      print join ' ', @$_i, "\n"; # Join data in array pointed to by 
                                  # dereferencing $_ with spaces and 
                                  # print it.
  }

   The idea is that the array returned by the split isn't going to stay 
around unless you specifically stick it in a permanent variable 
someplace, and so it is vitally important that the [ ]'s be used to make 
what is returned a real variable whose contents won't be overwritten 
with the next call to something that returns a list.  Read up in Chapter 
4 of the Camel book, the perlref man page, and practice. :) Hope this 
helps...
						Bill
-- 
Sending me unsolicited email through mass emailing about a product or
service your company sells ensures that I will never buy or recommend your
product or service.


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

Date: Sat, 5 Apr 1997 10:52:16 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Leon Stepanian - Purco Inc." <info@purco.qc.ca>
Subject: Re: Trouble t with a 2D array!
Message-Id: <Pine.GSO.3.96.970405103950.18891D-100000@kelly.teleport.com>

On Fri, 4 Apr 1997, Leon Stepanian - Purco Inc. wrote:

> I've been going crazy trying to make this 2D test array work as it
> should, 

That's okay. Perl doesn't have 2D arrays. (But if you understand what it
does have, you can fake them very nicely.)

> @line = <QUADDATA>; 		#Is this O.K.

Yes, it's okay if you want to read each line of the file into a separate
array element as a string. If you want to parse each line to get at the
elements within it, it's not going to do what you're after. 

> print ("\n\nThis is a test of value at \$line[3][10] $line[3]->[7]\n"); 
> # This test does not work. It should print the integer 34.

If you want $line[3][7] to have a value, you'll want to put one in there.
Perhaps this would do it:

    while (<QUADDATA>) {
        next unless /\d/;		# Skip non-element lines
	push @line, [ /(\d+)/g ];
    }

That should extract each group of digits on each line, group each one into
a ("horizontal") anonymous list, then push that list onto the @line array
(which should be renamed, perhaps).

For more info, check out perldsc(1) and perllol(1). Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/





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

Date: Sat, 05 Apr 97 00:02:16 GMT
From: tomw@tsys.demon.co.uk (Tom Wheeley)
Subject: Re: Unix and ease of use  (WAS: Who makes more ...)
Message-Id: <860198536snz@tsys.demon.co.uk>

In article <01bc400d$79a2dbc0$LocalHost@dan>
           dan.kang@nuri.net "Daniel Kang" writes:

> Chen Ofek <cheno@opal.co.il> wrote
> 
> > Stephane Plattner wrote:
> 
> > > IMHO this answer contradicts to the basics of economics. Openess means
> > > to a great extent equality and equality prohibits competition.
> > > (communism). Competition rises only when differences exists and it's
> > > the market (or the environment), who dictates which product is better.
> > > 
> > > --
> > 
> > Wrong!!!
> > Openess means more competition.
> 
> Well, I would say openess means less competition and more *cooperation* which
> is *bettter*.

No, *more* competition.  The main force stifling competition in the computer
world is that of standards.  If your product does not fit the standard then
it will not sell in significant amounts.  Microsoft understand and exploit
this fact in order to prromulgate bg-ware as the standard; thus driving out
the competition.

Windows is a closed standard.  Could anyone write a product to compete with
Windows?  (well, there's WINE of course... imho the most important project
for free software on the intel platform)

-- 
:sb)



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

Date: Sat, 5 Apr 1997 20:36:58 -0500
From: Mike Conlen <meconlen@intnet.net>
Subject: Re: Unix and ease of use (WAS: Who makes more ...) 
Message-Id: <Pine.SV4.3.91.970405203118.10709C-100000@xcalibur>

On 5 Apr 1997, Leslie Mikesell wrote:

> In article <3342473A.794B@ic.ac.uk>, Gavin Tabor  <gavin@ic.ac.uk> wrote:
> >Terry Reedy wrote:
> >> 
> >> In article <33414A13.4D45@absyss.fr>, seay@absyss.fr says...
> >> > But remember that
> >> >everytime someone does some form of freeware (GNU,
> >> >Perl, Linux, whatever), this is a bit of socialism.
> >> 
> >> NO!  freeware is voluntary activity (free enterprise) with no guns or
> >> g-men in sight.  It is the opposite of socialism.
> >
> >NO! freeware is communism - the theoretical version, not the
> >practical version - you do it because you want to do it, not
> >for any profit beyond what you need to live on.
> 
> Not at all.  Lots of freeware was at least partly written by people
> who were paid for doing it by someone who needed it.  The decision
> to share what you have done with others has nothing to do with
> the reasons for doing it in the first place.

In Socialism and Communism people are given the responsibility to provide 
something to the community, where as freeware is given beacuse someone 
wants to. The diffrence being that if I give out as freeware some program 
I can stop supporting it if I like, I could even remove my self from the 
internet all together, (as well as the rest of the computing world) and 
forget I ever did it. 
Socialism and Communism provide for ways to maintain software, ie. give 
someone a government job to do it, or put a gun to their head, where as 
freeware in a democraticaly run government you support could be cut off. 
If someone blew up the building where a Perl convenction was taking place 
all the Perl Gurus might be killed. The government isnt going to find 
some non-social Perl guru and say, "You must handle Perl support beacuse 
Wall and Schwartz are dead."

							Groove on Dude
							Michael Conlen




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

Date: 5 Apr 1997 13:25:35 -0600
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <5i68vf$jrg$1@Venus.mcs.net>

In article <3342473A.794B@ic.ac.uk>, Gavin Tabor  <gavin@ic.ac.uk> wrote:
>Terry Reedy wrote:
>> 
>> In article <33414A13.4D45@absyss.fr>, seay@absyss.fr says...
>> > But remember that
>> >everytime someone does some form of freeware (GNU,
>> >Perl, Linux, whatever), this is a bit of socialism.
>> 
>> NO!  freeware is voluntary activity (free enterprise) with no guns or
>> g-men in sight.  It is the opposite of socialism.
>
>NO! freeware is communism - the theoretical version, not the
>practical version - you do it because you want to do it, not
>for any profit beyond what you need to live on.

Not at all.  Lots of freeware was at least partly written by people
who were paid for doing it by someone who needed it.  The decision
to share what you have done with others has nothing to do with
the reasons for doing it in the first place.

Les Mikesell
  les@mcs.com


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

Date: 5 Apr 1997 15:09:38 GMT
From: knit1purl1@aol.com (KNIT1PURL1)
Subject: unlink on NT
Message-Id: <19970405150900.KAA01478@ladder01.news.aol.com>

I cannot get this to work on NT:

unlink <*.txt>;

If I specify the entire file name, unlink does work, but not this globbing
method. Is there a way to do this on NT?


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

Date: 5 Apr 1997 16:52:55 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: unlink on NT
Message-Id: <5i6017$4d7@fridge-nf0.shore.net>

KNIT1PURL1 (knit1purl1@aol.com) wrote:

: I cannot get this to work on NT:
: unlink <*.txt>;

I thought there was a perlglob.exe included with the distribution?  You
might want to read the docs, bug reports, and FAQs about globbing in NT
Perl.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 5 Apr 1997 18:18:37 GMT
From: "Dave Roth" <rothd@roth.netX>
Subject: Re: Using Perl with MS-Access
Message-Id: <01bc41ed$6fb04990$5f906ec6@main2>



Donald H. Locker <dhl@mrdog.msl.com> wrote in article
<E839DM.DDu@mrdog.msl.com>...
> Step 1: figure out how to do what you need to do manually.
> Step 2: automate that method.
> 
> i.e.  start reading up on M<gag>Access, figure out what commands and
> data you need to feed it to get the desired result, then coerce (via
> an appropriate language) a computer to do the routine work for you.
> 
> In article <33425f7e.7192482@news.saix.net>,
> Kevin Posen <posenj@lancet.co.za> wrote:
> >Hi.
> >
> >I've been requested to use a Perl CGI script to receive data from an
HTML form
> >and to add this to a database maintained in MS-Access.
> >
> >I have no idea where to start as I haven't used Access (or any other
database
> >maintenance system) much at all.

Check out Win32::ODBC. It works well.
http://www.roth.net/odbc/

dave
-- 
================================================================
Dave Roth                               ...glittering prizes and
Roth Consulting                     endless compromises, shatter
rothd@roth.net                         the illusion of integrity

 My email address is disguised to fool automailers. Remove the
                 trailing 'X' to send me email.
****************************************************************
Use of  this message or  email address  for commercial  purposes
(including "junk" mailings) is strictly prohibited and protected
under  current  international  copyright laws  and United States
Code, Title 47, Chapter 5, Subchapter II.

 


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

Date: 5 Apr 1997 18:17:04 GMT
From: "Dave Roth" <rothd@roth.netX>
Subject: Re: Using Perl with MS-Access
Message-Id: <01bc41ed$38bb39e0$5f906ec6@main2>



Andrew Gruskin <agruskin@melbpc.org.au> wrote in article
<33450457.2656304@news.melbpc.org.au>...
> On Tue, 01 Apr 1997 19:22:18 GMT, posenj@lancet.co.za (Kevin Posen)
> wrote:
> 
> >Hi.
> >
> >I've been requested to use a Perl CGI script to receive data from an
HTML form
> >and to add this to a database maintained in MS-Access.
> >
> >I have no idea where to start as I haven't used Access (or any other
database
> >maintenance system) much at all.
> >
> >Any ideas?
> >
> I can only suggest you go for my ol' favourite, OLE Automation.
> 
> Your Win32 port of Perl will come with some documentation - try
> looking for oleauto.htm.  Then have a look in the MSAccess help for
> OLE Automation Server.
> 
> You can drive Access from Perl using all the VBA methods available in
> Access.
> 
> IMHO, this type of Perl application is cool!


The OLE module would work fine but I would consider using Win32::ODBC. It
is fairly fast and can handle any ODBC database that you have a driver for.
	http://www.roth.net/odbc/
dave
-- 
================================================================
Dave Roth                               ...glittering prizes and
Roth Consulting                     endless compromises, shatter
rothd@roth.net                         the illusion of integrity

 My email address is disguised to fool automailers. Remove the
                 trailing 'X' to send me email.
****************************************************************
Use of  this message or  email address  for commercial  purposes
(including "junk" mailings) is strictly prohibited and protected
under  current  international  copyright laws  and United States
Code, Title 47, Chapter 5, Subchapter II.



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

Date: Fri, 04 Apr 1997 08:23:48 -0800
From: Eric Harley <erich@powerwareintl.com>
Subject: VMS mail archive to Unix mbox format script?
Message-Id: <33452B14.46C@powerwareintl.com>

Does anybody have, or know how I should go about 
writing, a VMS mail to Unix mbox script? I am 
needing to convert some of my mail archives that 
would really like to be converted.


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

Date: 5 Apr 1997 18:15:55 GMT
From: "Dave Roth" <rothd@roth.netX>
Subject: Re: Win32 DDE module?
Message-Id: <01bc41ed$0f26b1e0$5f906ec6@main2>



mikee@spindle.net wrote in article <860158792.7192@dejanews.com>...
> I'm trying to send commands (keystrokes) from a perl script into a
> windows application and for all I know about windows (not much :) this
> must be done through DDE, so I'm looking for a perl DDE module.
> 
> Is this the right way to do what I need?
> Is there a DDE module available?
> Is there another way to do what I need?
> 
> TIA
> 
> Mike
> 
> -------------------==== Posted via Deja News ====-----------------------
>       http://www.dejanews.com/     Search, Read, Post to Usenet
> 

Someone once wrote a DDE extension but I never got it to compile hence
never tried it. I uploaded it to Activeware's ftp site back when it was Hip
Communications. Even though the technology has been falling to the wayside
since OLE is the rave I think it would be cool for someone to take it on.
dave
-- 
================================================================
Dave Roth                               ...glittering prizes and
Roth Consulting                     endless compromises, shatter
rothd@roth.net                         the illusion of integrity

 My email address is disguised to fool automailers. Remove the
                 trailing 'X' to send me email.
****************************************************************
Use of  this message or  email address  for commercial  purposes
(including "junk" mailings) is strictly prohibited and protected
under  current  international  copyright laws  and United States
Code, Title 47, Chapter 5, Subchapter II.



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

Date: 05 Apr 1997 14:38:00 +0100
From: midimani@site88.ping.at (Betty Kainz)
Subject: Win32::NetAdmin & Win32::AdminMisc
Message-Id: <6UI0pjOCdNB@site88.ping.at>

Hi !

I sure hope that somebody can help me ! I need these two modules
desperately for a project, and Dave Roth's site seems to be down.

Could somebody please tell me if it's possible to get them somewhere else,  
or maybe send them to me ?!?

I'm also looking for any documentation and/or script examples that
anyone may have for these modules.

I'd be really grateful for any help I can get ! :-)

Thanks in advance ! :-)
Betty


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

Date: 5 Apr 1997 18:09:26 GMT
From: "Dave Roth" <rothd@roth.netX>
Subject: Re: Win32::NetAdmin & Win32::AdminMisc
Message-Id: <01bc41ec$27af04c0$5f906ec6@main2>

My site should be back up. I had some troubles getting the InterNIC to
change my primary DNS, but all is well now (I hope).
There is also a version of AdminMisc for build 304 available.
dave
-- 
================================================================
Dave Roth                               ...glittering prizes and
Roth Consulting                     endless compromises, shatter
rothd@roth.net                         the illusion of integrity

 My email address is disguised to fool automailers. Remove the
                 trailing 'X' to send me email.
****************************************************************
Use of  this message or  email address  for commercial  purposes
(including "junk" mailings) is strictly prohibited and protected
under  current  international  copyright laws  and United States
Code, Title 47, Chapter 5, Subchapter II.


Betty Kainz <midimani@site88.ping.at> wrote in article
<6UI0pjOCdNB@site88.ping.at>...
> Hi !
> 
> I sure hope that somebody can help me ! I need these two modules
> desperately for a project, and Dave Roth's site seems to be down.
> 
> Could somebody please tell me if it's possible to get them somewhere
else,  
> or maybe send them to me ?!?
> 
> I'm also looking for any documentation and/or script examples that
> anyone may have for these modules.
> 
> I'd be really grateful for any help I can get ! :-)
> 
> Thanks in advance ! :-)
> Betty
> 


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

Date: Sat, 05 Apr 1997 08:51:28 GMT
From: "Steve Morris" <steve@laverstoke.demon.co.uk>
Subject: Windows95 and Perl for Win32s
Message-Id: <01bc419e$9f426ca0$189edec2@laverstoke.demon.co.uk>

I need some help with the installation of Perl5 for Win32s into PWS on
Windows95. 
I have installed the Perl5 for Win32 code in a number of places on my
system, including the C:\Webshare directory, which is where my local webs
reside. I have tried setting shares with different access permissions,
still with no success. If have established that i can read the relevant
directories with the browser, by seeing filelists if i leave off the
filename in the URL address.
I tried installing the PerlIIS DLL, but this caused my system to completely
crash when i tried out the script.
With the perl.exe in place, all i get when i submit a request, is nothing.
The hourglass comes up, with no results. If i test the script from a DOS
window, i get output from the script, to the screen, so i presume that the
perl.exe is working OK.
I have read various documents on the subject, including MS Knowledge base
articles relating to IIS.
I am using the HelloWorld.pl example to test. I have tried this with and
without the ? i.e Helloworld.pl?.
I read references to setting the correct variables for the system, but do
not know what to set and how.
Please someone help. I'm sure people have got this working. I can't keep
testing stuff online, it costs too much here in the UK.

steve@laverstoke.demon.co.uk



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

Date: 4 Apr 1997 17:56:09 -0500
From: Roderick Schertler <roderick@argon.org>
To: bernie@rev.net
Subject: Re: Writing a routine the works like 'open'
Message-Id: <pz208qjtas.fsf@eeyore.ibcinc.com>

On Tue, 01 Apr 1997 23:05:05 GMT, bernie@rev.net (Bernard Cosell) said:
> 
> [...] how you can write subroutines which take 'filehandles' as
> arguments and can do the right thing with the argument [e.g., leaving
> the 'filehandle' open in the context of the caller so that the caller
> can then read the file, etc.]

If the calling and called subroutines are in the same package there is
nothing special you have to do, just put the filehandle argument in a
scalar and use the scalar where you normally would a filehandle.

If the caller might be in a different package then you have to qualify
bareword filehandles with the name of the calling package (otherwise
Perl will put them in your package).  Use Symbol::qualify for this.

    use Carp    qw(croak);
    use Fcntl   qw(LOCK_EX);
    use Symbol  qw(qualify);

    sub locked_open {
        @_ == 1 or @_ == 2 or croak 'usage: locked_open FH [, SPEC]';
        no strict 'refs';
        my $fh = qualify shift, scalar caller;
        my $spec = @_ ? shift : $$fh;
        my $ret = open $fh, $spec       or return;
        flock $fh, LOCK_EX              or return;
        return $ret;
    }

-- 
Roderick Schertler
roderick@argon.org


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 240
*************************************

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