[19852] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2047 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 1 14:06:07 2001

Date: Thu, 1 Nov 2001 11:05:13 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1004641513-v10-i2047@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 1 Nov 2001     Volume: 10 Number: 2047

Today's topics:
        [ot] Re: Newbie Question (Jason Kawaja)
        autosplit.ix ? (zawy)
    Re: autosplit.ix ? (zawy)
        Can I use "grep" to search files having common extensio <shenxin@sympatico.ca>
    Re: Can I use "grep" to search files having common exte (Logan Shaw)
    Re: Can I use "grep" to search files having common exte <hunter@nortelnetworks.com>
        Categories and sub categories. <its_mr_impossible@hotmail.com>
    Re: Categories and sub categories. <tsee@gmx.net>
    Re: Contents of a hash blank in only *part* of a module <tsee@gmx.net>
    Re: Contents of a hash blank in only *part* of a module (Nick Temple)
        desperate: perl scripts called from init.d/... scripts <Robert.Lopez@abq.sc.philips.com>
    Re: displaying headers in perl <control153@yahoo.com>
        explanation of special vars $a, $b... <rcobine@indiana.edu>
    Re: explanation of special vars $a, $b... <spam@thecouch.homeip.net>
    Re: explanation of special vars $a, $b... <mjcarman@home.com>
    Re: Getting one element of array return value <wuerz@yahoo.com>
    Re: Getting one element of array return value (Anno Siegel)
    Re: Getting one element of array return value <mjcarman@home.com>
    Re: Help with a tough algorithm <kherlitz@mindcast.com>
    Re: How to run a perl script as background from remote  (Nick Temple)
    Re: how to set up a CGI on my webpage (Nick Temple)
        Leftmost SHORTEST (Zilt)
    Re: Leftmost SHORTEST <spam@thecouch.homeip.net>
    Re: Leftmost SHORTEST (John J. Trammell)
    Re: Leftmost SHORTEST (Tad McClellan)
    Re: Linking Perl to a databse <comdog@panix.com>
    Re: MAC user question <tom@tealcity.com>
    Re: Need script or tool to create function call lists <lhswartw@ichips.intel.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 1 Nov 2001 14:01:47 +0000 (UTC)
From: kawaja@ece.ufl.edu (Jason Kawaja)
Subject: [ot] Re: Newbie Question
Message-Id: <slrn9u2lev.r6a.kawaja@kawaja.ece.ufl.edu>

previously, Tad McClellan <tadmc@augustmail.com> wrote:
> Jürgen Exner <jurgenex@hotmail.com> wrote:
>>"Jason Kawaja" <kawaja@ece.ufl.edu> wrote in message
>>news:slrn9u0inv.o3v.kawaja@kawaja.ece.ufl.edu...
>>> previously, Peter Morris <no_spam.ple@se.com> wrote:
>>> > Hello, I'm just learning PERL. I don't really understand
>>> > what these $_ and @_  variables are all about. Can someone
>>> > explain, please.
>>>
>>> $_ is the variable $ARG
>>>  holds the scalar that gets passed to a subroutine
>>>
>>> @_ is the variable @ARG
>>
>>This is just plain wrong.
>>$_ is $_ and not $ARG 

[snip]

> 
>>@_ is @_ and has nothing to do with @ARG (which doesn't even exist unless
>>you defined it; maybe you meant @ARGV?)
> 
> 
> Yeah, that part just made no sense at all.

i agree, looking back at this thread i see only one thing i remember, my name.

must of been doing too many things at once, sorry for the misinformation i 
posted.

-- 

/* Regards,
   Jason Kawaja, UF-ECE Sys Admin */



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

Date: Thu, 01 Nov 2001 14:16:58 GMT
From: zawy12@yahoo.com (zawy)
Subject: autosplit.ix ?
Message-Id: <3be15878.482794022@news.mindspring.com>

I'm trying to install and use Net::SSLeay but when I try  use Net::SSLeay
it says autosplit.ix can't be found.  I can't seem to find that file
anywhere.  help


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

Date: Thu, 01 Nov 2001 14:21:16 GMT
From: zawy12@yahoo.com (zawy)
Subject: Re: autosplit.ix ?
Message-Id: <3be159d7.483144777@news.mindspring.com>


P.S., I don't have administrator  privileges.  No access to Perl
configuration.   remove "12" from my email

On Thu, 01 Nov 2001 14:16:58 GMT, zawy12@yahoo.com (zawy) wrote:

>I'm trying to install and use Net::SSLeay but when I try  use Net::SSLeay
>it says autosplit.ix can't be found.  I can't seem to find that file
>anywhere.  help



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

Date: Thu, 1 Nov 2001 11:13:48 -0500
From: "xin" <shenxin@sympatico.ca>
Subject: Can I use "grep" to search files having common extension(e.g. *.c) recursively in a directory?
Message-Id: <bneE7.36434$az4.2951251@news20.bellglobal.com>

grep have a option "-r", but the input is supposed to be  a path name. Is
there a way to limit the search scope to *.c files(or with any other
extensions)  under the path?




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

Date: 1 Nov 2001 10:34:15 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Can I use "grep" to search files having common extension(e.g. *.c) recursively in a directory?
Message-Id: <9rrti7$ppu$1@charity.cs.utexas.edu>

In article <bneE7.36434$az4.2951251@news20.bellglobal.com>,
xin <shenxin@sympatico.ca> wrote:
>grep have a option "-r", but the input is supposed to be  a path name. Is
>there a way to limit the search scope to *.c files(or with any other
>extensions)  under the path?

As far as I can see, this is a Unix question and not a Perl one.  But
anyway, you can do this:

	find . -type f -name '*.c' -print | xargs grep foo /dev/null

Hope that helps.

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

                                          Georges Bernanos


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

Date: Thu, 1 Nov 2001 11:13:59 -0500
From: "dh" <hunter@nortelnetworks.com>
Subject: Re: Can I use "grep" to search files having common extension(e.g. *.c) recursively in a directory?
Message-Id: <9rrtqt$1jg$1@news.storm.ca>

grep -i pattern *.c

or over directories:
find . -name *.c | xargs grep pattern

dave


"xin" <shenxin@sympatico.ca> wrote in message
news:bneE7.36434$az4.2951251@news20.bellglobal.com...
> grep have a option "-r", but the input is supposed to be  a path name. Is
> there a way to limit the search scope to *.c files(or with any other
> extensions)  under the path?
>
>




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

Date: Thu, 1 Nov 2001 14:34:59 -0000
From: "John Taylor" <its_mr_impossible@hotmail.com>
Subject: Categories and sub categories.
Message-Id: <1004625407.14743.0.nnrp-10.c2de1f0e@news.demon.co.uk>

Hi all,

What is the best data structure and algorithm/s to inplement ordered product
categories and sub categories. There are 6000 categories and several leves
of sub categories.

Users will need to insert/change/remove categories at any level. I will also
need to allow users to select any category to store/remove/change products
below these categories.

I am really scratching my head over this one!

Do I need to use a binary sort tree for this.


Thanks,

John.

-----------------
He Without Sin, Cast The First Stone.

Love one another.
-----------------




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

Date: Thu, 1 Nov 2001 17:36:58 +0100
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: Categories and sub categories.
Message-Id: <9rrtjl$78u$06$1@news.t-online.com>

"John Taylor" <its_mr_impossible@hotmail.com> schrieb im Newsbeitrag
news:1004625407.14743.0.nnrp-10.c2de1f0e@news.demon.co.uk...
| What is the best data structure and algorithm/s to inplement ordered
product
| categories and sub categories. There are 6000 categories and several leves
| of sub categories.

TIMTOWTDI!
A hash of hashes of arrays, maybe?
Better yet: A database...

| Users will need to insert/change/remove categories at any level. I will
also
| need to allow users to select any category to store/remove/change products
| below these categories.
|
| I am really scratching my head over this one!

Don't get hurt!

| Do I need to use a binary sort tree for this.

No. That's not quite Perlish, I daresay.

Maybe DBD::*, DBI, DB_File can be of help to you.

HTH,
Steffen
--
$_=q;0cb212c210b0bb010c0113bb0c410c0b516c0bb3d212c2b0b0b016b6cb2b2c21010c0
b41110b3bba0e0c0d2c4b2b6bc013d2c0d0b01012b0b0;;s/\n//g;s/(\d)/$1<2?$1:'0'x
$1/ge;s/([a-f])/'1'x(ord($1)-97)/ge;print"\n";$o=$_;push@o,substr($o,$_*8,
8)for(0..24);for(@o){print"\0"x(26-$i).chr(oct('0b'.($_)))."\n";$i++}#st_m





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

Date: Thu, 1 Nov 2001 17:30:52 +0100
From: "Steffen Müller" <tsee@gmx.net>
Subject: Re: Contents of a hash blank in only *part* of a module
Message-Id: <9rrt8h$6jb$06$1@news.t-online.com>

"Martien Verbruggen" <mgjv@tradingpost.com.au> schrieb im Newsbeitrag
news:slrn9u10b0.ctg.mgjv@verbruggen.comdyn.com.au...
| On Wed, 31 Oct 2001 23:33:31 +0100,
| Steffen Müller <tsee@gmx.net> wrote:
| > "Tad McClellan" <tadmc@augustmail.com> schrieb im Newsbeitrag
| > news:slrn9tvubn.2q2.tadmc@tadmc26.august.net...
| >| Jason Clifford <jason@uklinux.net> wrote:
| >| You could interpolate rather than concatenate. Most people think
| >| interpolation is easier to read and understand.
| > I don't think so.
| You don't think that most people think that, or you don't think that
| interpolation is easier to read? They're very different statements :)

I know, that's the pun. But I actually just don't think 'so' *myself*.

[...]

| If you meant to say that using single quotes is somehow better when
| the string needs no interpolation, then you have just stumbled upon
| one of the items that pops up here regularly, and that noone seems to
| be able to agree on. I don't see the diffeence, some people seem to
| have problems with double quotes for strings that don't require
| interpolation. Maybe it depends on what sort of other programming
| background one has. I tend to use double quotes, unless I want to
| prevent interpolation, and nowadays I mostly use q// in that case.

I did mean to say that. Didn't want to start over that whole discussion,
though. Just let me note that we disagree on the "/' debate.

Steffen
--
$_=q;0cb212c210b0bb010c0113bb0c410c0b516c0bb3d212c2b0b0b016b6cb2b2c21010c0
b41110b3bba0e0c0d2c4b2b6bc013d2c0d0b01012b0b0;;s/\n//g;s/(\d)/$1<2?$1:'0'x
$1/ge;s/([a-f])/'1'x(ord($1)-97)/ge;print"\n";$o=$_;push@o,substr($o,$_*8,
8)for(0..24);for(@o){print"\0"x(26-$i).chr(oct('0b'.($_)))."\n";$i++}#st_m





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

Date: 1 Nov 2001 11:00:43 -0800
From: nicktemple2000@yahoo.com (Nick Temple)
Subject: Re: Contents of a hash blank in only *part* of a module
Message-Id: <a9fe2341.0111011100.2c4c4d59@posting.google.com>

I think someone has been jacking themselves off too much.

Martien Verbruggen <mgjv@tradingpost.com.au> wrote in message news:<slrn9u10b0.ctg.mgjv@verbruggen.comdyn.com.au>...
> On Wed, 31 Oct 2001 23:33:31 +0100,
> 	Steffen Müller <tsee@gmx.net> wrote:
> > "Tad McClellan" <tadmc@augustmail.com> schrieb im Newsbeitrag
> > news:slrn9tvubn.2q2.tadmc@tadmc26.august.net...
> >| Jason Clifford <jason@uklinux.net> wrote:
> >| >my $jasonvar = "name=".$user_dat->{'name'};
> >|
> >| You could interpolate rather than concatenate. Most people think
> >| interpolation is easier to read and understand.
> > 
> > I don't think so.
> 
> You don't think that most people think that, or you don't think that
> interpolation is easier to read? They're very different statements :)
> 
> > Anyway, he could at least use 'name='.$user_dat->{'name'}.
> 
> I don't see the difference, unless you meant to say: 
> 
> He could at least use either 'name='.$user_dat->{'name'} or
> "name=".$user_dat->{"name"}, to be consistent about the quoting style,
> or even leave some of the quotes off: "name" . $user_dat->{name}.
> 
> If you meant to say that using single quotes is somehow better when
> the string needs no interpolation, then you have just stumbled upon
> one of the items that pops up here regularly, and that noone seems to
> be able to agree on. I don't see the diffeence, some people seem to
> have problems with double quotes for strings that don't require
> interpolation. Maybe it depends on what sort of other programming
> background one has. I tend to use double quotes, unless I want to
> prevent interpolation, and nowadays I mostly use q// in that case.
> 
> Martien


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

Date: 01 Nov 2001 10:19:29 -0700
From: Robert Lopez <Robert.Lopez@abq.sc.philips.com>
Subject: desperate: perl scripts called from init.d/... scripts
Message-Id: <jc6pu728l3y.fsf@abqb1k.abq.sc.philips.com>

With respect to the runlevel changing scripts such as in /etc/init.d
on some systems and in /sbin/init.d on other systems:

If run level start/stop scripts, written in posix shell, start and
stop other scripts written in perl is there any reason to expect
problems? in general? in HP-UX 11?

All the scripts I moved from an older Solaris system and from an older
HP-UX 10.20 to a new HP-UX 11 cluster are having various mysterious
problems. That the scripts and perl are in place before they are run
has been confirmed for both moving up in run levels and in moving down
in run levels.

The scripts work perfectly when run by root manually by running them
directly and via the run level links.
 eg:
   cd /sbin/init.d; ./script.pl start_msg  < -- works
   cd /sbin/init.d; ./script.pl start      < -- works
   cd /sbin/init.d; ./script.pl stop_msg   < -- works
   cd /sbin/init.d; ./script.pl stop_msg   < -- works
   cd /sbin/rc2.d; ./K96script.pl ....     < -- works
   cd /sbin/rc3.d; ./S96script.pl ....     < -- works

The problems include:

When the system is actually changing run levels and the init process
executes the scripts they fail to stop on going down run levels.

When the system is actually changing run levels and the init process
executes the scripts they fork off another process when going up run
levels.
  eg:
dba 19000     1 10 00:07:01 ... /bin/sh /dba/dbscripts/loadall /dba/cfg/cfg21
dba 19005  1900  4 00:07:01 ... /bin/sh /dba/dbscripts/loadall /dba/cfg/cfg21

The posix scripts are owned by root. The database control scripts
written in perl are owned by dba.  The posix scripts have lines like:

  su - dba -c /dba/dba/dbscripts/loadall /dba/cfg/cfg21& >  /logs/dba/cfg21 2>&1

HP support rep thinks the problem is the use of perl.

Any ideas?
-- 
Robert.Lopez@Philips.com


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

Date: Thu, 01 Nov 2001 09:22:46 -0500
From: cool dude <control153@yahoo.com>
Subject: Re: displaying headers in perl
Message-Id: <3BE15AB6.40FFADD7@yahoo.com>

alastair , i tried that but i do not want the header of a url, i want the
header of the browser request aclling the script ...


Alastair wrote:

> cool dude <control153@yahoo.com> wrote:
> > can someone help me. i want to write a cgi script
> > that is called by a browser. on the browser will be displayed the header
> >
> > information for the request (in other words the header info of the
> > browser
> > since no data is being passed). i have all the lwp modules needed
> > installed
>
> Doesn't LWP::Simple suffice for this?
>
> Cheers,
>
> --
> AS                                  |
> alastair@calliope.demon.co.uk       |
> http://www.calliope.demon.co.uk     |            PGP Key : A9DE69F8
> -------------------------------------------------------------------



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

Date: Thu, 1 Nov 2001 10:26:20 -0500
From: "Ryan Cobine" <rcobine@indiana.edu>
Subject: explanation of special vars $a, $b...
Message-Id: <9rrpis$idk$1@jetsam.uits.indiana.edu>

I have been looking for some documentation that discusses the magical $a and
$b. I have seen them used in this context:

    sub bylname {

        $lastname_table{$a} cmp $lastname_table{$b}

    }

This is called later in a foreach loop like so:

    foreach $key (sort bylname keys %lastname_table) {...

Seems like $a $b are some default "next in list" and "next after next in
list" variables, but I can't find any discussion of them on the Web. I know
that they are in Camel book 3rd edition, but I only have 2nd ed.

Any explanation of these will be appreciated!
--

~Ryan




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

Date: Thu, 1 Nov 2001 10:30:50 -0500
From: "Mina Naguib" <spam@thecouch.homeip.net>
Subject: Re: explanation of special vars $a, $b...
Message-Id: <yUdE7.2812$Bs2.107465@weber.videotron.net>


"Ryan Cobine" <rcobine@indiana.edu> wrote in message
news:9rrpis$idk$1@jetsam.uits.indiana.edu...
> I have been looking for some documentation that discusses the magical $a
and
> $b. I have seen them used in this context:
>
>     sub bylname {
>
>         $lastname_table{$a} cmp $lastname_table{$b}
>
>     }
>
> This is called later in a foreach loop like so:
>
>     foreach $key (sort bylname keys %lastname_table) {...
>
> Seems like $a $b are some default "next in list" and "next after next in
> list" variables, but I can't find any discussion of them on the Web. I
know
> that they are in Camel book 3rd edition, but I only have 2nd ed.
>
> Any explanation of these will be appreciated!

$a and $b are specific to sorting routines. They provide the "left side" vs.
"right side" so you can build elaborate sorting routines using them as
opposed to the default "greater than" method.

More info at perldoc -f sort or
http://www.perldoc.com/perl5.6/pod/func/sort.html

> --
>
> ~Ryan
>
>




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

Date: Thu, 01 Nov 2001 11:31:48 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: explanation of special vars $a, $b...
Message-Id: <3BE18704.EAA13225@home.com>

Ryan Cobine wrote:
> 
> I have been looking for some documentation that discusses the
> magical $a and $b.

$a and $b are not magical. (That term has meaning in Perl.) The only
thing special about the vars themselves is that they are automatically
defined as package globals, which means that they are exempt from
needing declaration under use strict 'vars'.

> I have seen them used in this context:
> 
>     sub bylname {
>         $lastname_table{$a} cmp $lastname_table{$b}
>     }

That's a sortsub. Perl automatically uses $a and $b as the variables for
passing arguments to them. This is the reason that $a and $b are
automatically defined.

> Seems like $a $b are some default "next in list" and "next after
> next in list" variables, but I can't find any discussion of them
> on the Web.

No need to go to the web, check the docs on your own computer. Type

   perldoc -f sort

and

   perldoc -q sort

at a command prompt.

-mjc


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

Date: 01 Nov 2001 07:36:48 -0500
From: Mona Wuerz <wuerz@yahoo.com>
Subject: Re: Getting one element of array return value
Message-Id: <m3g07y7jmn.fsf@DCCMBX01.njitdm.campus.njit.edu>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:

> According to Mona Wuerz  <wuerz@yahoo.com>:
> 
> >                                                                   So
> > there's no way (as far as I can see) to avoid assigning that list to
> > an array variable if you want to address specific elements.
> 
> Why?  The (LIST)[INDEX] construct picks individual elements from a list.

-- and I thought of that as an anonymous array, not a list. I was
mistaken, it seems. Whether, however, it makes a difference from a
conserving-memory POV, I'm still searching for a definitive answer.

(Not that I wouldn't agree that if a sub returns a flat list big
enough to warrant memory concerns, one probably should look for
alternatives.) 

-mona


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

Date: 1 Nov 2001 13:42:35 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Getting one element of array return value
Message-Id: <9rrjgb$g5$1@mamenchi.zrz.TU-Berlin.DE>

According to Mona Wuerz  <wuerz@yahoo.com>:
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:
> 
> > According to Mona Wuerz  <wuerz@yahoo.com>:
> > 
> > >                                                                   So
> > > there's no way (as far as I can see) to avoid assigning that list to
> > > an array variable if you want to address specific elements.
> > 
> > Why?  The (LIST)[INDEX] construct picks individual elements from a list.
> 
> -- and I thought of that as an anonymous array, not a list. I was
> mistaken, it seems. Whether, however, it makes a difference from a
> conserving-memory POV, I'm still searching for a definitive answer.
 
The (...)[] definitely expects a list inside the (), not an anonymous
array.  The difference in memory consumption would be negligible, however.

Anno


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

Date: Thu, 01 Nov 2001 07:44:45 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: Getting one element of array return value
Message-Id: <3BE151CC.4896E299@home.com>

Dimitri wrote:
> 
> Michael Carman <mjcarman@home.com> wrote in message > news:<3BE024D1.79D19AD3@home.com>...
> >
> > Dimitri wrote:
> > >
> > > Say we have a subroutine that returns an array (a big one).
> > > How can I get the n-th element of this array, without having
> > > to assign the return value to another array (and effectively
> > > copy the whole thing)?
> 
> Thanks for all the help! How about using this?
> 
> (undef, $x) = &sss();

Yes, that's another alternative. It works fine where n is small (and
constant).

> would it be better than the proposed alternative, memory-wise?

No. If sss() returns a list, then that list is always created somewhere
in memory.

-mjc


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

Date: Thu, 01 Nov 2001 10:41:42 -0800
From: Kirk Herlitz <kherlitz@mindcast.com>
Subject: Re: Help with a tough algorithm
Message-Id: <3BE19766.F7304FBC@mindcast.com>


Yeah, I was gonna say that it sounded like a perfect scenario for
recursion, but I don't know if I could have come up with a short and
sweet solution...  Very nice...

"John J. Trammell" wrote:
> 
> On 31 Oct 2001 20:12:13 -0800, Tommy Butler wrote:
> > I'm trying to get a six-character string *in stepped sequence*
> > from the array of possible unique six-character strings for the
> > character class of [a-zA-Z0-9_].
> 
> Booya!
> 
> #!/usr/bin/perl -lp
> BEGIN {use integer;@f=('A'..'Z','a'..'z',0..9,"_");
> sub x{!(caller(5))&&($_[0]%@f,x($_[0]/@f))}}
> s/$_/reverse map($f[$_],x($_))/e;
> 
> Anybody got any more of that sweet sweet sweet Halloween candy?  :-)


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

Date: 1 Nov 2001 10:56:28 -0800
From: nicktemple2000@yahoo.com (Nick Temple)
Subject: Re: How to run a perl script as background from remote host ?
Message-Id: <a9fe2341.0111011056.509b09b6@posting.google.com>

Start by deleting all the files that sound like "Osama".

"Matt" <pneumatus@NOSPAMhotmail.com> wrote in message news:<9rq1bq$7$1@neptunium.btinternet.com>...
> have a go at
> 
> nohup perl FILENAME &
> 
> Matt...
> 
> "j0eblack" <j0eblack@ihug.com.au> wrote in message
> news:9rp0jl$a30$1@bugstomper.ihug.com.au...
> > Hi
> >
> > I remotely connect to a server ** a paid hosting server ** ,  here's the
> > problem
> > I wanted to allow a script  to runs in background  ** the task of the
>  script
> > is to constantly monitor certain directories  and delete the appropriate
> > file ** .
> > the problem is as soon as my telnet connection to the hosting server
> > terminated, the script stop running.
> > Is there any way I can let it keep running ? ** after the disconnection of
> > coz **
> > ** probably this is not a so PERL question , but if u have a clue ,
>  greatly
> > appreciate it :) **
> >
> > thank you
> >
> >
> >
> >
> >


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

Date: 1 Nov 2001 11:04:04 -0800
From: nicktemple2000@yahoo.com (Nick Temple)
Subject: Re: how to set up a CGI on my webpage
Message-Id: <a9fe2341.0111011104.a8398e3@posting.google.com>

Well, I have a problem with scaling and itching both.  Not with my
nads,  because I don't have any.

xeno@eskimo.com (Xeno Campanoli) wrote in message news:<9rpupa$rc4$1@eskinews.eskimo.com>...
> Xeno Campanoli (xeno@eskimo.com) wrote:
> 
> : you are doing is standard and even for some reason recommended.  In most cases
> : it is needlessly not good.  I always here people complain that Perl doesn't
>  	^ Sorry, I meant "hear"
> : scale well.  It scales much better, especially when you start writing systems


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

Date: 1 Nov 2001 09:18:11 -0800
From: zilt@iname.com (Zilt)
Subject: Leftmost SHORTEST
Message-Id: <7e13fafe.0111010918.620731f3@posting.google.com>

Hi!

I suspect my problem is not an FAQ because I haven't found any
references to it in comp.lang.perl (searched with google). Here it is:

How do you instruct gawk (or at least perl) to match the leftmost
SHORTEST occurance instead of the default longest? A classical example
would be
/<.*>/
which does not match a single HTML tag, but matches from the first '<'
to the last '>' in the record. Okay, I know the workaround for this
is:
/<[^>]*>/
but how do you work around SEQUENCES? E.g. C-stlye comments: /* */ or
BEGIN .. END blocks in Pascal (assuming multi-line records)? As far as
I know, there's no way to NOT match an expression in gawk, e.g.
/BEGIN(^END)*END/ would not work.

Regards,
Zilt


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

Date: Thu, 1 Nov 2001 12:48:22 -0500
From: "Mina Naguib" <spam@thecouch.homeip.net>
Subject: Re: Leftmost SHORTEST
Message-Id: <tVfE7.3467$Bs2.159096@weber.videotron.net>


"Zilt" <zilt@iname.com> wrote in message
news:7e13fafe.0111010918.620731f3@posting.google.com...
> Hi!
>
> I suspect my problem is not an FAQ because I haven't found any
> references to it in comp.lang.perl (searched with google). Here it is:
>
> How do you instruct gawk (or at least perl) to match the leftmost
> SHORTEST occurance instead of the default longest? A classical example
> would be
> /<.*>/

Have you done some research ? This is very clear in the "PERLRE" document:
By default, a quantified subpattern is "greedy", that is, it will match as
many times as possible (given a particular starting location) while still
allowing the rest of the pattern to match. If you want it to match the
minimum number of times possible, follow the quantifier with a "?". Note
that the meanings don't change, just the "greediness":

In summary, you want /<.*?>/

Read http://www.perldoc.com/perl5.6/pod/perlre.html


> which does not match a single HTML tag, but matches from the first '<'
> to the last '>' in the record. Okay, I know the workaround for this
> is:
> /<[^>]*>/
> but how do you work around SEQUENCES? E.g. C-stlye comments: /* */ or
> BEGIN .. END blocks in Pascal (assuming multi-line records)? As far as
> I know, there's no way to NOT match an expression in gawk, e.g.
> /BEGIN(^END)*END/ would not work.
>
> Regards,
> Zilt




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

Date: Thu, 1 Nov 2001 12:02:20 -0600
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: Leftmost SHORTEST
Message-Id: <slrn9u33h7.g3.trammell@haqq.el-swifto.com>

On 1 Nov 2001 09:18:11 -0800, Zilt <zilt@iname.com> wrote:
> I suspect my problem is not an FAQ because I haven't found any
> references to it in comp.lang.perl (searched with google). Here it is:
> 
> How do you instruct gawk (or at least perl) to match the leftmost
> SHORTEST occurance instead of the default longest? A classical example
> would be
> /<.*>/
> which does not match a single HTML tag, but matches from the first '<'
> to the last '>' in the record. Okay, I know the workaround for this
> is:
> /<[^>]*>/
> but how do you work around SEQUENCES? E.g. C-stlye comments: /* */ or
> BEGIN .. END blocks in Pascal (assuming multi-line records)? As far as
> I know, there's no way to NOT match an expression in gawk, e.g.
> /BEGIN(^END)*END/ would not work.
> 

my $string = q[<tag0> BEGIN <tag1> END <tag2> BEGIN <tag3> END <tag4>];

if ($string =~ m[<([^>]*?)>])
{
    print "got tag with negated character class: '$1'\n";
}

if ($string =~ m[<(.*?)>])
{
    print "got tag with non-greedy regex: '$1'\n";
}

if ($string =~ m[BEGIN(.*?)END])
{
    print "got BEGIN-END block with non-greedy regex: '$1'\n";
}

Note that regexps are the wrong solution to this problem, e.g.:

  <input type="textarea" name="trouble" value=">">

and

  BEGIN
     print "this line will cause no END of trouble";
  END

You might want to read up on Parse::RecDescent.  gawk is not going
to cut it either.

-- 
[M]en become civilized, not in proportion to their willingness to believe,
but in proportion to their willingness to doubt.            - H.L. Mencken


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

Date: Thu, 01 Nov 2001 18:32:08 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Leftmost SHORTEST
Message-Id: <slrn9u32ke.8pt.tadmc@tadmc26.august.net>

Zilt <zilt@iname.com> wrote:

>in comp.lang.perl (searched with google). 


The comp.lang.perl newsgroup was removed about *6 years* ago!


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 01 Nov 2001 12:33:44 -0600
From: brian d foy <comdog@panix.com>
Subject: Re: Linking Perl to a databse
Message-Id: <comdog-D88AB7.12334401112001@news.panix.com>

In article <c1b9601c.0110310343.62908c13@posting.google.com>, 
chris.collins@rbos.com (Chris Collins) wrote:

> I am trying to link a Perl script to a sybase database.  I then want
> to run a query and print the results into a seperate file.  I am
> confident that i can do this once i have the necesaary material. 
> Unfortunately i cannot find anywhere how to access a database.  Is
> there a standard form to follow?

use the DBI module with the Sybase driver

    http://search.cpan.org/search?dist=DBI
    http://search.cpan.org/search?dist=DBD-Sybase

-- 
brian d foy <comdog@panix.com> - Perl services for hire
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html



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

Date: Thu, 01 Nov 2001 10:17:01 -0500
From: Tom <tom@tealcity.com>
Subject: Re: MAC user question
Message-Id: <3BE1676C.1BE7@tealcity.com>

Hi Anno,
Thanks. Thought I did that. Guess I Didn't
get it right.  oops!
Thanks again.
tom



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

Date: Wed, 31 Oct 2001 09:52:49 -0800
From: "Swanthog" <lhswartw@ichips.intel.com>
Subject: Re: Need script or tool to create function call lists
Message-Id: <9rpdpi$nsl@news.or.intel.com>

Larry,

I think this does what you ask except it creates .html files.
http://www.zib.de/Visual/software/doc++/index.html

Larry S.

"Larry Wilson" <lk.wilson@home.com> wrote in message
news:B7FC8BD7.24A8F%lk.wilson@home.com...
> Anybody know of a perl script (or other unix tool) to analyze a bunch of
> C/C++ source code files to create function call diagrams or lists of
> function calls automatically?  Something like this (where functionFoo is
> called by functionABC, which is called by funcXYZ, and so on)...
>
>   main()......................foomain.c,              line xxx
>     funcXYZ().................sourcefile1.cpp,        line xxx
>       functionABC()...........sourcefile9.c,          line xxx
>          functionFoo()........sourcefileFoo.c         line xxx
>
>   main()......................foomain.c               line xxx
>     functBozo()...............foomain.c               line xxx
>          functionFoo()........sourcefileFoo.c         line xxx
>
>   functZounds()...............sourcefileGamma.cp      line xxx
>      functionFoo()............sourcefileFoo.c         line xxx
>
>
>  or the reverse order (where the called function is first, followed by
> calling functions) ...
>
>  functionFoo()   foomain.c, xxx
>    functBozo()   foomain.c, xxx
>
> Actual format is not particularly important.
>
>
>




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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 2047
***************************************


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