[19826] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2021 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 27 06:05:32 2001

Date: Sat, 27 Oct 2001 03: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)
Message-Id: <1004177107-v10-i2021@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 27 Oct 2001     Volume: 10 Number: 2021

Today's topics:
    Re: [OT] Re: $ENV not defined <dlorraine@bbc.net>
        Clarification on 'system' command <cmon_209AThotmail.com> <nospam@newsranger.com>
    Re: Clarification on 'system' command <wwonko@rdwarf.com>
        how to remove unicode(maybe?) characters (Brooklyn East)
        Need help with modules <coec@iinet.net.au>
    Re: Need help with modules <jonasbn@wanadoo.dk>
    Re: need Regular Expression help <krahnj@acm.org>
        Newbie. <exodus@thisaintreal.com>
    Re: Newbie. <Tassilo.Parseval@post.rwth-aachen.de>
    Re: Newbie. <dlorraine@bbc.net>
    Re: Newbie. <Tassilo.Parseval@post.rwth-aachen.de>
    Re: Newbie. <exodus@thisaintreal.com>
    Re: Newbie. <exodus@thisaintreal.com>
    Re: PATH and output questions (Chris Fedde)
    Re: PATH and output questions (Logan Shaw)
    Re: Perl Vs. Java <rob_13@excite.com>
        regular expression for url <isaditya@yahoo.com>
    Re: regular expression for url (Logan Shaw)
    Re: regular expression for url <isaditya@yahoo.com>
    Re: variable replacement <uri@sysarch.com>
    Re: What the **** is WRONG with this!? <pne-news-20011027@newton.digitalspace.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 27 Oct 2001 03:29:21 -0600
From: "D L Fleetwood" <dlorraine@bbc.net>
Subject: Re: [OT] Re: $ENV not defined
Message-Id: <ttkveu1kj98bc1@corp.supernews.com>

> Your post is off-topic for this newsgroup.  For your edification,
> here's a quote from Conway's _OOP_, page 71

A) That's YOUR opinion; B) Who cares (which is my point in any event)

>
>   The Perl groups provide an extraordinary amount of useful information
>   and feedback, and an exceptional opportunity to interact with the
>   designers and implementers of the Perl language.  They are frequented
>   by a large cross-section of the worldwide Perl community from raw
>   novices to supreme gurus.
>
>   It is particularly important, therefore, to be aware of the culture
>   and customs of the various groups before attempting to post.  If

Why?  Because it says so in a book?  Is it part of the clp.misc culture to
berate people who thank the group?

>   nothing else, be sure to read the relevant introductory messages
>   (e.g., "Welcome- read this first" in comp.lang.perl.moderated). Better
>   still, lurk around the various groups a little before you post.  Read
>   the messages and get a feel for what's appropriate.
>
> Had you lurked for a while, you'd have known that Tad's comment

A) How do you know I haven't possibly been lurking for a few years already?
B) I know Tad's priggish comments all too well

> in this subthread are fairly accurate reflections of the customs
> of clp.misc.  Your sublime ignorance of this fact has surely left
> a memorable impression.

C) Pathetic: both the state of the customs of clp.misc, and your
pretentiousness (sublime ignorance: HAHAHAHAHA)
D) I fear no kill-file




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

Date: Sat, 27 Oct 2001 06:13:52 GMT
From: Chandramohan Neelakantan<cmon_209AThotmail.com> <nospam@newsranger.com>
Subject: Clarification on 'system' command
Message-Id: <AgsC7.2444$xS6.3127@www.newsranger.com>

Hi all 

perldoc for  'system' command  says 

"If there are no shell metacharacters in the argument,
it is split into words and passed directly to
`execvp', which is more efficient. " 


Would appreciate if  anybody can throw light on 
`execvp'.

TIA
C

Chandramohan Neelakantan


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

Date: Sat, 27 Oct 2001 07:44:03 +0000 (UTC)
From: Louis Erickson <wwonko@rdwarf.com>
Subject: Re: Clarification on 'system' command
Message-Id: <9rdok3$3fo$1@holly.rdwarf.com>

Wow, here's one I actually know the answer to.  =)

Chandramohan Neelakantan<cmon_209AThotmail.com> <nospam@newsranger.com> wrote:

: perldoc for  'system' command  says 

: "If there are no shell metacharacters in the argument,
: it is split into words and passed directly to
: `execvp', which is more efficient. " 

: Would appreciate if  anybody can throw light on 
: `execvp'.

That is discussing the internals of how Perl actually goes about
running the program you've given it.

The execvp(3) system call is what Perl is using to launch the argument
you have given it.  It launches a program directly, rather than
using the shell to do so.

If there are shell metacharacters, like >, <, or | in the argument,
Perl uses the system call system(3).  That is, the C program that is
Perl uses a C library call which is also called "system".  That call
uses a copy of the shell to start the command line given as the
argument.

Perl will use execvp(3) if it possibly can.  It is faster and has
less other system overhead than system.  However, if it needs the
extra capabilities the shell would add - mostly redirecton, but
there's several things it does - then it uses system(3) instead.

Confusing that the Perl function system has the same name as the
C library call system(3).

("What," you ask, "are those numbers in parenthesis after those
words?"  Those are the section in the Unix manual pages that the
command can be found.  If you type: "man 3 system" you will get
the documentation from the right part of the manuals, rather than
the several entries you might otherwise get.  See the man page
for man(1) which should have a list of what those numbers mean.)

Hope I helped more than I confused.

-- Lou Erickson



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

Date: 26 Oct 2001 23:08:59 -0700
From: psu26262@odin.cc.pdx.edu (Brooklyn East)
Subject: how to remove unicode(maybe?) characters
Message-Id: <8d1dd6ca.0110262208.648e726c@posting.google.com>

Hi, 
How do I remove unicode(?) characters using perl?

Example:
It looks like this on pico:
¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡¨¡

but like this on vi (but the cursors only points to "\" character):
050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041\050\041

thanks,


jose


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

Date: Sat, 27 Oct 2001 16:16:39 +0800
From: "Colin Coe" <coec@iinet.net.au>
Subject: Need help with modules
Message-Id: <3bda6d68$0$9629@echo-01.iinet.net.au>

Hi all, I am a Perl newbie and I am having troubles getting programs to work
with modules.

What I want to do is use write a Perl program which uses Net::FTP and Curses
to produce a window drive ftp client.  I am using "Perl in a Nutshell" and
"Programming Perl" as guides.

The following code:
#!/usr/bin/perl -w
use strict;
use Net::FTP;

Causes the following error:
Can't locate Net/FTP.pm in @INC (@INC contains:
/usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0
/usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0
/usr/lib/perl5/site_perl .) at ./ftp.pl line 3.
BEGIN failed--compilation aborted at ./ftp.pl line 3.

I have run "perl -MCPAN -e shell" and done "install Net::FTP" and even
"force install Net::FTP" and CPAN tells me that Net::FTP is up to date.
This happens with all modules I try and include.

I'm guessing that I am doing something really stupid here but I can't figure
out what.

Please help

Colin

PS: Please CC any responces to my email address.  Thanks.

PPS: Apologies for the cross-post, but I really need some help with this.




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

Date: Sat, 27 Oct 2001 10:30:51 +0200
From: jonasbn <jonasbn@wanadoo.dk>
Subject: Re: Need help with modules
Message-Id: <Pine.LNX.4.33.0110271029350.1065-100000@localhost.localdomain>

On Sat, 27 Oct 2001, Colin Coe wrote:

> Hi all, I am a Perl newbie and I am having troubles getting programs to work
> with modules.
>
> What I want to do is use write a Perl program which uses Net::FTP and Curses
> to produce a window drive ftp client.  I am using "Perl in a Nutshell" and
> "Programming Perl" as guides.
>
> The following code:
> #!/usr/bin/perl -w
> use strict;
> use Net::FTP;
>
> Causes the following error:
> Can't locate Net/FTP.pm in @INC (@INC contains:
> /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0
> /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0
> /usr/lib/perl5/site_perl .) at ./ftp.pl line 3.
> BEGIN failed--compilation aborted at ./ftp.pl line 3.
>
> I have run "perl -MCPAN -e shell" and done "install Net::FTP" and even
> "force install Net::FTP" and CPAN tells me that Net::FTP is up to date.
> This happens with all modules I try and include.
>
> I'm guessing that I am doing something really stupid here but I can't figure
> out what.
>
> Please help
>
> Colin
>
> PS: Please CC any responces to my email address.  Thanks.
>
> PPS: Apologies for the cross-post, but I really need some help with this.
>
Do a locate FTP.pm to find out whether FTP.pm is what is in your expected path.

jonasbn
-- 
jonasbn <jonasbn@wanadoo.dk> || http://jonasbn.hjem.wanadoo.dk

There has been a little distress selling on the stock exchange.
		-- Thomas W. Lamont, October 29, 1929 (Black Tuesday)



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

Date: Sat, 27 Oct 2001 07:29:51 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: need Regular Expression help
Message-Id: <3BDA62F9.D269C0AB@acm.org>

Dave Tweed wrote:
> 
> Brian Janko wrote:
> > However,  you bring up a good point.  I did not know there was an "official"
> > standard for valid email addresses.  Where would I find that spec?  I would
> > be very interested.
> 
> It's called RFC822. Any search engine should be able to dig up a copy for you.

You probably meant RFC2822.  :-)



John
-- 
use Perl;
program
fulfillment


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

Date: Sat, 27 Oct 2001 09:37:37 +0100
From: "Exodus" <exodus@thisaintreal.com>
Subject: Newbie.
Message-Id: <RmuC7.1733$GA.145900@news2-win.server.ntlworld.com>

Is it OK to post newbie questions to this group?

Even if they are really obivious to some of you more experience programmers?

I've just started learning Perl, and rely on some of our friendly tech's at
work for the majority of problems I hit (which are quite a few - but I do
learn from them.)

I'm currently working on producing a content management system (for a Web
site) in Perl, which I felt would give me enough variety to get a good grip
on the language.  I've already hit some major problems which I didn't
foresee when I design the application (is a collection of scripts an
application?) but it's been tremendous fun, and I get a real sense of pride
when I figure something out :o)

As a starting point, I wondered whether anyone could recommend some sites
for looking for help - preferably sites that have lots of practical examples
(I'm a visual learner.)

Best regards

Ex.




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

Date: Sat, 27 Oct 2001 11:26:45 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Newbie.
Message-Id: <3BDA7DD5.4020509@post.rwth-aachen.de>

Exodus wrote:

> Is it OK to post newbie questions to this group?


Yes, in general it is.


[...]

> As a starting point, I wondered whether anyone could recommend some sites
> for looking for help - preferably sites that have lots of practical examples
> (I'm a visual learner.)


That's good since I think Perl is a visual language (not in the sense of 
point-and-click though).

You may have a look at the mentioned tutorials somewhere on 
http://www.perl.com . Probably a lot will deal with CGI, obviously your 
project falls into this domain.
Yes, the best place to start with is the documentation that comes with 
Perl. Try 'perldoc perldoc' to get an introduction to it and a list of 
the available manpages.

Other things ultimately useful:
'perldoc -f perl_function_that_you_want_to_know_more_about'
'perldoc -q KEYWORD' where keyword is a word that might show up in one 
of the many Perl-FAQs. That's also important for this group here since 
you are expected to search the FAQs before you post here.

Modules you are using also have manpages: 'perldoc Module::Name'. They 
usually contain the SYNOPSIS-part where short examples of usage are to 
be found.


Tassilo


-- 
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};



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

Date: Sat, 27 Oct 2001 03:31:09 -0600
From: "D L Fleetwood" <dlorraine@bbc.net>
Subject: Re: Newbie.
Message-Id: <ttkviaopg7kvea@corp.supernews.com>

"Exodus" <exodus@thisaintreal.com> wrote in message
news:RmuC7.1733$GA.145900@news2-win.server.ntlworld.com...
> Is it OK to post newbie questions to this group?

Thus quoth the Usenet Nazis:

No Perl for you!




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

Date: Sat, 27 Oct 2001 11:45:54 +0200
From: Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: Newbie.
Message-Id: <3BDA8252.6090600@post.rwth-aachen.de>

D L Fleetwood wrote:

> "Exodus" <exodus@thisaintreal.com> wrote in message
> news:RmuC7.1733$GA.145900@news2-win.server.ntlworld.com...
> 
>>Is it OK to post newbie questions to this group?
>>
> 
> Thus quoth the Usenet Nazis:
> 
> No Perl for you!


*plonk*...hence no D L Fleetwood for me.


-- 
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
[1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
ord(chr($h->{$_}))))};



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

Date: Sat, 27 Oct 2001 10:45:53 +0100
From: "Exodus" <exodus@thisaintreal.com>
Subject: Re: Newbie.
Message-Id: <RmvC7.11499$a14.217222@news6-win.server.ntlworld.com>

Thanks for the tips.

"Tassilo von Parseval" <Tassilo.Parseval@post.rwth-aachen.de> wrote in
message news:3BDA7DD5.4020509@post.rwth-aachen.de...
> Exodus wrote:
>
> > Is it OK to post newbie questions to this group?
>
>
> Yes, in general it is.
>
>
> [...]
>
> > As a starting point, I wondered whether anyone could recommend some
sites
> > for looking for help - preferably sites that have lots of practical
examples
> > (I'm a visual learner.)
>
>
> That's good since I think Perl is a visual language (not in the sense of
> point-and-click though).
>
> You may have a look at the mentioned tutorials somewhere on
> http://www.perl.com . Probably a lot will deal with CGI, obviously your
> project falls into this domain.
> Yes, the best place to start with is the documentation that comes with
> Perl. Try 'perldoc perldoc' to get an introduction to it and a list of
> the available manpages.
>
> Other things ultimately useful:
> 'perldoc -f perl_function_that_you_want_to_know_more_about'
> 'perldoc -q KEYWORD' where keyword is a word that might show up in one
> of the many Perl-FAQs. That's also important for this group here since
> you are expected to search the FAQs before you post here.
>
> Modules you are using also have manpages: 'perldoc Module::Name'. They
> usually contain the SYNOPSIS-part where short examples of usage are to
> be found.
>
>
> Tassilo
>
>
> --
> $a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->
> [1]+1,$b->[1],"her")];for(@{[$a,$b,$c,$d]}){for(@{$_}){$_=~/\d+/?print
> (chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108
> ),(0x20,0x68,0x61,)]};print(map{chr($_)}@{($c->(1))});$h={a=>33*3,b=>
> 10**2+7,c=>"1"."0"."1",d=>0162};@h=sort(keys(%$h));for(@h){print(chr(
> ord(chr($h->{$_}))))};




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

Date: Sat, 27 Oct 2001 10:47:39 +0100
From: "Exodus" <exodus@thisaintreal.com>
Subject: Re: Newbie.
Message-Id: <uovC7.11522$a14.219233@news6-win.server.ntlworld.com>

Perhaps I've not worken up enough yet - but I don't get it.

"D L Fleetwood" <dlorraine@bbc.net> wrote in message
news:ttkviaopg7kvea@corp.supernews.com...
> "Exodus" <exodus@thisaintreal.com> wrote in message
> news:RmuC7.1733$GA.145900@news2-win.server.ntlworld.com...
> > Is it OK to post newbie questions to this group?
>
> Thus quoth the Usenet Nazis:
>
> No Perl for you!




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

Date: Sat, 27 Oct 2001 04:48:39 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: PATH and output questions
Message-Id: <H0rC7.180$X3.183366144@news.frii.net>

In article <ch4jtt8ags0l6ldj24j25ug7hq6qfue462@4ax.com>,
Lou Moran  <lmoran@wtsg.com> wrote:
>
>print @files ; #just here to see if it worked
>
>2 -- The print @files prints out (as expected) in a line, while I
>probably won't ever look at the actual output of this I'd like to know
>how to format the output.
>

    for (@files) {
	print "$_\n";
    } 

or

    print join("\n", @files),"\n";

Good Luck!
-- 
    This space intentionally left blank


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

Date: 27 Oct 2001 01:24:43 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: PATH and output questions
Message-Id: <9rdjvb$3e7$1@charity.cs.utexas.edu>

In article <H0rC7.180$X3.183366144@news.frii.net>,
Chris Fedde <cfedde@fedde.littleton.co.us> wrote:
>    print join("\n", @files),"\n";

I always prefer to do it this way...

    print map ("$_\n", @files);

 ...mainly because it takes less typing.

  - Logan
-- 
"In order to be prepared to hope in what does not deceive,
 we must first lose hope in everything that deceives."

                                          Georges Bernanos


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

Date: Sat, 27 Oct 2001 05:20:50 GMT
From: "Rob - Rock13.com" <rob_13@excite.com>
Subject: Re: Perl Vs. Java
Message-Id: <Xns9147D94475F0rock13com@64.8.1.227>

Edwin Günthner <news:3BD7C2EF.E8699F12@web.de>:

> Large projects DO need interfaces that are absolutely 
> clear in their meaning. If a language allows you to
> do "dirty things" people will start to use those 
> features. That might be OK for small projects - but
> in my eyes it is a clear "DON'T" in bigger projects.

I'm relatively new to Perl but I think use strict and use warnings 
go along way in preventing those 'dirty things'. And a documented 
coding style to follow.

-- 
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/


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

Date: Sat, 27 Oct 2001 00:36:13 -0500
From: "Aditya" <isaditya@yahoo.com>
Subject: regular expression for url
Message-Id: <20011027.003613.349517445.1426@yahoo.com>

This is my problem:

The input to my program would be a url. It can be assumed that the url
would be for a web page. Now i have to make sure that this url is
absolute: 
1. If i have just one word string as input i need to add 'http://www' as 
prefix and '.com' as suffix. 
2. If i do have 'http://' prefix and no suffix then add '.com' to the end
and vice-versa.
3. Check whether the syntax of url is proper, if not correct it.

Any suggestions?


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

Date: 27 Oct 2001 01:29:55 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: regular expression for url
Message-Id: <9rdk93$3f6$1@charity.cs.utexas.edu>

In article <20011027.003613.349517445.1426@yahoo.com>,
Aditya <isaditya@yahoo.com> wrote:
>The input to my program would be a url. It can be assumed that the url
>would be for a web page. Now i have to make sure that this url is
>absolute: 
>1. If i have just one word string as input i need to add 'http://www' as 
>prefix and '.com' as suffix. 
>2. If i do have 'http://' prefix and no suffix then add '.com' to the end
>and vice-versa.
>3. Check whether the syntax of url is proper, if not correct it.
>
>Any suggestions?

Look at the URI and URI::Heuristic modules from CPAN.  They should do
most of what you want.  See http://search.cpan.org/search?module=URI .

  - Logan
-- 
"In order to be prepared to hope in what does not deceive,
 we must first lose hope in everything that deceives."

                                          Georges Bernanos


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

Date: Sat, 27 Oct 2001 02:34:11 -0500
From: "Aditya" <isaditya@yahoo.com>
Subject: Re: regular expression for url
Message-Id: <20011027.023411.1789366143.1960@yahoo.com>

In article <9rdk93$3f6$1@charity.cs.utexas.edu>, "Logan Shaw"
<logan@cs.utexas.edu> wrote:

> In article <20011027.003613.349517445.1426@yahoo.com>, Aditya
> <isaditya@yahoo.com> wrote:
>>The input to my program would be a url. It can be assumed that the url
>>would be for a web page. Now i have to make sure that this url is
>>absolute:
>>1. If i have just one word string as input i need to add 'http://www' as
>>prefix and '.com' as suffix.
>>2. If i do have 'http://' prefix and no suffix then add '.com' to the
>>end and vice-versa.
>>3. Check whether the syntax of url is proper, if not correct it.
>>
>>Any suggestions?
> 
> Look at the URI and URI::Heuristic modules from CPAN.  They should do
> most of what you want.  See http://search.cpan.org/search?module=URI .
> 
>   - Logan

Thanks for your reply. Now i have another question. I read the manpage
for the module and came across URL_GUESS_PATTERN. I could not find how to
actually use it. The way it is given in the manpage doesn't help me. Any
suggestions?

aditya


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

Date: Sat, 27 Oct 2001 04:04:27 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: variable replacement
Message-Id: <x7vgh1zq12.fsf@home.sysarch.com>

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

<rearranged for logical reasons>

  TM> (my other followup OTOH has 2 evals and 1 interpolation, 'cause
  TM> the code for the 2nd eval is a double quoted string.)

  TM> Uri Guttman <uri@sysarch.com> wrote:

  >> s/foo/$b/ is the same as s/foo/"$b"/e.

  TM> Yes, because the _code_ happens to use quotes in the
  TM> code-to-be-evaluated.

so that implies that $b in the former case IS interpolated.

  >> ilya has pointed out that the replacement side of s/// is
  TM>                                                     ^^^
  TM>                                                     ^^^ note no 'e'


that is the point of the above. a plain s/// does
interpolate. internally it really is s//""/e. the replacement is a
double quotish string which always means interpolation. in fact the
regex side also interpolates which you already know.

  TM> s///e treats the replacement as code, not as a double-quotish string.

  TM> Right?

yes.

  TM> With an 'e', there is no "string", there is only "code" in
  TM> the replacement part. (and the result of evaluating the code
  TM> is taken as the string to use.)

  >> >> s/$a/$b/eegs; # double the 'e' !
  >> 
  TM> Two evals, zero interpolations.

  TM> I stand by the "2 evals, 0 interpolations" statement.

that makes sense now. the /e is like a block eval with the code parsed
at compile time. the /e just does another eval on the string result of
that block eval.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs  --------------------------  http://jobs.perl.org


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

Date: Sat, 27 Oct 2001 11:48:26 +0200
From: Philip Newton <pne-news-20011027@newton.digitalspace.net>
Subject: Re: What the **** is WRONG with this!?
Message-Id: <b5vkttcti2lhiv8snl67cldu4hr6knc7k5@4ax.com>

On Thu, 25 Oct 2001 23:49:46 GMT, Tim Hammerquist <tim@vegeta.ath.cx>
wrote:

[NT & NTFS]
> do they also have hard links?

AFAIK, NT supports hard links on NTFS (didn't know about the symlinks
thingy). However, IIRC there are weird restrictions such as the user
must have the "backup" right or only works in the POSIX subsystem but
not the Win32 (GUI) subsystem, whatever that means. Don't ask me about
the details.

Followup to where?

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

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.  

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


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