[10215] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3808 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 24 00:07:27 1998

Date: Wed, 23 Sep 98 21:00:18 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 23 Sep 1998     Volume: 8 Number: 3808

Today's topics:
    Re: any way to encrypt my script? bitnut1@my-dejanews.com
        Calling java from cgi(Perl W32) run on Windows NT <johnvun@asiapac.net>
    Re: Hashes springing into existence [Was: more regex/pa <zenin@bawdycaste.org>
        How to post via HTTPS (Harry)
    Re: Is perl millennium compliant ? <klus@vaxxine.com>
        Manipulating Single lines in file... <agn@cryogen.com>
    Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
    Re: Perl & Java - differences and uses (David Formosa)
    Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
    Re: Perl & Java - differences and uses <zenin@bawdycaste.org>
        Perl with use/require doesn't work under cron bobmorgan@my-dejanews.com
    Re: Poll: How Did You Learn Perl? <ghicken@NOSPAMsmart.net>
    Re: Poll: How Did You Learn Perl? <sneaker@sneex.fccj.org>
        Question about Sendmail, Perl, and CGI <phunter@hass.usu.edu>
    Re: Question about Sendmail, Perl, and CGI <ksmith@RemoveThisToEmail.searchpoint.com>
    Re: Regular Expression Beautifier <mgregory@asc.sps.mot.com>
    Re: send geroge reese (was Re: Call for Participation:  <borg@imaginary.com>
        substitute to a new string, leaving first unchaned due@discovernet.net
    Re: substitute to a new string, leaving first unchaned <ajohnson@gpu.srv.ualberta.ca>
        system call treats vars as literals... (perl 5.005) <pazandak@OBJS.com>
    Re: where is Date::Parse? (Leslie Mikesell)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Thu, 24 Sep 1998 03:13:54 GMT
From: bitnut1@my-dejanews.com
Subject: Re: any way to encrypt my script?
Message-Id: <6ucddi$veb$1@nnrp1.dejanews.com>


>------------------------------------------
> rjk@coos.dartmouth.edu (Ronald J Kimball): ...
> Perhaps it's more akin to saying that only astrophysicists should make
> authoritative comments about the composition of stars.
>------------------------------------------

Wrong again.

Scientific method does not and never did require that theories
be formulated by observers in the field. In fact, many discoveries
were made by sharp minds who had never even visited the trenches.

It should be obvious that the authority in any given subject is
derived solely from one's understanding of that subject, rather
than from how many years one has spent doing this or that.

B.N.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Thu, 24 Sep 1998 11:12:03 +0800
From: johnvun <johnvun@asiapac.net>
Subject: Calling java from cgi(Perl W32) run on Windows NT
Message-Id: <3609B883.D75C7BEF@asiapac.net>

Dear Expert,

How to call java application from a cgi (Perl W32) run on Windows NT?

I want to run a cgi, from the cgi call a java application, then format a
html page back to user.


Thanks !

johnvun




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

Date: 24 Sep 1998 02:28:36 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Hashes springing into existence [Was: more regex/pattern substitution]
Message-Id: <906604119.785605@thrush.omix.com>

Daniel Grisinger <dgris@rand.dimensional.com> wrote:
	>snip<
: What?  Do you mean that perl doesn't consult with spirits?  Damn. :-)

	Nope, however it often takes the intake of spirits to consult
	the perl source. :-)

: Actually, I thought that hv_fetch() was called and that if it
: failed newHV() would be called without ever involving any
: of the *exists functions.  I must have been mistaken, though,
: as I can no longer find the code that I thought did that.

	Which is basically what my piezo perl internals was pointing
	out.

	Instead of exists($foo{bar}{baz}) doing (hv_fetch() || newHV()), etc
	all the way down the tree until it can finally do pp_exists() on
	"baz", why can't the first hv_fetch() that fails result in exists()
	bailing out false?

	It seems to me this would be *faster* for all cases.  Why?  If the
	tree is complete and we can do pp_exists() on the final element, we
	lose nothing (we have to fetch the entire tree anyway, which implies
	a test of some kind or another (hv_fetch() returning false, I
	think)).  If the tree is not complete, we basically do the same
	operation but we can bail out sooner.

	Along similar (ok, a bit twisted:-) lines of logic, should:

		-f "/path/to/some/file.txt"

	First create the full directory structure, /path/to/some/, if it
	does not exist?  God I hope not. :-)

	Note however, that I'm not speeking of assignment here, only the
	special case of exists().  Indeed, $foo{bar}{baz} = "dog"; should
	of course work as it currently does.  I can not however, see a
	single reason why an exists() test should be creating anything.
	Not creating more structures is a primary (but not only, I'll
	admit) reason for having exists() in the first place.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Thu, 24 Sep 1998 06:55:57 GMT
From: harry@dublin.net (Harry)
Subject: How to post via HTTPS
Message-Id: <3609ec80.10547785@news.netcom.ca>

	Hello!

	I was just wondering how I post via https. I have downloaded
	SSLeay & have the Perl modules to connect to a secure-host.

	Although, I'm really confused as to how I post.

	I need to write a Perl script which connects to my secure
	server and submits a form via formmail.

	Anyone have any tips?

	Ciao!


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

Date: 24 Sep 1998 03:38:43 GMT
From: "Jon Klus" <klus@vaxxine.com>
Subject: Re: Is perl millennium compliant ?
Message-Id: <01bde76e$762113e0$23d405d1@pckreamer>


Sure, I certify PERL using the Jon Nonsense Y2K Certification
Standard for the Uninitiated (JNY2KCSU).  But then again, I
also certify COBOL, C, C++, BASIC, Fortran, my favourite
pliers, multimeter, wrench, and my kitchen toaster. :-)

My Microsoft coffee cup worries me though. :-)

Ah, as long as you use a four digit year (or a biased
representation), and always remember...

Don't blame the tool, blame the mechanic (s/he makes more money).


Eisen Chao <echao@interaccess.com> wrote in article
<6ub5e4$3qj$3@supernews.com>...
> I R A Aggie (fl_aggie@thepentagon.com) wrote:
> : In article <35EEB1F2.34BD@boat.bt.com>, georgelj@boat.bt.com wrote:
> : 
> : + Does snybody knwo if the current releases of perl have been certified
> : + for millennium compliance ?
> : 
> : *Which* millenium?
> 
>   *Which* Calandar System
>   (e.g. jewish, Babylonian, Chinese, Greek Orthodox)
>  
> : James
> 


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

Date: 23 Sep 1998 19:17:28 +0700
From: "The Astrochicken" <agn@cryogen.com>
Subject: Manipulating Single lines in file...
Message-Id: <01bde761$72295fc0$4b8c41d8@dwalla.pacifier.com>

I am working on a glossary script and am almost complete; all i have left
is the admin script, which has been causing me some troubles.  I have 26
files (one for each letter in the alphabet), in which the words and their
definitions are stored, so each file looks something like this:

word|number_assigned_2_word|definition
word2|another_number|definition
etc.

I have gotten as far as making the admin script that displays the word that
you wish to edit or delete, but i don't know how to manipulate single lines
in a file.  Is it possible to open the desired file and delete the line i
wish to delete so i can replace it with the new, updated line (or not even
replace it if i just want to delete the record)?

If my previous paragraphs didn't make any sense, pretty much what i want to
know is how to delete individual lines from a file.  If you can provide
information that would help me, it would be greatly appreciated.  Thank
you.

-erik (The Astrochicken)
agn@cryogen.com
ICQ: 5408410


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

Date: 24 Sep 98 02:01:55 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906602811.387276@thrush.omix.com>

David Formosa <dformosa@zeta.org.au> wrote:
: In <6ubg92$1bg$1@nnrp1.dejanews.com> bjohnsto_usa_net@my-dejanews.com writes:
	>snip<
: >What do you mean by lambda style function?
:
: A lambda style function is a function that has no name.

	Umm, not quite correct.  This is an anonymous function, which is
	only part of what a lambda function is.  Indeed, it is not even
	the most important or most interesting part.

: For example in perl I can go,
:
: $var = sub {
: 	$x =shift;
: 	$y =shift;
: 	return $x+$y;
: }

	This is a function pointer to an anonymous function.  A lambda style
	function is more powerful as in addition to this aspect, it also holds
	the state at the time it was defined.  Perl example:

        sub foo {
            my $x = shift;
            return sub {
                return $x * 10;
            };
        }
        
        my $this = foo(5);
        my $that = foo(10);
        
        print $this->(), "\n";
        print $that->(), "\n";

	## Prints:
	##	50
	##	100

	Simply, the state of $x at the time the anonymous function was built
	is stored as now an intrinsic aspect of the anonymous function.
	Indeed, it is even similar to a field of an object.  The paradigm
	here however is reversed from traditional OO in that instead of the
	data knowing how to do work on itself (an "object" of data with
	methods), the work knows what data to work on.

	Java can not do this.  Not with interfaces, inner classes, or
	anything else (well, except for JPL <evil grin>).

	Would one build an entire system from lambda functions?  Probably
	not, however I have yet to see anyone, any language, or any other
	methodology match them for call back operators, dynamic dispatch
	tables, and similar highly dynamic operations.  This is why even
	Python (if memory serves me) has support for them.

	Now for George, please show us how this aspect of lambda functions
	(*not* function/method pointers) can be replicated in an OO framework.

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 24 Sep 1998 12:56:03 +1000
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: Perl & Java - differences and uses
Message-Id: <6uccc3$ocs$1@godzilla.zeta.org.au>

In <906602811.387276@thrush.omix.com> Zenin <zenin@bawdycaste.org> writes:

[...]

>	This is a function pointer to an anonymous function.  A lambda style
>	function is more powerful as in addition to this aspect, it also holds
>	the state at the time it was defined.  Perl example:


This is what I would noramly call a lambda closure.  Could someone please 
clarify the diffrences between an anonomuous function, a lambda function and
a lambda closure?



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

Date: 24 Sep 1998 03:25:59 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906607559.784954@thrush.omix.com>

George Reese <borg@imaginary.com> wrote:
: In comp.lang.java.programmer Zenin <zenin@bawdycaste.org> wrote:
	>snip<
: : 	Or more correctly, no language can enforce OO at all (as you
: : 	yourself proved in another post), thus "supports" and "enforces"
: : 	are (as they are in ENGLISH) two very, very different terms.
:
: Goddamn, you are a fucking idiot.

	Temper, temper...

: Those two are not contradictory
: statements and I am tired of playing word games with you and the other
: group of clowns who seem so utterly incapable of reading.

	Many of your statements support our points of view.  To point out
	such conditions is not only a valid argumental method, it is
	also a common and well understood one.  You may not like the fact
	that your own statements can be used as valid arguments to unseat
	your conclusions, but what you like, I, or anyone else like is not
	relevant to this thread.

	<tangent>
	I just noticed your login.  I must admit it's amusing how well
	it seems to fit you, since at the heart of your arguments you
	seek to remove the individuality of the programmer...

		I am George Reese of OO.
		Resistance is futile.
		You will be assimilated.

	:-) <--for the humor impaired

	</tangent>

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: 24 Sep 98 03:41:52 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <906608792.232015@thrush.omix.com>

David Formosa <dformosa@zeta.org.au> wrote:
: This is what I would noramly call a lambda closure.  Could someone please 
: clarify the diffrences between an anonomuous function, a lambda function and
: a lambda closure?

	A lambda function and a closure are the same.

	An anonymous function is simply a function without a name.  A
	function pointer is the address of a function that may or may
	not have a name.

	Normal function:

	sub foo { return "foo" }

	Anonymous function:

	my $foo = sub { return "foo" }

	Function pointers to named functions:

	my $foo = \&foo;   ## "Hard" (ie address) reference/pointer
	my $foo = "foo";   ## "Soft" (ie, by name) reference/pointer

	Function pointer to an anonymous function:

	my $foo = sub { return "foo" }

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Thu, 24 Sep 1998 03:22:24 GMT
From: bobmorgan@my-dejanews.com
Subject: Perl with use/require doesn't work under cron
Message-Id: <6ucdtf$1n$1@nnrp1.dejanews.com>

Hi,

  I have a perl script that that uses "use myPackage;". The script works fine
  from the command line (AIX 4.1.4). When I try and run the script as a cron
  job, the script never runs. I tested this by using some print statements to
  a file and they never show up when under cron but work fine when run from
  the command line.

  I changed my script to use "require" and that did not work either from cron.
  Again it worked fine from the command line.

  If I take out the "use" and "require" statements from the script - then it
  works fine from the command line and from cron.

  The packages that I am using are some of my own located in the same
directory  as the script.

  Any ideas ? Has anyone encountered this problem ?

  Thanks in advance.

  Bob Morgan
  bob.morgan@computer.org

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 24 Sep 1998 02:08:37 +0000
From: Gary Hicken <ghicken@NOSPAMsmart.net>
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <m3pvcmw9cq.fsf@ghicken.smart.net>

John Porter <jdporter@min.net> writes:


> I learned from the Pink Camel.
> 
> So here's a poll for everyone.
> 
> From what resource(s) did you learn Perl?
> 
> . Llama v.1
> . Llama v.2
> . Camel v.1
> . Camel v.2
> . Other book (give name)
> . Docs included in the distribution
> . Something on the WWW
> . Studying existing code
> . Class/tutor
> 
> -- 
> John "Many Jars" Porter

I'm still learning. I wrote my first perl script three years ago. Since then
I've been through every other language until I was tasked to kick out some
killer perl scripts. When I'm done I'll never go back to any of the others.

Resources:
   Llama v.1
   Camel v.1
   Perl Cookbook (just bought two weeks ago)

   Perldocs (on the fly)

Gary

-- 
-------Gary Hicken-------------------------------------------
-------remove NOSPAM-----------------------------------------


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

Date: Wed, 23 Sep 1998 22:40:55 -0400
From: Bill 'Sneex' Jones <sneaker@sneex.fccj.org>
Subject: Re: Poll: How Did You Learn Perl?
Message-Id: <3609B137.5077F707@sneex.fccj.org>

Gary Hicken wrote:
> 
> John Porter <jdporter@min.net> writes:
> 
> > From what resource(s) did you learn Perl?
> >
> > . Llama v.2
> > . Camel v.2
> > . Other book (give name)
> > . Docs included in the distribution
> > . Something on the WWW
> > . Studying existing code

Those as well, including Perl by Example (Redbook),
Advanced Perl, Web Client programming, Lincoln Stein's CGI.pm,

But mainly I have learned, and am still learning, from others
- Other peoples code (good and bad) and from people here
on comp.lang.perl.misc.

Also, I find that I gain the most insight from doing examples
and testing out ideas.  Some things work, some don't; but
all in all I find find Perl most helpful :]

And I admit that I should read the 'included docs' more, but
some sections I just can't stomach, sorry...

-Sneex- :] 
__________________________________________________________________
Bill Jones | FCCJ Webmaster | http://webmaster.fccj.org/Webmaster
__________________________________________________________________
We are the CLPM... Lower your standards and surrender your code...
We will add your biological and technological distinctiveness to 
our own... Your thoughts will adapt to service us...
 ...Resistance is futile...


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

Date: Wed, 23 Sep 1998 21:35:55 -0600
From: Patrick Hunter <phunter@hass.usu.edu>
Subject: Question about Sendmail, Perl, and CGI
Message-Id: <3609BE1B.266B9CAB@hass.usu.edu>

I've been trying to find some way to pull this off and I'm hoping that
someone here has gotten it to work.

I have a form on a website that I'm designing for a university group
that hires students to help other students improve writing skills. There

is an online application for interested students to sign up. Part of the

application process is the submission of two writing samples. I wrote a
CGI script in Perl 5 that calls sendmail and sends the submission to the

responsible person. I would also like to be able to offer the ability
for the student to submit their writing samples online as well, using
the file upload feature of Netscape. I would then want the submitted
files to be included as attachments when sendmail sends the data to the
recipient. Does anybody know if this is possible? I know how to write
the HTML for the form, however, I am unclear of the coding on the Perl
side and sendmail attachments. Any help or advice would be appreciated.
Public posting or private emails welcome.

Patrick Hunter
hunterp@xmission.com



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

Date: Thu, 24 Sep 1998 03:36:31 GMT
From: "Ken" <ksmith@RemoveThisToEmail.searchpoint.com>
Subject: Re: Question about Sendmail, Perl, and CGI
Message-Id: <37jO1.5351$RC5.3732285@news.rdc1.bc.wave.home.com>


There are a few scripts that do something like that over at:
http://www.cgi-resources.com
you could also try http://www.script-search.com

Ken
http://www.searchpoint.com


Patrick Hunter wrote in message <3609BE1B.266B9CAB@hass.usu.edu>...
>I've been trying to find some way to pull this off and I'm hoping that
>someone here has gotten it to work.
>
>I have a form on a website that I'm designing for a university group
>that hires students to help other students improve writing skills. There
>
>is an online application for interested students to sign up. Part of the
>
>application process is the submission of two writing samples. I wrote a
>CGI script in Perl 5 that calls sendmail and sends the submission to the
>
>responsible person. I would also like to be able to offer the ability
>for the student to submit their writing samples online as well, using
>the file upload feature of Netscape. I would then want the submitted
>files to be included as attachments when sendmail sends the data to the
>recipient. Does anybody know if this is possible? I know how to write
>the HTML for the form, however, I am unclear of the coding on the Perl
>side and sendmail attachments. Any help or advice would be appreciated.
>Public posting or private emails welcome.
>
>Patrick Hunter
>hunterp@xmission.com
>




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

Date: 24 Sep 1998 09:24:34 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Re: Regular Expression Beautifier
Message-Id: <r8ww6u2xmt.fsf@asc.sps.mot.com>

ilya@math.ohio-state.edu (Ilya Zakharevich) writes:

> [A complimentary Cc of this posting was sent to Daniel Grisinger 
> <dgris@rand.dimensional.com>],
> who wrote in article <6ubc2r$aat$1@rand.dimensional.com>:
> > regdecl is a regular expression beautifier that
> > accepts a regular expression as input and generates
> > a formatted, commented, regular expression as output.
> > 
> > For example-
> > 
> > '(?:(?:as?)\t+.+(?:ooga(?!booga)|flim(?=flam)
> >  (walla-walla))((?<!asdf)q*?(?<=t)(?:rv+)*last
> >  (?#this is a comment)asdf{5,93}[q-u](?:\t
> >  \n\r\f+\a?))\basd\Bqq(?is:asdgf))'
> > 
> > becomes
> > 
> > (?:                 # Start non-capturing group 
> >   (?:                 # Start non-capturing group 
> >     a                   # The literal string `a' 
> >     s?                  # The literal string `s'  0 or 1 time 
> >   )                   # End group 
> 
> I think CPerl does much better (without extra bloat and unneeded
> comments). - Except the embedded comments, need to be fixed.

One might note that the original problem specification was explicitly
to include commenting the regex.  I guess the only way that CPerl
meets this spec is by noting that the spec doesn't say how much
commenting.

I guess that I would use CPerl in emacs to indent my code, wheras I
might use regdecl to save the hassle of poring over regex doc to
decode some obtuse regex that uses features I haven't seen before...

Where do I get CPerl?

Martin.


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

Date: Thu, 24 Sep 1998 03:03:26 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: send geroge reese (was Re: Call for Participation: Python Conference)
Message-Id: <2EiO1.1707$Ge.5615396@ptah.visi.com>

In comp.lang.java.programmer Jeremy Hylton <jeremy@cnri.reston.va.us> wrote:
: Uri Guttman <uri@camel.fastserv.com> writes:

:> >>>>> "JH" == Jeremy Hylton <jeremy@cnri.reston.va.us> writes:
:> 
:>   JH> Call for Participation
:> 
:>   JH> 7TH INTERNATIONAL PYTHON CONFERENCE
:>   JH> http://www.foretec.com/python/workshops/1998-11/
:> 
:> let's send george reese. he'll teach them a thing or two about OO and
:> debating.
:> 

: That's not such a bad idea <0.5 wink> (not George in particular).
: There is an introdction to Python tutorial being held the first
: morning of the conference (and an introduction to JPython in the
: afternoon).  The occasionaly debate might be more productive, and I
: imagine that Perl programmers could learn a thing or two about OO from 
: Python (even if they contain to use Perl).

At this point, I intend to come.  Not to learn about OO or debating--I
understand those concepts quite well.  I actually have a strong
interest in JPython.

-- 
George Reese (borg@imaginary.com)       http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
   "Keep Ted Turner and his goddamned Crayolas away from my movie."
			    -Orson Welles


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

Date: Thu, 24 Sep 1998 01:54:21 GMT
From: due@discovernet.net
Subject: substitute to a new string, leaving first unchaned
Message-Id: <6uc8od$q04$1@nnrp1.dejanews.com>

Can someone provide some help for the following.

I want to take an array, use s/// to find something and change it but leave
the original unchanged and write the change to a new var.  Is there a one
liner to do this?

I am using:
$foo = 'one two three';
$bar = $foo;
$bar =~ s/one/une/;
but I would like to do it all at once like:

$bar = $foo =~ s/one/une/;

but $bar here is 1 as the substitution is successful.  I have tried () in
various places without success.  Any suggestions?

Bob

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 23 Sep 1998 22:40:59 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: substitute to a new string, leaving first unchaned
Message-Id: <3609BF4B.E1549F7@gpu.srv.ualberta.ca>

due@discovernet.net wrote:
> 
> Can someone provide some help for the following.
> 
> I want to take an array, use s/// to find something and change it but leave
> the original unchanged and write the change to a new var.  Is there a one
> liner to do this?
[snip] 
> $bar = $foo =~ s/one/une/;
> 
> but $bar here is 1 as the substitution is successful.  I have tried () in
> various places without success.  Any suggestions?

I guess you didn't try them like:

($bar = $foo) =~ s/one/une/;

regards
andrew


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

Date: Wed, 23 Sep 1998 21:42:34 -0600
From: Paul Pazandak <pazandak@OBJS.com>
Subject: system call treats vars as literals... (perl 5.005)
Message-Id: <3609BFFD.29AFA9E5@OBJS.com>

I am trying to simply call cat (win95) with three vars, but they are treated as literals...
Why?

E.g.

system ( 'cat i:\foo.txt $_ > $mytmpfile');

Doing a print works:
print $_ ;
or
print "Processing file: $_" ;

so, why is the variable handled like a literal in the system call??????
Were's this darn oddity documented in "Programming Perl"?

Thanks SO much (in advance)!

Paul.
[please respond directly to me.]

p.s.[I am using File::Find, and all I want to do is insert a few lines at the top of every
file in a directory (including subdirs) -- the file traversing works, just not the insertion.]



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

Date: 23 Sep 1998 21:32:46 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: where is Date::Parse?
Message-Id: <6ucb0e$sjn$1@Mars.mcs.net>

In article <6uauen$nhv$1@client3.news.psi.net>,
Abigail <abigail@fnx.com> wrote:
>Leslie Mikesell (les@MCS.COM) wrote on MDCCCXLIX September MCMXCIII in
><URL: news:6u9vqn$3t5$1@Venus.mcs.net>:
>++ 
>++ Hmmmm, very curious how something like ftp or lynx could break
>++ simply because they are invoked by perl.  Even if there are
>++ firewall options involved, perl shouldn't be munching your
>++ environment or config file settings. 
>
>
>I'm not saying ftp or lynx are breaking. It's just that CPAN doesn't
>seem to know how to handle them.

Lynx and ncftp are just command line operations - not much to go wrong.
Normal ftp needs to use ~.netrc or a chat on a pipe so it is more
fragile under program control.

  Les Mikesell
    les@mcs.com


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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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