[10882] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4483 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 22 23:07:18 1998

Date: Tue, 22 Dec 98 20:00:18 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 22 Dec 1998     Volume: 8 Number: 4483

Today's topics:
        $ troubles bl968@my-dejanews.com
    Re: $ troubles (Sam Holden)
        Another replacement question: <groans@mailexcite.com>
    Re: Another replacement question: <ebohlman@netcom.com>
    Re: Any Perl 5.005 binary build for win32? <raphael@iscusa.com>
    Re: Can I change a varible on the fly. (Larry Rosler)
    Re: CHMOD a file before writing to it.. (Martien Verbruggen)
    Re: faster than regexp (Larry Rosler)
    Re: How do I manually change the value of a hidden text (Bill Moseley)
    Re: Meaning of comp generated statement <off-duty@entheosengineering.com>
    Re: Meaning of comp generated statement (Martien Verbruggen)
        Need help with setting up Perl/cgi <tech@aba-architects.com>
    Re: Need help with setting up Perl/cgi <roger_mcilmoyle@woodbridgegroup.com>
    Re: Nested sorting (Larry Rosler)
    Re: NT login script to query group membership.... <metcher@spider.herston.uq.edu.au>
    Re: Perl 5.005_002 and berkeley db problems bostic@bostic.com
    Re: Please help me reading .csv textfiles (Bill Moseley)
    Re: Please help me reading .csv textfiles (Martien Verbruggen)
    Re: problem with $/ - is it a perl bug? (Larry Rosler)
    Re: problem with $/ - is it a perl bug? <alex@kawo2.rwth-aachen.de>
    Re: problem with $/ (Tad McClellan)
    Re: problem with $/ (Larry Rosler)
    Re: problem with $/ <rick.delaney@home.com>
    Re: Recursive file copy keeping date attributes (Bill Moseley)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 23 Dec 1998 00:51:10 GMT
From: bl968@my-dejanews.com
Subject: $ troubles
Message-Id: <75pepu$ad7$1@nnrp1.dejanews.com>

I am reading in a file which terminates with a $ to show the proper end of
file.

I am trying to read the file to verify that the $ is in the file and thus is
valid.

The problem i get is that perl seems not to recognize the fast that the $ is
what i am looking for.

Any help is appreciated.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 23 Dec 1998 01:41:28 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: $ troubles
Message-Id: <slrn780ii8.fc3.sholden@pgrad.cs.usyd.edu.au>

On Wed, 23 Dec 1998 00:51:10 GMT, bl968@my-dejanews.com
	<bl968@my-dejanews.com> wrote:
>I am reading in a file which terminates with a $ to show the proper end of
>file.
>
>I am trying to read the file to verify that the $ is in the file and thus is
>valid.
>
>The problem i get is that perl seems not to recognize the fast that the $ is
>what i am looking for.
>
>Any help is appreciated.

Perl has no problems finding an arbitrary byte at the end of a file...

Your code is probably incorrect seeing $ means a few things in different places
in perl code. But since you didn't post your code no one can help.

Something vaguely like the following might work... though the following
exactly as it is won't....

seek FILE,-2,2;
print $data if read FILE, $data, 1;



-- 
Sam

Another result of the tyranny of Pascal is that beginners don't use
function pointers.
	--Rob Pike


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

Date: Tue, 22 Dec 1998 18:05:48 -0800
From: me <groans@mailexcite.com>
Subject: Another replacement question:
Message-Id: <36804FFC.F46D07CB@mailexcite.com>

Hello All!

Lets say I have an html such as the following:

<FORM name=mfrm method=GET
action="http://www.altavista.com/cgi-bin/query">

Lets also say I want to add a "/" to the end of the string so it looks
like this:

<FORM name=mfrm method=GET
action="http://mammoth.psnw.com:5364/http://www.altavista.com/cgi-bin/query/">

Note that there are several other tags like this one on the page that do
not end with a trailing "/" so matching exact text is impossible.  How
do I tell Perl to look for the end of a URL (not the end of the line)
and add a "/"?

Note that also, tags do not necessarily end with a quotation mark . . .
HELP!

~Prime




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

Date: Wed, 23 Dec 1998 02:53:52 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Another replacement question:
Message-Id: <ebohlmanF4EDDs.Fsz@netcom.com>

me <groans@mailexcite.com> wrote:
: Lets also say I want to add a "/" to the end of the string so it looks
: like this:

: <FORM name=mfrm method=GET
: action="http://mammoth.psnw.com:5364/http://www.altavista.com/cgi-bin/query/">

: Note that there are several other tags like this one on the page that do
: not end with a trailing "/" so matching exact text is impossible.  How
: do I tell Perl to look for the end of a URL (not the end of the line)
: and add a "/"?

Perl doesn't have any concept of a URL, so you'll need to use some code 
that does.  I'd suggest using the HTML::Parser module to split your HTML 
up into its logical structures, such as attributes (which is where you're 
going to find URLs) and making the substitutions on them.  It's possible 
that HTML::Filter, which is a subclass of HTML::Parser, will be easier to 
use; check its docs.

Do *not* try to parse HTML yourself using regular expressions unless 
you're only parsing HTML that you wrote yourself; most such "solutions" 
fail on non-obvious-but-legal constructs that are often seen in HTML from 
the Outside World.



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

Date: Tue, 22 Dec 1998 17:34:18 -0800
From: Raphael Conrad <raphael@iscusa.com>
Subject: Re: Any Perl 5.005 binary build for win32?
Message-Id: <36804899.F1C43E1A@iscusa.com>

Hi,

I built 5.005_02 with no problems using VC 5.0. All tests worked
(the test script noted that it was skipping a few). If you like, I
could make the resulting binary tree generally available.

Can anyone advise me on building in FastCGI support? This
I have tried to do, but failed.

Raphael

GEMINI wrote:

> Hi all,
>   The newest binary build for win32 that I can find is 5.004,
> a binary distribution built by Borland C. I've tried to
> make one from the 5.005_02 source but got a failure.
> I am wondering if some one has made it? where can I get it?
> thanks.



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

Date: Tue, 22 Dec 1998 18:23:31 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Can I change a varible on the fly.
Message-Id: <MPG.10e9f3fbf50ba2c79898f0@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <367FE5E9.705F9353@entheosengineering.com> on Tue, 22 Dec 
1998 18:33:13 +0000, Rich Grise <off-duty@entheosengineering.com> 
says...
 ...
> print <<"EOC";
 ...
> EOC
> 
> Double-quoting your "EOC" for your here document will make
> it interpolate variables on the way.

So will not quoting the EOC at all, which is more usual.

> Or, do it with individual print statements, where the
> double-quotes will interpolate for you.

Why???

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


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

Date: Wed, 23 Dec 1998 03:18:47 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: CHMOD a file before writing to it..
Message-Id: <riZf2.101$jf.3018@nsw.nnrp.telstra.net>

In article <368028e2.0@glitch.nildram.co.uk>,
	"Tony" <tspencer@exconet.co.uk> writes:
> Anyone know how I can CHMOD a file 666 before writting  to it and then CHMOD
> it 644 after it has been written to using Perl.

Why? If you can chmod it, you're the owner, so you don't need to
change the permissions. If you're not the owner, you can't chmod it,
and you can't write to it. 

In short: The process that has to write to the file will need write
permission on it. If it doesn't own the file, and doesn't have write
permissions, there is nothing you can do about it. And that is how it
should be. if it was any different, there would be absolutely no use
for all those permissions, would there?

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd.       | make a better idiot.
NSW, Australia                      | 


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

Date: Tue, 22 Dec 1998 17:34:54 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: faster than regexp
Message-Id: <MPG.10e9e89c96e394bb9898ed@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <36802AC2.FAF1380F@gmx.de> on Wed, 23 Dec 1998 00:26:58 
+0100, Rolf Dewitz <r2.d2@gmx.de> says...
> I've to analyse a very long log-file line by line. So i'm looking for a
> method to split these lines without regexp very fast. Thanks.

> $logline=~/^(.+?) - (.+?) \[(.+?):(\d\d:\d\d:\d\d) .+?\] "([A-Z]+?)
> (.*)\/[^\/]* .+?" /o;
                     ^  Not needed -- no interpolation in the regex.
   
> proxy.bla.de - so [20/Aug/1998:09:31:07 +0200] "GET /images/suche.gif
> HTTP/1.0" 304 -

Here are four of the ways to split a line:

substr() -- works best with fixed column widths, so not in this case.

unpack() -- works best with fixed column widths, so not in this case.

split() -- requires a single pattern to split on, so not in this case.

regex -- works at arbitrary places, so appropriate for this case.

I have found by benchmarking that instead of using lots of '.*?' and 
'.*' patterns, it is best to be as specific as you can.  So, in your 
case, the following might be faster (but there are no guarantees -- 
learn how to use Benchmark.pm yourself) UNTESTED:

m!^                # To get rid of "Leaning-Toothpick Syndrome"
  ([a-z.]+)        # Domain (could just use \S+)
  \s-\s            # Space dash space (could just use \W+)
  ([a-z]+)         # Lower-case letters (could just use \S+)
  \s\[             # Space left-bracket
  ([^:]+):         # Date
  (\d\d:\d\d:\d\d) # Time
  [^"]+"           # Stuff to double-quote
  ([A-Z]+)\s       # Upper-case letters (could just use \S+)
  (.*)/            # Path (could be more specific)
  ([a-z.]+)        # Filename (could just use \S+)
!x                 # So humans can decipher it

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


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

Date: 23 Dec 1998 01:06:25 GMT
From: moseley@best.com (Bill Moseley)
Subject: Re: How do I manually change the value of a hidden text field CGI.pm
Message-Id: <36804211$0$204@nntp1.ba.best.com>

In article <367e6e1d.353171874@news.uni.edu>, troy.bull@uni.edu says...
>
>I am trying to set a state variable, on the first form it is set to 1
>on the second form, I tried to hidden(-name->'state' -default=>'2')
>it stays set to one.  It says in the doc, you must manually change it,
>my question is how do I manually change it?

Sticky fields are a feature in CGI.pm.

What I've done is either delete() the field and then set it, or try

print $q->hidden(-name=>'state',
                 -value=>'2',
                 -override=>1,
                );

(Be careful to use => instead of -> as in your above example.  Seems to me that
error doesn't get caught.)

--------------
Bill Moseley
moseley@best.com



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

Date: Tue, 22 Dec 1998 18:41:00 +0000
From: Rich Grise <off-duty@entheosengineering.com>
To: Emma <ponce151@bellatlantic.net>
Subject: Re: Meaning of comp generated statement
Message-Id: <367FE7BC.61C343E2@entheosengineering.com>

Emma wrote:
> 
> SOMEONE, PLEASE HELP
> 
>     $emailaddress = "ponce151\@bellatlantic.net";

Right Here:

>  open(MAIL, "| $mailprog") || 
           HTMLError("$mailprog: Can't open because ($!).");

this needs to be:
  open (MAIL, "| $mailprog $emailaddress) || $HTMLError("etc....

> Thank you a million times! Ema

You're welcome!
-- 
Rich Grise
off-duty@entheosengineering.com
(No need to futz with my e-mail: I have a "delete" button!)


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

Date: Wed, 23 Dec 1998 03:13:11 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Meaning of comp generated statement
Message-Id: <bdZf2.99$jf.3018@nsw.nnrp.telstra.net>

In article <367FE7BC.61C343E2@entheosengineering.com>,
	Rich Grise <off-duty@entheosengineering.com> writes:

> Right Here:
> 
>>  open(MAIL, "| $mailprog") || 
>            HTMLError("$mailprog: Can't open because ($!).");
> 
> this needs to be:
>   open (MAIL, "| $mailprog $emailaddress) || $HTMLError("etc....

I don't think so, unless the implementation of sendmail is a very odd
one:

>From earlier post:

>> $mailprog = "/usr/lib/sendmail -t";      #mail program on Server,change

The -t flag to sendmail tells it to get the destination from the To:
and Cc: lines in the stuff that it gets on stdin. Any addresses in the
argument list will be suppressed.

This is the correct, or at least best and safest way to call sendmail.
it avoids possible problems with shell metacharacters in the email
address.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | This matter is best disposed of from a
Commercial Dynamics Pty. Ltd.       | great height, over water.
NSW, Australia                      | 


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

Date: Tue, 22 Dec 1998 09:18:32 -0700
From: Shana Priwer <tech@aba-architects.com>
Subject: Need help with setting up Perl/cgi
Message-Id: <367FC658.648620E3@aba-architects.com>

Hi - I'm extremely new to CGi and Perl, and hope someone
can help me set up my system.

I'm running NT 4 Workstation on a P2 266 with about
200 megs RAM. We serve our website from this computer
using IIS, and a modem connection to a local ISP. Our
website is publicly accessible from anywhere on the net
by typing in http://ipaddress/iisadmin/index.htm

We want people to be able to upload files to this computer.
I found a free upload cgi script. I downloaded Perl for
Win32 and installed it to D:\Perl. When you go to the
page called upload.cgi, browse for your file, and click
"upload", you get an http 500 server error.

I'm sure I don't have something set up right, but all
the online FAQs I've read haven't been able to help
me get this setup configured.

Can anyone offer me some advice/instructions on what I
need to do? I'm a 3d modeler/animator by trade so I do have
some knowledge of certain things about computers, but I'm
totally new to this.

Thanks very much-
Shana
shana@lpl.arizona.edu



---== http://www.newsfeeds.com - Largest Usenet Server In The World! ==---


---== http://www.newsfeeds.com - Largest Usenet Server In The World! ==---


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

Date: Tue, 22 Dec 1998 21:23:29 -0600
From: "Roger McIlmoyle" <roger_mcilmoyle@woodbridgegroup.com>
Subject: Re: Need help with setting up Perl/cgi
Message-Id: <3680541f.0@nemo.idirect.com>

I just went mad trying to do what you are trying to do and I finnaly decided
it would simply be easier to use another WebServer than IIS.
Once I left IIS and tries another Webserver, everything started to work
fine.

But, if you insist, make sure perl will run from the command line first, ie
it's in you path. Then make sure that the script that you are trying to run
is in a directory known to IIS with permissions set to allow execute and
script.

Maybe you will have more luck than I, but, these are the tips I was afforded
by other's.

Shana Priwer wrote in message <367FC658.648620E3@aba-architects.com>...
>Hi - I'm extremely new to CGi and Perl, and hope someone
>can help me set up my system.
>
>I'm running NT 4 Workstation on a P2 266 with about
>200 megs RAM. We serve our website from this computer
>using IIS, and a modem connection to a local ISP. Our
>website is publicly accessible from anywhere on the net
>by typing in http://ipaddress/iisadmin/index.htm
>
>We want people to be able to upload files to this computer.
>I found a free upload cgi script. I downloaded Perl for
>Win32 and installed it to D:\Perl. When you go to the
>page called upload.cgi, browse for your file, and click
>"upload", you get an http 500 server error.
>
>I'm sure I don't have something set up right, but all
>the online FAQs I've read haven't been able to help
>me get this setup configured.
>
>Can anyone offer me some advice/instructions on what I
>need to do? I'm a 3d modeler/animator by trade so I do have
>some knowledge of certain things about computers, but I'm
>totally new to this.
>
>Thanks very much-
>Shana
>shana@lpl.arizona.edu
>
>
>
>---== http://www.newsfeeds.com - Largest Usenet Server In The World! ==---
>
>
>---== http://www.newsfeeds.com - Largest Usenet Server In The World! ==---




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

Date: Tue, 22 Dec 1998 18:21:39 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Nested sorting
Message-Id: <MPG.10e9f38adc9f640f9898ef@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <36803d47$0$204@nntp1.ba.best.com> on 23 Dec 1998 00:45:59 
GMT, Bill Moseley <moseley@best.com> says...
 ...
> sub store_reference {
>     my $lines = letters();
>     my @sorted =    map { $_->[0] }               # Schwartzian Transform
>                     sort {
>                             $a->[1] cmp $b->[1] or  # names
>                             $a->[2] <=> $b->[2]     # numbers
>                     } map {
>                             [\$_, m/^(\D+)(\d+)/]
>                     }  @$lines;
> }                    

But now @sorted is an array of references, not the original array of 
data.  Your map needs to be to ${$_->[0]} which will probably change the 
timing considerably.

Will you consider this, rerun the benchmarks, and let us know?

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


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

Date: Wed, 23 Dec 1998 13:45:25 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: NT login script to query group membership....
Message-Id: <36806755.25840708@spider.herston.uq.edu.au>

There's a little MS program called INGROUP.EXE which will indicate (via
its exit code) group membership.  You may have trouble getting the exit
code from perl, however, so you might need to put INGROUP into a batch
file that creates a flag file.  This turns the exit code test into a
file existence test, for which you can use perl's -e operator.

-- 
Jaime Metcher

P.S. Martien, if Mark gets this to fly, every desktop on his network
will have the word "perl" displayed on it for the duration of the logon
script.  I think this should be encouraged, don't you?

Mjd440 wrote:
> 
> Hi folks,
> 
> I need to change  my login script so drives are mapped  according to what
> groups a user belongs to.  The NT resource kit has some utilities that will
> take care of this for me, but they don't work for Win95 users.  Is there way I
> can get this info into my login script?
> 
> Thanks for any suggestions.
> 
> Cheers,
> 
> Mark


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

Date: Wed, 23 Dec 1998 01:29:34 GMT
From: bostic@bostic.com
Subject: Re: Perl 5.005_002 and berkeley db problems
Message-Id: <75ph1s$c7u$1@nnrp1.dejanews.com>

In article <367FE5A5.FC256712@iscusa.com>,
  Colin Earl <colin@iscusa.com> wrote:
> Hi Pete,
>
> You might consider switching to mySQL or similar even if the
> tests all work. We found some severe bugs in Berkeley DB that
> were not exposed by any of the tests.

I've now exchanged email with Colin.  I believe that the version
of Berkeley DB in which he found problems was 1.85.  Version 1.85
was academic software released around 1992, was never supported,
and is widely known to have problems.  (See

        http://www.sleepycat.com/Berkeley DB.185.html

for further information.)

The current, 2.X versions of Berkeley DB have none of these problems,
whether used with Perl or not, and whether used with the DB_File or
BerkeleyDB Perl modules.

Regards,
Amy Adams

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Amy Adams                       Berkeley DB Product Manager
Sleepycat Software Inc.         db@sleepycat.com
394 E. Riding Dr.               +1-617-633-2429
Carlisle, MA 01741              http://www.sleepycat.com

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 23 Dec 1998 01:00:41 GMT
From: moseley@best.com (Bill Moseley)
Subject: Re: Please help me reading .csv textfiles
Message-Id: <368040b9$0$204@nntp1.ba.best.com>

In article <367EF5B3.1E0ED1CC@abim.net>, cva@abim.net says...
>I am trying to read .csv (comma-seperated) files, which have been
>exported from MS Excel or Access, for example.

Did you try the example in perlfaq4:

"How can I split a [character] delimited string except when 
inside [character]? (Comma-separated files)"

I've used that example when reading exported Excel files.

--------------
Bill Moseley
moseley@best.com



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

Date: Wed, 23 Dec 1998 03:08:47 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Please help me reading .csv textfiles
Message-Id: <39Zf2.97$jf.3018@nsw.nnrp.telstra.net>

In article <368031CB.B19B5B4C@abim.net>,
	Christian von Appen <cva@abim.net> writes:
> Hi Martien and the others,
> 
> many thanks for your comments!
> 
> Martien Verbruggen wrote:
> 
>> use Text::CSV or Text::ParseWords
> 
> The ParseWords module does not fit, because it expects backslashed
> quotes in quoted strings, or simply deletes the quotes. Common CSV Files
> do not have backslashed quotes.

Are you sure?

#!/usr/local/bin/perl5.00404 -w
use strict;
use Text::ParseWords;

while (<DATA>)
{
	chomp;
	my @words = quotewords(',', 1, $_);

	print join(" : ", @words),"\n";
}

__DATA__
"field1","field2 has "quotes" in it",field 3,"field 4"

__OUTPUT__
"field1" : "field2 has "quotes" in it" : field 3 : "field 4"

To me that looks as if the quotes inside of the quotes are kept. Of
course, you'll have to set the second argument to quotewords ($keep)
to a true value...

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Inside every anarchy lurks an old boy
Commercial Dynamics Pty. Ltd.       | network - Mitchell Kapor
NSW, Australia                      | 


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

Date: Tue, 22 Dec 1998 17:03:43 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: problem with $/ - is it a perl bug?
Message-Id: <MPG.10e9e148970ef469898ec@nntp.hpl.hp.com>

In article <397lvj4uyz.fsf@ibnets.com> on 22 Dec 1998 18:28:52 -0500, 
Uri Guttman <uri@ibnets.com> says...
 ... 
> this is from perlop for s///:
> 
>              If the delimiter chosen is single quote, no variable
>              interpolation is done on either the PATTERN or the
>              REPLACEMENT. 
> 
> the equivilent text for m// is not there. so that is a documentation big
> IMO. i will report it to p5p.

I quoted the text for m//, obtained from the links from 
http://www.perl.com to 
ftp://ftp.cs.colorado.edu/pub/perl/CPAN/doc/manual/html/pod/perlop.html
which is 5.005_02.

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


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

Date: Wed, 23 Dec 1998 02:24:17 +0100
From: Alex Farber <alex@kawo2.rwth-aachen.de>
Subject: Re: problem with $/ - is it a perl bug?
Message-Id: <36804641.277F8BAE@kawo2.rwth-aachen.de>

Hi Uri,

thanks for your help - I've overseen that paragraph in 
the perl docs

/Alex


Uri Guttman wrote:
> 
> >>>>> "AF" == Alex Farber <alex@kawo2.rwth-aachen.de> writes:
> 
>   AF> Alex Farber wrote:
>   >> $INPUT_RECORD_SEPARATOR = "-----------------\n"
>   >> ...
>   >> while (<READ>)
>   >> {
>   >> if (m'\nComment:\s+(.+)${INPUT_RECORD_SEPARATOR}'is)
>   >> {
>   >> $comment = $1;
>   >> }
>   >> }
> 
>   AF> Hi again,
> 
>   AF> I have  tried the same, but with other delimiters:
> 
>   AF>      if (m"\nComment:\s+(.+)${INPUT_RECORD_SEPARATOR}"is)
> 
>   AF> and it works now. So, is it a perl bug (a variable $x is not
>   AF> being interpolated in  m'$x' expression) or is it a feature?
> 
> that is a feature. see the doc stuff below. why did you decide to use '
> (or ") for your delimiter? plain / would be fine for what you
> have. better alternate choices are the paired [](){}. i have never seen
> quotes used for m// or s///.
> 
> this is from perlop for s///:
> 
>              If the delimiter chosen is single quote, no variable
>              interpolation is done on either the PATTERN or the
>              REPLACEMENT.
> 
> the equivilent text for m// is not there. so that is a documentation big
> IMO. i will report it to p5p.
> 
> uri
> 
> --
> Uri Guttman                             Hacking Perl for Ironbridge Networks
> uri@sysarch.com                         uri@ironbridgenetworks.com

--
http://www.simplex.ru/pref.html


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

Date: Tue, 22 Dec 1998 19:16:41 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: problem with $/
Message-Id: <p9gp57.3o7.ln@magna.metronet.com>

Uri Guttman (uri@ibnets.com) wrote:
: >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

:   LR> You have run into one of the more obscure features of the 'm'
:   LR> operator.  From `perldoc perlop`:

:   LR>     With the 'm' you can use any pair of non-alphanumeric,
:   LR> non-whitespace characters as delimiters (if single quotes are
:   LR> used, no interpretation is done on the replacement string...


: larry, which version are you using? i looked for that and didn't find it
: but at work here we have 5.004_03 which is sorta old. i reported it and
: maybe i shouldn't have if it was fixed in a later version.


   Apologies (for my sniping) to Alex if he has buggy docs.

   It is not in perl5.004_01 nor perl5.004_04.

   It is in perl5.005_02.


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


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

Date: Tue, 22 Dec 1998 17:42:16 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: problem with $/
Message-Id: <MPG.10e9ea5087cc16509898ee@nntp.hpl.hp.com>

In article <394sqn4u39.fsf@ibnets.com> on 22 Dec 1998 18:47:54 -0500, 
Uri Guttman <uri@ibnets.com> says...
> >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
>   LR> You have run into one of the more obscure features of the 'm'
>   LR> operator.  From `perldoc perlop`:
> 
>   LR>     With the 'm' you can use any pair of non-alphanumeric,
>   LR> non-whitespace characters as delimiters (if single quotes are
>   LR> used, no interpretation is done on the replacement string...
> 
> larry, which version are you using? i looked for that and didn't find it
> but at work here we have 5.004_03 which is sorta old. i reported it and
> maybe i shouldn't have if it was fixed in a later version.

5.005_02.  Your bug report will be filed properly (i.e., circularly).  
:-)  It is great that the latest docs are on the Web now!
 
> and i asked the guy, why he would use ' as a delimiter? the usefulness
> of m'' or s''' is highly dubious but they are there!

He switched to " (instead of /), before any of our responses.  To each 
his own...

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


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

Date: Wed, 23 Dec 1998 03:50:56 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: problem with $/
Message-Id: <36806A52.FD738828@home.com>

Larry Rosler wrote:
> 
> In article <394sqn4u39.fsf@ibnets.com> on 22 Dec 1998 18:47:54 -0500,
> Uri Guttman <uri@ibnets.com> says...
> > >>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
> >   LR> You have run into one of the more obscure features of the 'm'
> >   LR> operator.  From `perldoc perlop`:
> >
> >   LR>     With the 'm' you can use any pair of non-alphanumeric,
> >   LR> non-whitespace characters as delimiters (if single quotes are
> >   LR> used, no interpretation is done on the replacement string...
                                                 ^^^^^^^^^^^

> >
> > larry, which version are you using? i looked for that and didn't 
> > find it but at work here we have 5.004_03 which is sorta old. i 
> > reported it and maybe i shouldn't have if it was fixed in a later
> > version.
> 
> 5.005_02.  Your bug report will be filed properly (i.e., circularly).
> :-)  It is great that the latest docs are on the Web now!

While it's nice that single quotes are now mentioned under m//, it looks
like someone cut and pasted a little too much from s///.  I don't see
any _replacement_ strings in m//.  :-)

Here's the rest of it:

     (if single quotes are used, no interpretation is done on the 
     replacement string. Unlike Perl 4, Perl 5 treats backticks as 
     normal delimiters; the replacement text is not evaluated as a 
     command). 

I don't think Perl 4 ever behaved like that!  A bug report is still in
order, which I will submit first thing in the new year unless someone 
wants to beat me to it.

-- 
Rick Delaney
rick.delaney@shaw.wave.ca


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

Date: 23 Dec 1998 00:56:07 GMT
From: moseley@best.com (Bill Moseley)
Subject: Re: Recursive file copy keeping date attributes
Message-Id: <36803fa7$0$204@nntp1.ba.best.com>

Not a perl solution, but the DOS xcopy program will copy attributes, and
keep date same as the source.

In article <368027E8.AFEC35BD@swcp.com>, lynn@swcp.com says...
>
>
>I'm trying to copy files from Win-NT workstations to an area on a
>file server that will be written to a CD-recorder for backup
>purposes.  The File::Copy module seems to be lacking two features
>that I'd like.  The most desirable feature would be a copy that
>includes all files in a directory and all of its subdirectories
>somewhat like Unix does with the cp -R command.  The second feature
>is that I'd like the file dates to be preserved.  I'm using the
>File::Path module (mkdir) to generate paths to the target
>directories so that they exist prior to the copy.
>
>Using the 'system( $from $to )' command with a $from\*.* construct
>will preserve the file dates but will not descend the directories. 
>I'd like to keep this thing so that it only uses standard shell
>commands for 'copy' (or perl commands) and not have to rely on the
>Cygnus 'cp' port to windows.
>
>Does anyone know where a more robust 'copy' command can be found
>for Perl?
>
>Thanks.
>Lynn
>
>lynn@swcp.com

-- 
( Please CC: by email if not too much trouble )
--------------
Bill Moseley
moseley@best.com



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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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 V8 Issue 4483
**************************************

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