[16096] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3508 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 29 11:05:35 2000

Date: Thu, 29 Jun 2000 08:05:18 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <962291118-v9-i3508@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 29 Jun 2000     Volume: 9 Number: 3508

Today's topics:
    Re: $_ and @_ use? <mjcarman@home.com>
        ***Do not use this code!*** Re: Perl Help Please! <sariq@texas.net>
    Re: ***Do not use this code!*** Re: Perl Help Please! <pap@NOTHEREsotonians.org.uk>
        answeraday.com <showbiz@showbiz.8m.com>
    Re: Book on Perl ASP <samara_biz@hotmail.com>
    Re: Cant get perl cgi result (directly..) (Tad McClellan)
        catch error SQL eastking@my-deja.com
        DANGEROUS CODE ABOVE (was Re: Perl Help Please!) (Randal L. Schwartz)
    Re: Dereferencing a two dimensional array? <mjcarman@home.com>
    Re: explicit package name (Tad McClellan)
    Re: Finding the directory of the current script <billy@arnis-bsl.com>
    Re: Golf problem (Leo Schalkwyk)
    Re: HELP ME PLEASE !!!! <dmeyers@panix.com>
    Re: How can I use perl to print $ in a string? jinrai@my-deja.com
    Re: how can perl know what url it is using (Rafael Garcia-Suarez)
    Re: How to change Solaris user password <red_orc@my-deja.com>
        How to get the PID of a process startet by system()? <herz.s@zdf.de>
        HTML::Parser docs and homepage sm108@hotmail.com
    Re: HTML::Parser docs and homepage rmore1@my-deja.com
        I am looking for a local Mongers group in South Jersey. garymgordon@yahoo.com
    Re: I am looking for a local Mongers group in South Jer <care227@attglobal.net>
        interpreting system() returned numbers dbottoms98@my-deja.com
    Re: interpreting system() returned numbers <care227@attglobal.net>
    Re: Joining lines (Tad McClellan)
    Re: Joining lines (Tad McClellan)
        Need help with IIS configuration for Perl script suppor <ekjolsrud@ipares.no>
    Re: Need help with IIS configuration for Perl script su <yuanjieNOyuSPAM@netscape.net.invalid>
    Re: Need help with IIS configuration for Perl script su <ekjolsrud@ipares.no>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 29 Jun 2000 08:38:52 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: $_ and @_ use?
Message-Id: <395B516C.3A943FA6@home.com>

Kirill Miazine wrote:
> 
> On Wed, 28 Jun 2000, Alun Moon wrote:
> 
> # I've been trying to learn more about using $_ and @_ as default
> # parameters and returns from functions.
> #
> # Largely trial and error so far.
> #
> # Do they work with things like
> #
> # while(shift){
> #   # do something
> # }
> #

Sure. There's nothing magic about the while() loop that would make
shift() behave any differently. Of course, you should carefully consider
whether or not you *want* the behavior you'll get here. See below.
 
> I don't think it's possible:

Possible, yes. Useful? Maybe not.
 
> this would'n print anythig useful:
> perl -e '&foo(1,2,3,4);sub foo { while(shift) {print "$_\n"}}'

No, but it does execute the loop for each element in the list. It's just
the a bare 'shift' throws the return value away, so the $_ is undefined.
The data in the list is therefore meaningless, only its length is
important. Probably not what you want 99% of the time, but it could be
useful one day.

To the OP: Read the docs on individual functions to see what, if
anything, they do with $_ and @_. Most Perl hackers like using default
args because we're a lazy lot and it saves keystrokes. There is some
dissent on this issue, though. Use of default parameters makes your
program terser and harder to read, at least for less experienced
programmers. If you're writing code that somebody else is going to have
to maintain, try to err on the side of verbosity and clarity instead of
obfuscating things by playing Perl golf.

-mjc


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

Date: Thu, 29 Jun 2000 09:26:45 -0500
From: Tom Briles <sariq@texas.net>
Subject: ***Do not use this code!*** Re: Perl Help Please!
Message-Id: <395B5CA5.57971130@texas.net>

Paul Taylor wrote:
> 
> Magic wrote:
> >
> >         I need a simple script which will let me do this:
> >
> > If I call it using
> > "myscript.cgi?WORD=CHEESE&PAGE=page3.html"
> >
> > then it will send page3.html to the browser replacing all occurrences
> > of "!THE_WORD!" with "CHEESE".
> >
> > Does anyone have a script like that which I could look at?
> 
> Here you go skate-boy (assuming you're using CGI.pm, which you should).

<Snipped perhaps the most dangerous code I have ever seen posted to a
Perl newsgroup, in the hopes that it will only be archived once.>

DO NOT USE THE CODE IN THE POST TO WHICH I AM REPLYING!!!

It could *very, very* easily be used for evil purposes!

To the poster of said code:  *Submit a cancellation immediately*, and
we'll hope for the best.

Geez...frickin' amazing.

- Tom


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

Date: Thu, 29 Jun 2000 15:31:37 +0100
From: Paul Taylor <pap@NOTHEREsotonians.org.uk>
Subject: Re: ***Do not use this code!*** Re: Perl Help Please!
Message-Id: <395B5DC9.2B74D15B@NOTHEREsotonians.org.uk>

> 
> <Snipped perhaps the most dangerous code I have ever seen posted to a
> Perl newsgroup, in the hopes that it will only be archived once.>
> 
> DO NOT USE THE CODE IN THE POST TO WHICH I AM REPLYING!!!
> 
> It could *very, very* easily be used for evil purposes!
> 
> To the poster of said code:  *Submit a cancellation immediately*, and
> we'll hope for the best.
> 
> Geez...frickin' amazing.
> 
> - Tom

In my shaky defence, this is what the guy asked for - and the script
wasn't intended to be a complete package.  It was submitted on the 
assumption that other functionality would be provided by the intended
user.

Nevertheless, I completely retract the code and hope that I haven't
upset too many people.

Pap.


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

Date: Thu, 29 Jun 2000 13:05:18 +0200
From: "Bizi" <showbiz@showbiz.8m.com>
Subject: answeraday.com
Message-Id: <8jfc7j$3p3$2@SOLAIR2.EUnet.yu>

I would like to recommend you Answer A Day at http://www.answeraday.com/ if
you would like to get questions, answers and resources for computers,
business, Internet...To subscribe to one the list send blank email to
mailto:answeraday-subscribe@topica.com or at http://www.answeraday.com/




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

Date: Thu, 29 Jun 2000 08:02:12 -0400
From: "Alex T." <samara_biz@hotmail.com>
Subject: Re: Book on Perl ASP
Message-Id: <395B3AC4.757E7005@hotmail.com>

Try "ActivePerl with ASP and ADO" by Tobias Martinsson. You can find out
more about this book from Amazon.com.
Also, try www.perlscripters.com

Alex

Bob Martin wrote:

> Can anyone recomend a book on Perl ASP?
>
> Thanks!
>
> Bob



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

Date: Thu, 29 Jun 2000 09:13:16 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Cant get perl cgi result (directly..)
Message-Id: <slrn8lmirc.2uo.tadmc@magna.metronet.com>

On Thu, 29 Jun 2000 07:13:37 GMT, omtslug@my-deja.com <omtslug@my-deja.com> wrote:

>(you see in the script further down that I make stdout
>unbuffered).


You do NOT make stdout unbuffered.

You make stdout autoflush. It is still buffered, you just
flush the buffer more often.


[snip a bunch of Jeopardy quoted text]

>> > select(STDOUT); $| = 1;

[snip a bunch more of Jeopardy quoted text]


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


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

Date: Thu, 29 Jun 2000 10:37:53 GMT
From: eastking@my-deja.com
Subject: catch error SQL
Message-Id: <8jf8u0$ja$1@nnrp1.deja.com>

Hi,every one here.

I'm using DBI and DBD::Oracle to access database. when I use following
source

	 $sth = $dbh->prepare("select foo, bar from table where
baz=?");

         $sth->execute( $baz );

         while ( @row = $sth->fetchrow_array ) {
           print "@row\n";
         }

If execution failed, How can I know the whole SQL with "?" replaced
with $baz?

I don't think following is the best idea

	my $sql = "select foo, bar from table where baz=?";

	 $sth = $dbh->prepare($sql);

         $sth->execute( $baz );

         while ( @row = $sth->fetchrow_array ) {
           print "@row\n";
         }

	$sql =~ s/\?/$baz/ ;


Thanks in advance


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 29 Jun 2000 07:11:59 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: DANGEROUS CODE ABOVE (was Re: Perl Help Please!)
Message-Id: <m13dlwo9u8.fsf_-_@halfdome.holdit.com>

>>>>> "Paul" == Paul Taylor <pap@NOTHEREsotonians.org.uk> writes:

Paul> #!/usr/bin/perl

Paul> use CGI ;

Paul> my $query = CGI::new() ;

Paul> my $word = $query->param('WORD') ;
Paul> my $page = $query->param('PAGE') ;

Paul> # Assuming you haven't printed your headers
Paul> print "Content-Type:  text/html\n\n" ;

Paul> open PAGE, $page ;

Paul> while (<PAGE>) {
Paul>   s/\!THE_WORD\!/$word/g ;
Paul>   print ;
Paul> }

So I just invoke

  http://www.your.server.org/yourscript?PAGE=rm+-rf+/+|

and you say bye bye to all your files.

Please, people.  Do NOT write code that uses params directly as filenames!
That's what *taint* mode tries to protect you against, and you failed
to use taint mode on this script!

-- 
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: Thu, 29 Jun 2000 08:05:48 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Dereferencing a two dimensional array?
Message-Id: <395B49AC.4F2F9C9B@home.com>

Shannon Jacobs wrote:
> [...] it seems that perldoc is not installed properly on either of 
> the UNIX boxes [...] "man perlref" works on the UNIX boxes

Odd, normally perldoc will find things man doesn't... You do indeed have
a SNAFU'd install.

> Actually, there is an embarrassment of riches as far as documentation
> goes. So far most of it flies over or under my head.

Then might I suggest investing in a good introductory book such as
"Learning Perl"? The docs are good, but they're intended as a reference,
not a tutorial. There are some tutorials included, though, including
'perldoc perlreftut'. Pull up 'perldoc perltoc' and 'perldoc perl' for a
good overview of what's available.

> My current feeling about Perl is that I'm using a trench mortar 
> to kill flies.

Heh. Interesting analogy, but Perl is well suited to small problems. The
problem may be in your approach. I know I did lots of dumb, brute force
things before I learned enough of Perl to be more elegant. (I still use
a hammer sometimes, but at least it's a smaller one.)

> > See 'perldoc strict'
> 
> I've been through that section several times and still can't 
> figure out if it will help. I have also experimented with it,
> and I can say that it didn't *seem* to be helpful, but the 
> explanation is still fluttering about overhead.

Hrmph. Well, let it soak a while and then read it over again. You seemed
to expect $reslist and $results to be the same thing, and I just
wondered if one name was a typo for the other. If so, 'strict' will try
to warn you by forcing you to predeclare your variables and squawking if
only use a variable once.

-mjc


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

Date: Thu, 29 Jun 2000 08:31:01 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: explicit package name
Message-Id: <slrn8lmgc5.2uo.tadmc@magna.metronet.com>

On Thu, 29 Jun 2000 09:18:33 GMT, maroun234@my-deja.com <maroun234@my-deja.com> wrote:

>
>I'm trying to compile a perl file.
>I'm getting the following messge:
>Global symbol '$HOST' requires explicit package name at line 50


Have you already looked up the message in perldiag.pod?


>line 50 has: my $HOST = 'private@201.43.2.2';
              ^^
              ^^ $HOST is lexically scoped


>anyone has any ideas?


If you are really getting that message with that code, then
it looks like a bug in perl (but I doubt it).

(It is much more likely that there is something that you are
 not telling us...
)


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


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

Date: Thu, 29 Jun 2000 14:24:08 GMT
From: Ilja Tabachnik <billy@arnis-bsl.com>
Subject: Re: Finding the directory of the current script
Message-Id: <8jfm5j$a5t$1@nnrp1.deja.com>

In article <8jbi4t$94r$1@nnrp1.deja.com>,
  conic@bigpond.com wrote:
> Is there a way for a script to realise what directory it is in?  I
want
> to examine files that are in the same directory as the script, but
also
> to be able to move the script to any directory without changing it.
>

If you are on Unix, them you may find Unix Programming FAQ
http://www.faqs.org/faqs/unix-faq/programmer/faq/)
usefull (they are C-centric but the main idea is the same
for any language):

qq(

1.14 How can I find a process' executable file?
===============================================

This would be a good candidate for a list of `Frequently Unanswered
Questions', because the fact of asking the question usually means that
the design of the program is flawed. :-)

You can make a `best guess' by looking at the value of `argv[0]'.
If this contains a `/', then it is probably the absolute or relative
(to the current directory at program start) path of the executable.
if it does not, then you can mimic the shell's search of the `PATH'
variable, looking for the program.  However, success is not guaranteed,
since it is possible to invoke programs with arbitrary values of
`argv[0]', and in any case the executable may have been renamed or
deleted since it was started.

If all you want is to be able to print an appropriate invocation name
with error messages, then the best approach is to have `main()' save the
value of `argv[0]' in a global variable for use by the entire program.
While there is no guarantee whatsoever that the value in `argv[0]' will
be meaningful, it is the best option available in most circumstances.

The most common reason people ask this question is in order to locate
configuration files with their program. This is considered to be bad
form; directories containing executables should contain *nothing* except
executables, and administrative requirements often make it desirable for
configuration files to be located on different filesystems to
executables.

A less common, but more legitimate, reason to do this is to allow the
program to call `exec()' *on itself*; this is a method used (e.g. by
some versions of `sendmail') to completely reinitialise the process
(e.g. if a daemon receives a `SIGHUP').

1.14.1 So where do I put my configuration files then?
-----------------------------------------------------

The correct directory for this usually depends on the particular
flavour of Unix you're using; `/var/opt/PACKAGE', `/usr/local/lib',
`/usr/local/etc', or any of several other possibilities.  User-specific
configuration files are usually hidden `dotfiles' under `$HOME' (e.g.
`$HOME/.exrc').

From the point of view of a package that is expected to be usable across
a range of systems, this usually implies that the location of any
sitewide configuration files will be a compiled-in default, possibly
using a `--prefix' option on a configure script (Autoconf scripts do
this).  You might wish to allow this to be overridden at runtime by an
environment variable.  (If you're not using a configure script,
then put the default in the Makefile as a `-D' option on compiles,
or put it in a `config.h' header file, or something similar.)

User-specific configuration should be either a single dotfile under
`$HOME', or, if you need multiple files, a dot-subdirectory.  (Files or
directories whose names start with a dot are omitted from directory
listings by default.) Avoid creating multiple entries under `$HOME',
because this can get very cluttered. Again, you can allow the user to
override this location with an environment variable. Programs should
always behave sensibly if they fail to find any per-user configuration.

);

Ilja.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 29 Jun 2000 10:53:33 GMT
From: schalkwy@minnie.molgen.mpg.de (Leo Schalkwyk)
Subject: Re: Golf problem
Message-Id: <8jf9rd$eic7$1@fu-berlin.de>

Jack Applin (neutron@fc.hp.com) wrote:
: Gwyn Judd <tjla@guvfybir.qlaqaf.bet> wrote:

: >      perl -F// -ane 'my%c;@c{@F}=1;@F*keys%c==121&&print' /usr/dict/words

: This is shorter:

:        perl -pe '$_=""if/(.).*\1/||11-length' /usr/dict/words

that is not only the shortest by far, it's also perfectly readable
code.  Wins the 'short,sweet,and perlish' prize!

the only I could think of to make it shorter is cheating:

awk '!/(.).*\1/&&length==10' 

Leo (running for cover)



--
------------------------------------------------------------
         schalkwy@molgen.mpg.de


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

Date: 29 Jun 2000 11:04:09 -0400
From: David Meyers <dmeyers@panix.com>
Subject: Re: HELP ME PLEASE !!!!
Message-Id: <yobya3o4jh2.fsf@panix6.panix.com>

Jakob Schmidt <sumus@aut.dk> writes:

> So to get the scripts living-dir you actually have to use
> 
> ( $mydir ) = $0 =~ m#^(.*)/[^/]+$#;

use FindBin qw($Bin);


--d


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

Date: Thu, 29 Jun 2000 14:26:00 GMT
From: jinrai@my-deja.com
Subject: Re: How can I use perl to print $ in a string?
Message-Id: <8jfm9q$96l$1@nnrp2.deja.com>

In article <8jchql$9mt$1@newton3.pacific.net.sg>,
  "shaohong" <chenshaohong@sim.edu.sg> wrote:
> Hi,
>
> Since $ is a reserve character in Perl. If I
want to print $ in a string,
> for example I want to print " Total amount is
S$100", I only get the result
> "Total amount is S", $100 is missing!
>
> Need your help. Thanks.
>
> shaohong
>
>
You escape it with a backslash like so print
"\$100"; would print $100.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 29 Jun 2000 12:06:12 GMT
From: garcia_suarez@hotmail.com (Rafael Garcia-Suarez)
Subject: Re: how can perl know what url it is using
Message-Id: <slrn8lmf5i.iir.garcia_suarez@rafael.kazibao.net>

Tony Shrimpoton wrote in comp.lang.perl.misc:
>hi ,
>
>i am writing an web site at the moment , and becasue it is sending user and
>credit card info about i am running it on a 128bit ssl cert
>
>my question is  , how can i get my perl cgi script to know that is is
>running on https:// and not http:// ?? because i want the script to ent if
>it is on a http:// cannection

Your web server probably sets some environment variables when it serves
https pages. You can then retrieve them from your perl script via the %ENV
hash. Look into your server's docs for more info.

-- 
Rafael Garcia-Suarez


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

Date: Thu, 29 Jun 2000 13:14:43 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: How to change Solaris user password
Message-Id: <8jfi3j$6t8$1@nnrp1.deja.com>

In article <8jdvb9$gn8$1@orpheus.gellyfish.com>,
  Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> On Wed, 28 Jun 2000 09:15:24 GMT alexyuen2092@my-deja.com wrote:
> >
> >
> > P.S. please email me at alexyuen2092@my-deja.com as I could not do
> > frequent access to this newsgroup.
> >
>
> And I have infrequent access to email so what do we do now ?
>
> /J\

particularly since the OP has to visit deja.com to get the email anyway
 . . .


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 29 Jun 2000 16:22:23 +0200
From: Stefan <herz.s@zdf.de>
Subject: How to get the PID of a process startet by system()?
Message-Id: <395B5B9F.1DAFF438@zdf.de>

Hello,

on Sun/Solaris i'm starting java programs with perl scripts.
 ...
system("java myprogram");
echo "PID: ?"
 ...

How can i get the PID of this java process, not of the script ?
When i do this with a bash script i can use $!.

Regards
Stefan





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

Date: Thu, 29 Jun 2000 09:56:46 GMT
From: sm108@hotmail.com
Subject: HTML::Parser docs and homepage
Message-Id: <8jf6gq$v20$1@nnrp1.deja.com>

Hello everyone,

I would like to start using the HTML::Parser module for various tasks,
but I found the documentation a bit "light" for such a complex module.
I've been all over CPAN, and I've tried to find a reference home page,
but no joy.
Does anyone know of good tutorials for the module?

Thank you in advance -

Steve


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 29 Jun 2000 12:19:41 GMT
From: rmore1@my-deja.com
Subject: Re: HTML::Parser docs and homepage
Message-Id: <8jfesg$4i9$1@nnrp1.deja.com>

In article <8jf6gq$v20$1@nnrp1.deja.com>,
  sm108@hotmail.com wrote:
> Hello everyone,
>
> I would like to start using the HTML::Parser module for various tasks,
> but I found the documentation a bit "light" for such a complex module.
> I've been all over CPAN, and I've tried to find a reference home page,
> but no joy.
> Does anyone know of good tutorials for the module?
>
> Thank you in advance -
>
> Steve
The most recent version of The Perl Journal has a very good article
about HTML::Parser

http://www.itknowledge.com/tpj/

--
=============================
Richard More
http://www.richmore.com/


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 29 Jun 2000 11:49:15 GMT
From: garymgordon@yahoo.com
Subject: I am looking for a local Mongers group in South Jersey.
Message-Id: <8jfd3l$39t$1@nnrp1.deja.com>

I am looking to join a local Mongers group in South Jersey.

I would also like to know if any member of a Mongers group feel that
they are worth getting involved in.

I am new to programming in Perl and would love to join some type of
support group?  (Not like an AA group ... just for support and help in
my goal to keep learning more about Perl.)  hahahaha

ANY COMMENTS???

Gary


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 29 Jun 2000 09:45:51 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: I am looking for a local Mongers group in South Jersey.
Message-Id: <395B530F.E14769C1@attglobal.net>

garymgordon@yahoo.com wrote:
> 
> I am looking to join a local Mongers group in South Jersey.
> 

Did you check:
http://www.pm.org/groups/north_america.shtml


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

Date: Thu, 29 Jun 2000 13:35:32 GMT
From: dbottoms98@my-deja.com
Subject: interpreting system() returned numbers
Message-Id: <8jfjb2$7rt$1@nnrp1.deja.com>

Hello,

Does anyone know where to find info on the numbers returned from the
system() command in Perl.  I know it says to divide by 256 but what do
those numbers mean??  Thanks

DGB


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Thu, 29 Jun 2000 10:58:54 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: interpreting system() returned numbers
Message-Id: <395B642E.551ECBE5@attglobal.net>

dbottoms98@my-deja.com wrote:
> 
> Hello,
> 
> Does anyone know where to find info on the numbers returned from the
> system() command in Perl.  I know it says to divide by 256 but what do
> those numbers mean??  Thanks

Depends on the program you are executing or the environment it is
being executed under.  Nothing to do with Perl.


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

Date: Thu, 29 Jun 2000 09:26:18 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Joining lines
Message-Id: <slrn8lmjjq.2uo.tadmc@magna.metronet.com>

On Wed, 28 Jun 2000 19:21:37 -0400, Rick Stricker <webmaster@[spamblock]web-slingers.com> wrote:

>That's the reply I'd expect from someone who doesn't know
>the answer.


Eh?

He _did_ answer your question (join).

What on Earth are you talking about?


Rick, meet killfile.

killfile, meet Rick.


>Nobody asked for a complete app, just a code snippet.


Eh?

He _did_ give code snippets.

There is another code snippet showing how to use join() in the
docs that you were referred to. Did you try reading them?

What on Earth are you talking about?


>That's the purpose of Usenet, BTW


The purpose of Usenet is NOT to read the docs to you.

You can do that yourself. No need to tie up hundreds (thousands?)
of people and thousands of computers when the docs are already
on your hard disk...


All you need to know is _what_ docs to read, which Dan
has provided!


We now proceed with the Twilight Zone timing of this followup.

( first thing fourth
  second thing third
  third thing first
  fourth thing second
)


>.
>Dan Manion wrote in message ...
>>## First step ... open your file
>>open (FILE, "bigassfile") || die "open error: $!";
>>my @ALL = <FILE>;
>>close (FILE);
>>## SEE perldoc -f open
>>
>>##2nd step ... use chomp.
>>chomp(@ALL);
>>## SEE perldoc -f chomp
>>
>>##3rd Step ... use join.
>>my $str = join('',@ALL);
>>##perldoc -f join
>>
>>
>>There are tons of great books and online documentation on learning perl.
>>Might be worth your time to go find some good bathroom reading material and
>>start to tackle some of the basics.
>>
>>Hope this helps!
>>
>>"R.Roe" <rroe@mail.com> wrote in message
>>news:8F617E505rroemailcom@64.34.205.9...
>>> I would appreciate help with with the following:
>>> I need to convert a text file containing several lines which have
>carriage
>>> returns at the end, into one long string by joining the lines. How do I
>>write
>>> the perl code for this please?
>>>
>>> Thanks in advance.



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


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

Date: Thu, 29 Jun 2000 09:37:03 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Joining lines
Message-Id: <slrn8lmk7v.2uo.tadmc@magna.metronet.com>

On Wed, 28 Jun 2000 19:21:16 -0400, Rick Stricker <webmaster@[spamblock]web-slingers.com> wrote:

>That's the reply I'd expect from someone who doesn't know
>the answer.


And _you_ don't know the answer either, yet you have posted
*twice* to this thread.

You have wasted much more time than either of the people
that you have followed up to!


So where do _you_ answer the question?


(things are a bit different in the Big 8 newsgroups, not much
 like the alt.* wasteland...

   http://www.visi.com/~barr/alt-creation-guide.html
)


>Lighten up, Paul.  Nobody asked for a complete app, just
>a code snippet.  That's the purpose of Usenet, BTW.


Did you forget to include your code snippet?


>Paul Taylor wrote in message <395A267B.FB3AC977@NOTHEREsotonians.org.uk>...
>>"R.Roe" wrote:
>>>
>>> I would appreciate help with with the following:
>>> I need to convert a text file containing several lines which have
>carriage
>>> returns at the end, into one long string by joining the lines. How do I
>write
>>> the perl code for this please?
>>>
>>> Thanks in advance.
>>
>>Honestly, if you want someone to code it for you, go hire a programmer.
>>
>>Or read the fabulous manual page.  Or O'Reilly's books.


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


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

Date: Thu, 29 Jun 2000 13:42:19 GMT
From: "Eirik Kjølsrud" <ekjolsrud@ipares.no>
Subject: Need help with IIS configuration for Perl script support
Message-Id: <%mI65.820$Dxe.180658688@news.telia.no>

Hi!

I have to use an old perl-script to manage japanese e-mails on a commercial
site I administer. I don't have any experience with perl, but fortunately,
at this point, all I have to do is set up IIS to support perl-scripts.
What I have done is :

- downloaded and installed a perl-interpreter (perl ver 5.001, perl for
Win32 build 107)

- executed the script via the interpreter, which worked fine

- tried to enable perl-scripts in IIS, without luck. I followed the steps in
a tutorial and made a virtual directory containing the script. The directory
is enabled for execution of scripts. In the application setting I mapped the
 .pl extension with the perl.exe file and made it a 'script engine'. I have
checked that users have NTFS-permissions to execute the script. What happens
when I try to launch the script in a browser is that the page starts
loading, but nothing ever happens and eventually it gives an error message
explaining that the page cannot be displayed.

If anyone knows what I might try or what I have done wrong or any other
method of supporting perl-scripts in IIS it would be of great help!!

Eirik Kjølsrud




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

Date: Thu, 29 Jun 2000 06:49:25 -0700
From: yuanj <yuanjieNOyuSPAM@netscape.net.invalid>
Subject: Re: Need help with IIS configuration for Perl script support
Message-Id: <08f18e68.e583c76e@usw-ex0102-014.remarq.com>

A lot of things could have been wrong.  I'd make sure that the
script will produce a line at the very beginning of its output
as the following:

Content-type: text/html

and a blank line after this line, before your real web page
content.  Without these lines, IIS doesn't deliver properly.


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

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: Thu, 29 Jun 2000 14:25:02 GMT
From: "Eirik Kjølsrud" <ekjolsrud@ipares.no>
Subject: Re: Need help with IIS configuration for Perl script support
Message-Id: <2%I65.827$Dxe.180478464@news.telia.no>

Here's a copy of the .pl file I tried to access. The sendmail program works
just fine with the perl interpreter.

$| = 1;
print "Content-type: text/html\n\n";
print "<html><body>\n";
print "Sending message<br>\n";
print "</body></html>\n";

$mailprog = 'sendmail.exe';

open (MAIL, "|$mailprog -t");
print MAIL "To: Your Name <name\@host.com>\n";
print MAIL "From: My Name <myname\@myhost.com>\n";
print MAIL "Subject: This is the subject\n\n";

print MAIL "This is the body of the message\n";
print MAIL "This is line 2\n";
close (MAIL);

Do you have any suggestions on another perl-script I can run to isolate the
problem and make sure there is nothing wrong with the perl-script ??

Eirik




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

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

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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


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