[10860] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4461 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Dec 19 15:07:24 1998

Date: Sat, 19 Dec 98 12:00:21 -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           Sat, 19 Dec 1998     Volume: 8 Number: 4461

Today's topics:
    Re: $&, $', and $` and parens.... <uri@sysarch.com>
    Re: $&, $', and $` and parens.... (Ronald J Kimball)
    Re: @INC   and perl (Ronald J Kimball)
    Re: Diagnostic Scrolls by gemhound@gemhound.com
    Re: Easy newbie questions (Tad McClellan)
    Re: First German Perl Workshop 1.0 (Ronald J Kimball)
        glob() returns empty list roger-spamfree@sinasohn.com
        help! (IS)
    Re: help! <due@murray.fordham.edu>
    Re: help! (Tad McClellan)
    Re: How do I .....? <pulsecode@mailandnews.dot.com>
    Re: How do I .....? (Tad McClellan)
    Re: non-blocking socket connect question (Adam Levy)
    Re: numbers in base 36 <uri@sysarch.com>
    Re: numbers in base 36 (Randal L. Schwartz)
    Re: numbers in base 36 (Randal L. Schwartz)
        RE: Popping a terminal (shell) and write to it ? vmenon@home.com
    Re: Print only the first 50 characters <pulsecode@mailandnews.dot.com>
        reading all files in a directory <tspencer@exconet.co.uk>
        replacing text with a variable groans@mailexcite.com
    Re: replacing text with a variable <pulsecode@mailandnews.dot.com>
    Re: replacing text with a variable <due@murray.fordham.edu>
        Retrospective on comp.lang.perl.moderated? (Larry Rosler)
    Re: Retrospective on comp.lang.perl.moderated? (Matthew Bafford)
    Re: Retrospective on comp.lang.perl.moderated? <uri@sysarch.com>
    Re: Retrospective on comp.lang.perl.moderated? ptimmins@netserv.unmc.edu
    Re: Retrospective on comp.lang.perl.moderated? <uri@sysarch.com>
    Re: shift. (Ronald J Kimball)
    Re: shift. <ajohnson@gatewest.net>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 19 Dec 1998 12:22:18 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: $&, $', and $` and parens....
Message-Id: <x77lvom4hh.fsf@sysarch.com>

>>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:


  BL> Look, if you really want to get rid of $&, $4 and $', here's
                                                  ^^^^

that is why we should ban all 'smart' newsreaders. when you type a
backquote, you should get a backquote. not a funny 'better looking'
backquote. it that supposed to be legal perl? i am not blaming bart but
his broken reader that thinks it know more than he does.
they are not standard so why do they think they are useful?

switch off fancy char substitutions. kill them dead, dead, dead!!!!

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Sat, 19 Dec 1998 13:08:13 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: $&, $', and $` and parens....
Message-Id: <1dka9zt.9ghuyb1qex0baN@bay1-457.quincy.ziplink.net>

Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:

> Depends.  As I wrote in another message, nongreedy has a potential to
> be up to 3x quickier than greedy - in newer Perls only.

And as I wrote in response to that message, please explain how the regex
engine has been changed to make non-greedy quantifiers more efficient.

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 19 Dec 1998 13:08:15 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: @INC   and perl
Message-Id: <1dkaabg.mce8ar9qr3r4N@bay1-457.quincy.ziplink.net>

[posted and mailed]

Peter L. Berghold <peter@berghold.net> wrote:

> @INC is an array pre-defined by PERL and not a file.  You can "edit" it
> by doing something like:
> 
> BEGIN{
>     push(@INC,"/some/path/some/where");
> }

But the proper way to do it (with recent versions of Perl), is:

use lib '/some/path/some/where';

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 19 Dec 1998 18:12:15 GMT
From: gemhound@gemhound.com
Subject: Re: Diagnostic Scrolls by
Message-Id: <75gq9v$d2i$1@nnrp1.dejanews.com>



> When did Microsoft break *JavaScript* on purpose? They implement the
> EMWACKO whatever-the-heck-it-is standard, as does Netscape now. Before
> that, JavaScript was defined as "whatever Netscape did", and their
> implementation often didn't work the way it was documented. (IE's
> JScript often worked along with the documentation, and scripts that
> worked in it would break in Netscape.)
>

That may be, but as I write, I had to get rid of Referstat on my website. 
This has been running for a year on thousands of machines as a very popular
web statistics program. It ran fine, but now I find that Msoft's Internet
Explorer is breaking this legacy Javascript, and I am getting complaints of
browsers freezing.

It stinks that I must be afraid of using vanilla Javascript which may work
Now, but which Msoft may break at some Future time, to make their Jscript
more popular. I just pray they never get ahold of Perl.

No, I don't want to get into a debate ;')  But this is just as I see it --
it's really annoying that a language which was invented precisely so that it
would be a Standard, is not a standard at all.It just makes maintaining my
site all the more problematic.	The latest version of IE also seems to
breaking a Lot of other javascript according to some other NGs I read.

Still, I guess the bad generates the good.  The whole reason I am getting
into Perl is that Perl CGI will be on My server, under My control, and not
subject to the whims of either Msoft Or Netscape.

Jim Mooney

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


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

Date: Sat, 19 Dec 1998 13:02:19 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Easy newbie questions
Message-Id: <r7tg57.6t2.ln@magna.metronet.com>

(BXTC) (bxtc@forfree.at) wrote:
: I have just started learning Perl and am tring to write a small program
: to write html templetes from existing files.  My first question is what
: symbol/combination works as a wild card (*)?  For instance I want to
: search a string $name to see if it look like *.html   Meaning does the
: name end in .html whatever the filename is.  


if ( $name =~ /\.html$/)
   { print "'$name' looks like *.html\n" }
else
   { print "'$name' does NOT look like *.html\n" }


That checks to see if the name has a .html filename extension,
although it doesn't even need "the regex equivalent of an asterisk
in a glob".

   .* in a regex is roughly the same as * in a glob (ie. matches
   zero or more of (nearly) any character).


For more info on Perl's regular expressions and associated
operators, try:

   perldoc perlre

   perldoc perlop


: I tried using it like that
: but it only would detect "*.html" (one single file).  


   But you must keep your code secret?

   If you show us what you tried, we have a much better chance
   of helping you fix it  ;-)


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


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

Date: Sat, 19 Dec 1998 13:08:17 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: First German Perl Workshop 1.0
Message-Id: <1dkaas8.1bizxcb459paeN@bay1-457.quincy.ziplink.net>

[posted and mailed]

<birgitt@my-dejanews.com> wrote:

> I lurk regularly in all Perl NGs, have nothing perlish to post and
> nothing perlish (yet) to ask (just a lot to read). I don't qualify
> at all to join clp.moderated. I could not post my first reaction to the
> announcement to clp.moderated. I still want to know what is going on
> among Perl programmers in Germany. Is that too much to ask ?

clp.moderated is just a newsgroup; you don't "join" it.

You either read it or you don't, and you either post to it or you don't.

(If you want to post to it, you have to register your email address.
There are no special "qualifications" needed for registering.)

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 19 Dec 1998 15:56:43 GMT
From: roger-spamfree@sinasohn.com
Subject: glob() returns empty list
Message-Id: <75giab$ikl$1@remarQ.com>

I have a CGI script that works fine locally and on a couple of Unix boxen,
but when installed in the cgi-bin directory on my server, returns an empty
list from the glob() function.  

Icut out everything but the glob() and it runs with no errors, but the
glob() doesn't find any files.  Other scripts in the same directory also
run fine (but this is my first pgm using glob()).

The directory is rwxr-xr-x, as is the program.  My ISP has been
spectacularly unhelpful (web page coming soon) in even telling me what
operating system I'm dealing with.  After nearly a month, they finally
admitted that it might be a unix system running BSDi 3.0.

Anyway, the program works locally, but not in the CGI directory, so I
suspect it has somethign to do with permissions or something.
Unfortunately, while I have nearly 20 years experience with procedural
programming, I'm not a Unix or CGI expert.  Any suggestions or advice
anyone can offer would be greatly appreciated.  Thanks!

P.S., remove the -spamfree option from my address to reply.

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

Uncle Roger                       "There is pleasure pure in being mad
sinasohn@ricochet.net                        that none but madmen know."
Roger Louis Sinasohn & Associates
San Francisco, California                  http://www.crl.com/~sinasohn/



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

Date: Sun, 20 Dec 1998 00:55:46 +0800
From: "Lui Wing Cheung (IS)" <wclui@virtue.csis.hku.hk>
Subject: help!
Message-Id: <Pine.GSO.4.03.9812200055020.24154-100000@virtue.csis.hku.hk>

anyone who can help me with this in perl?

$number=30;
$str=<STDIN>;
print $str;

When the user input "$number", i want that the terminal to output "30"
rather than 
"$number".

Thank You.




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

Date: 19 Dec 1998 18:23:27 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: help!
Message-Id: <75gquv$pm4$0@206.165.165.155>

Lui Wing Cheung (IS) wrote in message ...
|anyone who can help me with this in perl?
|$number=30;
|$str=<STDIN>;
|print $str;
|When the user input "$number", i want that the terminal to output "30"
|rather than
|"$number".


Well, I am sure TIMTOWTDI, but OWTDI

$number=30;
   $str=<STDIN>;
print eval $str;

HTH

AmD






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

Date: Sat, 19 Dec 1998 13:27:45 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: help!
Message-Id: <hnug57.eb3.ln@magna.metronet.com>

Lui Wing Cheung (IS) (wclui@virtue.csis.hku.hk) wrote:
: anyone who can help me with this in perl?

: $number=30;
: $str=<STDIN>;
: print $str;

: When the user input "$number", i want that the terminal to output "30"
: rather than 
: "$number".


   Perl FAQ, part 4:

      "How can I expand variables in text strings?"


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


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

Date: Sat, 19 Dec 1998 10:59:54 -0800
From: "PCM" <pulsecode@mailandnews.dot.com>
Subject: Re: How do I .....?
Message-Id: <75gt07$hfm$1@news-02.meganews.com>

>In otherwords how do I know these strings do not have any content other
than
>spaces or special chars.

Here ya go...

## Clean up things your browser does to form data

# Convert the +'s back to whitespace
$FORM{'name'} =~ tr/+/ /;

# Change those %20's back to spaces, etc...
$FORM{'name'} =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

# Strip out any HTML the user entered
$FORM{'name'} =~ s/<!--(.|\n)*-->//g;
$FORM{'name'} =~ s/<([^>]|\n)*>//g;

Anything left should be raw text and numbers

Patrick
/---------------------------\
    Perl help and more
http://error500.hypermart.net
\---------------------------/





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

Date: Sat, 19 Dec 1998 13:05:54 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How do I .....?
Message-Id: <ietg57.6t2.ln@magna.metronet.com>

Muthu Muthuraj (mvenkatesh@worldnet.att.net) wrote:
: Find out if the variable obtained from a HTML form using $FORM{'name'} where
: name is the variable in the form contains only spaces and no chars/digits.

: In otherwords how do I know these strings do not have any content other than
: spaces or special chars.


   print "'$FORM{name}' is OK\n" if $FORM{name} =~ /[a-zA-Z0-9]/;


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


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

Date: Sat, 19 Dec 1998 12:39:35 -0600
From: adrade@wwa.com (Adam Levy)
Subject: Re: non-blocking socket connect question
Message-Id: <adrade-1912981239360001@pool2-031.wwa.com>

In article <x3y67bewgq1.fsf@tigre.matrox.com>, Ala Qumsieh
<aqumsieh@matrox.com> wrote:

> >  2. How do I then know when the connection has been made so I can send the
> > data? 
> 
> listen() for incoming connections and then accept() them.
> You should read more about sockets before you go on.

I was looking for info on connect(). I want to be able to connect, send
some data, and then receive data as it comes in. But I dont want this
connection to block another like connection going on with another server.

I want this program to be able collect the data from both connections as
it comes it from either, the two variables designated to each building up
simultaneously.


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

Date: 19 Dec 1998 13:08:01 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: numbers in base 36
Message-Id: <x7zp8kknsu.fsf@sysarch.com>

>>>>> "MB" == Matthew Bafford <dragons@scescape.net> writes:

  MB> I did say it was from one of my older scripts! :)  Anyway, it works fine 
  MB> with a 3 digit number.

if you mean to convert from base to decimal, it was broken. 100 octal
returns 16 while it should return 64. that is broken. the multiplier
should be increasing by powers of the base, not powers of 2 * the base.
that is basic base math.

  MB> *scratch head*

wash your har more often. :-)

  MB> =>   MB> 		if   ( $multi == 1 ) { $multi  = $base }
  MB> =>   MB> 		else                 { $multi *= 2     }
  MB> =>                                                  ^^^
  MB> =>                                                  $multi

  MB> Um, no.  That's not how this works.

  MB> The multiplier doubles every position, not squares.

i scratch your head. how does it double every position? in plain ol'
decimal the multipliers should be 1, 10, 100, 1000 ... it is not a
doubling but a exponential increase.

  MB> => 	my $base   = shift;

  MB> => 		$multi *= $multi ;

sorry, should have been *= $base which is what i meant. it was late after a
party!! but your 2 was wrong. 

  MB> Benchmark: timing 32768 iterations of MB, URI...
  MB>         MB: 48 wallclock secs (49.10 usr +  0.00 sys = 49.10 CPU)
  MB>        URI: 44 wallclock secs (43.45 usr +  0.00 sys = 43.45 CPU)

  MB> So yours is faster... :-)

well, faster is faster. i think it is slightly simpler too.

and i did my own benchmark with the if removed and i go from %6
improvement (your test) to almost %16 speedup. the if is
significant. also i removed the chars assignment from the call since it
is a constant and is wasted overhead.

also ucfirst is slightly faster than uc.

these are tested (and i use oct to verify the conversions).

uri

use Benchmark;
use integer ;

$oct = '0x12ad5f';
$base = 16 ;

print oct( $oct ), "\n" ;

$oct =~ s/^0x// ;

print base2dec1( $base, $oct ), "\n" ;
print base2dec2( $base, $oct ), "\n" ;

timethese (1 << 14, {
	uri => sub { base2dec1( $base, $oct ) },
	matt => sub { base2dec2( $base, $oct ) },
	}
) ;



BEGIN { 
my %chars;

@chars{( '0' .. '9', 'A'..'Z')} = (0..35);

sub base2dec1 {
	my $base   = shift;
	my $number = shift;
	my $ret;
	my $multi = 1;

	$ret = 0 ;
	while( $c = chop $number, length( $c ) ) {
		$ret   += $chars{ uc $c} * $multi;
		$multi *= $base ;
	}

	return $ret;
}


sub base2dec2 {
		
	my $base   = shift;
	my $number = reverse(shift);
	my $ret;
	my $multi = 1;

	for ( split //, $number ) {

		$ret   += $chars{ uc $_} * $multi;

		if   ( $multi == 1 ) { $multi  = $base }
		else                 { $multi *= $base }
	}

	return $ret;
}

}

Benchmark: timing 16384 iterations of matt, uri...
      matt: 26 secs (25.62 usr  0.00 sys = 25.62 cpu)
       uri: 22 secs (21.49 usr  0.00 sys = 21.49 cpu)



-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Sat, 19 Dec 1998 19:29:30 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: numbers in base 36
Message-Id: <m1lnk4dj4l.fsf@halfdome.holdit.com>

>>>>> "ptimmins" == ptimmins  <ptimmins@netserv.unmc.edu> writes:

ptimmins> %dec = map { $_ => $i++ } (0..9,'a'..'z'); # map the 36 base36 characters
ptimmins>                                            # to their corresponding base10
ptimmins>                                            # values

For me, that's more clearly written as:

  %dec = (); @dec{0..9, 'a'..'z'} = 0..35;

But to each his own, I guess.

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Sat, 19 Dec 1998 19:40:07 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: numbers in base 36
Message-Id: <m1hfurex7c.fsf@halfdome.holdit.com>

>>>>> "deja" == deja  <deja@kiama.com> writes:

deja> Is there a way for perl to read numbers in bases other 8,10, and 16?
deja> There is a function in Java to format an integer in any base, I would like to
deja> create a base 36 number in java and pass it to a perl script. Can perl convert
deja> it back to decimal?

Well, here's a hack that just dawned on me:

    sub base36_to_dec {
      my $x = shift;
      $x =~ tr/0-9a-zA-Z/\x00-\x09\x0a-\x23\x0a-\x23/d;
      my $y = 0;
      for (unpack "C*", $x) {
	$y = $y * 36 + $_;
      }
      $y;
    }

    print map "base36($_) = ".base36_to_dec($_)."\n",
      qw(1 z Z 10 1z 1Z randal);

print "Just another Perl hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Sat, 19 Dec 1998 17:06:35 GMT
From: vmenon@home.com
Subject: RE: Popping a terminal (shell) and write to it ?
Message-Id: <367CB393.57D538EE@home.com>

Hey there,

I am trying to write a perl program, which does some data manipulation
and then popps a window (terminal window in UNIX) and prints to this
window.

The program is executed through a cron job and is not executed manually
throught the command line (if this makes a difference ?).

I just started learning perl and would appreciate any help you could
give me.

Thanks
Vivek

(or e-mail me at vmenon@tradeit.com)


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

Date: Sat, 19 Dec 1998 10:55:17 -0800
From: "PCM" <pulsecode@mailandnews.dot.com>
Subject: Re: Print only the first 50 characters
Message-Id: <75gsni$hbj$1@news-02.meganews.com>

Try this:

$desc = "this is my book and it is really interesting and fun to read.
please feel free to buy it now and blah blah blah";

$abbrev = substr($desc,0,50)."...";

Cuts the long string to 50 characters (you can change the 50 to whatever you
want).  And you can take that ellipsis off the end if you don't want it.

Patrick
/---------------------------\
    Perl help and more
http://error500.hypermart.net
\---------------------------/

>this is my book and it is really interesting and fun to read.  please feel
>free to buy it now and blah blah blah
>
>so it displays on a web page like this:
>  this is my book and it is really interesting and fun to ...





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

Date: Sat, 19 Dec 1998 19:03:11 -0000
From: "Tony" <tspencer@exconet.co.uk>
Subject: reading all files in a directory
Message-Id: <367bf9b2.0@glitch.nildram.co.uk>

Hi
I am use Perl to try to read certain files in a directory and return the
data asked for to a web page.
The directory I am trying to get the script to read contains a number of
users files with users information and a number of other files.
The user files just have a name and no extension, the other files that do
not contain users info have an extension.
I need to tell the script to open the $users directory and read the users
files one at a time and return the field containing the users name and
email address to the web page the script generates.
The users name is in a field represented by $userdata[1]
The email address is in a field by itself and is represented by $userdate[4]
 .
So can anyone supply a snipet of code that will open the directory specified
by $users and read all the files without an extension one at a time and for
each $userdata[1] $userdata[4] print the data to a webpage and do a carriage
return.
Hope this is clear
Thanks
Tony




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

Date: Sat, 19 Dec 1998 18:23:23 GMT
From: groans@mailexcite.com
Subject: replacing text with a variable
Message-Id: <75gquq$dh1$1@nnrp1.dejanews.com>

Hello all,

Lets say I want to change:

/some/text

to

$a/some/text

where $a is any text value.

Could I use the following commmand?

s!/s!$a/s!is;

Or is there another one that would work better?

Thanks in advance!

~Prime

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


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

Date: Sat, 19 Dec 1998 10:48:51 -0800
From: "PCM" <pulsecode@mailandnews.dot.com>
Subject: Re: replacing text with a variable
Message-Id: <75gsbh$h7g$1@news-02.meganews.com>

>Lets say I want to change:
>/some/text  to  $a/some/text

If that's all you want to do, just do this:

$text = "/some/text";
$both = $a.$text;

Patrick
/---------------------------\
    Perl help and more
http://error500.hypermart.net
\---------------------------/





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

Date: 19 Dec 1998 19:24:42 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: replacing text with a variable
Message-Id: <75guhq$307$0@206.165.165.155>

groans@mailexcite.com wrote in message <75gquq$dh1$1@nnrp1.dejanews.com>...
|Hello all,
|Lets say I want to change:
|/some/text
|to
|$a/some/text
|where $a is any text value.
|Could I use the following commmand?
|s!/s!$a/s!is;


Well, what happened when you tried it?  I am not sure why you have the s there
but I am going to believe you that you need it.

|Or is there another one that would work better?


For this example?  Kind of depends on what you mean by better and what your
actual data looks like.  So far this looks fine to me.

HTH

AmD




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

Date: Sat, 19 Dec 1998 07:54:46 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Retrospective on comp.lang.perl.moderated?
Message-Id: <MPG.10e56c1c512e52a3989966@nntp.hpl.hp.com>

I crossposted this submission as shown below:
  Newsgroups: comp.lang.perl.moderated, comp.lang.perl.misc
It has appeared in ...moderated, but not in ...misc!  Isn't that a 
surprise?

With apologies to those who have seen it before, here is the question:

With year-end-assessment time rapidly approaching, would anyone care to 
comment on how comp.lang.perl.moderated has performed over its life of 
six months or so, relative to the hopes and expectations of its 
proponents?

A cost-benefit analysis at this time might be enlightening.

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


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

Date: Sat, 19 Dec 1998 12:20:07 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <MPG.10e5aa56543d532b989768@news.scescape.net>

In article <MPG.10e56c1c512e52a3989966@nntp.hpl.hp.com>, lr@hpl.hp.com 
says...
=> I crossposted this submission as shown below:
=>   Newsgroups: comp.lang.perl.moderated, comp.lang.perl.misc
=> It has appeared in ...moderated, but not in ...misc!  Isn't that a 
=> surprise?
=> 
=> With apologies to those who have seen it before, here is the question:
=> 
=> With year-end-assessment time rapidly approaching, would anyone care to 
=> comment on how comp.lang.perl.moderated has performed over its life of 
=> six months or so, relative to the hopes and expectations of its 
=> proponents?
=> 
=> A cost-benefit analysis at this time might be enlightening.

It appears in .misc.  Your newsreader didn't show it, since you had 
already read it in .moderated.

:-)

--Matthew

Another Gravity user.


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

Date: 19 Dec 1998 01:44:14 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <x7g1acmy0x.fsf@sysarch.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

  LR> With year-end-assessment time rapidly approaching, would anyone care to 
  LR> comment on how comp.lang.perl.moderated has performed over its life of 
  LR> six months or so, relative to the hopes and expectations of its 
  LR> proponents?

  LR> A cost-benefit analysis at this time might be enlightening.

i don't know how to do it but i feel it has been underused. most of the
action is still in misc. i feel the regulars should make a habit of
either posting original stuff in moderated only of setting followups of
interesting threads there. this will cause a shift of the higher S/N
threads to moderated. it won't eliminate the FAQ's and off topic posts
but will concentrate them in misc where they can be handled and filtered
more easily. that was the original intent of moderated and it has not
been living up tothat since it is not used as such. i don't make too
many original posts but i did one recently (on locking dirs) and i
decided to put in only in moderated so it would get more visibility. i
will continue to follow both groups as long as they exist but it would
be easer and more efficient for me if i know the moderated group has
high S/N threads and misc is mostly FAQ's and their rtfm responses. :-)
if a thread gets more interesting in misc than it can migrate to
moderated.

for example, this is a worthy thread to migrate to moderated only so i
will set my followups accordingly.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Sat, 19 Dec 1998 17:57:03 GMT
From: ptimmins@netserv.unmc.edu
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <75gpde$ce5$1@nnrp1.dejanews.com>

In article <MPG.10e2d95848e744bd989963@nntp.hpl.hp.com>,
  lr@hpl.hp.com (Larry Rosler) wrote:

> With year-end-assessment time rapidly approaching, would anyone care to
> comment on how comp.lang.perl.moderated has performed over its life of
> six months or so, relative to the hopes and expectations of its
> proponents?
>
> A cost-benefit analysis at this time might be enlightening.

It hasn't turned out to be what I had hoped ... that's not to say it
isn't what it should be ... my expectations were probably unrealistic
(and presumptuous).

I was thinking I was going to get a free on-line tutorial or detailed
analysis of specific Perl topics of interest ... sort of like
Tom's and Nat's Perl Cookbook on-line, or a daily dose of TPJ ...
I'd sit back and let the gurus do all the work, and impart chunks
of their wisdom upon me.

Tom's recent 'FMTEYEWTK on open' is what I was naively thinking
would be the sort of thing flowing out of c.l.p.moderated on a regular
basis. Again, that was rude and presumptuous of me, and I now realize
that.

The people that have already proven themselves have no incentive
(or need) whatsoever to keep proving themselves. They have bills to
pay and lives to lead, like the rest of us. For some reason, I was
thinking there would be more of a "competitive edge" in the moderated
newsgroup, where the gurus would draw each other out. Schmucks like
me (yes, I know the derivation of 'schmuck', and accept it in this
matter) would then revel in the Perl Wisdom "price wars" that resulted
between the gurus. At least that was my master plan.

Plan B is now in effect. Re-read what I've read in the docs, read more
thoroughly the things in the docs that I've only glossed over, read
and play around with the snippits in The Perl Cookbook, Advanced Perl
Programming, et al, keep reading TPJ, and keep following c.l.p.misc and
c.l.p.moderated.

As far as a cost/benefit analysis goes in regard to c.l.p.moderated,
I still get more "bang for the buck" by filtering through all the
chaff to find the grains of wisdom that exist in c.l.p.misc. This isn't
a denigration of c.l.p.moderated so much as it is a statement of where I'm
'at' in my own personal Perlization. The misc group currently has more
relevance for me and what I need to accomplish at this particular point
in time.

Many thanks to all the gurus and budding gurus who post so unselfishly in
both newsgroups. I learn something significant literally every week.

Patrick Timmins
$monger{Omaha}[0]

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


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

Date: 19 Dec 1998 13:13:06 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <x7ww3oknkd.fsf@sysarch.com>

>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:

  LR> I crossposted this submission as shown below:
  LR>   Newsgroups: comp.lang.perl.moderated, comp.lang.perl.misc
  LR> It has appeared in ...moderated, but not in ...misc!  Isn't that a 
  LR> surprise?

are you sure? many newsreaders will not show a posting that was read
already in one of its cross posted list. if you read it first in
moderated, you wouldn't see it in misc. you have to do some special
magic to locate the post (by id i think) in a given group.

i know this happens in emacs gnus and others have that feature. 

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Sat, 19 Dec 1998 13:08:19 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: shift.
Message-Id: <1dkabs0.1kn97qu1rsmu6wN@bay1-457.quincy.ziplink.net>

Peter L. Berghold <peter@berghold.net> wrote:

> Ala Qumsieh wrote:
> 
> > om7@cyberdude.com writes:
> >
> > >
> > > Can someone please tell me what the following does
> > >
> > > my $variablename = shift;
> > >
> > > It's being called inside a sub routine.
> >
> > I believe it elevates the variable into a higher level in the
> > subroutine's stack.
> >
> 
> Actually, it pops a value off the stack and stores it into the variable.
> 

No, I think it puts your Perl script into gear.

Note that if you want your Perl script to back up, you should use
reverse(), instead.

And if it breaks down, you'll have to get out and push().

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Sat, 19 Dec 1998 13:27:12 -0600
From: Andrew Johnson <ajohnson@gatewest.net>
Subject: Re: shift.
Message-Id: <367BFE10.295957A0@gatewest.net>

Ronald J Kimball wrote:
> 
> Peter L. Berghold <peter@berghold.net> wrote:
> 
> > Ala Qumsieh wrote:
> >
> > > om7@cyberdude.com writes:
> > >
> > > >
> > > > Can someone please tell me what the following does
> > > >
> > > > my $variablename = shift;
> > > >
> > > > It's being called inside a sub routine.
> > >
> > > I believe it elevates the variable into a higher level in the
> > > subroutine's stack.
> > >
> >
> > Actually, it pops a value off the stack and stores it into the variable.
> >
> 
> No, I think it puts your Perl script into gear.
> 
> Note that if you want your Perl script to back up, you should use
> reverse(), instead.
> 
> And if it breaks down, you'll have to get out and push().

but don't forget to unshift() first!

and don't be alarm()'d about the inevitable pop()'s, they're normal ...
on the other hand, you have to listen() for ping()'s carefully
with socket()'s at the ready. For the most part, if you do get 
lost, check your map()'s and continue{}, unless{} you're using an
import() in which case you are at the mercy of the manufacturer. Oh,
and don't lose your keys().

eek ... sleep() ... gotta get some

regards
andrew


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

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

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