[12842] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 252 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 25 16:07:19 1999

Date: Sun, 25 Jul 1999 13:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 25 Jul 1999     Volume: 9 Number: 252

Today's topics:
    Re: Best Perl book? <digitalsorceress@d1g1t4!$0rc3$$.com>
        RE: Controlling page size/orientation in PS and PDFs nichols@blarg.net
    Re: directory sizes <ehpoole@ingress.com>
    Re: file manipulation <dan@fearsome.net>
    Re: flock - does it wait for people to finish reading? (Tad McClellan)
    Re: Geekspeak Programming Contest (Sitaram Chamarty)
    Re: http_referer problems (Randal L. Schwartz)
    Re: http_referer problems (Abigail)
    Re: http_referer problems <georgec@webleicester.co.uk>
    Re: LWP won't compile into freestanding exe (David Efflandt)
    Re: output of print map ( { unless (/^#/) {} } ("#") ); (Randal L. Schwartz)
    Re: Outputting text as entered by user (Arul Singam)
    Re: Perl on NT to Oracle on Unix (John D Groenveld)
        Ping with the system(); <bruno.baguette@francemel.com>
    Re: Ping with the system(); (Garth Sainio)
    Re: random (Tad McClellan)
        remove records from database (Chad Horton)
    Re: Replacing and Stripping HTML (Tad McClellan)
    Re: Search Perl Script <debot@xs4all.nl>
    Re: special problem (Tad McClellan)
    Re: Telnet via CGI? <cs2400@hotmail.com>
    Re: Variables in Regx? (Argouarch)
    Re: Which group is appropriate? (Tony Kennick)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Sun, 25 Jul 1999 16:03:15 -0400
From: "DigitalSorceress" <digitalsorceress@d1g1t4!$0rc3$$.com>
Subject: Re: Best Perl book?
Message-Id: <g0Km3.17564$kL2.568515@ndnws01.ne.mediaone.net>

When I first wanted to learn PERL, I picked up Visual Quickstart guide -
"PERL and CGI for the world Wide Web" by Elizabeth Castro (isbn
0-201-35358-x) It really helped out as I had little knowledge od CGI and
none of PERL. It has nice examples of code and resulting displays. It is
also centered around using PERL for web pages. Once I had absorbed the
contents of that book, I was then very comfrtable with most of the O'reilly
books already suggested by the others. (I still find some of it goes over my
head, but that just makes me more curious and driven tl learn more.)

Good Luck -
The Digital Sorceress




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

Date: Sun, 25 Jul 1999 17:51:10 GMT
From: nichols@blarg.net
Subject: RE: Controlling page size/orientation in PS and PDFs
Message-Id: <379B4E8E.5F5C944A@blarg.net>

I had the same problem that a person on the poscript newsgroup had:

"Using ps2pdf, I converted serveral ps files to pdf, however when I view
them in Acrobat the page orientation is wrong.  Instead of Landscape
mode, the reader defaults to portrait.  Thus, the text is sideways.  I
have tried using distiller and distiller does it correctly.  However,
for my purposes I need to use ps2pdf.  Does anyone have any ideas. 
Documentation on ps2pdf is terse.  Is there, someway I could modify the
pdf file? Adding a bytecodeor editing something?  Something that would
change the orientation."  

Does anyone have an existing perl script that will rotate a pdf or
poscript landscape file so it will display properly (not sideways)?
Or is there a parameter that can be used with the ps2pdf that makes this
adjustmemt during the conversion?

FYI:  I tried the perl script that was listed on the Postscript
newsgroup but it was broken.  I also tried inserting the ps code (<<
/PageSize [792 612] >> setpagedevice) into the ps file but there was no
change after it was run thru ps2pdf again.

Thanks for your help,

Frankie


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

Date: Sun, 25 Jul 1999 14:00:36 -0400
From: "Ethan H. Poole" <ehpoole@ingress.com>
Subject: Re: directory sizes
Message-Id: <379B50C4.99E06EF0@ingress.com>

Tad McClellan wrote:
> 
> Brian Pontz (pontz@channel1.com) wrote:
> 
> : Does anyone know how to get a total directory size including all the
> : subdirectories? I thought about using

For a very simple, all Perl with no dependencies, way to calculate the
total size of all files (but not necessarily the disk space they occupy
since it doesn't take into account the size of a storage block or
compression if compression is transparent on the OS in use):

  http://www.interact2day.com/test1/DiskSpace.txt

That's "test[one]" for font's that make L's and Ones look the same

It's fairly handy for rough estimates.  If you know the block size and the
disk space used by each directory link you can increase it's accuracy by
adding the bytes used for each dir link and 50% of the file block size
multiplied by the total number of files to the total space.  That will
make an even more accurate estimation of total disk space.

-- 
Ethan H. Poole           ****   BUSINESS   ****
ehpoole@ingress.com      ==Interact2Day, Inc.==
(personal)               http://www.interact2day.com/


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

Date: Sun, 25 Jul 1999 18:39:05 +0100
From: "Dan Adams" <dan@fearsome.net>
Subject: Re: file manipulation
Message-Id: <932924284.17651.0.nnrp-04.c2deb1c5@news.demon.co.uk>

Hi,

Simply, a huge thanks to everybody who has mailed or posted assistance on
this problem.

Dan Adams
dan@fearsome.net




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

Date: Sun, 25 Jul 1999 07:45:30 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: flock - does it wait for people to finish reading?
Message-Id: <qcten7.l4g.ln@magna.metronet.com>

James Thurley (jamesthurley@hotmail.com) wrote:
: This may seem a stupid question, but when you lock a file with flock(), does
: it wait for people to finish reading from the file before it locks it (if
: the people reading it haven't locked it)?


   flock is *merely advisory* (it says so:  perldoc -f flock  ).

   It does not work unless _all_ programs that use the file cooperate.

   If some other program has not locked the file before reading it,
   it is not cooperating.


   So, no, flock() waits (blocks) only if the file has been locked.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 25 Jul 1999 04:57:06 -0700
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Geekspeak Programming Contest
Message-Id: <slrn7pkj9q.3mb.sitaram@diac.com>

On Sat, 24 Jul 1999 09:48:20 GMT, Bart Lateur
<bart.lateur@skynet.be> wrote:

>Yeah, right. MS' people aren't clever enough to program a virus. <duck
>and run>

You're not that far off.  I faintly remember an old joke that ran
something like this:

    Guy #1: Windows is a virus.

    Guy #2: No it's not!  A virus is supposed to be small, fast,
    and do it's job well.  So there!


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

Date: 25 Jul 1999 10:42:37 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: http_referer problems
Message-Id: <m14sisk4mq.fsf@halfdome.holdit.com>

>>>>> "I" == I R A Darth Aggie <fl_aggie@thepentagon.com> writes:

I> + HTTP_REFERER _should_ contain the name of the page that calls the script

I> If and ONLY IF your server is configured to set that variable. Not all
I> are.

It's not a server issue.  It's a client issue.  But your last sentence
is true. :)

I> + BTW, this isn't a Perl question, but a CGI question.

I> No. It's a server configuration question, and should be in
I> comp.infosystems.www.servers.{misc,windows,unix,whatever}, depending
I> on the platform type.

No, it's a client question, and you should look at
comp.infosystems.www.browsers.whatever. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 25 Jul 1999 13:27:17 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: http_referer problems
Message-Id: <slrn7pmlmq.b32.abigail@alexandra.delanet.com>

Randal L. Schwartz (merlyn@stonehenge.com) wrote on MMCLIV September
MCMXCIII in <URL:news:m14sisk4mq.fsf@halfdome.holdit.com>:
// >>>>> "I" == I R A Darth Aggie <fl_aggie@thepentagon.com> writes:
// 
// I> + HTTP_REFERER _should_ contain the name of the page that calls the script
// 
// I> If and ONLY IF your server is configured to set that variable. Not all
// I> are.
// 
// It's not a server issue.  It's a client issue.  But your last sentence
// is true. :)


It's actually both. Cause the client can send all the Referer headers
it wants, if the server doesn't pass them on, the program will never
see them.


Abigail
-- 
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print 
               qq{Just Another Perl Hacker\n}}}}}}}}}'    |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w


  -----------== 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: Sun, 25 Jul 1999 19:39:07 +0100
From: "George Crane" <georgec@webleicester.co.uk>
Subject: Re: http_referer problems
Message-Id: <%OIm3.54$zq4.450@news1-hme0.mcmail.com>

Thanks - this isnt a question for perl - true enough - I will migrate. But
while this is here -is it true I need to set up the server to include
HTTP_REFERER or do I need to mess with the client - or both. If any of this
is true anyway it makes REFERER inappropriate for what I need anyway. Are
there better ways to stop strangers from calling scripts. Reply in person if
you prefer georgec@webleicester.co.uk
Many thanks.
George
Randal L. Schwartz wrote in message ...
>>>>>> "I" == I R A Darth Aggie <fl_aggie@thepentagon.com> writes:
>
>I> + HTTP_REFERER _should_ contain the name of the page that calls the
script
>
>I> If and ONLY IF your server is configured to set that variable. Not all
>I> are.
>
>It's not a server issue.  It's a client issue.  But your last sentence
>is true. :)
>
>I> + BTW, this isn't a Perl question, but a CGI question.
>
>I> No. It's a server configuration question, and should be in
>I> comp.infosystems.www.servers.{misc,windows,unix,whatever}, depending
>I> on the platform type.
>
>No, it's a client question, and you should look at
>comp.infosystems.www.browsers.whatever. :)
>
>--
>Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
><merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
>Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
>See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl
training!




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

Date: 25 Jul 1999 18:34:34 GMT
From: efflandt@xnet.com (David Efflandt)
Subject: Re: LWP won't compile into freestanding exe
Message-Id: <slrn7pmmd8.1bj.efflandt@efflandt.xnet.com>

On Sun, 25 Jul 1999 00:39:22 -0400, Bob Walton <bwalton@rochester.rr.com> wrote:
>David Greer wrote:
>
>> When I compile a script using ActiveCorp's PDK PerlApp script into a
>> freestanding exe it compiles fine, but when run gives the following
>> error:
>>
>> Can't locate LWP in @INC (@INC contains: . C:\TEMP\crunch) at (eval 1)
>> line 109, <FILECHUNK> chunk 1.
>>
>> crunch is the name of the script and FILECHUNK is a file handle used
>> within the script.  LWP is used in the script.  Anybody run into any
>> thing of this sort?
>
>...
>David, offhand, it looks like @INC does not include the directory where
>your LWP resides.  You might try adding that directory to @INC and see if
>it works them.  Something like:
>
>push @INC,'c:/full/path/to/directory/where/LWP/is/stored';
>
>As to why your @INC isn't set right when compiled, I don't know.

I am not familiar with ActiveState, but usually Perl 5 needs to have the
path in @INC at precompile time, and the following statement would
unshift it onto @INC before regular statements execute:

use lib 'c:/full/path/to/directory/where/LWP/is/stored';

-- 
David Efflandt   efflandt@xnet.com   http://www.xnet.com/~efflandt/
http://www.de-srv.com/   http://cgi-help.virtualave.net/


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

Date: 25 Jul 1999 10:40:01 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: output of print map ( { unless (/^#/) {} } ("#") );
Message-Id: <m17lnok4r2.fsf@halfdome.holdit.com>

>>>>> "Tad" == Tad McClellan <tadmc@metronet.com> writes:

Tad> PPS: the presence/absense of the Newsgroups header does *not*
Tad>      (reliably) indicate that it was also posted. That's why
Tad>      everybody puts those little [announcements] in the *body*
Tad>      of the followup and the email message. Please do that.

Or, you can get a super news/mail/everything reader that puts a
message in the mail, but not in the news posting, like GNUS (my
choice).  No need to tell the Usenauts that this was also sent as
mail, unless you feel like it.

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 25 Jul 1999 17:26:10 GMT
From: ansingam@chat.carleton.ca (Arul Singam)
Subject: Re: Outputting text as entered by user
Message-Id: <7nfhbi$t0l$1@bertrand.ccs.carleton.ca>



Please help me a bit more...
so say i store my textarea contents into a variable $myVariable, 
and i write it to a file to output it later on, 
should i do the following:

open(FILE, ">$myFile");
print pre FILE "$myVariable";
close(FILE);

Thanks for your help.
Arul S






> use CGI ':standard';

> print pre ( param ( 'yourtextarea' ) );






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

Date: 25 Jul 1999 13:22:17 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Perl on NT to Oracle on Unix
Message-Id: <7nfh49$ami$1@grolsch.cse.psu.edu>

Have your DBA install the Oracle client software on your NT machine and
configure SQLNet. Then you can build and install DBI/DBD::Oracle from source
(or precompiled from ActiveState).
John
groenveld@acm.org


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

Date: Sun, 25 Jul 1999 20:57:54 +0200
From: "Bruno Baguette" <bruno.baguette@francemel.com>
Subject: Ping with the system();
Message-Id: <7nfmn7$305$1@xenon.inbe.net>

Hello,

I have to do a Perl Script which control if an IP respond or not...

And i must use the system(); because it is the alone function to make a
system command...

So i try to take the reply of the ping :
$mystring=system(ping 194.7.91.65);
But mystring already contents 0....  Why ???


How can i take the reply of the system(ping 194.7.91.65); ?
I need this string to check if the IP have reply to the ping command or
not...

Note that the CGI will run on an Redhat 6.0 Linux Server with Apache.

Thanks in advance for your reply !

----------------------------------------------------------------------------
--
Bruno Baguette  (bruno.baguette@francemel.com)




----------------------------------------------------------------------------
--
Bruno Baguette  (bruno.baguette@francemel.com)








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

Date: Sun, 25 Jul 1999 15:14:15 -0400
From: modred@shore.net (Garth Sainio)
Subject: Re: Ping with the system();
Message-Id: <modred-2507991514160001@gniqncy-s02-110.port.shore.net>

In article <7nfmn7$305$1@xenon.inbe.net>, "Bruno Baguette"
<bruno.baguette@francemel.com> wrote:

<snip>
!!  
!!  So i try to take the reply of the ping :
!!  $mystring=system(ping 194.7.91.65);
!!  But mystring already contents 0....  Why ???
!!  
!!  
!!  How can i take the reply of the system(ping 194.7.91.65); ?
!!  I need this string to check if the IP have reply to the ping command or
!!  not...
<snip>

From the documentation included with perl

perldoc -f system
=item system LIST

Does exactly the same thing as "exec LIST" except that a fork is done
first, and the parent process waits for the child process to complete.
Note that argument processing varies depending on the number of
arguments.  The return value is the exit status of the program as
returned by the wait() call.  To get the actual exit value divide by
256.  See also L</exec>.  This is I<NOT> what you want to use to capture
the output from a command, for that you should use merely backticks or
qx//, as described in L<perlop/"`STRING`">.

So, $mystring is getting the exit value of the ping, not the actual
results. To get the actual results of the ping you can use backticks, open
a pipe to the process, or use the Net::Ping module found on CPAN. If you
are going to make a call to the system you should fully qualify the path
(i.e. /usr/bin/ping instead of ping).

backticks:

$mystring = `ping 194.7.91.65`;

opening a pipe:

open(PING, "ping 194.7.91.65 |") or die "Could not fork: $!\n";
# read the results like a normal file handle

while(<PING>)
{
   # Do something with the results.
}


using the module (you may need to install this or get it installed), these
are just general instructions since I have never used this specific module
before.

add use Net::Ping; at the top of your then look at the documentation via
the shell command perldoc Net::Ping.


HTH

Garth

-- 
Garth Sainio               "Finishing second just means you were the 
modred@shore.net            first to lose" - anonymous


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

Date: Sun, 25 Jul 1999 07:56:59 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: random
Message-Id: <b2uen7.l4g.ln@magna.metronet.com>

Tony Greenwood (tony@webscripts.org) wrote:

: I am generating a random number between 2 and 7
: What I would like to do is fix it so 4,5 and 6 appear more often.

: However it does seem a long way around the problem. is there a better
: way ? 


   Generate more than the 6 numbers you want, and adjust the
   "out of range" ones to equal one of the "to be more frequent"
   ones:

      $num = 2 + int rand(9);   # generate 9 values instead of 6
      $num -= 4 if $num > 7;    # make 4,5,6 appear about twice as often


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sun, 25 Jul 1999 10:57:28 -0800
From: sandc@sprynet.com (Chad Horton)
Subject: remove records from database
Message-Id: <r2Jm3.152$9d.81921@WReNphoon3>

Here is my dilema:

I have a database like this:

100|www.pepsi.com|10|10|80|0|
20|www.pepsi.com|1||1|18|0|
20|www.pepsi.com|1|1|18|0|
10|www.pepsi.de|1|1|8|0
65|www.remark.pepsi.com|32|20|10|3|
44|www.pepsi.com|10|10|12|12|
23|www.digipepsi.net|5|15|1|2|
100|www.digipepsi.net|25|30|20|25|

What I need to find the highest value for column 1 for all records per
domain and remove the duplicate records.

So, in this case the results be be this:

100|www.pepsi.com|10|10|80|0|
10|www.pepsi.de|1|1|8|0
65|www.remark.pepsi.com|32|20|10|3|
100|www.digipepsi.net|25|30|20|25|

I have only gotten as far as opening the database!

Please help.
Thanks,
chad.



   -**** Posted from RemarQ, http://www.remarq.com/?a ****-
 Search and Read Usenet Discussions in your Browser - FREE -


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

Date: Sun, 25 Jul 1999 08:02:52 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Replacing and Stripping HTML
Message-Id: <cduen7.l4g.ln@magna.metronet.com>

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

: </FONT> thingies (are those tags?)


   There 2 types of tags: start tags and end tags (they are delimiters).

   </FONT> is an end tag.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sun, 25 Jul 1999 20:59:18 +0200
From: Frank de Bot <debot@xs4all.nl>
Subject: Re: Search Perl Script
Message-Id: <379B5E86.F8FBA3AE@xs4all.nl>

You could try to run that "UNIX only" scripts. Mostly they can also be runned
on NT. (as far I know)

DS wrote:

> I have searched for days to find a Perl script that will do searches
> throughout my website.  I am running on a NT Platform and every script I
> find is UNIX only and no one seems to know where to find one at.  This is
> the last ditch effort, so any help would be GREATLY appreciated.
>
> Thanks,
> David Spivey
> dspivey@rossbyweather.com

--
Penpal International    , Searchy.net
http://www.debot.nl/ppi , http://www.searchy.net/
ppi@debot.nl            , support@searchy.net




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

Date: Sun, 25 Jul 1999 08:00:55 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: special problem
Message-Id: <n9uen7.l4g.ln@magna.metronet.com>

Jeremy James (perly@ufl.edu) wrote:
: Frank de Bot wrote:

: > I want to do something weird ( I think ).
: > I have a string which is called array:
: >
: > $string = "array";
: >
: > Now I want to create an array with that variable.
: >
: > @array = "";  # To put something in it is for later
: >
: > if I have a string whit the value "mp3" I want to create a array @mp3
: >
: > Is this possible?


: I believe what you are looking for is a symbolic reference:


   Probably.

   But he will be better off if he never finds them (using a
   hash instead is "better" for nearly all values of "better").


       http://www.plover.com/~mjd/perl/varvarname.html


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sun, 25 Jul 1999 13:44:29 -0400
From: "c.s." <cs2400@hotmail.com>
Subject: Re: Telnet via CGI?
Message-Id: <932924798.213.50@news.remarQ.com>

>> What is an "expect command"?
>>
>
>NAME
>       expect  -  programmed  dialogue with interactive programs,
>       Version 5
>
>SYNOPSIS
>       expect [ -dDinN ] [ -c cmds ] [ -[f|b] ] cmdfile ] [ args ]
>
>INTRODUCTION
>       Expect is a program that "talks" to other interactive pro­
>       grams according to a script.  Following the script, Expect
>       knows  what  can  be  expected from a program and what the
>       correct response should be.
>
>Hope that helps
>
>/J\

Hmm... sounds interesting... Thanks  :-)






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

Date: Sun, 25 Jul 1999 12:13:31 -0800
From: argouarc@idiom.com (Argouarch)
Subject: Re: Variables in Regx?
Message-Id: <argouarc-2507991213310001@argouarc.dial.idiom.com>

In article <4jldn7.87f.ln@magna.metronet.com>, tadmc@metronet.com (Tad
McClellan) wrote:

($key,$translation)=split(/:/);
$translation =~ s#\b($key)\b#<b>$1</b>#ig;
$_ = "$key:$translation";  # put them back together

it worked! I just had to add a /i since $key is uppercase in the first
instance only. In fact I just realize that using this feature, it was
probably not necessary to split the line, just 1) get the key, 2)
lowercase the key, and 3) do the substitution without \i, it would apply
only to translation. Et voila.
 I wonder if the \b are necessary? but then I did not have them in my
first attempt friday and it would not work, also I may have forgotten \i
and got sidetracked with the variable business. A simple mistake can
really throw you off track on all kind of deadends and make you forget
that perl is always based on the simplest solution possible.

Philippe




> Argouarch (argouarc@idiom.com) wrote:
> : Here's the problem, I have a dictionary flat file with 30 000 lines, I
> : want to bold every instance of the defined word in each definition so my
> : regular expresion has to change for each line (sure dont want to do this
> : by hand, and was'nt PERL designed just for this crap :=)?. 
> : I also want the html tags inserted in the file itself so I wrote a simple
> : utility script to change the file.
> 
> : I tried this:
> : Open...
>   ^
>   ^ syntax error
> 
> : While (<FILE>){
>   ^
>   ^ syntax error
> 
> : ($key,$translation)=split(/:/);
> 
> : s/(${$key})/<b>$1<\/b>/g;
> 
>        s#\b($key)\b#<b>$1</b>#g;  # might need to throw in a \Q there too
> 
>    or, if you want to exclude bolding the defined word "column":
> 
>          $translation =~ s#\b($key)\b#<b>$1</b>#g;
>          $_ = "$key:$translation";  # put them back together
> 
> : }
> 
> : would not work... although I am forcing dereferencing of $key
> [snip]
> : Am I missing something here? 
> 
> 
>    I don't see that references are needed for this.
> 
>    Am I missing something here?  :-)
> 
> 
> --
>     Tad McClellan                          SGML Consulting
>     tadmc@metronet.com                     Perl programming
>     Fort Worth, Texas


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

Date: Sun, 25 Jul 1999 18:12:08 GMT
From: tony@showroom.org.uk (Tony Kennick)
Subject: Re: Which group is appropriate?
Message-Id: <379b49f7.13524908@missy.shef.ac.uk>

John Callender <jbc@shell2.la.best.com> imparted the following:

:->Abigail <abigail@delanet.com> wrote:
:->> No, there isn't. This is Usenet. Usenet is not the place to ask the same
:->> questions over and over again.

John Callender <jbc@shell2.la.best.com> imparted the following:

:->Actually, that's *exactly* what Usenet is, and c.l.p.m. illustrates
:->that fact about as well as any group I've seen. Wishing for it to be
:->otherwise does not make it so, regardless of the "shouldness" of that
:->position.

I'm sorry but you are wrong. If you can't be bothered to read the docs
before you post, why should people be bothered to answer your
questions?

Secondly and going of at an angle slightly, not reading the FAQ for a
group can break it. I am a relative newcommer to perl (in fact it is
tempting to write a "just another script kiddy" programme for my .sig)
but have been reading Usenet of about 6 years (still a newbie by some
standards) and have seen some groups sink under the signal-to-noise
ratio and some suffer even worse fates. For example alt.fan.pratchett
used to read and posted to by Terry Pratchett, however despite the FAQ
telling people not to posters were always bombarding the man with book
ideas. Leading to him leaving the group for to stop people trying to
sue him over things they posted to a newsgroup two months after he
started writng a book along those lines.

:->Abigail <abigail@delanet.com> wrote:
:->> And think about it. Perl can be pretty complex at some times. You really
:->> think that figuring out stuff with a bunch of newbies will give you
:->> better or faster answers than reading the FAQ?

John Callender <jbc@shell2.la.best.com> imparted the following:

:->Not faster answers, no. But "better" is a subjective measurement,
:->subject to individual variations in sort criteria. It seems pretty
:->clear that the original author would appreciate a group where newbie
:->questions (like Perl babytalk) enjoyed some degree of official
:->sanction. Personally, I would too. Somewhere where beginners could
:->engage in beginner-level discussions without having to worry about
:->being zinged for missing something in the documentation. Even his
:->original article here, which I thought was a model of appropriateness,
:->from the good subject line, to the provision of necessary information,
:->to the careful and specific formulation of the question, and even the
:->respectful tone it displayed towards the group's experts, got him the
:->patented Abigail brush-back, with a hard fastball up under the chin.

Whereas I can see people getting confused when the golf is in full
swing or if someone posts an answer that fits the spec exactly, but of
course the spec was badly written. However the golf posts generally
only start from a correct reply and the second sort are very valuable
for teaching people a point.
I'm not sure what you want when you ask for perl baby talk. There are
lots of people here that when presented with a question that cannot be
answered by pointing someone at the docs post three of four answers
that all do the job, getting more and more optimised as you go down
the page untill reaching the most idiomatic at the bottom.
I have the strangest feeling that the FAQ and other docs that come
with perl having been peer reviewed for years constitute if not the
best solutions for individual cases at least the best general
solutions.
The other point is who will give the correct answers in the newbie
group? Do you expect the experts to form a rota? Or don't you want
experts in there? By definition other newbies are not the best people
to give programing advice, in this situation I predict even more
scripts outputting 19100 next year.

:->There will, of course, always be inappropriate behavior here, and there
:->will be those who believe their are justified in responding negatively
:->as a means of correction. But I have come to the opinion that there
:->really are two distinct groups of users here (or at least, a continuum
:->with swollen lobes at either end). On the one hand are the professional
:->programmers who created this group, and believe, rightly, that they
:->should be allowed to determine its future. On the other hand are a
:->whole bunch of us Web carpetbaggers, amateurs who never took a computer
:->science class and, for better or worse, will probably never wind up
:->coding full-time.

I don't think that the great and good of the perl world that post here
require you to have a CS degree or to be a paid coder to post here.
However *I think* they want people to:

pick the right group
read the docs
try things out
ask a specific question
not expect a free ride
make some sort of effort to learn how to *programme*

Since I don't read the C or C++ or any other language group I don't
know if anyone asks questions in them like "I don't know how to
programme or any C how do I re-write this mission critical
application, P.S. if it goes wrong washington will blow up"
I didn't finish my degree and it wasn't a comp sci one anyway, however
I still understand that the first and most important part of solving
any problem with a computer program is spending some time thinking
about the algorithm first, then working how how to impliment it.

My personal reasons for reading this group is to expose myself to
other people's code, I'm sure I learnt more about programming from the
Cookbook than the Camel and I'm sure as a newbie that I will learn
nothing from a newbie group.

On the other hand as much as I have learned from this group my golf
scores are still an embarisment to my Step-Father.
 
*ching* 2p worth.

-- 
From Tony Kennick aka Gonzo The Great
http://missy.shef.ac.uk/users/old-firm/
Gonzo: Slang for "the last man standing 
at a drinking marathon"


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

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


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