[24414] in Perl-Users-Digest
Perl-Users Digest, Issue: 6602 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 24 18:06:00 2004
Date: Mon, 24 May 2004 15:05:10 -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 Mon, 24 May 2004 Volume: 10 Number: 6602
Today's topics:
[ANN] Perl6::Binding 0.0601 Uploaded to CPAN <kevin@vaildc.net>
Re: ActiveState Perl mangles text files <matthew.garrish@sympatico.ca>
Re: ActiveState Perl mangles text files (Jim Keenan)
Re: Cannot launch simple applications (notepad, java) u <gnari@simnet.is>
Re: Equivalent of the Mid function from VB? <tore@aursand.no>
Re: filter in perl (Anno Siegel)
How to acces all of the archieves of google using perl (alex)
Re: How to acces all of the archieves of google using p (Walter Roberson)
Re: How to detect $CORE::GLOBAL:: overrides? (Anno Siegel)
Re: How to detect $CORE::GLOBAL:: overrides? <usenet@morrow.me.uk>
Re: How to detect $CORE::GLOBAL:: overrides? <usenet@morrow.me.uk>
Re: How to detect $CORE::GLOBAL:: overrides? (Anno Siegel)
Re: How to pass input from perl to shell programming? (Swamy)
Re: How to substitute a variable containing a directory <brian_helterline@hp.com>
Re: Inserting variable within <<EOL <raisin@delete-this-trash.mts.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 23 May 2004 02:00:31 GMT
From: Kevin Michael Vail <kevin@vaildc.net>
Subject: [ANN] Perl6::Binding 0.0601 Uploaded to CPAN
Message-Id: <Hy8Knr.1v5r@zorch.sf-bay.org>
Version 0.0601 corrects a problem whereby the dependencies in
Makefile.PL didn't get carried over when I switched from using RCS to
using CVS. Duh.
This module creates lexical aliases to items that can be either lexical
or dynamic. For example, after this statement:
my $foo := $array[2];
both $foo and $array[2] refer to the same value. If you take references
to both items, you'll discover that \$foo eq \$array[2]. Changing
either of them changes the other.
You can also alias entire arrays or hashes:
my @bar := @$arrayref;
my %baz := %{$hoh{'element1'}->{'subelement'}};
You can also alias the contents of an array or a hash, or an array or
hash slice.
my ($foo, @bar, %baz) := *@array;
In the above, $array[1] must be an array reference, and $array[2] must
be a hash reference.
When aliasing the contents of a hash, the names of the aliased
variables determine the hash members that are aliased. The following
two statements have identical effects.
my ($foo, @bar, %baz) := *%hash;
my ($foo, @bar, %baz) := @hash{qw/foo bar baz/};
This version is still an alpha version, released so that I can get some
feedback
on bugs and on the general functionality of the module.
Version 0.02 fixed some minor problems.
Version 0.03 gets the prerequisites right in Makefile.PL.
Version 0.04 corrects a number of bugs, and updates the prerequisite
for PadWalker to 0.09.
Version 0.05 checks to see if a hash element exists before attempting
to create an alias for it, and modifies the tests to skip several of them
due to a problem in PadWalker with Perl 5.8.x.
Version 0.06 fixes a long-standing problem with bindings in recursive
subroutines. Basically, the underlying XS code was always binding the
variable in the first call, not the one at the current stack level.
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
DEPENDENCIES
This module requires these other modules and libraries:
Filter::Util::Call
Text::Balanced
PadWalker
COPYRIGHT AND LICENCE
Copyright 2003-2004 Kevin Michael Vail
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
--
Found Poetry (_Science News_, 14-Jun-2003): oldest _homo sapiens_ find
+-----------------------------------------+ ocean eddies' far-flung effects;
| Kevin Michael Vail <kevin@vaildc.net> | superior threads spun
+-----------------------------------------+ the pox from prairie dogs.
------------------------------
Date: Mon, 24 May 2004 11:35:15 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: ActiveState Perl mangles text files
Message-Id: <NCosc.15759$sr3.278745@news20.bellglobal.com>
"Mothra" <mothra@mothra.com> wrote in message
news:4sjsc.5175528$iA2.602959@news.easynews.com...
> Ben Morrow wrote:
>
> > Quoth Mothra <mothra@mothra.com>:
> >
> >>
> >>---------code---------
> >>
> >>#!/perl
> >
> >
> > Somehow I doubt you have perl installed as c:/perl.exe. This should
> > either be
> >
> > #!c:/perl/bin/perl
> >
> > or simply
> >
> > #!perl
> >
> And yet it still works! But the lines above worked too. I think AS
> Perl only looks for the word perl in the first line./
>
Actually, shebang lines in Windows are *almost* entirely useless (but don't
hurt for portability). The use of perl to execute your .pl files is done
through file associations (a.k.a the registry). So long as the association
is correct for the file type, you can double click on your scripts to run
them (which, in my opinion, is a useless feature unless the script is fully
debugged). XP now integrates the file associations into calls from a command
prompt, so you can get away with just using the file name. In older
versions, you need perl in your path and make an explicit call to the
executable.
All that said, perl will still check for switches like -w and -T (the latter
won't work inside a script on Windows, though). And running scripts under
Apache is a whole other story... : )
Matt
------------------------------
Date: 24 May 2004 13:52:25 -0700
From: jkeen_via_google@yahoo.com (Jim Keenan)
Subject: Re: ActiveState Perl mangles text files
Message-Id: <196cb7af.0405241252.53b880d3@posting.google.com>
Mothra <mothra@mothra.com> wrote in message news:<VWisc.16121270$Of.2688947@news.easynews.com>...
> I woudn't normally use this, but it seemed the easiest way to process my
> "Blocked Senders" list in Outlook.
>
> The code below, should be straightforward, but look at the output it
> produces when you run it on a windows text file (created in notepad).
> It seems to put blank spaces (or unprintable characters) in between each
> original character. If I write it back out to a text file, it's even worse.
>
> Anyone know (or care) why? I used to write AS Perl scripts a couple of
> years ago, and I'm sure it never did this.
>
> ---------code---------
>
> #!/perl
Unless something has changed lately, I don't think the shebang line is
relevant in AS Perl. I have the perl executable in my path and call
'perl iofile.pl' from the command line.
> use strict;
> use IO::File;
>
> my $input=IO::File->new('blocked_senders.txt', 'r');
> my @blocked_senders=<$input>;
> $input->close;
>
> foreach(@blocked_senders){
> print $_ . "\n";
> }
>
Since you didn't supply 'blocked_senders.txt' I had to make some
assumptions as to how it looked. Assumptions: (1) Single '\n' at end
of line rather than two; (2) All lines flush against left margin
rather than starting with 2 wordspaces; (3) Eliminate '?_' garbage on
first e-mail address; (4) eliminate all wordspaces. In other words:
##### START ASSUMED SOURCE (blocked_senders.txt) #####
shemeka@telia.com
carlos_morrisif@bev.com
diamond.8918.54352@m-t-n.com
dyne@youareinvitedto.com
fdidwp@fluchtreaktion.de
fftya0udj@widomaker.com
gannonpalma@wanadoo.fr
joanbogacki@winterhighland.co.uk
krysta_higgins@tekmailer.com
kwlrkkfhlp@163.net
leopmzt@163.net
lzhr@24horas.com
michaeldart@rojname.com
noreply@tickle-inc.com
pnrwnpeml@msn.com
smart0solomon@uswest.net
thawnnabolek@acrobatmail.com
timklotto2@netscape.net
##### END ASSUMED SOURCE #####
Once I cleaned up the source, I ran your code, the only peculiarity I
noticed was that the output came out with line-returns rather than
one. Not surprising, because there was no 'chomp' in the 'foreach'
loop.
foreach(@blocked_senders) {
chomp;
print $_ . "\n";
}
So your Perl code does not appear to be the problem per se (unless I'm
missing something).
Jim Keenan
------------------------------
Date: Mon, 24 May 2004 18:33:43 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: Cannot launch simple applications (notepad, java) using Apache and PERL(CGI)
Message-Id: <c8tf2s$b9v$1@news.simnet.is>
"JDS" <jds@iti-oh.com> wrote in message
news:6b2d6822.0405240618.cccf714@posting.google.com...
[snip top posting]
[remove non-existent newsgroup from header]
>
> What beats me is the fact that I cannot launch an application on the
> same machine- I should be able to run the 4 lines of code to start a
> notepad through the webserver. At this point, it is sufficient for my
> demo purposes to be able to launch an application using Apache and
> Perl as mentioned in my email.
>
I do not know about Apache under windows, but under real operating
systems, there is the issue of privilege. the cgi scripts may not
have the required priviledges to launch a windows application.
gnari
------------------------------
Date: Mon, 24 May 2004 17:25:46 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: Equivalent of the Mid function from VB?
Message-Id: <pan.2004.05.24.14.58.33.942035@aursand.no>
On Mon, 24 May 2004 15:58:28 +0100, Connell Gauld wrote:
> I'm trying to grab a section from a piece of text and I was wondering if
> there was an equivalent to Visual Basic's Mid function in perl.
> Basically it takes a start index (as a number of characters from the
> beginning of the string) and a similar end index and returns the text
> between them.
perldoc -f substr
substr EXPR,OFFSET,LENGTH,REPLACEMENT
substr EXPR,OFFSET,LENGTH
substr EXPR,OFFSET
Extracts a substring out of EXPR and returns it. First charac-
ter is at offset 0, or whatever you've set $[ to (but don't do
that). If OFFSET is negative (or more precisely, less than
$[), starts that far from the end of the string. If LENGTH is
omitted, returns everything to the end of the string. If
LENGTH is negative, leaves that many characters off the end of
the string.
[...]
--
Tore Aursand <tore@aursand.no>
"Why shouldn't truth be stranger than fiction? Fiction, after all, has
to make sense." (Mark Twain)
------------------------------
Date: 24 May 2004 15:05:37 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: filter in perl
Message-Id: <c8t301$5bh$1@mamenchi.zrz.TU-Berlin.DE>
Andrea Spitaleri <spiritelllo@interfree.it> wrote in comp.lang.perl.misc:
> Hi everyone,
> I need to confirm a my doubt.
> I use to make filter which they work perfectly. I am wondering if the
> style of these scripts are perl-fashion or not. Ex in.txt:
>
> home
> dog
> cat
> home
> car
> bus
> etc
> etc
>
> to grab the text from "home" to other "home" I use to do:
>
> while(<>){
> if(/^home/){
> print;
> while(<>){
> print;
> if(/^home/){
> exit;
> }}}}
> to get:
>
> home
> dog
> cat
> home
> but is not really perl style, i should say. any suggestion?
Most of all you're lacking indentation and white space.
while ( <> ) {
if ( /^home/ ) {
print;
while(<>){
print;
if(/^home/){
exit;
}
}
}
}
> btw, in such way I print also the last line starting with home. If I
> don't want print it?? so like:
>
> home
> dog
> cat
Then swap the last "if" clause and the following "print" line.
Using "exit" to break out of a loop is overkill (you can take that
literally, it kills your program). Give the outer loop a label, say
"LOOP:", and replace "exit" with "last LOOP".
But you don't need deeply nested loops for this:
my $printing;
while ( <DATA> ) {
$printing = ! $printing if /^home/;
print if $printing;
}
does the same thing.
Anno
------------------------------
Date: 24 May 2004 13:15:08 -0700
From: zhangchl_2000@yahoo.com (alex)
Subject: How to acces all of the archieves of google using perl and NNTP protocal? help
Message-Id: <50a47555.0405241215.5f3f8927@posting.google.com>
hi,
I want to download the archieves of one newsgroup and analyse them?
Does anybody know how to get all the news? my local server just store
the late news. IF anybody know the google server name, that could
help. And thanks.
------------------------------
Date: 24 May 2004 20:21:04 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: How to acces all of the archieves of google using perl and NNTP protocal? help
Message-Id: <c8tlfg$knr$1@canopus.cc.umanitoba.ca>
In article <50a47555.0405241215.5f3f8927@posting.google.com>,
alex <zhangchl_2000@yahoo.com> wrote:
: I want to download the archieves of one newsgroup and analyse them?
:Does anybody know how to get all the news? my local server just store
:the late news. IF anybody know the google server name, that could
:help. And thanks.
Google has multiple servers, and they don't give out nntp feeds
(at least not casually.) Google also places limits on the number of
hits that may be generated per query (about 1000.)
Google does not carry *all* the news. There's a flag you can set
in your headers (or as the first line of your posting) to cause
google to ignore the posting.
Depending how far back you need to go, you might find Supernews
adequate.
--
This is not the same .sig the second time you read it.
------------------------------
Date: 24 May 2004 16:24:52 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to detect $CORE::GLOBAL:: overrides?
Message-Id: <c8t7kk$9c1$1@mamenchi.zrz.TU-Berlin.DE>
David Coppit <newspost@coppit.org> wrote in comp.lang.perl.misc:
> Greetings!
>
> Does anyone know a way that I can detect whether *CORE::GLOBAL::die has
> been overridden? \&CORE::GLOBAL::die ne \&CORE::die, so I'm not sure how
> to handle it.
>
> The reason I ask is that I'm trying to workaround some bizarre behavior in
> the following code:
With due respect, it is rather your attempt at overriding that looks
bizarre. Where did you get the idea that this is how it's done?
> my $OLD_DIE;
> BEGIN
> {
> # Store any previously overwritten die
> $OLD_DIE = \&CORE::GLOBAL::die;
Have you actually read the paragraph about overriding in perlsub? It says
explicitly that "GLOBAL::die" is not a sub, and you can't take references
to it. "CORE::GLOBAL::die" doesn't even exist unless you create it
there.
> *CORE::GLOBAL::die = \&my_die;
Where did you get that from? You *import* your "die" function into
CORE::GLOBAL if you want "die" overridden. Run-time overwriting of
the sub does nothing for you. Again, perlsub expressly says so.
> }
>
> sub my_die
> {
> # do some stuff
> &$OLD_DIE(@_);
> }
>
> If CORE::GLOBAL::die has already been overwritten, it works as expected.
Well, yes. Someone else has set up things so that die( ...) calls
CORE::GLOBAL::die( ...), so if you change what CORE::GLOBAL::die does,
the modified version gets called. Without such prior setup, it isn't
called.
> However, if it hasn't, then my_die gets called instead of CORE::die.
> (Somehow $OLD_DIE is being set to my_die?!)
That's general behavior of subs. You can first say "$x = \ &foo", then
define "sub foo { ...}", and then call it through "$x->( ...)". It's
the same mechanism that Perl uses to resolve forward references to
subs in ordinary code.
> I figured if I could detect that it wasn't overridden, then I can directly
> call CORE::die and avoid the infinite recursion.
There's no need to. With overriding, the mechanism to call the original
is already in place, you don't have to keep your own coderefs around
(which you don't get anyway). Just call CORE::die (not CORE::GLOBAL::die)
in your overriding code (and elsewhere) as needed.
Overriding is done through importation (at compile time, there is no
other way). Importation can be simulated with "use vars ..." and
subsequent definition of a corresponding sub if you want to avoid the
overhead of an extra module. Here is an example, using "warn" instead
of "die", so wed can have two calls per run:
{
# package CORE::GLOBAL;
use subs qw( warn);
# add "+++" to the text
sub warn { CORE::warn '+++' . shift() . '+++' }
}
warn 'in main'; # always modified
package Other;
warn 'in Other'; # only modified if die() is in CORE::GLOBAL
The bare block is only there to limit the scope of "package". If
the "package"-statement is commented out as shown, the sub "warn" is in
package main, and "warn" is only overridden there. If it is active,
"warn" is defined in CORE::GLOBAL and overrides the behavior everywhere.
In both cases, the original function is called through "CORE::warn"
without further measures.
Anno
------------------------------
Date: Mon, 24 May 2004 17:31:31 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: How to detect $CORE::GLOBAL:: overrides?
Message-Id: <c8tbhj$586$1@wisteria.csv.warwick.ac.uk>
Quoth David Coppit <newspost@coppit.org>:
> Greetings!
>
> Does anyone know a way that I can detect whether *CORE::GLOBAL::die has
> been overridden? \&CORE::GLOBAL::die ne \&CORE::die, so I'm not sure how
> to handle it.
>
> The reason I ask is that I'm trying to workaround some bizarre behavior in
> the following code:
>
> my $OLD_DIE;
> BEGIN
> {
> # Store any previously overwritten die
> $OLD_DIE = \&CORE::GLOBAL::die;
>
> *CORE::GLOBAL::die = \&my_die;
> }
>
> sub my_die
> {
> # do some stuff
> &$OLD_DIE(@_);
> }
>
> If CORE::GLOBAL::die has already been overwritten, it works as expected.
> However, if it hasn't, then my_die gets called instead of CORE::die.
> (Somehow $OLD_DIE is being set to my_die?!)
>
> I figured if I could detect that it wasn't overridden, then I can directly
> call CORE::die and avoid the infinite recursion.
The CORE::GLOBAL:: subs are not the actual builtins. There is no way to
take a ref to the actual builtin; rather, what happens is when perl is
compiling and it finds a builtin, it checks the CORE::GLOBAL:: namespace
and inserts a sub call rather than a builtin if the sub exists.
When you take a ref to a sub which isn't defined yet, a special sort of
auto-vivification takes place: the ref returned is one which will be
valid for the sub when it is defined. This is why the ref you've got
refers to your sub.
What you could do is this:
use subs qw/my_die call_old_die/;
BEGIN {
my $OLD_DIE =
defined &CORE::GLOBAL::die ? \&CORE::GLOBAL::die : undef;
*CORE::GLOBAL::die = \&my_die;
sub call_old_die {
if ($OLD_DIE) {
goto &$OLD_DIE;
}
else {
CORE::die @_;
}
}
}
sub my_die {
#...
call_old_die @_;
}
, but it would almost certainly be better to use $SIG{__DIE__}. See the
mention of $^S in perlvar for an important warning.
Ben
--
'Deserve [death]? I daresay he did. Many live that deserve death. And some die
that deserve life. Can you give it to them? Then do not be too eager to deal
out death in judgement. For even the very wise cannot see all ends.'
ben@morrow.me.uk
------------------------------
Date: Mon, 24 May 2004 17:34:49 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: How to detect $CORE::GLOBAL:: overrides?
Message-Id: <c8tbnp$586$2@wisteria.csv.warwick.ac.uk>
Quoth anno4000@lublin.zrz.tu-berlin.de (Anno Siegel):
> David Coppit <newspost@coppit.org> wrote in comp.lang.perl.misc:
> > Greetings!
> >
> > Does anyone know a way that I can detect whether *CORE::GLOBAL::die has
> > been overridden? \&CORE::GLOBAL::die ne \&CORE::die, so I'm not sure how
> > to handle it.
> >
> > The reason I ask is that I'm trying to workaround some bizarre behavior in
> > the following code:
>
> With due respect, it is rather your attempt at overriding that looks
> bizarre. Where did you get the idea that this is how it's done?
Umm... that is how overriding is done. Importing a function into
CORE::GLOBAL is just a nicer wrapper around the *.. = \&.. assignment.
Ben
--
I must not fear. Fear is the mind-killer. I will face my fear and
I will let it pass through me. When the fear is gone there will be
nothing. Only I will remain.
ben@morrow.me.uk Frank Herbert, 'Dune'
------------------------------
Date: 24 May 2004 18:53:53 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to detect $CORE::GLOBAL:: overrides?
Message-Id: <c8tgc1$dm9$1@mamenchi.zrz.TU-Berlin.DE>
Ben Morrow <usenet@morrow.me.uk> wrote in comp.lang.perl.misc:
>
> Quoth anno4000@lublin.zrz.tu-berlin.de (Anno Siegel):
> > David Coppit <newspost@coppit.org> wrote in comp.lang.perl.misc:
> > > Greetings!
> > >
> > > Does anyone know a way that I can detect whether *CORE::GLOBAL::die has
> > > been overridden? \&CORE::GLOBAL::die ne \&CORE::die, so I'm not sure how
> > > to handle it.
> > >
> > > The reason I ask is that I'm trying to workaround some bizarre behavior in
> > > the following code:
> >
> > With due respect, it is rather your attempt at overriding that looks
> > bizarre. Where did you get the idea that this is how it's done?
>
> Umm... that is how overriding is done. Importing a function into
> CORE::GLOBAL is just a nicer wrapper around the *.. = \&.. assignment.
The assignment is necessary, but not sufficient. To be effective,
it must happen at compile time (any assignment, not necessarily of
the eventual code), and it must happen in a different package.
Otherwise no overriding is done, and you get "ambiguous call" warnings
instead. "use subs ...", as shown in perlsub, is the standard way
of introducing overriding without importation.
Further, it is not necessary, and even futile to capture
\ &CORE::GLOBAL::foo. The attempt, in face of the explicit
... Even though it looks like a regular function call, it
isn't: you can't take a reference to it, such as the incorrect
"\&CORE::open" might appear to produce.
is what struck me as bizarre, not the typeglob assignment per se.
Anno
------------------------------
Date: 24 May 2004 10:16:57 -0700
From: swamyb@hotmail.com (Swamy)
Subject: Re: How to pass input from perl to shell programming?
Message-Id: <1aaaeaf0.0405240916.b70ffcd@posting.google.com>
swamyb@hotmail.com (Swamy) wrote in message news:<1aaaeaf0.0405210846.302f71dd@posting.google.com>...
> I have a perl program which executes a shell program using system
> call. This shell program needs user input for several questions it
> asks. How can I automate the user input so that user don't have to key
> in the input?
>
> thanks
> Swamy
Thanks a lot for your advice. I found IO->React more useful which is
docmented in CPAN.
regards
swamy
------------------------------
Date: Mon, 24 May 2004 13:49:51 -0700
From: "Brian Helterline" <brian_helterline@hp.com>
Subject: Re: How to substitute a variable containing a directory path into Apache httpd.conf file????
Message-Id: <40b26124$1@usenet01.boi.hp.com>
"MegaC" <dmegyesi@truecontext.com> wrote in message
news:e45fcc01.0405222135.69bd0edd@posting.google.com...
> Hi all,
>
> I am trying to create a installation script for our product at work.
> The script involves prompting the user for the pathname of Apache (and
> other components not mentioned here). I then plan to take this
> user-entered pathname and edit the http.conf file, by globally
> replacing all occurances of a place holder called "APACHE_HOME" with a
> ms-dos variable containing the install path entitled %APACHE_HOME%.
>
> So, in my ms-dos script, I have something like this:
>
> ....
> set APACHE_HOME=%userManualPathofApache%
> ...
> set PERL_EXE=%IPLANET_HOME/bin/shared/library/perl
> @rem Above line is the path to the perl version used by iPlanet
> ...
> %PERL_EXE% -wpe s/APACHE_HOME/"%APACHE_HOME%"/ < httpd.conf >
> httpd.conf.mod
> move /Y httpd.conf.mod httpd.conf
>
> What I want to happen is for the ms-dos script to call perl to
> globally replace all occurances of the placeholder APACHE_HOME with
> the interpolated variable of %APACHE_HOME% which contains the install
> path of Apache (eg. C:/Program Files/Apache/Apache2). However,
> because of the backslashes in the directory name, the substution
> strips out the /s and leaves C:Program FilesApacheApache2.
>
For DOS, you need your -e parmaters within quotes:
set userManualPathofApache=C:/Program Files/Apache/Apache2
set APACHE_HOME=%userManualPathofApache%
perl -wpe "s'APACHE_HOME'\"%APACHE_HOME%\"'" < httpd.conf > httpd.conf.mod
This will replace APACHE_HOME with "C:/Program Files/Apache/Apache2"
It wasn't clear to me if you wanted the replacement string to contain quotes
or not.
--
brian
------------------------------
Date: Mon, 24 May 2004 13:00:29 -0500
From: Web Surfer <raisin@delete-this-trash.mts.net>
Subject: Re: Inserting variable within <<EOL
Message-Id: <MPG.1b1bf4341aa7d6b2989821@news.mts.net>
[This followup was posted to comp.lang.perl.misc]
In article <p97sc.11$uc.4@newssvr19.news.prodigy.com>,
redalert@wakproductions.com says...
> Hello,
>
> I am having a perplexing problem inserting a variable in the middle of text
> without a space. For example:
>
>
> $myvar = 'some';
> print <<STOP
> I want $myvar thing between text.
I want ${myvar}thing between text.
> STOP
>
> This would output:
> I want some thing between text.
>
> The difficulty arises when I want to insert $myvar without a space between
> the words; I want the output to look like this:
> I want something between text.
>
> What can I do to join $myvar and the following 'thing' as one word in the
> above string construct?
>
> Help is greatly appreciated. Thanks.
>
>
> --
> Winston Kotzan
> http://www.wakproductions.com/
>
>
>
>
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 6602
***************************************