[6553] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 178 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 25 17:07:13 1997

Date: Tue, 25 Mar 97 14:00:23 -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           Tue, 25 Mar 1997     Volume: 8 Number: 178

Today's topics:
     Re: 1 2 Many (Help!) slacker@dixonillinois.com
     Accessing the WWW via Perl (Daniel Freeman)
     Re: Advanced perl question (Simon Hyde (aka Jeckyll))
     re: bizarre problem - found simple solution <clive@bigfish.co.uk>
     Re: Directory Listing in Perl <sveerara@cisco.com>
     Fork & Memory Allocation Question <simont@post.its.mcw.edu>
     HELP !!! Java application and or C from Perl?????? <mshannon@lds.com>
     Re: help slacker@dixonillinois.com
     multiple key sort <mdb@cdc.noaa.gov>
     Netscape Navigator 3.x <102556.773@CompuServe.COM>
     Novell Netware <seay@absyss.fr>
     Re: Perl process doesn't go away <rootbeer@teleport.com>
     Perl, Delphi, Linux, Windows, and databases (VB5E?) <chris@ixlabs.com>
     Question on perltoot - handling of class data (Jim Showalter)
     Re: Regular Expresion question. (Rahul Dhesi)
     regular expression for check lower case (Sherman Hsieh)
     Re: term 'regular expressions' considered undesirable <kevlar@ns.net>
     Re: Unix 'Cat' equivelent (Daniel Freeman)
     Re: Unix 'Cat' equivelent (Tad McClellan)
     Re: Unix 'Cat' equivelent (Nathan V. Patwardhan)
     Re: Unix and ease of use  (WAS: Who makes more ...) (Daniel P Hudson)
     Wanted: WWW Programming Mgr. info@oxfordresources.com
     Re: What's a bad Perl book? (David Alan Black)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 25 Mar 1997 17:51:53 GMT
From: slacker@dixonillinois.com
Subject: Re: 1 2 Many (Help!)
Message-Id: <33380f43.1254443@news.essex1.com>

On Tue, 25 Mar 1997 08:37:14 GMT, adelton@fi.muni.cz (Honza Pazdziora)
wrote:

>slacker@dixonillinois.com writes:
>
>> I've been messing with this for far too long for what seems like it
>> should have a simple answer. All I'm trying to do is read a file in
>> ($file) if it exists and then print the same file back out. It works
>> but I'm getting 2 entries for each line in the first file which I do
>
>2 entries. Does it mean you get each line twice? Or you get extra
>empty line after each line?

Yes, each line twice. It prints the same list twice actually so none
of the duplicate entries are next to each other and both lists have
the same order.
>
>> not want. Does it matter that it's a comma seperated varable file?
>> If some one has the answer and the time to explain why the answer
>> works I can use all the help I can get. 
>> 
>> 
>>


#!/usr/bin/perl
# update_daemon1.pl


$quit = 0;

while ($quit != 1) {


   ###############  open initial_dbase and read each line into
variables  ##################
	open(ADD_DB,"initial_dbase.csv") ;
	
	while ($line = <ADD_DB>) {

		($key, $date, $first_name, $last_name, $email,
$address1, $address2,  
		$city, $country, $state, $zip, $phone, $check_phone,
$fax, $check_fax, $contact, 
		$check_contact, $file, $category, $info, $check_call,
$new_category, 
		$check_new_category, $check_update, $graphic_url,
$ad_type, $listing, 
		$time, $language, $ad_headline, $price, $payby,
$cardtype, $cardholder,
		$cardnumber, $cardexp, $compile_time) = split(/,/,
$line);


#print "$category\n" ;
#print "$file\n" ;

   ###############  check to see if file exists or not and add new
lines  ##################
		if (-e $file){
			open(ORIGINAL_CSV_FILE, "$file") or die "Can't
open $file, $!" ;
							
		}		
	}

$quit = 1 ;

}
>
>Well, this piece of code works for me after I put $file = 'subjects';
>line in front of it. Are you sure you do not mess up perl's variables
>somewhere before this code?
>
>--
>------------------------------------------------------------------------
> Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
>                   I can take or leave it if I please
>------------------------------------------------------------------------


Thanks for the fast replies.

Greg McKean
Just another slacker.
slacker@dixonillinois.com


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

Date: 25 Mar 1997 18:06:53 GMT
From: daniel@aksi.net (Daniel Freeman)
Subject: Accessing the WWW via Perl
Message-Id: <5h947t$ku4$1@wn.aksi.net>

I've got this handy little package called getwww that allows me to access 
the WWW via Perl.  Now I have a need to access a password protected web site
(server directory protection; not a cgi-bin style password.)

I can't figure out how to do this.  GetWWW simply returns an error "not 
authorized" like the server would return if you tried to access the 
directory with the wrong password.

I'm starting to think that maybe there is a complex form of an URL which 
contains the username and password?  If this is the case, I could give 
getWWW that URL instead of the normal one.

Any ideas would be greatly appreciated.

Best regards,
Daniel Freeman

*----------------------------------------------------------------------------*
          20/20 Technologies:  A Clear Vision of Internet Marketing
 6980 NW 29th Way, Ft. Lauderdale, FL 33309 * (954) 984-8898 (M-F, 9a-5p EST)
          E-Mail: ttt@2020tech.com   WWW: http://www.2020tech.com/
*----------------------------------------------------------------------------*


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

Date: Tue, 25 Mar 1997 19:24:38 GMT
From: shyde@poboxes.com (Simon Hyde (aka Jeckyll))
Subject: Re: Advanced perl question
Message-Id: <33401f56.9447195@news.uni-stuttgart.de>

On Tue, 25 Mar 1997 15:53:26 GMT, scrich@cris.com (Rich) wrote:

>I'm trying to pass a binary file via html document (from hard drive to
>server). What is the command(s) on the script end to process this
>info.

get CGI.pm; #from http://www.perl.com/CPAN/modules/by-module/CGI
read CGI.pm documentation;
use CGI.pm file upload stuff;
remember to do binmode (OUTFILE) if you are printing to the outfile.
---
Yours Sincerely,
                                      ,                     
   () o                              /|   |          |      
   /\     _  _  _    __   _  _        |___|        __|   _  
  /  \|  / |/ |/ |  /  \_/ |/ |       |   |\|   | /  |  |/  
 /(__/|_/  |  |  |_/\__/   |  |_/     |   |/ \_/|/\_/|_/|__/
                                               /|           
                                               \|           
(Simon Hyde)


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

Date: Tue, 25 Mar 1997 21:17:50 +0000
From: Clive Holloway <clive@bigfish.co.uk>
Subject: re: bizarre problem - found simple solution
Message-Id: <333840FE.4B19@bigfish.co.uk>

I bothered everyone with the problem below, have sussed it, and thought
you might like to know what happened...

The problem was in referring to the filename.

I was using a chdir command:

chdir "\data" (or something like that)

from the command line this worked, but when run through the jacket
script from windows it didn't.

DUH! The win 3.1 httpd server uses '/' to denote directory change and
not '\'

I just wish it could have told me in the error log....

> I have a script that works when run from the command line.
> 
> When I run it from Netscape, through Win HTTPD server (win 3.1) I get
> everything up to an 'open(FILEHANDLE,">filename.dat");'
> 
> Is it me being a newbie, or a config problem on win HTTPD? If anyone can
> help, please mail me!!
> 
> code sample where it falls apart:
> 
> open(POSTCODES,"<p_codes.dat") || die ("Can't open postcode data
> file!");
> 
> #find match
> 
> while ($line = <POSTCODES>) {
> chomp $line;
> @codes=split(",",$line);
> last if ($codes[0] eq $prefix);
> }
> close(POSTCODES);

-- 

big fish web design     Tel: +44 (0)15395 64580   pager: 0336 778419
21-23 Park Road         Fax: +44 (0)15395 63487
Milnthorpe              The longest trial in british history
Cumbria                 The truth is out there...
LA7 7AD   UK            http://www.mcspotlight.org


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

Date: 25 Mar 1997 11:55:54 -0800
From: Sriranga R. Veeraraghavan <sveerara@cisco.com>
Subject: Re: Directory Listing in Perl
Message-Id: <ls33etjzqyd.fsf@sveerara-ultra.cisco.com>


> 
> Paul Denman wrote:
> > 
> > I have come up with:
> > 
> >         print "Enter the directory you want listing:";
> >         chop($newdir = <STDIN>);
> >         chdir($newdir) || die "Cannot chdir to $newdir";
> >         opendir(DOT,".") || die "Cannot opendir .";
> >         foreach (sort readdir(DOT)) {
> >                         print "$_ \n";
> >         }
> >         closedir(DOT);
> > 

Hi, if you want quick and dirty and fast, you should probably
not chdir() and closedir().  Try something like:

	sub list{
		opendir(DIR,$_[0]) || die "Error: $_[0] $!\n";
		@files = readdir(DIR);
		for($a=0;$a<=$#files;$a++){print "$files[$a]\n";}
	}


HTH, ----ranga <sveerara@cisco.com>


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

Date: Tue, 25 Mar 1997 14:44:22 -0600
From: Simon Twigger <simont@post.its.mcw.edu>
Subject: Fork & Memory Allocation Question
Message-Id: <33383925.4D97@post.its.mcw.edu>

Hi there,

I have a Perl 5 CGI script which creates a sound file from scratch. As
it goes through creating the sound file it writes the various parts of
the file to a buffer file [buffer.au]. Having done this I work out the
sound file header informtion (length of file etc.) and print this to the
final file and follow it up by opening up the buffer.au file and
printing that to the final file as well. I do this because the header
has to be at the start of the file and I dont know how big the file is
until I've made it! Consequently I have to store it somewhere before
assembling it into the final .au format.

This all works fine, however, it creats rather large files (4Mb) and asI
dont want these on my server for ever, I fork the script and have the
child process sleep for 10mins before unlinking the files. This gives
the user enough time to download the file and listen to it, after which
it's trashed. The problem I am having is that the child process has a
really large memory overhead, taking up 4Mb of RAM whilst its sitting
there waiting to do its stuff. Needless to say, if I have too many of
these floating around the server runs out of memory.

How can I reduce the memory occupied by these child processes so that
this doesnt happen? I save the various sound files to the disk so I
dont  have a variable holding the whole 4Mb of data (at least I dont
think I do...) which might account for the large process size. Can
anyone suggest why the child process is so large and how I might go
about reducing its size? All it does is just sleep and then unlink the
files, the child specific code is only about 5 lines. Im aware that the
child has copies of all the variables of the parent, but as I said I
dont think I have 4Mb of variables...

I suspect I may be better off just calling a new script which is devoted
to unlinking these files but which hopefully wont have a large memory
overhead. I'd still like to know why the child is so large though. :)


Thanks in advance for any help anyone can give me.

	Simon.


Dr. Simon Twigger, 
Medical College of Wisconsin, Milwaukee.


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

Date: Tue, 25 Mar 1997 16:52:59 -0500
From: Michael Shannon <mshannon@lds.com>
Subject: HELP !!! Java application and or C from Perl??????
Message-Id: <3338493B.126C@lds.com>

How do I launch/run/execute a java application from a Perl script. I
have a CGI/perl script that needs to pass information to a java
application and have the results of the application returned to the perl
script for further Perl processing. 

I am not sure if I use the system, exec, fork, etc commands or any of
them for that matter.  My thought is that the procedure used to invoke a
C program  might be the same for a Java application.

Thanks for ny help...Mike

-- 
Michael J. Shannon, Jr.    
mshannon@lds.com             Logical Design Solutions, Inc.
201-971-0100 ext 161         465 South Street   Suite 103
201-971-0103 (fax)           Morristown,  NJ  07960

"Why cut a tree to build a church when you could just worship the tree?"


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

Date: Tue, 25 Mar 1997 17:57:25 GMT
From: slacker@dixonillinois.com
Subject: Re: help
Message-Id: <33381184.1831233@news.essex1.com>

On Mon, 24 Mar 1997 20:09:52 +1000, Paul Swan <sales@jewellery.com>
wrote:

>Does any one have a small self serch program?

Just looking down and feeling around usually works, if you are having
problems might I suggest a flashlight and a mirror.


Sorry, couldn't resist.
Slacker


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

Date: 25 Mar 1997 11:39:56 -0700
From: Mark Borges <mdb@cdc.noaa.gov>
Subject: multiple key sort
Message-Id: <vku3lzbytf.fsf@cdc.noaa.gov>

I'm trying to sort a bibliographic database in refer(1) format by
multiple keys: (1) lead author, (2) date, (3) remaining authors. The
only thing I can come up with right now (far from perfect) is to
create a secondary integer index and use the ord() function:

----------------------------------------
  @idx = ();
  $ix = 0;
  for (@biblio) {
    for (split("\n",$_)) {
      if (/^%A (.*)/ and $ix == 0) {
        $lead = uc( (split(',',$1))[0] );
        $lead =~ s/^\s*//;
        for (1,2,3,4,5) {
  	$fac = 10**(12-(2*$_));
  	$ix = $ix + $fac*ord(substr($lead,$_-1,1));
        }
  
      } elsif (/^%D (.*)/) {
        ($val = $1) =~ s/^\s+//;
        $ix = $ix + 2000 - $val;
        push(@idx,$ix);
        print "ix=$idx[-1]\n";
        $ix = 0;
        last;
      }
    }
  }

  for (@biblio[ sort { $idx[$a] <=> $idx[$b] } 0 .. $#idx ]) {
   # do stuff 
  }
----------------------------------------

but this is so ugly there must be a more better way ;-). Not only
that, it's fragile and will surely break for some cases (it ignores
the remaining authors in the sort for now).

Has anyone else come across a more elegant solution?

Thanks.

-- 
  -mb-


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

Date: 25 Mar 1997 21:21:26 GMT
From: Scott Reed  <102556.773@CompuServe.COM>
Subject: Netscape Navigator 3.x
Message-Id: <5h9fkm$olf$1@mhafn.production.compuserve.com>

I am currently working on an NT system that uses Perl with 
ActiveWare's Perl for Win32.  I can get the script to work 
properly under IE 3.0.  When I use Netscape's Navigator, it tries 
to use a helper app to respond to the perl script because it has 
a .pl extension.  I tried to remove the references of the .pl 
files in Navigator through a file in the Navigator directory and 
the Win 95 registry.  Does anyone know how I can get around this? 
 I didn't buy Navigator so I don't have support from Netscape.  
Also, I have to use the .pl extension because it is required from 
 Perl for Win32.  Help!!


-- 
Programmer/Analyst
smreed@phico.com


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

Date: Tue, 25 Mar 1997 19:20:19 +0000
From: Douglas Seay <seay@absyss.fr>
Subject: Novell Netware
Message-Id: <33382573.A21@absyss.fr>

I've look around CPAN and the only thing I've found
for novell is perl4.  Is anyone working on a port of
perl5 for novell?

- doug


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

Date: Tue, 25 Mar 1997 11:55:17 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Larry Alexander <lalex@apnet.com>
Subject: Re: Perl process doesn't go away
Message-Id: <Pine.GSO.3.96.970325114713.10799O-100000@kelly.teleport.com>

On 25 Mar 1997, Larry Alexander wrote:

> I have been running a script (an HTML registration script where users
> type in their name, email address and interests) since December 1996
> with no problem. For the past week, however, I have been noticing a
> process that is eating up CPU time. This script, called guestap.pl
> appears in the ps listing as "guestap." without the "pl" extension with
> many minutes of time against it. I have to manually go in and kill this
> process.
> 
> I've checked the server logs and nothing strange there. This obviously
> doesn't happen every time the script is run... only sometimes.  (ouch!) 
> Any clues as to where I can look? perl debug says all is OK.

Many scripts have places where they can block. Do you start any other
processes via backticks or system, for example? Perl has to wait for those
other processes to finish before it can continue. Or do you lock a file? 
That can block, of course. Maybe your process is waiting for some event
(say, a signal) which is trapped by one of its child processes or
otherwise lost. It could block waiting for input. Or, of course, you might
have an infinite loop that you didn't intend. 

Some servers can be set to kill a process after (say) five seconds of CPU
time. Or you can make your script time out by means of alarm or a watchdog
process. Good luck!

-- 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: Tue, 25 Mar 1997 11:39:26 -0800
From: Chris Schoenfeld <chris@ixlabs.com>
Subject: Perl, Delphi, Linux, Windows, and databases (VB5E?)
Message-Id: <333829ED.4650@ixlabs.com>

ARGH!

We are having trouble scaling some of our work.
We have been doing Perl/CGI/database work with DB_File/Berkeley DB.
Now I want to do some Client/Server work with Delphi.
I want a new database which will support both.

Delphi wants to use Oracle, Sybase, Informix, or Interbase.
>From what I understand, Perl has modules for some/all of these in
various stages of robustness.
NONE of these databases support Linux - GRRRR!!!

I need a database I can run on Linux, Windows 95, Windows NT, and
Solaris, that has excellent Linux Perl support and excellent Windows C/S
RAD tool support. I am willing to switch to VB5 enterprise if that will
help.

I'm starting to beleive there is no such animal. I will probably have to
find a Linux/Solaris database with ODBC (blechh).

I started to evaluate Velocis, which seemed like a good choice - but
their Perl module was comprised of a windows DLL! arg!

It would be great if Sybase would just port to Linux. Then we could
start off with SQL Anywhere and scale up development on both platforms.

-- 
Chris Schoenfeld
IX Development Laboratories   
Santa Rosa, California
(707)-543-8030 Ext. 12


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

Date: Tue, 25 Mar 1997 12:22:57 -0500 (EST)
From: gamma@mintaka.iern.disa.mil (Jim Showalter)
Subject: Question on perltoot - handling of class data
Message-Id: <Pine.GSO.3.95.970325115503.19212A-100000@mintaka.iern.disa.mil>


I have read the perltoot document and I have a question on the handling of
class data.  It is not clear to me how access to the "census" variable via
a reference makes the class more inheritable.  It appears that the
contructors and destructors operate on a reference to the same variable,
in this case "census," regardless of how many levels deep a method is
inherited.  Clearly I am missing something. Could someone please shed some
light? 

Thanks,
Jim










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

Date: 25 Mar 1997 20:35:03 GMT
From: c.c.eiftj@98.usenet.us.com (Rahul Dhesi)
Subject: Re: Regular Expresion question.
Message-Id: <5h9ctn$st4@samba.rahul.net>

In <5h94ka$oof$2@csnews.cs.colorado.edu> Tom Christiansen
<tchrist@mox.perl.com> writes:

>  How do I check a valid email address?

>    You can't.

Of course, one may ask and answer:

     How do I define a valid email address?

     You can't.

See below.

Date:    27 Jul 1996 20:40:59 GMT
From:    Rahul Dhesi <dhesi>
Newsgroups: comp.infosystems.www.authoring.cgi,comp.lang.perl.misc
Message-Id: <4tdusr$ner@samba.rahul.net>
Subject: Re: Validation of E-mail Return Addresses

In <ukbuh1piun.fsf@julie.teleport.com> merlyn@stonehenge.com (Randal L.
Schwartz) writes:

>This question keeps coming up.  Lusers
>post the very wrong answers.  And then the myth continues to get
>propogated....
>How do *you* suggest we prevent the bad mythology from propogating,
>without raising the highest of warnings when it comes up? 

Let's note the subject heading:

   Validation of E-mail Return Addresses

Now, the question:

   Just what do we mean, "validation of email addresses"?

Technical people, such as Randal, might say:

   It means determining their RFC-conformance.

Users, however, really care about:

   Will my replies reach this person or not?

The quetion posed by Richard_Kennedy@ci.des-moines.wa.us (Richard
Kennedy) was:

   During testing, I noticed that most errors occurred when people
   entered their e-mail address.   Without a valid return e-mail
   address, the user can not receive the results...If there is no
   automatic method, is it possible to validate the e-mail address
   entered by the user against any information sent by their browser?

I think it's a safe guess that Richard only cares about the email
address being usable for replies.

pudge@pcix.com (Chris Nandor) responded:  "I use a little subroutine I
wrote to validate their input to check for some minor errors."  

It seems to me that Chris's emphasis is on detecting typing errors, and
perhaps on making sure the address is usable for replies.  His program
enforces the following syntax on email addresses that it considers
valid:

#     (at least one char)@(at least one char).(at least two chars)
#     and it must not contain any of the following characters:
#     ;><&*`|,

Randal responds:

   Hmm.  "fred&barney"@stonehenge.com is a perfectly valid email
   address.  Why are you rejecting it?

   Get a clue.  Nearly *every* character is legal on the left side
   ("local part") of an RFC-822 email address, as long as it is quoted
   properly.  Go thee hence to RFC822 for your clues.

Randal takes the words 'valid' and 'legal' to mean 'RFC-conforming'.

On the other hand, the average user takes something to be valid when "it
works" and to be invalid when "it doesn't work".  As a user I just want
to get my work done.  If email to an address bounces, the address is
invalid.  If email gets delivered, the address is valid.  (Even if it
was not RFC-conforming.)  As a simple example, there are people (see my
 .signature for an example) who will tell you that a simple address like

   dhesi

is horribly broken and not RFC-conforming.  But for local mail it
works just fine.  It even works just fine if you connect from some
remote host to the SMTP port of one of the machines here and give it a
command like 'rcpt to: dhesi'.  If it works, it works.

Now let's ask this question:

    Is testing for RFC-conformance a good way of detecting typing
    errors in email addresses?  Or would it be better to check
    for some common email address formats instead?

The strategy used by pudge@pcix.com (Chris Nandor), of checking
for certain formats and certain special characters, might be useful if
our only goal is to warn the user about possible errors.  But Chris's
strategy will fail badly on some addresses if it simply rejects
addresses it cannot parse.  Some people will have addresses that don't
fit Chris's mold.

Randal's strategy, of checking only for RFC conformance, fails too.  It
will accept many possible typographical errors that will generate an
invalid (undeliverable) address that is valid (RFC conforming).

There really is no way of reliably checking email addresses for validity
(if defined as "does it work").  jomiller@wyoming.com (Joshua Miller)
comes close with his strategy:

   I found that after I put a note on my page that says:

   Please verify that your e-mail address is correct. I get rid of about
   25% of all registers because of an incorrect e-mail address. Thanks.

   The number of incorrect e-mail address I was getting dropped from
   about 25% to about 2%.  This in combination with the previously
   posted script should rule aout most of your problems.

But delete his last sentence, about using the posted script, unless
you use it only to generate an "Are you sure?" question.
-- 
Rahul Dhesi <dhesi@rahul.net>
"please ignore Dhesi" -- Mark Crispin <mrc@CAC.Washington.EDU>
-- 
Rahul Dhesi <dhesi@spams.r.us.com>
a2i communications, a quality ISP with sophisticated anti-junkmail features
** message body scan immune to fake headers ***   see http://www.rahul.net/
>>> "please ignore Dhesi" -- Mark Crispin <mrc@CAC.Washington.EDU> <<<


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

Date: 25 Mar 1997 20:28:27 GMT
From: shsieh@haas.berkeley.edu (Sherman Hsieh)
Subject: regular expression for check lower case
Message-Id: <5h9chb$j73@agate.berkeley.edu>

I was wondering how to go about checking a variable for cases. For 
example, I want to do something if $variable is all lower case. I 
couldn't figure out what regular expression to use. Help.

	-Sherman
-- 


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

Date: Tue, 25 Mar 1997 13:05:11 -0800
From: "K. Healy" <kevlar@ns.net>
Subject: Re: term 'regular expressions' considered undesirable
Message-Id: <33383E07.41C6@ns.net>

Jeffrey wrote:
> 
> Clay Irving <clay@panix.com> wrote:
> |> >with history. I suppose you could start a crusade to use a different
> |> >phrase. How about 'whachamacallit'? :-)
> |>
> |> And I highly recommend the second edition of Jeffrey's Book called,
> |> "Mastering Whachamacallits"
> 
> Mmmm, somehow this reminds me of the last line of the first paragraph
> on page 71 (of the first edition :-)
                     ^^^^^     
Huh?  Is there a second already?

Kevin
<kevlar@ns.net>


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

Date: 25 Mar 1997 18:11:34 GMT
From: daniel@aksi.net (Daniel Freeman)
Subject: Re: Unix 'Cat' equivelent
Message-Id: <5h94gm$ku4$2@wn.aksi.net>

Nathan V. Patwardhan (nvp@shore.net) wrote:

: Bryan Grenn (beermeister@geocities.com) wrote:

: : cat filea.txt fileb.txt filec.txt > newfile.txt
: : How can I easlily do this in perl ???? 

: Very easily.  Just use @ARGV for the arguments, and $#ARGV+1 for the
: number of arguments.  Bear in mind that (unlike C) ARGV[0] is not the
: scriptname, but an argument.

ARGV SHMARGV, this looks like a job for the diamond operator.  To wit:

	while ($line = <>) { print $line };

Viola!  A one line cat command.

Daniel Freeman

*----------------------------------------------------------------------------*
          20/20 Technologies:  A Clear Vision of Internet Marketing
 6980 NW 29th Way, Ft. Lauderdale, FL 33309 * (954) 984-8898 (M-F, 9a-5p EST)
          E-Mail: ttt@2020tech.com   WWW: http://www.2020tech.com/
*----------------------------------------------------------------------------*


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

Date: Tue, 25 Mar 1997 08:57:50 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Unix 'Cat' equivelent
Message-Id: <e5p8h5.uc1.ln@localhost>

Mike Campbell (mcampbel@tvmaster.turner.com) wrote:
: bill@sover.net.no.junkmail (Bill) writes:

: >    Here's a quick and easy cat clone:
: > 
: > #!/usr/bin/perl -w
: > 
: >   while (<>) {
: >       print;
: >   }

: perl -e 'print while (<>);'


Which is the same as:


perl -pe ''     ;-)


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


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

Date: 25 Mar 1997 21:25:52 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Unix 'Cat' equivelent
Message-Id: <5h9ft0$kdm@fridge-nf0.shore.net>

Daniel Freeman (daniel@aksi.net) wrote:

: ARGV SHMARGV, this looks like a job for the diamond operator.  To wit:
: 	while ($line = <>) { print $line };

: Viola!  A one line cat command.

One-line shmone-line: perl -pe '';

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: 25 Mar 1997 01:16:30 GMT
From: afn03257@freenet4.afn.org (Daniel P Hudson)
Subject: Re: Unix and ease of use  (WAS: Who makes more ...)
Message-Id: <5h791e$pk0@huron.eel.ufl.edu>

Stephane Plattner <NOSPAMplas@fmi.ch> wrote:
>mwolfe@shrike.depaul.edu wrote:

>> In the end Linux will bury MS.  Linux is open.  This means open
>> competition.  This means better products.  LINUX RULES.


>IMHO this answer contradicts to the basics of economics. Openess means,
>to a great extent, equality, and equality prohibits competition.

Not really. But this thread is so damn stupid we'll leave it as you
state.

>(communism). Competition rises only when differences exists and it's
>the market (or the environment), who dictates which product is better.

Not true. The Market is an uneducated public opinion. It is not a
factual comparison or scientific breakdown of products in any form.

MicroSoft, as any GOOD business should, knows this and uses it to
it's advantage. Only a natural born idiot wouldn't. It's like
everything else in the world. How many poeple here have ever
shopped at a Food Lion? For those of you scratching your heads,
Food Lion is a national chain of grocery stores comparable to Winn-Dixie,
Public, etc. I'll guess that less that 10% have, Why? WHy do you think?
Every corner and tv station advertises the two. Are they better?
Not really. WD has great meat, but their selection for everything
absolutely sucks. Publix has selection at about twice the price.
Food Lion has good selection, better than WD, with fair prices,
better than Publix. Knowing this, how many will actually go to food lion
and how many will shop at WD/Publix? Probably about 15% will try FL.
Why? We're lazy, there is definately a Publix or WD close to you,
but FL may be across town. So? So MS software is in every shopping center,
Wal-Mart, K-Mart, Book Store, etc.. Where is linux? If your lucky a book
store has it on CD-ROM with a $60 book. But its on-line? Yeah, but I need
an OS to get on-line and once I've installed DOS/Windows/whatever, Linux
offers me no REAL reason to switch unless I'm a business or a 15 year old
storing nuddy photos on my drive I don't want Mom to see. Privacy of the
average home user's system is POINTLESS. What are they going to do?
Find out I didn't use a disk compressor? SO WHAT?!

Now SHUT-UP, get back ON-TOPIC, use your computer as YOU see fit, and
STOP trying to tell everyone else HOW TO USE THIER'S!!!!!!!!!!!!!!!!


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

Date: Tue, 25 Mar 1997 15:11:27 -0600
From: info@oxfordresources.com
Subject: Wanted: WWW Programming Mgr.
Message-Id: <859317277.8917@dejanews.com>

Internet Programming Manager
Perl - Java - Database
Oxford Resources Corp., a Long Island, NY based leader in the automobile
finance industry, is forming an exciting new unit which will offer
automobiles and financing via the Internet.  We are seeking a talented
programmer for our real-time electronic auction, on-line financing, and
encryption applications.  SQL, Unix, SSL, and HTML experience required.
Applicant must be self-motivated, and have good communication and
organizational skills in order to complete projects independently.  Salary
and benefits are very competitive.  To find out more, send resume with
salary history to info@oxfordresources.com, or fax to 516/390-3868, Attn:
EVRI

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 25 Mar 1997 19:36:12 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: What's a bad Perl book?
Message-Id: <5h99fc$m39@pirate.shu.edu>
Keywords: Hexapodia as the key insight

Tom Christiansen <tchrist@mox.perl.com> writes:

>In comp.lang.perl.misc, 
>    revjack@radix.net writes:
>:Sorry, all those other threads were getting to me.

>Well, I find "Java in a Nutshell" to be a very bad Perl book. :-)

I don't know - most books on Java at least present a lot of
good reasons to learn Perl.  :-)

David Black
dblack@icarus.shu.edu



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

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

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