[13031] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 441 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 10 04:07:28 1999

Date: Tue, 10 Aug 1999 01:05:08 -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           Tue, 10 Aug 1999     Volume: 9 Number: 441

Today's topics:
    Re: CGI beginner (Abigail)
    Re: CGI.pm: very simple error (Abigail)
    Re: CGI.pm: very simple error (Larry Rosler)
    Re: CGI/Perl programmer needed (Abigail)
    Re: Control characters in Perl (Mark-Jason Dominus)
    Re: diff in perl? (Abigail)
        finding array size <glasscat@shell7.ba.best.com>
    Re: finding array size (Sam Holden)
    Re: Help With Simple Search Script <callen@boxcar.driver8.org>
    Re: HELP...! <callen@boxcar.driver8.org>
    Re: Newbie: File I/O + Locking question (Anno Siegel)
    Re: perl script - help (Bill Moseley)
    Re: perl script - help (Abigail)
    Re: Perl version question (Bart Lateur)
        perldoc and activeperl help <phony@nospam.com>
    Re: POST via Imagemap - How? (Bart Lateur)
    Re: pricing a perl job <erict@cc.wwu.edu>
    Re: problem with DBI.pm <psychosherry@email.com>
    Re: Quick Question :) <mzive@interactive.net>
    Re: Quick Question :) (Abigail)
    Re: Reading the Online Documentation? (Malcolm Ray)
    Re: Replace section in file with another file (Bart Lateur)
    Re: Simple write routine (Anno Siegel)
    Re: String compare <cmd@maths.uq.edu.au>
    Re: turn $6 into $6000 (brian d foy)
    Re: turn $6 into $6000 (Iain Chalmers)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 10 Aug 1999 01:26:01 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: CGI beginner
Message-Id: <slrn7qvhfa.ahe.abigail@alexandra.delanet.com>

mirak@vnet.net (mirak@vnet.net) wrote on MMCLXIX September MCMXCIII in
<URL:news:370c197a.14184147@news.mindspring.com>:
%%
%% I now consider myself just above a novice perl programmer.
%% I can't even figure out how to make "Hello World" display correctly


I dunno, but I wouldn't rank myself "above" a novice programmer
if I couldn't figure out "Hello World" yet.



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 10 Aug 1999 01:06:26 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: CGI.pm: very simple error
Message-Id: <slrn7qvgak.ahe.abigail@alexandra.delanet.com>

Jflowers44 (jflowers44@aol.com) wrote on MMCLXIX September MCMXCIII in
<URL:news:19990809190448.25863.00006119@ng-cm1.aol.com>:
%% How do I know if the hashbang line ends in ^M?  


perl -wnle 'print "Bingo!" if $. == 1 && /\cM$/' program

Of course, if you would run with -w, you would not have had
this problem.


Abigail
-- 
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Mon, 9 Aug 1999 23:01:30 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: CGI.pm: very simple error
Message-Id: <MPG.12195ff01f40b741989e16@nntp.hpl.hp.com>

In article <8NNr3.5435$rR.10128@nsw.nnrp.telstra.net> on Tue, 10 Aug 
1999 04:21:24 GMT, Martien Verbruggen <mgjv@comdyn.com.au> says...
> In article <19990809190448.25863.00006119@ng-cm1.aol.com>,
> 	jflowers44@aol.com (Jflowers44) writes:
> 
> Don't cut important pieces of information when following up :)
> 
> Your script says:
> #!usr/local/bin/perl
> [snip]
> 
> > I tried to run it using 
> > ./sciptname.pl 
> > and it says "No such file or directory".  I ran it using 
>       ^^
>       the system
> 
> You probably don't have /usr/local/bin/perl. Try something like
> 
> # which perl
> 
> to find out where it is. Probably in /usr/bin/

Actually, Jflowers44 propably doesn't have usr/local/bin/perl relative 
to whatever the current directory is.  :-)

Jflowers44 should try

  #!/usr/local/bin/perl
    ^

And after that works, Jflowers44 should try adding:

  #!/usr/local/bin/perl -w
  use strict;

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


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

Date: 10 Aug 1999 01:21:19 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: CGI/Perl programmer needed
Message-Id: <slrn7qvh6g.ahe.abigail@alexandra.delanet.com>

Jeff Reynolds (techsearch@home.com) wrote on MMCLXIX September MCMXCIII
in <URL:news:87Ir3.128$uU5.152@news.rdc2.occa.home.com>:
;; Go to my website for contact info:


No.


*ploink*


There *you* go.



Abigail
-- 
$" = "/"; split $, => eval join "+" => 1 .. 7;
*{"@_"} = sub  {foreach (sort keys %_) {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 10 Aug 1999 07:10:34 GMT
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Control characters in Perl
Message-Id: <7ooj87$6s8$1@monet.op.net>

[Mailed and posted]

In article <7omubt$ka5$1@nnrp1.deja.com>,
Brundle  <brundlefly76@hotmail.com> wrote:
>my $test=join(/\004/,qw(one two three));

This line is erroneuos.  I just submitted a patch that will generate a
compile-time warning for this program.  Here is the warning:

join(/string/, ...) probably should be written as join('string', ...) at ... 


The `perldiag' man page says:

(W) People often make a mistaken analogy between split() and join()
and suppose that join's first argument, like split's, should be a
pattern.  But it isn't a pattern; it is a plain string.  If you write
C<join(/string/, ...)> then you have asked for a pattern match
operation with $_ as the target.  The true or false result of this
pattern match is then used to join together the remaining arguments.
This is almost certainly not what you wanted.

I expect that this will be released in version 5.6.
Thanks for the reminder.


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

Date: 10 Aug 1999 01:37:02 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: diff in perl?
Message-Id: <slrn7qvi40.ahe.abigail@alexandra.delanet.com>

Tom Kralidis (tom.kralidis@ccrs.nrcanDOTgc.ca) wrote on MMCLXIX September
MCMXCIII in <URL:news:37AEDE89.DB72BE0C@ccrs.nrcanDOTgc.ca>:
'' 
'' What's the best way to do this in Perl?
'' 
'' diff file1 file2 > difference.txt

system "diff file1 file2 > difference.txt";



Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 10 Aug 1999 06:49:59 GMT
From: Margaret Escherich <glasscat@shell7.ba.best.com>
Subject: finding array size
Message-Id: <37afcb97$0$221@nntp1.ba.best.com>

It's easy to find the size (in bytes) of a file with -s.

How do you find the size of an array or a splice?  how could I, for example, take 400 bytes of an
array?

thanks and apologies if this is in any of the FAQs - I couldn't find it.

Margaret


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

Date: 10 Aug 1999 06:56:30 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: finding array size
Message-Id: <slrn7qvj9m.787.sholden@pgrad.cs.usyd.edu.au>

On 10 Aug 1999 06:49:59 GMT,
	Margaret Escherich <glasscat@shell7.ba.best.com> wrote:
>
>How do you find the size of an array or a splice? how could I, for
>example, take 400 bytes of an array?

perldoc -f length

-- 
Sam

I don't want Perl to be beautiful--I want you to write beautiful
programs in Perl.
	--Larry Wall


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

Date: 10 Aug 1999 06:03:06 GMT
From: Christopher Allen <callen@boxcar.driver8.org>
Subject: Re: Help With Simple Search Script
Message-Id: <7oofaq$2dn8$2@news1.spacestar.net>

Syko <freak6238@aol.com> wrote:
> OK, first, here's my script:

> ==================================================
> open SEARCH, "library.txt";
                          ^^^^ or die "can't open it $! \n";

> @search = <SEARCH>;

> $keywork = "cool";
         ^
# Do you mean keyword ?
#

> $page = 2;

> for ($i = 0, $j = 0; $i <= $#search; $i++) {
> 	if ($search[$i] =~ m/$keyword/io) {
                                    ^

> 		$matches[$j] = $search[$i];

> 		$j++


-----
-out




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

Date: 10 Aug 1999 06:15:38 GMT
From: Christopher Allen <callen@boxcar.driver8.org>
Subject: Re: HELP...!
Message-Id: <7oog2a$2dn8$3@news1.spacestar.net>

Kevin <kawa@taiwan.com> wrote:
> Hi,

> In a web page, I want to write a perl program that can receives surfer's
> inputs and

? The question is why do surfers always throw tennis shoes on electric 
wires/telephone wires overhead?
**
Handling this on the client side would be of use to you : 
KEYWORD {javascript}.

Whether this can/how be done is better queryed in a js newsgroup.
--
-*
out




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

Date: 10 Aug 1999 07:23:08 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Newbie: File I/O + Locking question
Message-Id: <7ook0s$mf3$1@lublin.zrz.tu-berlin.de>

Chris <chrisl@hamptons.com> wrote in comp.lang.perl.misc:
>Howdy all
>
>I have to write some simple CGI scripts. Thes scripts are going to be
>writing to some common files, and I have to have some kind of
>synchronization. Is there any file locking in Perl?

Why do you bother the newsgroup with this question?  The answer is
right on your hard disk.  perldoc -q lock would have led you right
there.

>                                                     And if not, can I
>just do something like 


>	while (open(OUT, ">> common.txt"))
>	{
>		# Loop until the open() succeeds
>	}
>
>without being mocked?

No.  The question itself is laughable.  You haven't thought for a minute
before you wrote it down.

Anno


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

Date: Mon, 9 Aug 1999 23:11:19 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: perl script - help
Message-Id: <MPG.12196263903f96de98969d@nntp1.ba.best.com>

Abigail (abigail@delanet.com) seems to say...
> perl -walne '$_{$F[0]}->{$F[3]}++;
>              END{map{print"For word $_ I found:";%_=%{$_{$_}};
>                  map{print"    $_{$_} instances of $_"}keys%_}keys%_}' file

I love well documented code.

-- 
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.


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

Date: 10 Aug 1999 01:32:06 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: perl script - help
Message-Id: <slrn7qvhqn.ahe.abigail@alexandra.delanet.com>

Bill Moseley (moseley@best.com) wrote on MMCLXX September MCMXCIII in
<URL:news:MPG.12196263903f96de98969d@nntp1.ba.best.com>:
|| Abigail (abigail@delanet.com) seems to say...
|| > perl -walne '$_{$F[0]}->{$F[3]}++;
|| >              END{map{print"For word $_ I found:";%_=%{$_{$_}};
|| >                  map{print"    $_{$_} instances of $_"}keys%_}keys%_}' file
|| 
|| I love well documented code.


It's self documenting. Only obscure code needs comments.



Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 10 Aug 1999 07:55:48 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl version question
Message-Id: <37afdaeb.442201@news.skynet.be>

Tim Lowe wrote:

>My university has switched web servers and thus I had to move everything 
>over to a new server.  I had a messageboard that ran perfectly under the 
>following version of perl:
>
>5.004_04 for osfalpha-dec_osf
>
>But now I get "premature end of script headers" errors under this 
>version:
>
>5.004_04 for aix
>
>My university provided the unix program to copy the website over from one 
>server to the other. I've double checked all file permissions and 
>directory references, but I guess I could have missed something.

Have you updated the "#!" lines?

	Bart.


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

Date: 10 Aug 1999 06:27:14 GMT
From: "Bart Simpson" <phony@nospam.com>
Subject: perldoc and activeperl help
Message-Id: <7oogo2$ep8$0@216.39.133.87>

I am running ActivePerl under Win98, and I download the perl docs so I could
use "perldoc -f whatever" to look up commands, but it doesn't work so well
under windows.

It works fine if its just a small amount of text returned, such as when I
use "perldoc -f ucfirst", but when I try to look up 'substr' most of the
info scrolls off the top of the screen.  Same as when I type "perldoc -h"

Is there a switch to pause every screen?
I tried redirecting to a file, like "perldoc -f substr>one.txt" that didn't
work.

I do appreciate the answers I've been receiving, which tell me to look it up
in perldoc, now I just need help with perldoc. Go figure. :)




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

Date: Tue, 10 Aug 1999 07:04:16 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: POST via Imagemap - How?
Message-Id: <37b0ce8b.1531309@news.skynet.be>

Abigail wrote:

>Do you really have to contribute to the notion amongst Dutch people
>that people from Belgium don't understand any humour?

The Dutch would think *everything* is funny. Ooh! A pile of crap!
Hahahah!
 
	Bart.


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

Date: Tue, 10 Aug 1999 00:33:59 -0700
From: Eric Turner <erict@cc.wwu.edu>
Subject: Re: pricing a perl job
Message-Id: <37AFD5E7.2EF98B74@cc.wwu.edu>

Max Pinton wrote:
> 
> While I've given up on getting any kind of usable answer here...

I'll assume for the sake of argument that you live in the Unites States
(perhaps this is an arrogant assumption.) If you don't then just apply
the appropriate exchange rate. The Occupational Outlook Handbook
(http://stats.bls.gov/oco/ocoiab.htm) gives earnings for various
occupations. Here is an exerpt from it:

"A survey of workplaces in 160 metropolitan areas reported that
beginning programmers had median annual earnings of about $27,000..."

There are 52 work weeks in a year, times 5 ( to get the number of
workdays per year), times 8 gives you 2080 work hours per year. $27,000
per year divided by 2080 gives you $12.98 per hour. Considering that you
[probably] do not have a four year degree in Computer Science, nor any
prior experience as a professional programmer, you probably should
charge a little bit less. $12.00 per hour sounds about right. Since you
worked for 16 hours I suggest you charge $192.00.

Eric Turner


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

Date: Tue, 10 Aug 1999 11:22:38 +0500
From: "Sherry" <psychosherry@email.com>
Subject: Re: problem with DBI.pm
Message-Id: <37afc38e.0@spine.brain.net.pk>

Hello,
I also had the same problem, but a nice guy helped me.
Since you have
ActiveState Perl, you really need to familiarize yourself with the things
ActiveState provides.  This includes the HTML docs that have a shortcut
on your Start Menu; the ppm program for downloading modules; the
perldoc program for finding things in the documentation; the Perl FAQ
[Frequently Asked Questions with complete answers]; and the ActiveState
win32 Perl FAQ, to name a few.  Go back to ActiveState, and go to:

http://www.activestate.com/support/mailing_lists.htm

to find several win32-Perl mailing lists to which you can subscribe.
You'll probably want to start with the basic win32-perl-users group.
You can ask questions there, and read the advice of many Perl users.

Now then, as to your question.  Here's my first bit of advice on that.
NEVER download anything from CPAN if you can get it already-built from
ActiveState.  Read the instrcutions for 'ppm' - they're in the HTML
docs on your Start Menu.  Make sure you have a net connection open, and
type in a command prompt:

ppm search DBI

you'll get a name for the DBI module.  In this case it will be just
DBI.  So now to install the module, you type:

ppm install DBI

and ppm installs it for you, including putting the docs in your HTML
tree.  The DBI module from CPAN assumes you have a functional version
of make.  You can get gmake from the Free Software Foundation, or you
can get nmake (for free) from the Microsoft website.  nmake is what
you'll want to be more compatible with ActiveState, which is a Micro-
soft shop.

Since you didn't *install* DBI or get it working, of course Perl
couldn't find a working copy of it, and so you got those
 errors.

Take care,
Shehryar Piracha
Email: spiracha@cs.lums.edu.pk


mao wrote in message <37AB1C33.FF7ECA0C@hotmail.com>...
>i've a problem with DBI.pm:
>
>i downloaded ActivePerl 518 (as i use Win95), the latest version of
>DBI.pm (113) and copied it into the perl/lib directory.
>then i got the mysql.pm from mysql.org.
>i also downloaded some perl scripts that use DBI.pm to contact a mysql
>db.
>
>i tried to run them, but everytime i got the errmsg "can't locate
>loadable object in @NIC...".
>the line with the error was:
>"use DBI;"
>but all scripts use this syntax.
>i tried it with:
>"use DBI::MySQL;"
>fine, no errors (i still don't know why all the scripts (and the DBI.pm
>FAQ) make it w/o "::MySQL")
>
>anyway, then i wanted to use the DBI->connect() object/method to connect
>my db, know i get the errmsg:
>"object connect not found via dbi.pm..."
>what's wrong with my source? or is there something wrong with my DBI.pm?
>
>PLEASE EMAIL ME!
>thanks a lot,
>malte
>




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

Date: Tue, 10 Aug 1999 02:33:06 -0400
From: "Michael Zive" <mzive@interactive.net>
Subject: Re: Quick Question :)
Message-Id: <WuPr3.1$hy4.57@reader1.interactive.net>

which one
Abigail <abigail@delanet.com> wrote in message
news:slrn7qv9ck.ahe.abigail@alexandra.delanet.com...
> Uri Guttman (uri@sysarch.com) wrote on MMCLXIX September MCMXCIII in
> <URL:news:x73dxtdko1.fsf@home.sysarch.com>:
> "" >>>>> "A" == Abigail  <abigail@delanet.com> writes:
> ""
> ""   A> While not faster, this should work too, and it doesn't require you
> ""   A> to figure out how many digits you need:
> ""
> ""   A>    %t   =  map {$_ => $i ++} qw /000 001 010 011 100 101 110 111/;
> ""   A>    $bin =  0 x (3 - length ($bin) % 3) . $bin if length ($bin) %
3;
> ""   A>    $bin =~ s/(...)/$t{$1}/g;
> ""   A>    $num =  oct $bin;
> ""
> ""   A>    @t   =  qw /000 001 010 011 100 101 110 111/;
> ""   A>    $bin =  sprintf "%o" => $num;
> ""   A>    $bin =~ s/./$t[$1]/g;
> ""   A>    $bin =~ s/^0+//;
> ""
> "" if you are doing both then you can share some init code:
> ""
> "" @t = qw /000 001 010 011 100 101 110 111/;
> "" @t{ @t } = 0 .. $#t ;
>
>
> I was actually thinking of doing %s = reverse %t, instead of the @t line.
> And then of course s/(.)/$s{$1}/g;
>
>
>
> Abigail
> --
> perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
> HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
> LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
> "http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) ->
content))
> =~ /(.*\))[-\s]+Addition/s) [0]'
>
>
>   -----------== Posted via Newsfeeds.Com, Uncensored Usenet News
==----------
>    http://www.newsfeeds.com       The Largest Usenet Servers in the World!
> ------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers
==-----




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

Date: 10 Aug 1999 01:36:13 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Quick Question :)
Message-Id: <slrn7qvi2d.ahe.abigail@alexandra.delanet.com>

Michael Zive (mzive@interactive.net) wrote on MMCLXX September MCMXCIII
in <URL:news:WuPr3.1$hy4.57@reader1.interactive.net>:
%% which one

Which one of what? Your questionmarkfree question is just a pointless
question. There's no context. It's like busting in a room, and then
exclaiming "which one". Noone will know what you are talking about.


[After the fact postings, including sig and advertisement deleted]


Next time, you'll be dead.



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 10 Aug 1999 07:54:05 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: Reading the Online Documentation?
Message-Id: <slrn7qvmkt.s13.M.Ray@carlova.ulcc.ac.uk>

On 09 Aug 1999 23:36:30 GMT, Mesarchm <mesarchm@aol.com> wrote:
>I am not argueing that the docs aren't the best place to look 1st.  But what I
>am saying is that if people turn to you for help, being willing to help.  The
>perfect example is Mr. Know it all (Just Another Larry) Rosler Hewlett-Packard
>Laboratories.  He answers 90% of the posts on this newsgroup w/ "Read the Docs"
> Get a life.

There's not a lot of glory in directing people to the documentation.  Since
anyone can do it, it doesn't imply anything about the level of knowledge
of the person doing it.  It's not a very fruitful course of action for a
"know it all".

>If you have nothing better to do then sit around all day and not
>help people then you really need to get out and get a life.
>Mike

He *is* helping people.

If you just want someone to read to you, you'll have to eat up all your
broccoli first.
-- 
Malcolm Ray                           University of London Computer Centre


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

Date: Tue, 10 Aug 1999 07:07:41 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Replace section in file with another file
Message-Id: <37b3cf1e.1677464@news.skynet.be>

David Cassell wrote:

>Chris L wrote:

>> while I understand how to replace a string in a file with another string, I'm
>> unclear how to replace a section in a file with the whole of another
>> file.
>> 
>> My website has menus surrounded by comment tags:
>> <!--startmenu-->
>> foostuff
>> <!--endmenu-->
>> 
>> I would like to replace that section with another section that resides
>> in a file...
>
>Well, one way would be to read your file into a single array:
>
>   @file_contents = <INFILE>;

That is silly. Turn the file into a *string*, and then do the
replacements.

Simplest would be to (temporarily) undeffing $/.

	$file_contents = do { local $/; <INFILE> };
		
	Bart.


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

Date: 10 Aug 1999 07:49:08 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Simple write routine
Message-Id: <7oolhk$mge$1@lublin.zrz.tu-berlin.de>

Uri Guttman  <uri@sysarch.com> wrote in comp.lang.perl.misc:

>	$date_file = 'y2kcompatible' ;
>	open( DATE, ">$date_file" ) || die "can't create file $date_file $!" ;
>	print DATE scalar( localtime ), "\n" ;
>	close( DATE ) || die "can't close file $date_file $!" ;

I have rarely seen a check on close of an ordinary file.  Is there
any particular reason why you include it here?  Or just general
tidiness?

Anno


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

Date: Tue, 10 Aug 1999 17:08:54 +1000
From: chris dawson <cmd@maths.uq.edu.au>
Subject: Re: String compare
Message-Id: <37AFD006.F9601E6F@maths.uq.edu.au>

> > Do I win a holiday for two or something?
> 
> Not if that's all you could find wrong with it :)
> 

Damn, booby prize then.

Chris.


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

Date: Tue, 10 Aug 1999 02:18:33 -0400
From: brian@pm.org (brian d foy)
Subject: Re: turn $6 into $6000
Message-Id: <brian-ya02408000R1008990218330001@news.panix.com>

In article <x7iu6ob2hc.fsf@home.sysarch.com>, Uri Guttman <uri@sysarch.com> posted:

> print $money ;
> 
> i have always wanted to print money.

i was expecting you to say that $6 is read-only, or that only Alan
Greenspan can change the value of $6.

-- 
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: Tue, 10 Aug 1999 16:25:27 +1000
From: bigiain@mightymedia.com.au (Iain Chalmers)
Subject: Re: turn $6 into $6000
Message-Id: <bigiain-1008991625280001@bigman.mighty.aust.com>

brian wrote:

> In article <x7iu6ob2hc.fsf@home.sysarch.com>, Uri Guttman
<uri@sysarch.com> posted:
> 
> > print $money ;
> > 
> > i have always wanted to print money.
> 
> i was expecting you to say that $6 is read-only, or that only Alan
> Greenspan can change the value of $6.

heh heh

how about: 

my $x='()'x5999;
$x.="($6)";
/$x/;

???

big


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

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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


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