[12731] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 141 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 14 12:07:15 1999

Date: Wed, 14 Jul 1999 09:05:13 -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           Wed, 14 Jul 1999     Volume: 9 Number: 141

Today's topics:
    Re: $ENV(VAR) problem! (brian d foy)
    Re: <<eof in `` <si_bendovi@hotmail.com>
        Anybody know how to to this? <kdom@mail.mobistar.be>
        Built perl 5.005_03 on AIX 4.3.2? <nickgeo@merle.acns.nwu.edu>
        C-like #define macros in Perl (TM Lehto)
    Re: changing hash values (brian d foy)
    Re: checking Perl offline (Andrew M. Langmead)
    Re: creating an array of hashes (Christian M. Aranda)
    Re: document converter <rcadmus@amctheatres.com>
    Re: FAQ 5.7: How can I use a filehandle indirectly? (Greg Bacon)
        FLOCK: How can I do exclusive read??? <thecure1@mediaone.net>
    Re: getting the virtual host info... (brian d foy)
        help with perl (GreenDay1a)
    Re: help with perl ()
    Re: I want to do something interesting with ranges (Steve Simmons)
        Interest of mixing Perl + MS Access <thierry.metoudi@francemel.com>
        Is my Perl script or IE4 ??? <john@openquest.com>
    Re: knowing it's own name? (Larry Rosler)
    Re: knowing it's own name? (Vice Admiral Acker)
    Re: knowing it's own name? (Larry Rosler)
    Re: knowing it's own name? (John Klassa)
    Re: long explanations wearying (was Re: Top 10 response <gt7202e@prism.gatech.edu>
        newbie question: how put files from dir in array <iLs@cyberdude.com>
        Not able to write to file <lv_josh@my-deja.com>
    Re: Not able to write to file <marshalc@NO-SPAMamericasm01.nt.com>
    Re: Not able to write to file (Larry Rosler)
    Re: Old database is erased when I add new information (Perulinks)
    Re: Old database is erased when I add new information (John Stanley)
    Re: Old database is erased when I add new information (John Stanley)
    Re: Old database is erased when I add new information (Greg Bacon)
    Re: Old database is erased when I add new information (John Stanley)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Wed, 14 Jul 1999 09:45:20 -0500
From: brian@pm.org (brian d foy)
Subject: Re: $ENV(VAR) problem!
Message-Id: <brian-1407990945200001@31.bloominton-01rs13-14rt.il.dial-access.att.net>

In article <7mh9f4$95b$1@nnrp1.deja.com>, thiensyh@my-deja.com wrote:

>I'm facing a problem on my perl program , when i
>compile the program it gave me the following error
>message:
>Use of uninitialized value at sales.pl line 29.
>Use of uninitialized value at sales.pl line 32.
>Debug/Unknown method?
>
>Here is my code which the problem happened. Please
>help!
>if ($ENV{'REQUEST_METHOD'} eq 'GET') {
>    $buffer = $ENV{'QUERY_STRING'};
>}


the problem is that you aren't using CGI.pm.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Wed, 14 Jul 1999 15:03:35 GMT
From: Stanislav Benda <si_bendovi@hotmail.com>
Subject: Re: <<eof in ``
Message-Id: <7mi8s2$in1$1@nnrp1.deja.com>

In article <a17dm7.vue.ln@magna.metronet.com>,
  tadmc@metronet.com (Tad McClellan) wrote:
> Stanislav Benda (si_bendovi@hotmail.com) wrote:
> : How can I do on PC this? :
>
> : $var = `sqldba <<eof
> : connect
> : select * from global_name;
> : exit
> : eof`
>
> my $var =<<`ENDSQL`;   # those are backticks
> sqldba
> connect
> select * from global_name;
> exit
> ENDSQL

Not, this does not work. It starts sqldba ( command line SQL utility
for Oracle database) and waiting for keyboard input. When sqldba
finish, result is stored in $var. I need to start sqldba and send to it
this text: connect . . .
It could work in unix like I wrote, but in PC NT DOS shell there is
nothing like <<eof. There is no fork as well. Is it any chance to solve
this problem without creating aditional file and do:

my $var = `sqldba < inputFile.sql`

Thanks


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 14 Jul 1999 17:39:15 +0200
From: Kris <kdom@mail.mobistar.be>
Subject: Anybody know how to to this?
Message-Id: <378CAF23.EC4CE35@mail.mobistar.be>

Hi,

I am newcomer to Perl, so if you're don't wish to answer to same stupid
questions again and again, don't read any furhter.

Here is my problem:

I want to write a cgi for apache webserver on Digital Ux using perl.
This cgi should just display the contents of a variable.

However, the contents of this variable is not a line, but a lot of
lines.
My Netscape browser displays the content of the variable but as one big
string, which is normal because HTML does only react on <BR>

So what I want to do is to replace all the separator (newline, carriage
return or whatever) in the variable by <BR> using regular expressions.

Here the problem arises:
- what is that separator? When I use print to display the variable in UX
shell, everything is fine, so there must be a sort of a separator at the
end of each line
- How do I replace this separator with <BR> ?

If you have any other suggestions how I could do this, any help is much
appreciated!

Thanks, Kris Dom





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

Date: Wed, 14 Jul 1999 10:27:10 -0500
From: Nicholas Geovanis  <nickgeo@merle.acns.nwu.edu>
Subject: Built perl 5.005_03 on AIX 4.3.2?
Message-Id: <Pine.HPP.3.93.990714102342.1187C-100000@merle.acns.nwu.edu>

Hi -
  Using IBM C and C++ 3.6.4 with a couple of fixes on AIX 4.3.2, perl
5.005_03 builds OK (apparently). However three tests fail:
pragma/overload, lib/tie-push and lib/safe2. Has anyone resolved these or
tested successfully with a different compiler, or.....? Thanks.

+-------------------->
| Nick Geovanis
| IT Computing Svcs
| Northwestern Univ
V n-geovanis@nwu.edu



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

Date: Wed, 14 Jul 1999 15:38:24 GMT
From: hiwi1krg@iitb.fhg.de (TM Lehto)
Subject: C-like #define macros in Perl
Message-Id: <378ca933.80071166@iitb>

I am trying to write a Perl script that can print messages in several
languages. I have put all text strings to separate file (lang.pl). The
text strings have parts that change in run-time. When I try to print
them from my script, the variable part of the string either doesn't
show at all or shows as "This is directory: $working_dir" depending of
which combination of single and double quotes I use in every place.

Can I do it without using s/// substitution (perlfaq4 says something
about it but I don't want to use s///)?
Can I define macros like in C language?

thanks,
Tomi

--- my non-working script ---
#!/usr/local/bin/perl -w
require 'lang.pl'; 
$working_dir = 'some/directory';
print $finmsg;
print $engmsg;


--- lang.pl ---
$finmsg  = "Tämä on hakemisto: $working_dir"; # in finnish
$engmsg  = "This is directory: $working_dir"; # in some other language



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

Date: Wed, 14 Jul 1999 09:44:13 -0500
From: brian@pm.org (brian d foy)
Subject: Re: changing hash values
Message-Id: <brian-1407990944140001@31.bloominton-01rs13-14rt.il.dial-access.att.net>

In article <378C7FB6.4B7E55F9@fast.no>, kev <kevin.porter@fast.no> wrote:

>I have a HTML page with a form on it, which is POSTed to my Perl CGI
>script.
>In my script I convert the names and values into a hash so that I can
>reference them by name.

stop right there.

use CGI.pm instead.  no sense in re-inventing the same old broken
code.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Wed, 14 Jul 1999 14:40:44 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: checking Perl offline
Message-Id: <FEv7Fw.H1t@world.std.com>

rjk@linguist.dartmouth.edu (Ronald J Kimball) writes:

>Both methods have their advantages and disadvantages:

>Using print statements easily preserves the debugging between
>executions.

Now that the debugger has "break postponed", I'm sure that it wouldn't
be too tough to set up something so that the .perldb file can contain
breakpoints. Thats my most common use of the .gdbinit file.

For now, I rely on a separate breakpoints file and use emacs to
automate setting breakpoints.
-- 
Andrew Langmead


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

Date: Wed, 14 Jul 1999 16:27:46 GMT
From: christianarandaOUT@OUTyahoo.com (Christian M. Aranda)
Subject: Re: creating an array of hashes
Message-Id: <378dba4a.72932621@news.bmc.com>

On Wed, 14 Jul 1999 02:56:51 GMT, Rick Delaney <rick.delaney@home.com>
wrote:


>I don't think you had a specific question but you can make your code a
>lot shorter by using a hash slice.  I also strongly recommend 'use
>strict', especially since you're using references.
>
>    use strict;
>    # ...
>    my $y = 0;
>    my @sysData;
>    while (<FLAT>) {
>        @{ $sysData[$y++] }{@columnHead} = unpack "a24a20@unpackKey",
>$_;
>    }


Thanks for the help.  I am using "strict", but since it was only a
snippet, that got left out.

Thanks again for the hash slice code, tho.

-C
----------------------------------------
Christian M. Aranda
Performance Consultant
BMC Software - Waltham, MA


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

Date: Wed, 14 Jul 1999 10:44:53 -0500
From: Ray Cadmus <rcadmus@amctheatres.com>
Subject: Re: document converter
Message-Id: <378CB074.EEF59AED@amctheatres.com>

You might check out MSWordView at:

http://www.gnu.org/~caolan/docs/MSWordView.html

Josh Suarez wrote:

> I need a program which can convert word documents (and perhaps other
> formats) to text files, while retaining some indicator of which words
> were originally bold and italic.  The program needs to run on unix.  Has
> anyone seen something like this?  A perl script perhaps?
> Thanks,
>     Jim



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

Date: 14 Jul 1999 15:25:03 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: FAQ 5.7: How can I use a filehandle indirectly?
Message-Id: <7mia4f$9j1$3@info2.uah.edu>

In article <378e9d97.50852321@nntp.ix.netcom.com>,
	miker3@ix.netcom.com (Michael Rubenstein) writes:
: On 12 Jul 1999 15:00:01 GMT, gbacon@itsc.uah.edu (Greg Bacon)
: wrote:
: >Let's stick to Standard English (as opposed to, say, nonstandard
: >variations like the Queen's English :-) :-) for the English
: >hierarchies.
: 
: Come on now.  I never suggested we should write in dialects here.

You're taking me too seriously.  Still, if I were fixin' to write about
preparing to do something, I don't think I'd choose the phrasing that I
would probably use in conversation. :-)

I also think it could be argued that we do write in our own dialect, a
sort of Geek English.  Perl also seems to attract lots of people who
enjoy playing with language.  Writing should be fun, and it definitely
is when writing about Perl.

Greg
-- 
The depths of idiocy are as yet unplumbed.
              -- Larry Wall in <199612181938.LAA10214@wall.org>


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

Date: Wed, 14 Jul 1999 11:50:16 -0400
From: "CL" <thecure1@mediaone.net>
Subject: FLOCK: How can I do exclusive read???
Message-Id: <Pn2j3.7443$kL2.360595@ndnws01.ne.mediaone.net>

What is the correct FLOCK combination for doing exclusive read???
THANK YOU!!!




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

Date: Wed, 14 Jul 1999 09:42:37 -0500
From: brian@pm.org (brian d foy)
Subject: Re: getting the virtual host info...
Message-Id: <brian-1407990942370001@31.bloominton-01rs13-14rt.il.dial-access.att.net>

In article <378C9169.A9C976BE@ca.ibm.com>, Paul Leduc <pleduc@ca.ibm.com> wrote:

>I am writing a script to do some form processing, and when complete, I
>am trying to display a 'thank you' html page.  The problem is I want the
>code to work in both our test or staging environment as well as our
>production environment.
>
>I am using the following:
>print $q->redirect($q->protocol() . '://' . $q->virtual_host() .
>$done_url);
>
>however, $q->virtual_host() gives the same value (www.xxx.com)
>regardless of whether I am running it from http://www.xxx.com   or
>http://www.xxx.com:81 (our staging server).

the host is the same, so it should return the same host each time.

you'll have to add port information - $ENV{SERVER_PORT} or whatever
your server does with that info.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: 14 Jul 1999 15:06:44 GMT
From: greenday1a@aol.com (GreenDay1a)
Subject: help with perl
Message-Id: <19990714110644.13647.00000034@ng-cb1.aol.com>

I downloaded the stable_tar.gz from www.perl.com and I don't know what to do
with it. When I open it in Winzip, it asks what I should change the extension
to. What extension should i use? I am completely clueless and any help would be
appreciated. You can email me at greenday1a@aol.com


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

Date: 14 Jul 1999 15:16:20 GMT
From: dcross@tech-19.quixell.com ()
Subject: Re: help with perl
Message-Id: <7mi9k4$m58$1@starburst.uk.insnet.net>

GreenDay1a (greenday1a@aol.com) wrote:
: I downloaded the stable_tar.gz from www.perl.com and I don't know what to do
: with it. When I open it in Winzip, it asks what I should change the extension
: to. What extension should i use? I am completely clueless and any help would be
: appreciated. You can email me at greenday1a@aol.com

I assume from you mention of WinZip, that you are runnig Windows.
In that case, you should get ActivePerl from ActiveState
<http://www.activestate.com>.

Dave...



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

Date: Wed, 14 Jul 1999 15:26:53 GMT
From: scs@ans.net (Steve Simmons)
Subject: Re: I want to do something interesting with ranges
Message-Id: <1%1j3.1$0A1.24@news.aa.ans.net>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:

>Steve Simmons <scs@ans.net> wrote in comp.lang.perl.misc:
>>Tried something which (IMHO) should have worked, but didn't:
>>
>>	@section = (<STDIN>)[ 4 .. /^MARKER\n$/ ] ;
>>
>>In short, I wanted to grab lines 4 thru the line which contains
>>"^MARKER\n$" into @section . . .

>Thaumatic overload alert... seek shelter. . . 

 [[ nice explaination excised ]]

Ah, I get it -- thanks especially for the comments on the $. operator,
which were most enlightening.

That said, IMHO the suggested construct above should still work.  The
range operator in this form:

	while (<FILE>) {
		push @subset, $_ if ( 4 .. /^MARKER\n$/ ) ;
	}

is comparing against $. for the numeric constant 4, and against $_ for
the string /^MARKER\n$/.  To remove it from the I/O discussion, this is
essentially

	@file = (<FILE>) ;
	undef @subset ;
	foreach ( @file ) {
		push @subset, $_ if ( 4 .. /^MARKER\n$/ ) ;
	}
	undef @file ;

The former is preferable for a number of reasons of conciseness and
reduced memory usage.  However, it still does a (potentially) huge
number of pushes.  Just as

	@subset = @array[ 4 .. 10 ] ;

is a much more efficient way of generating slices than iterating over
@array and pushing onto @subset,

	@subset = @array[ 4 .. /^MARKER\n$/ ] ;

or as originally suggested,

	@subset = (<STDIN>)[ 4 .. /^MARKER\n$/ ] ;

could be a much more efficient way of generating that particular slice.
The construction rules for the list would be consistant with the use
of the range operator -- apply the test to $. for numeric constants,
test against $_ (each line, in the case of (<STDIN>), each element in
the case of @array).  Now, to address your more specific questions:

>What would the pattern be compared to in something
>like "for ( 0 .. /boom/ ) {}"?

It would use the @_ list, starting where $. is zero and ending with
the element that matches /boom/.

>But even array slices don't always provide something reasonable to
>match against.  @arry[ 1, 3, 5] = ( 5, 3, 1) is valid perl.  But
>what would @arry[ 1 .. /oops/] slice out of the array before it is
>defined?

In this question I'm assuming you mean `what would @arry[ 1 .. /oops/]
slice out of the array before it is defined?' to be that @arry is not
defined.  If so, you get the same as @arry[ 1 .. 5 ] if @arry is not
defined.

Taking the question differently, if @arry was defined but no element
contained /oops/, then
	@subset = @arry[ 1 .. /oops/ ] ;
should have the same result as
	@subset = @arry[ 1 .. $#arry ] ;
Similarly, if there was no /oops/ in @arry,
	@subset = @arry[ /oops/ .. /caught/ ] ;
should leave @subset empty no matter if /caught/ existed or not.

But in any case, perl doesn't do this.  Your lucid explaination tells me
why, and I'll leave the topic with a request to the perl developers that,
IMHO, it *should*.


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

Date: Wed, 14 Jul 1999 00:10:35 +0200
From: Thierry METOUDI <thierry.metoudi@francemel.com>
Subject: Interest of mixing Perl + MS Access
Message-Id: <378BB95B.2F49C08E@francemel.com>

Hello,
I'm wondering what funny things the use of Perl may add to MS Access
development. I mean not only accessing the data but about stirring the
guts of Access.

Any resources welcome.

Thanks




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

Date: Wed, 14 Jul 1999 16:33:09 +0200
From: "John Steer" <john@openquest.com>
Subject: Is my Perl script or IE4 ???
Message-Id: <7mi7dm$at8$1@wanadoo.fr>

I have a Perl CGI that open a binary file and send the
content to the user. The code is very simple :
-------------
print "Content-Type: application/octet-stream; name=\"myfile.cgi\"\n";
print "Content-Disposition: attachment; filename=\"myfile.cgi\"\n";
print "Content-Transfer-Encoding: binary\n";
print "Content-Length: 125872\n\n";
open FPTR, "myfile.cgi" ;
while (<FPTR>) {
print STDOUT;
};
------------
This works great with Netscape, and IE5. Neverthless, when IE4
runs the script and open a message box to save the file name,
the suggested file name is  randomly choosen like "CA8HMUAY."
 or "CAEP4ZOF." or so on. Am I missing any header in my Perl file or it is
IE4 ???

Thanks for helping
------
John
OpenQuest Web Hosting
-----




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

Date: Wed, 14 Jul 1999 07:08:53 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: knowing it's own name?
Message-Id: <MPG.11f639cdbf17cceb989cc7@nntp.hpl.hp.com>

In article <378B3730.DFDF29EB@post.utfors.se> on Tue, 13 Jul 1999 
14:55:12 +0200, Dr. Who <qwerty@post.utfors.se> says...
> Is there some way I can extract the name?
> like this ..
> 
>     -- some stuff goes here
> print $name_of_running_script;

Look in perlvar for

$PROGRAM_NAME
$0

That's a zero, not an oh.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Wed, 14 Jul 1999 14:47:52 GMT
From: KamiBot@rotfl.com (Vice Admiral Acker)
Subject: Re: knowing it's own name?
Message-Id: <378ca310.5002338@news3.inxpress.net>

I kinda guess you sorta mean:

$script = $ENV{'SCRIPT_FILENAME'};
print "$script\n";

This will print the full pathname of the file you're using, if I'm correct.

 .----<<<<<<<<REPLY SEPATOR>>>>>>>-------
|   Dr. Who Wrote:
|
| Is there some way I can extract the name?
| like this ..
| 
|     -- some stuff goes here
| print $name_of_running_script;
| 
| Br.
| DrW
| 
| 
| 



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

Date: Wed, 14 Jul 1999 08:18:23 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: knowing it's own name?
Message-Id: <MPG.11f64a1ecab7d547989cc8@nntp.hpl.hp.com>

In article <378ca310.5002338@news3.inxpress.net> on Wed, 14 Jul 1999 
14:47:52 GMT, Vice Admiral Acker <KamiBot@rotfl.com> says...
> I kinda guess you sorta mean:
> 
> $script = $ENV{'SCRIPT_FILENAME'};
> print "$script\n";

I kinda guess you sorta mean:

  $script = $ENV{SCRIPT_NAME};

> This will print the full pathname of the file you're using, if I'm correct.

No, it won't.  Even the correct name prints the pathname relative to the 
web root.

But who said anything about a web environment to begin with?

> .----<<<<<<<<REPLY SEPATOR>>>>>>>-------
> |   Dr. Who Wrote:
> |
> | Is there some way I can extract the name?
> | like this ..
> | 
> |     -- some stuff goes here
> | print $name_of_running_script;

See?  Where's any indication of a web server in that request? 

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 14 Jul 1999 15:52:10 GMT
From: klassa@aur.alcatel.com (John Klassa)
Subject: Re: knowing it's own name?
Message-Id: <7mibna$soo$1@aurwww.aur.alcatel.com>

On 14 Jul 1999 08:42:55 -0500, Abigail <abigail@delanet.com> wrote:
  > perl -e '* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  >          / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / 
  >          % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %;
  >          BEGIN {% % = ($ _ = " " => print "Just Another Perl Hacker\n")}'

  % perl ...
syntax error at -e line 4, near "= >"
BEGIN not safe after errors--compilation aborted at -e line 4.

  % perl -v
  This is perl, version 5.005_02 built for sun4-solaris

-- 
John Klassa / Alcatel USA / Raleigh, NC, USA


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

Date: Wed, 14 Jul 1999 11:45:33 -0400
From: andy barfoot <gt7202e@prism.gatech.edu>
Subject: Re: long explanations wearying (was Re: Top 10 responses)
Message-Id: <378CB09D.FE2A7738@prism.gatech.edu>

John Callender wrote:
> Uri argues that the person on the other side of the conversation must
> be sufficiently knowledgeable for him (Uri) to be able to use the
> convenient, efficient vocabulary of the experienced programmer.
> Otherwise, Uri isn't interested in putting in the effort required to
> communicate with that person. Which is fine; he shouldn't have to.
> After all, his professional expertise lies in *programming*, not in
> teaching, or communicating. But his use of "we" to imply that he is
> speaking for the group as a whole is suspect. The individual
> participants in c.l.p.m. can speak for themselves; they don't need Uri
> to speak for them. That's the nature of an unmoderated newsgroup.

True.  So the next time someone says they don't know what understand
{hashes, references, OOP, strings, etc.}, you're going to write a
tutorial for them, right?  Uri doesn't speak for you; you speak for
yourself, right?



> And here, predictably, is where I get my dander up. To assume that
> someone must be a moron if he or she doesn't intuitively grasp what a
> hash is based on whatever small subset of the docs he or she may have
> been exposed to is, in my view, arrogant. To say that such a person
> should get another job is to ignore the reality of what has been
> happening in the outer layers of the Perl onion.

Uri was referring to the "$_ for Dummies" books. (Who buys those? "Hmm,
a book for dummies. I guess I'll get that one.")

Anyway, i think those that ask really elementary questions are more
often considered lazy than stupid. A referral to the FAQs or a book is a
useful answer! People who don't want a referral, who really want an
essay written just for them, shouldn't be programmers. Real programmers
are willing to at least read elementary books such as "Learning Perl".
IMHO, anyway.

Of course, if you disagree, you can always start writing those long
explanations yourself.  Maybe you're right, and the character of the
group will change for the better. 




--
 andy barfoot


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

Date: Wed, 14 Jul 1999 16:33:20 +0200
From: "iLs" <iLs@cyberdude.com>
Subject: newbie question: how put files from dir in array
Message-Id: <7mi712$sm6$1@dinkel.civ.utwente.nl>

Hi, I'm just learning perl and wondering how I could put all the file names
of a certain dir. in an array ?
Can somebody show me an example ?

please e-mail me for I do not regularly check those newsgroups




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

Date: Wed, 14 Jul 1999 14:31:15 GMT
From: LV Josh <lv_josh@my-deja.com>
Subject: Not able to write to file
Message-Id: <7mi6vj$i3j$1@nnrp1.deja.com>

hello. yes, i am a newbie to perl.  i am playing with substr and tr to
alter substrings from a said file, say test.txt.  well, i have no
problem opening the file, making the changes *temporarily*, but once
the script ends, the file remains unchanged.  i know it is opening the
file correctly because i tell it to print output and it shows me my
changes.  i will post the actual script when i get to work if it
helps.  thanks.

--

Josh


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Wed, 14 Jul 1999 09:50:38 -0500
From: Marshall Culpepper <marshalc@NO-SPAMamericasm01.nt.com>
Subject: Re: Not able to write to file
Message-Id: <378CA3BE.3136080F@NO-SPAMamericasm01.nt.com>

you probably forgot to write the saved changes to the file..

print FILE $changes
----------------------------------
just another guy trying to save the world
----------------------------------





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

Date: Wed, 14 Jul 1999 08:24:03 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Not able to write to file
Message-Id: <MPG.11f64b6b158f81ab989cc9@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <7mi6vj$i3j$1@nnrp1.deja.com> on Wed, 14 Jul 1999 14:31:15 
GMT, LV Josh <lv_josh@my-deja.com> says...
> hello. yes, i am a newbie to perl.  i am playing with substr and tr to
> alter substrings from a said file, say test.txt.  well, i have no
> problem opening the file, making the changes *temporarily*, but once
> the script ends, the file remains unchanged.  i know it is opening the
> file correctly because i tell it to print output and it shows me my
> changes.  i will post the actual script when i get to work if it
> helps.  thanks.

It would help.  But in the meantime, my guess would be that you are 
forgetting to rewrite the file with the changes you have made.  See the 
following FAQ in perlfaq5:

"How do I change one line in a file/delete a line in a file/insert a 
line in the middle of a file/append to the beginning of a file?"

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 14 Jul 1999 14:09:55 GMT
From: perulinks@aol.com (Perulinks)
Subject: Re: Old database is erased when I add new information
Message-Id: <19990714100955.17551.00000029@ng-bd1.aol.com>

<<Are you sure you license allowed you to modify the scripts? Perhaps the
author is now preparing a lawsuit...>>

A lawsuit for what?  Nobody is even using his scripts!!!

I know you guys tend to sympathize with other fellow programers, I understand
that.
But what is fair is fair.  

You have to put the shoes of your clients --sometimes. There is a difference
between  A Web designer and a Web programer.  You can't call a Web designer a
loser just bacause he/she can't fix a programing problem that somebody else
had.  In the worst scenario you should at least answer emails or calls of
people who write you (especially if you receive money from him).  I always
answer emails from people who go to my Web site, and I don't receive a penny
from them (not even indirectly for I don't have commercial banners or make
money in any way in my Web site).
Well I came here for a technical question, and found my self deffending my self
wowwww!

Carlos


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

Date: 14 Jul 1999 15:27:38 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Old database is erased when I add new information
Message-Id: <7mia9a$8kq$1@news.NERO.NET>

In article <19990714095141.17551.00000024@ng-bd1.aol.com>,
Perulinks <perulinks@aol.com> wrote:
>If you would read my message well, you would notice that I didn't mention his
>name the first time--only after somebody replied asking me specifically for his
>name I gave it.

I read your message "well". So what if you didn't mention his name the
first time? You have now mentioned it. Did you make him aware that you
were doing this so he could come here and defend himself? Probably not.

>I didn't want to make any changes for free. Read the second my second message
>--again-- to see that I even offered money for it, but he didn't reply.

So what? You offered money and he didn't reply. He is not required to
accept your offer of work. You said the program worked until you mucked
with it. It is YOUR responsibility now, not his.

>Finally, I said he was "unable or unwilling" to answer my emails.  That is a
><b>FACT</b>--not an opinion.  

No, luser, that is your opinion. You have no way of knowing that he even
got your email, much less what he is unable of doing.

>But I would say this again and again:  If an author doen't answer or at least
>reply emails or calls about his scripts AFTER he received money for his/her
>scripts,  he/she should not sell them in the first place.  
>That is unethical at best. 

I wish you well finding software assistance after making this statement.
Someone who sells you software is not in any way required to make
whatever modifications you want to it for whatever money you happen to
offer him. It is unethical to call others unethical for not jumping to
do your bidding when you demand it for whatever price you set.  

You bought software that you admit worked when you got it, then you
changed it, and are calling the author unethical because he won't fix
what you broke. 



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

Date: 14 Jul 1999 15:32:00 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Old database is erased when I add new information
Message-Id: <7miahg$8lg$1@news.NERO.NET>

In article <19990714100955.17551.00000029@ng-bd1.aol.com>,
Perulinks <perulinks@aol.com> wrote:
><<Are you sure you license allowed you to modify the scripts? Perhaps the
>author is now preparing a lawsuit...>>
>
>A lawsuit for what?  Nobody is even using his scripts!!!

Then what is your problem? If you aren't using his scripts, why are you
whining about how unethical he is?

>You have to put the shoes of your clients --sometimes. 

What a marvelously meaningless proto-sentence.

>In the worst scenario you should at least answer emails or calls of
>people who write you (especially if you receive money from him).  

He received money from you for software that you admitted was working
before you played with it. His responsibility to you is over. You
assumed the responsibility when you edited his code.

>I always
>answer emails from people who go to my Web site, 

Goody for you.

>Well I came here for a technical question, and found my self deffending my self
>wowwww!

Wow indeed. You came here asking for support for a commercial software
package, provided no code that demonstrated your problem, and started
calling the author of the code you broke unethical because he won't fix
your mistakes for you. I can see why you might have to defend yourself.



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

Date: 14 Jul 1999 15:49:14 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Old database is erased when I add new information
Message-Id: <7mibhq$9j1$4@info2.uah.edu>

In article <7mgkhg$bnb$1@news.nero.net>,
	stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
: In article <slrn7olhkc.h7.abigail@alexandra.delanet.com>,
: >Ah, so you screwed up yourself. It's not fair blaiming the author for not
: >giving support, and then it turn out that you screwed up yourself.
: 
: This demonstrates the very good reason that people have for hiding the
: code of their perl scripts.

Hogwash.  If I want to make modification to my Ranger and end up
damaging my truck, people would laugh me out of town if I tried to
force Ford to fix my screwup.  They would laugh even harder if I
said that Ford is bad because they don't hold my hand.

A lot of this nonsensical notion of hiding the source from subclueful
customers stems from bizarre and bogotic expectations of programmers
that no one expects of other professions.  For a humorous treatment of
this, see <URL:http://world.std.com/~jimf/humor/architect.html>.

Greg
-- 
Only two things are infinite, the universe and human stupidity, and I'm not
sure about the former. 
    -- Albert Einstein


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

Date: 14 Jul 1999 16:02:25 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Old database is erased when I add new information
Message-Id: <7micah$9l1$1@news.NERO.NET>

In article <7mibhq$9j1$4@info2.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
>In article <7mgkhg$bnb$1@news.nero.net>,
>	stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
>: In article <slrn7olhkc.h7.abigail@alexandra.delanet.com>,
>: >Ah, so you screwed up yourself. It's not fair blaiming the author for not
>: >giving support, and then it turn out that you screwed up yourself.
>: 
>: This demonstrates the very good reason that people have for hiding the
>: code of their perl scripts.
>
>Hogwash.  If I want to make modification to my Ranger and end up
>damaging my truck, people would laugh me out of town if I tried to
>force Ford to fix my screwup.  

What "people" would do is irrelevant. The fact that you are in the Ford
dealership expecting them to fix what you broke for whatever you offer
them to fix it, and then start complaining in public how Ford is
unethical for not fixing your truck is relevant. That is what this guy is
doing.

>They would laugh even harder if I
>said that Ford is bad because they don't hold my hand.

Some might. Some wouldn't. If you believe they owe you a fix, why
wouldn't anyone else? 

>A lot of this nonsensical notion of hiding the source from subclueful
>customers stems from bizarre and bogotic expectations of programmers
>that no one expects of other professions.  

Hardly. Everyone has a text editor -- they come with the computer. Not
everyone has the tools to take a truck apart, and even if they do, there
is no grease to clean up when you edit code.



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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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 V9 Issue 141
*************************************


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