[10408] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4001 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Oct 18 05:02:09 1998

Date: Sun, 18 Oct 98 02:00:19 -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           Sun, 18 Oct 1998     Volume: 8 Number: 4001

Today's topics:
    Re: Are there any "perl.newbie" group or forum? <ajohnson@gatewest.net>
        Back button/reference <khalifa@blitz.cs.pitt.edu>
        Broken DNS resoving under W95/CGI/Activestate? hladik3@hladik.cz
        Broken DNS resoving under W95/CGI/Activestate?? hladik3@hladik.cz
        Broken DNS resoving under W95/CGI/Activestate?? (Zdenek Hladik)
        Can someone some help me complete this variable (Joe)
        Documentation on databse manipulation (mterich)
        I have a few elementary Perl problems (Ilya)
    Re: Insecure $ENV{PATH} while running setuid at /home/x <dlenox@ssix.net>
    Re: Javascript and perl <jeff@vpservices.com>
        lack of flock() for Win95/98? fix? <jvander@jps.net>
        newbie regular expression question agilson@planeteer.com
    Re: newbie regular expression question (Larry Rosler)
        Perl as a first language... I vote yes! (mterich)
    Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has regi <dgris@perrin.dimensional.com>
    Re: Slow Sort? <uri@sysarch.com>
    Re: Sorry <uri@sysarch.com>
    Re: Sorry <eashton@bbnplanet.com>
    Re: Sorry <dgris@perrin.dimensional.com>
    Re: sorting <uri@sysarch.com>
        Variables in m// <dfc@phys.ufl.edu>
    Re: Variables in m// <marnix@marnix.com>
        what is strlen() in perl? <mjb@voodoo.ca.boeing.com>
    Re: what is strlen() in perl? (Ethan H. Poole)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Sun, 18 Oct 1998 01:59:47 -0500
From: Andrew Johnson <ajohnson@gatewest.net>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <362991E3.2293F30F@gatewest.net>

Joergen W. Lang wrote:
> 
> Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> wrote:
> 
> > > Perl is _not_ just for breakfast anymore!
> >
> > Yes, and the day it makes dinner for me my life will be complete. :)
> >
> > e.
> 
> Something along the line of
>     use FOOD::DINNER qw(candle_light);
> would be very nice. ;-)

heck, I'd be happy if

    make Kraft::Dinner

worked out of the box.
:-)

andrew


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

Date: 18 Oct 1998 07:00:21 GMT
From: Yasir Khalifa <khalifa@blitz.cs.pitt.edu>
Subject: Back button/reference
Message-Id: <70c3m5$h7d$1@usenet01.srv.cis.pitt.edu>


How can I refer to a previous page without loosing the data
that is already entered in it. The HREF to $referer seems to
get me back to the previous page but with data being cleared.
On the contrary, the actual browser's Back button keeps the
data in the previous page when I get back to it. I need to
implement this (similar to the Back button or Back reference) 
within the cgi/Perl script. 

Any help on how I can refer to a previous page (in a multiple 
page application) without getting the data cleared?
Thanks,
-YK


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

Date: Sun, 18 Oct 1998 08:17:41 GMT
From: hladik3@hladik.cz
Subject: Broken DNS resoving under W95/CGI/Activestate?
Message-Id: <70c873$hvv$1@nnrp1.dejanews.com>

I wrote message about this few days ago, but no answer yet.

So let me ask, is here anybody who use client to interent services under
W95/CGI
with Activestate Perl (I tested build 502,503 504) and has not problems with
DNS
names resolving?

Resolving seems to work OK under commmand line but does not under for example
NS
Fasttrack or other (I tested small server written under DELPHI also ).

It seems that in W95 is problem with winsock under secondary shell?

                                          Zdenek Hladik

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


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

Date: Sun, 18 Oct 1998 08:19:13 GMT
From: hladik3@hladik.cz
Subject: Broken DNS resoving under W95/CGI/Activestate??
Message-Id: <70c8a0$i1h$1@nnrp1.dejanews.com>

I wrote message about this few days ago, but no answer yet.

So let me ask, is here anybody who use client to interent services under
W95/CGI
with Activestate Perl (I tested build 502,503 504) and has not problems with
DNS
names resolving?

Resolving seems to work OK under commmand line but does not under for example
NS
Fasttrack or other (I tested small server written under DELPHI also ).

It seems that in W95 is problem with winsock under secondary shell?

                                          Zdenek Hladik

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


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

Date: Sun, 18 Oct 1998 08:20:43 GMT
From: hladikz@infima.cz (Zdenek Hladik)
Subject: Broken DNS resoving under W95/CGI/Activestate??
Message-Id: <3629a4b3.2425985@news.felk.cvut.cz>

I wrote message about this few days ago, but no answer yet.

So let me ask, is here anybody who use client to interent services
under 
W95/CGI 
with Activestate Perl (I tested build 502,503 504) and has not
problems with 
DNS 
names resolving?

Resolving seems to work OK under commmand line but does not under for
example 
NS 
Fasttrack or other (I tested small server written under DELPHI also ).

It seems that in W95 is problem with winsock under secondary shell?



                                               Zdenek Hladik
                                            I N F I M A - W A N
                           /""""""\      Internet,LAN,WAN consulting
                         ( (o)  (o) )   Zazvorkova 2008 Praha 5,Czech
                             (..)           tel/fax +4202-5612731
                             ----       Internet: hladikz@infima.cz
                            \____/  --,      BBS 3122741(30 lines)
                                     / ,  ,     BBS.INFIMA.CZ
                                    `--+--|    FTP,WWW,TELNET
                                       '  '    


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

Date: Sun, 18 Oct 1998 01:04:06 GMT
From: jwronkowski@earthlink.net (Joe)
Subject: Can someone some help me complete this variable
Message-Id: <36293b90.45268227@news.earthlink.net>

Hi ,
I have a question and was wondering if someone could give me a hand.
Basically I have a dynamic ip and this output which is produced in a
log file can give me my ip but it changes.  I use a webramp which a
router with modems on it and it make the connection and this is the
only way i have found to get the ip.  I know it will always start with
153.37.55.XX so what I want to do is grep the file every hour and get
the last entry where it shows 153.37.55.65 and if it changes it will
produce the ip for the output if the ip hasn't changed then it will
give the same ip.
How can this be accomplished with a script.
the first part of my problem was accomplished with this line:

newip=$(tac | gawk '/153\.37\.55\./ {print $NF; exit}') this will grab
my IP but I also want to grab the date and time from the same line and
trun that into a variable?

I was just wondering if there was an easy way to grab the time/date
Oct  6 21:57:33 from the same line the 153.37.55.** was taken from.


Thanks
Joe Wronkowski

 sample of log file:
>> Oct  6 21:50:19 rogueserver in.telnetd[197]: connect from 208.224.174.21
>> Oct  6 21:50:24 rogueserver telnetd[197]: ttloop:  peer died: Success 
>> Oct  6 21:55:29 rogueserver in.telnetd[211]: connect from 208.224.174.21
>> Oct  6 21:55:35 rogueserver telnetd[211]: ttloop:  peer died: Success 
>> Oct  6 21:57:33 rogueserver in.pop3d[215]: connect from 153.37.55.65
>> Oct  6 21:57:34 rogueserver in.pop3d[215]: Servicing request for rogue



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

Date: Sat, 17 Oct 1998 22:10:19 -0800
From: filth@san.rr.vom (mterich)
Subject: Documentation on databse manipulation
Message-Id: <filth-1710982210200001@dt013n3b.san.rr.com>

I'm looking for some detailed documentation on database access with perl.
I have the camel book and "learning perl on win32" and both mention and
discuss briefly accessing databases with perl, however neither one goes
into gory detail.  Is there a book or an online tutorial that goes into it
with more detail?  A tab delimited spreadsheet would also work.  It would
need to work on win32, I'm not sure if there's really a big difference but
just in case.
Thanks!

-m terich


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

Date: 18 Oct 1998 07:49:40 GMT
From: ilya@ns1.foothill.net (Ilya)
Subject: I have a few elementary Perl problems
Message-Id: <70c6ik$cit$1@ns2.foothill.net>

 I have the following script. The purpose of the script is to process the
 MASTER_LIST, which is a file that simply contains a number of fully
 qualified host names. I want to perform several Unix commands on each host
 via remsh, and then save the results in its corresponding directory, i.e.,
 I want to save the ouput from machine1 to the directory
 /home/ilya/web/sysinfo/machine1/command.out. 

#!/usr/contrib/bin/perl
# Open a file in the format:
# fully_qualified_name1
# fully_qualified_name2
# fully_qualified_name3

open (MASTER_LIST,  "<master_list");   #open master_list for reading 

while (<MASTER_LIST>)        # read until EOF
 {

   chop;
   system ("remsh $_ command > /home/ilya/web/sysinfo/$_/command");

 }
 close (MASTER_LIST);

 
 However, the problem is that in the example above,
 /home/ilya/web/sysinfo/$_/command apparently does not expand to
 /home/ilya/web/sysinfo/machineXX/command file as it should and I am
 getting an error message:


 $ ./build_page.pl
 sh: /home/ilya/web/sysinfo/machine1: Cannot create the specified file.
 sh: /home/ilya/web/sysinfo/machine2: Cannot create the specified file.
 sh: /home/ilya/web/sysinfo/machine3: Cannot create the specified file.

 Now why would this be? Of course it cannot create
 /home/ilya/web/sysinfo/machine3 file, because it is a directory. I am
 trying to create /home/ilya/web/sysinfo/machineXX/command_name, in each
 directory.


 Thinking that something must be incorrect with the $_ built-in variable, I
 came up with this:

 
while ($input = <MASTER_LIST>)        # read until EOF
{

  chop;
   system ("remsh $input command > /home/ilya/web/sysinfo/$uptime/command");
   print "Processing $input \n";
}

 That does not give me an error. Instead, it logs me in to each machine
 want to run the command on!!!  I do NOT want to log on each machine. I
 want to remsh a few command for a few dozen machines and record the
 output.


 I am really disappointed. This is my first Perl  script, I usually program
 in ksh, and it seems that not only Perl does not have advantages over ksh,
 elementary tasks such as creating a number of files in several directories
 are difficult   to accomplish. What  is  going on  with  this. I could not
 figure this out after scanning several Perl books for an hour.

 Ilya
 

 
 




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

Date: Sat, 17 Oct 1998 23:09:33 -0400
From: Daniel Lenox <dlenox@ssix.net>
Subject: Re: Insecure $ENV{PATH} while running setuid at /home/xxx/cgi-bin/sendmail.pl
Message-Id: <36295BED.EE63AA5A@ssix.net>

Michael,
Yes I have tried your suggestion, however since it fails only from being
called
during form processing (from .html) all I get in the error log is the
mentioned message
as well as "Premature end of script headers".  So I am not able to see exactly
what
the problem is.
I even tried embedding html into the die message, but just can't get anything
to display
back in the browser.

Dan

Michael Budash wrote:

> In article <3629266D.16CEA8F8@ssix.net>, dlenox@ssix.net wrote:
>
> >> Recently brought Linux 2.0.25 server and tried running sendmail.pl
> >> (known working script)
> >> called by .html form processing.
> >>
> >> Offending line is :    open (MAIL, "|/usr/sbin/sendmail -t");
> >>
> >> Script works fine executed from command prompt, permissions on sendmail
> >> are 4755
> >> any ideas what is happening here?  apache.org strongly suggested this
> >> was strictly perl
> >> related....
>
> have you tried using:
>
> open (MAIL, "|/usr/sbin/sendmail -t") or die("cant open sendmail: $!");
>
> to see exactly what the error ($!) was?
>
> --
> Michael Budash ~ Michael Budash Consulting
> 707-255-5371 ~ 707-258-7800 x7736
> mbudash@sonic.net



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

SSIX Corporation
Solutions, Systems and Information Technologies

Website http://www.ssix.com
weBBS   http://www.ssix.com/bbs
---------------------------------------------------------------------------------





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

Date: 18 Oct 1998 02:20:27 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Javascript and perl
Message-Id: <36294FAF.31ED498A@vpservices.com>

Have the mouseover call a function which uses the document.form.submit()
method to submit the form, thereby starting the cgi listed as the action
on the form.

- Jeff

Sam Spurling wrote:
> 
> Does anyone know how to fire a perl script off from within a
> onmouseover
> event.  This is a section of code I am trying.  The first table row is
> a
> generic script I am trying to envoke.  The second table is a normal
> onmouseover event that works fine.
> 
> <tr>
>      <td width="110"><center><form
> action="http://www.somesite.com/cgi-bin/db.pl" method="POST"><input
> type="hidden" name="act" value="display"><input type="image"
> src="en1.gif"
> value="display">
>       onmouseover="window.status='Take a look at our stuff';
> img_act('Button5'); return true" onmouseout="window.status='';
> img_inact('Button5');return true"></center></form></td>
>     </tr>
>     <tr>
>      <td width="110"><center><a href="factor.htm"
> onmouseover="window.status='The page; img_act('Button6'); return true"
> onmouseout="window.status=''; img_inact('Button6');return true"><img
> name="Button6" img src="factor1.gif" width="105" height="20"
> border="0"
> align="absmiddle"></a></center></td>
>     </tr>


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

Date: Sat, 17 Oct 1998 20:32:37 -0700
From: "Jan VanderStoel" <jvander@jps.net>
Subject: lack of flock() for Win95/98? fix?
Message-Id: <362982ed.0@blushng.jps.net>

I attempted to run a Perl script using the flock() function on a Win 98
platform using Perl 5.005.  The script failed giving an error message saying
that the flock() function is not implemented on this platform.  The docs do
not indicate that flock() is not implemented.  This script does work on Win
NT 4.  Is there a fix for the Win 95/98 platform?

TIA,

Jan VanderStoel




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

Date: Sun, 18 Oct 1998 05:44:43 GMT
From: agilson@planeteer.com
Subject: newbie regular expression question
Message-Id: <36298011.2621119@news.planeteer.com>

I'm using the following to fine rows that contain Mars OR Jupiter in a
file:

$match = Mars\|Jupiter;
while(<TESTFILE>){
	if (/$match/i) ...

How can I find rows that contain both Mars AND Jupiter, in any order?

I've been looking through the man pages, but can't find anything - I
must be looking in the wrong place...

Thanks in advance.
Andy Gilson



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

Date: Sat, 17 Oct 1998 23:22:51 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: newbie regular expression question
Message-Id: <MPG.10932913b5f93adc9898c1@nntp.hpl.hp.com>

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

In article <36298011.2621119@news.planeteer.com> on Sun, 18 Oct 1998 
05:44:43 GMT, agilson@planeteer.com <agilson@planeteer.com> says...
> I'm using the following to fine rows that contain Mars OR Jupiter in a
> file:

What have the rows done that you want to fine them for?

Oh, you mean to 'find lines'...

> $match = Mars\|Jupiter;

Are there quotes missing here?

> while(<TESTFILE>){
> 	if (/$match/i) ...

If $match never changes, use '/o' to prevent repeated recompilation of 
the regex.

> How can I find rows that contain both Mars AND Jupiter, in any order?

Though this can be done in a single regex, by far the easiest way is to 
use two regexes:

  	if (/Mars/i && /Jupiter/i) ...

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


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

Date: Sun, 18 Oct 1998 01:10:49 -0800
From: filth@san.rr.vom (mterich)
Subject: Perl as a first language... I vote yes!
Message-Id: <filth-1810980110490001@dt013n3b.san.rr.com>

After reading this colorfully entertaining thread... ok, it's actually
about 20 threads encased in one, whatever, I figured I'd give some reasons
to learn Perl as a first language.

1. I know a good deal about computers, but do not know how to program.
2. I do not want to become a full-time programmer.
3. I want to automate common administrative tasks.
4. I do not have time (or money) to take programming courses (trying to be
a SysAsmin and a rock star simultaneously, also trying to prevent myself
from destroying my social life by spending all my time learning to
program.)
5. After fighting with books on C, C++, java... perl "made sense." And now
I'm able to write some perl after only a month.

Yes, as a newbie I find that the many ways in which perl can accomplish
your goals is a little intimidating, however... the boss looks at the
code, says "You know, it might have been easier to just use <insert
efficient code here> instead of <insert bloated newbie code>."  And the #1
reason I love perl:  my ugly, bloaty, newbie program does the *exact same
thing*.  So, I'll use efficient code when I learn how.  Until then I'll
pick (among the many ways to do it) only the ones I already know.

And NO, not all newbies are cry-baby-idiots.  We appreciate the help and
the patience of those who are more experienced.

Thanks.

-Matt

Oh! I'm newbie-wannabe-loser, am I ?!?!!
Well... my hardcore band is better than your hardcore band.


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

Date: Sun, 18 Oct 1998 04:52:35 GMT
From: Daniel Grisinger <dgris@perrin.dimensional.com>
Subject: Re: Raleigh.pm (Raleigh, NC, USA perl mongers) has registered
Message-Id: <m3u312bhv2.fsf@perrin.dimensional.com>

Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:

> Joergen W. Lang wrote:
> 
> > And the menu is written in Perl, of course.
> 
> Of course, with a translated version for the non-geeks. :)

No, non-geeks are expected to RTFM if they are
hungry :-).

dgris
-- 
Daniel Grisinger          dgris@perrin.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: 18 Oct 1998 00:01:02 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Slow Sort?
Message-Id: <x74st2tt6p.fsf@sysarch.com>

>>>>> "AH" == Alexis Huxley <alexis@danae.demon.co.uk> writes:


  AH> Phew! I'm glad I'm not the only person encountering this! I have only
  AH> 20Mb and have a hash of structures with 27000 elements to sort on key
  AH> and it's taking 30 minutes.


  AH> Yes, me! I appreciate that this is a bit of a 'me too' reply, but in light
  AH> of the followups I've seen so far, which all expressed incredulity that
  AH> a sort could take so long, I felt it appropriate to follow up.

as the other guy was asked, please show us some of this sort code. maybe
you are doing something grossly wrong that can be fixed directly. we
can't tell why only you two see 30 minute sorts. even in a thrashing
system you should go much faster than that. virtual memory is slower
than ram but not by such a margin. this tells me the sort routines and
data structures are probably at fault.

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: 17 Oct 1998 23:55:30 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Sorry
Message-Id: <x767dittfx.fsf@sysarch.com>

>>>>> "BL" == Bart Lateur <bart.mediamind@ping.be> writes:

  BL> Lee Brandson wrote:
  >> As an occasional watcher of this ng and its predecessor for some two years
  >> now, I would like to ask whether it is strictly necessary to be as rude as
  >> possible when answering (or not answering, as the case may be) a question?
  >> Is this what it takes to be "in the club?" 

  BL> To be "in the club", you only have to post frequent enough. In that
  BL> case, you can get away with just about anything.

don't you really mean "frequently enough with useful answers and
comments"? mode of the "rude" types (myself included) post plenty of
quality answers and comments to requests we deem worthy (you are not
worthy! you are not worthy! :-) the "rudeness" comes from seeing FAQ and
poor subject lines and stuff like "can you find or write me this script
in 5 minutes for no pay?" there is no "club" just various interested
hackers who have earned some modicum of respect as knowing soemthing
about perl. there are various levels of these hackers and we all have
made mistakes and we usually own up to them and not stand on some high
reese horse. but we are human too with all those wonderful emotions and
stuff. we get angry at newbies who don't do any homework first, laugh at
each other mistakes, try to top one another with perl tricks, solutions,
quips, quote, bon mots, insults, etc. like any group of computer
geeks. you should see what it is like at a perl mongers meeting or at the
perl conference!

this is usenet. it has always been this way and no massive influx of
newbies will change it. there won't ever be a newbie group here (or
anywhere else) because of the simple fact that experience hackers won't
want to be there and newbies won't want answers from other newbies. so
if the come here and expect to get answers, we have a standard which
we apply to them. they have to do some homework first, think about their
question carefully, show some real code or a real problem, use a good
subject, and try out the answers before coming back with more
questions. saying rtfm or rtfaq is a good answer for many things as it
will help the newbie in the long run and lower the noise level here.

just another rude perl hacker,

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: Sun, 18 Oct 1998 04:38:24 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Sorry
Message-Id: <36296E3B.ADCAABB1@bbnplanet.com>

Uri Guttman wrote:

> don't you really mean "frequently enough with useful answers and
> comments"? mode of the "rude" types (myself included) post plenty of
> quality answers and comments to requests we deem worthy (you are not
> worthy! you are not worthy! :-) the "rudeness" comes from seeing FAQ and
> poor subject lines and stuff like "can you find or write me this script
> in 5 minutes for no pay?" there is no "club" just various interested
> hackers who have earned some modicum of respect as knowing soemthing
> about perl. there are various levels of these hackers and we all have
> made mistakes and we usually own up to them and not stand on some high
> reese horse. but we are human too with all those wonderful emotions and
> stuff. we get angry at newbies who don't do any homework first, laugh at
> each other mistakes, try to top one another with perl tricks, solutions,
> quips, quote, bon mots, insults, etc. like any group of computer
> geeks. you should see what it is like at a perl mongers meeting or at the
> perl conference!

Hey, if I can be the only chick among 40+ crusty old bastards like
yourself at a bar and hold my own, anyone can suck it up and deal. There
is no club per se, at least not like some of the WME clubs of old men
drinking scotch that I've been in. Nay, this is just a bunch of geeks
hangin' out, talking turf. And, yes, we are all so human some days it
hurts. We are 3d, usenet is 2d, if someone takes it too personally, then
someone needs to go out and get a good beer or scotch and contemplate
the meaning of life. 

> this is usenet. it has always been this way and no massive influx of
> newbies will change it. there won't ever be a newbie group here (or

Newbies won't change what has been the same for at least 10 years, to
quote a favourite song of mine 'same as it ever was'. Newbies aren't
always so, and so the world turns and so time passes. Life, you're
soaking in it. 

> just another rude perl hacker,

Nay, just abrasive at times...then again, so am I. :) Rude implies
intent to hurt of offend...I don't think anyone here really means to do
so. 

e.

After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia.  - U. Eco -


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

Date: Sun, 18 Oct 1998 08:07:50 GMT
From: Daniel Grisinger <dgris@perrin.dimensional.com>
Subject: Re: Sorry
Message-Id: <m34st2uws2.fsf@perrin.dimensional.com>

Uri Guttman <uri@sysarch.com> writes:

< snip a lot of stuff that I agree with >

> just another rude perl hacker,

I believe they call it the `campaign for grumpiness where
grumpiness is due' over on comp.lang.c.

dgris
-- 
Daniel Grisinger          dgris@perrin.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: 17 Oct 1998 23:39:47 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: sorting
Message-Id: <x77lxytu64.fsf@sysarch.com>

>>>>> "MD" == Mark-Jason Dominus <mjd@op.net> writes:

  MD> In article <sar7ly0p7z9.fsf@camel.fastserv.com>,
  MD> Uri Guttman  <uri@camel.fastserv.com> wrote:
  >> i think you should just be able to use the sub ref directly.

  MD> I asked Chip about this a couple of days ago, and he agreed.

this is powerful backing. but does larry like it? makes sense as
building sort subs like this thread discussed is a powerful technique. i
would assume the sort operator could either take an expression (which is
a current error) or a scalar with a code ref. maybe a ful expression is
too much so a code ref scalar would be the only thing allowed, like a
file handle.

a related question: the original poster desired custom sort routines on
demand by users. if these are created and then thrown away, will it be a
memory leak? i don't know what happens to code refs when they are out of
scope and get ref counted to zero. do they get garbage collected too?

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, 17 Oct 1998 23:18:41 -0400
From: "Daniel F. Crisman" <dfc@phys.ufl.edu>
Subject: Variables in m//
Message-Id: <Pine.SOL.3.96.981017230655.26026A-100000@neptune.phys.ufl.edu>

Is there any way to tell m// (or s///) to ignore the special regex values
of characers in variables.

As an example I would like $b to match to $a in this code:
############
$a = 'o+o';
$b = $a;
$b =~ /$a/;
    # This last line returns false
############

and this code:
############
$a = 'o$o';
$b = $a;
$b =~ /$a/;
    # This last line returns false
###########

So, I want perl to ignore that there are special regex characters in
variables, how do I do it?

***********************
Daniel Crisman
dfc@phys.ufl.edu
***********************



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

Date: Sat, 17 Oct 1998 21:03:16 -0700
From: "Marnix A.  van Ammers" <marnix@marnix.com>
Subject: Re: Variables in m//
Message-Id: <36296888.0@blushng.jps.net>

It's somewhere in the manual.  You want to quote $a.  That is you want to
have each special character escaped with a backslash.  I think you need to
lookup "quotemeta" in the manual.  So you can do:

$a = quotemeta $a;

There is also something like "\Q$a".  But check the manual.

Daniel F. Crisman wrote in message ...
>Is there any way to tell m// (or s///) to ignore the special regex values
>of characers in variables.
>
>As an example I would like $b to match to $a in this code:
>############
>$a = 'o+o';
>$b = $a;
>$b =~ /$a/;
>    # This last line returns false
>############
>
>and this code:
>############
>$a = 'o$o';
>$b = $a;
>$b =~ /$a/;
>    # This last line returns false
>###########
>
>So, I want perl to ignore that there are special regex characters in
>variables, how do I do it?
>
>***********************
>Daniel Crisman
>dfc@phys.ufl.edu
>***********************
>




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

Date: Sun, 18 Oct 1998 01:03:20 GMT
From: Mehdi Beygi <mjb@voodoo.ca.boeing.com>
Subject: what is strlen() in perl?
Message-Id: <36293E58.F651A86@voodoo.ca.boeing.com>


--------------C6F987C38A676BBADE4F71A7
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I apologize for my ignorance, but how to get string length in perl.
for example

$str = "Hello World";

How do I get the strlen of $str ?
is there something like 'c' language:  n = strlen(pStr);   where pStr is
a char pointer?

and then is there a way to do character replacement by indexing? I know
I can use substr() in perl but was
wonder if there is something similar to 'c'  like:
char str[] = "hello world";
str[0] = 'H';
str[6] = 'W';

and now  str is "Hello World"


Perl is wonderful!
thanks

--
Mehdi Beygi  mjb@voodoo.ca.boeing.com
BoGart Development
206-544-9151



--------------C6F987C38A676BBADE4F71A7
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
I apologize for my ignorance, but how to get string length in perl.
<BR>for example

<P>$str = "Hello World";

<P>How do I get the strlen of $str ?
<BR>is there something like 'c' language:&nbsp; n = strlen(pStr);&nbsp;&nbsp;
where pStr is a char pointer?

<P>and then is there a way to do character replacement by indexing? I know
I can use substr() in perl but was
<BR>wonder if there is something similar to 'c'&nbsp; like:
<BR>char str[] = "hello world";
<BR>str[0] = 'H';
<BR>str[6] = 'W';

<P>and now&nbsp; str is "Hello World"
<BR>&nbsp;

<P>Perl is wonderful!
<BR>thanks
<PRE>--&nbsp;
Mehdi Beygi&nbsp; mjb@voodoo.ca.boeing.com
BoGart Development
206-544-9151</PRE>
&nbsp;</HTML>

--------------C6F987C38A676BBADE4F71A7--



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

Date: 18 Oct 1998 05:11:19 GMT
From: ehp@gte.net (Ethan H. Poole)
Subject: Re: what is strlen() in perl?
Message-Id: <70bt9n$qa4$1@news-1.news.gte.net>

[Posted and Emailed]  In article <36293E58.F651A86@voodoo.ca.boeing.com>, 
mjb@voodoo.ca.boeing.com says...
>
>I apologize for my ignorance, but how to get string length in perl.
>for example
>
>$str = "Hello World";
>
>How do I get the strlen of $str ?
>is there something like 'c' language:  n = strlen(pStr);   where pStr is
>a char pointer?
>
>and then is there a way to do character replacement by indexing? I know
>I can use substr() in perl but was
>wonder if there is something similar to 'c'  like:
>char str[] = "hello world";
>str[0] = 'H';
>str[6] = 'W';
>
>and now  str is "Hello World"

Lookup:  length()
         substr();

-- 
Ethan H. Poole            | Website Design and Hosting,
                          | CGI Programming (Perl & C)..
========Personal========= | ============================
* ehp @ gte . net *       | --Interact2Day--
http://home1.gte.net/ehp/ | http://www.interact2day.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 4001
**************************************

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