[16330] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3742 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 19 03:05:33 2000

Date: Wed, 19 Jul 2000 00:05:16 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <963990315-v9-i3742@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 19 Jul 2000     Volume: 9 Number: 3742

Today's topics:
    Re: ARRAY PROBLEM <-EViL-DOC-@BLUR.COM>
    Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!! (brian d foy)
    Re: cgi help (Neil Kandalgaonkar)
    Re: cgi help <ronnie@catlover.com>
    Re: CGI.pm question joelnet1@my-deja.com
    Re: cookie problem using CGI.pm <ttompkins@uswest.net>
    Re: crypt for Perl 4.0 (Keith Calvert Ivey)
        Duplicate Posts <danny@lennon.postino.com>
    Re: Duplicate Posts <mauldin@netstorm.net>
    Re: Duplicate Posts (jason)
    Re: file endings with regexps... sept00@my-deja.com
    Re: file uploading with PerlScript/ASP <debjit@oyeindia.com>
    Re: globbing subdirectories (Tad McClellan)
    Re: globbing subdirectories (Tad McClellan)
        help with pipes carmatron@my-deja.com
    Re: HELP: Pattern Match (Keith Calvert Ivey)
    Re: How can I make variables global when I define them  (Tad McClellan)
    Re: How can I make variables global when I define them  (Tad McClellan)
    Re: how to convert "1.2.3.10" to "01020310"? <mauldin@netstorm.net>
    Re: how to convert "1.2.3.10" to "01020310"? (Craig Berry)
    Re: how to convert "1.2.3.10" to "01020310"? <mauldin@netstorm.net>
        how to delete )) tvn007@my-deja.com
        I was wondering if someone will script me a cgi ladder? <juniorNOjuSPAM@charter.net.invalid>
    Re: Modify every file in a directory (Keith Calvert Ivey)
        Module Versions <nospam@nospam.com>
    Re: Module Versions <prakash@dakota.gate.net>
    Re: nasty DESTROY behaviour (Ilya Zakharevich)
    Re: newbie - like it so far - not so sure I do <iltzu@sci.invalid>
    Re: Perl Expert? I need help! <akurczyn@usa.net>
    Re: Perl Expert? I need help! (Abigail)
    Re: Search & replace String (Abigail)
        Set cookie after sending text? <charles_weaver@post.harvard.edu>
        Sign Up Script <mrclyde@bolomail.dyn.dhs.org>
    Re: Splitting on a number: help please (Keith Calvert Ivey)
        Topaz source? <matt@nightrealms.com>
        What does this mean? <jaurangNOjaSPAM@crosswinds.net.invalid>
    Re: What does this mean? (jason)
    Re: WHERE is libnet????? <nospam@nospam.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 19 Jul 2000 14:09:42 +1000
From: "-EViL-DOC-" <-EViL-DOC-@BLUR.COM>
Subject: Re: ARRAY PROBLEM
Message-Id: <397528b7$1@ns1.access1.com.au>

Sorry, it was a typo...

My question is how can i add the say third element from
$array1[1] (EG. integer1,integer2,integer3,integer4)
                                                   ^^ This one
to the 2nd element of $array2[3] (EG. integer1,integer2,integer3,integer4)
                                                                       ^^
This one
& store it in a variable, not overwrite an entry in array2.

So to do this could i change $array1[3][1]+=$array2[1][2]
to say
$somevar = $array1[3][1]+$array2[1][2] ?

i need to do a few such calculations & eventually ill then say something
like
$output = "$somevar1;$somevar2;$somevar3;$somevar4";
push (@array3, $output);

Thanks again

Bob Walton <bwalton@rochester.rr.com> wrote in message
news:3973B0B6.9EE1E1AD@rochester.rr.com...
> -EViL-DOC- wrote:
> ...
> > I am reading 2 files into separate arrays
> > @array1 contains many lines of the following format.
> > $array1[0] contains
integer1,integer2,integer3,integer4,integer5,integer6
> >
> > @array2 contains many lines of the following format.
> > $array2[0] contains integer1,integer2,integer3,integer4
> >
> > My question is how can i add the say third element from
> > $array1[1] (EG. integer1,integer2,integer3,integer4)
> >                                       ^^ This one
> >
> > to the 2nd element of $array1[3] (EG.
integer1,integer2,integer3,integer4
> >
> > ^^ This one
> > Thanks in advance !
>
> By "add to", I assume you mean "take the sum of the two numbers and
> replace the second number with that sum".  I also assume that the array
> elements of @array1 contain references to anonymous arrays.  If so:
>
>     $array1[3][1]+=$array1[1][2];
>
> is one way.  Why did you mention $array2 in your intro when you didn't
> use it in your question?
> --
> Bob Walton




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

Date: Wed, 19 Jul 2000 01:23:23 -0500
From: brian@smithrenaud.com (brian d foy)
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!
Message-Id: <brian-1907000123230001@105.sanjose-10-15rs16rt.ca.dial-access.att.net>

In article <m1wvij5dbn.fsf@halfdome.holdit.com>, merlyn@stonehenge.com (Randal L. Schwartz) wrote:

>"Buy Randal a beer night" was at only the very first perl conference
>(or maybe the second, whichever one first had online BOF schedules).

it was the second, and it was in series with the same thing with 
Chip Salzenberg and Jon Orwant (although i think i called it a
fireside chat in Jon's case).

-- 
brian d foy
Perl Mongers <URI:http://www.perl.org>
CGI MetaFAQ 
  <URI:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>



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

Date: Wed, 19 Jul 2000 05:24:39 GMT
From: neil@brevity.org (Neil Kandalgaonkar)
Subject: Re: cgi help
Message-Id: <8l3dlr$27g$1@localhost.localdomain>

In article <8l394u$3ae$1@news5.jaring.my>, han <lihock@pc.jaring.my> wrote:
>Does perl/cgi has the function "Session" like asp?

"perl/cgi" is a meaningless concept; perl is a general purpose language
and can be used in many different ways even for web applications.

Perl's standard CGI module can be used to generate cookies, which is all
that session keys are really, AFAIK.


>if nope
>how am i going to carry the variable from one html form to another?

If you like the ASP way of doing things, there are several modules that
give you much of the ASP interface in perl, including session keys. See 
search.cpan.org. (nb, I have never used them myself.) 

In addition there are about a kajillion other ways to do session keys 
with Perl and/or Apache. Once again you will find many of them on the CPAN.

-- 
Neil Kandalgaonkar <neil@brevity.org>


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

Date: Wed, 19 Jul 2000 01:32:43 -0400
From: Ron Grabowski <ronnie@catlover.com>
Subject: Re: cgi help
Message-Id: <39753D7B.CD350BF@catlover.com>

> Does perl/cgi has the function "Session" like asp?

Perl does not have a 'Session' function or a built-in Session object. 

This isn't a Perl question so much as it is a CGI question. CGI is a
stateless protocol so it does not maintain state between pages. If you
want to preserve state, you have to use cookies, add additional
information to the URL line, use hidden form values, etc.


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

Date: Wed, 19 Jul 2000 06:33:01 GMT
From: joelnet1@my-deja.com
Subject: Re: CGI.pm question
Message-Id: <8l3i2s$359$1@nnrp1.deja.com>

Thanks,

this did the trick for me:

$query = new CGI;
$query->import_names('R');

print $R::formvariable ;


In article <MPG.13dfc0fe86ba6f999896f3@news>,
  elephant@squirrelgroup.com (jason) wrote:
> joelnet1@my-deja.com wrote ..
> >I need to take the variables from a submitted form and create
formatted
> >html output from those vars.
> >
> >I don't want to have to translate let them like this:
> >$firstname = param("firstname");
> >
> >in order to use them because there are over 100 vars on the form I'm
> >working with.
>
> there are a number of options in CGI to create variables directly
from
> the CGI parameters .. check out the CGI documentation .. the easiest
is
> probably
>
>   import_names()
>
> --
>   jason -- elephant@squirrelgroup.com --
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 18 Jul 2000 23:38:13 -0700
From: "Tim Tompkins" <ttompkins@uswest.net>
Subject: Re: cookie problem using CGI.pm
Message-Id: <gMdd5.1329$gN4.390366@news.uswest.net>

If you're using different servers, make sure that you're setting the cookie
qualified to the domain level -- ie

   my $c = new CGI::Cookie(
        -domain=> '.domain.com',
        -path => '/',
        -secure => 1,
        -name => 'common_name_used_by_all_servers',
        -value => {k1=>'v1', k2=>'v2}
    )

Note that the leading dot is important in the domain.  This configuration
will allow various hosts on the same domain to use a single cookie (provided
that you're setting and requesting the same name as you stated).


--


Thanks,

Tim Tompkins
----------------------------------------------
Programmer / Staff Engineer
http://www.arttoday.com/
----------------------------------------------


"Alex Sapronov" <plazm@yahoo.com> wrote in message
news:8k4o3b$mhh$1@nnrp1.deja.com...
> Hi guys!
> I am running CGI.pm under mod_perl. We do user menagement on our web
> site using HTTP cookies and we have been running some logging to debug
> our system. One of the things we have done is we dumped cookies using
> CGI.pm raw_cookie() call. Some entries look very wierd. For example,
> some dumps contain cookies with identical names(!).
>
> Qsession=24.64.223.5.18068951860758711030e3f60af90e0801ddb17e4bf0c6c8d4a
> 7733ef; QULOGIN=030e3f60af90e0801ddb17e4bf0c6c8d4a7733ef;
> Qsession=24.64.223.5.18068951860758711bfb23498351c337887ef9accd55263d713
> fd7abd; QULOGIN=bfb23498351c337887ef9accd55263d713fd7abd
>
> The above output comes from single raw_cookie() call. Ho can that
> happen? It causes real problems :( The code runs under Apache.
>
> thanks,
> A.
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>




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

Date: Wed, 19 Jul 2000 03:44:21 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: crypt for Perl 4.0
Message-Id: <3979237c.5205047@news.newsguy.com>

Bob Walton <bwalton@rochester.rr.com> wrote:

>At one time, there was a Crypt module, which, if I recall correctly, was
>an all-Perl implementation of the crypt function (which function was
>missing from some versions of Perl 4 "due to excessive paranoia").  I no
>longer have a copy of the Crypt module, and, apparently, neither does
>CPAN -- after all, crypt is standard in Perl 5.  But maybe someone else
>does?

Actually, some Win32 versions of Perl 5 were the ones with the
"excessive paranoia" that led to the creation of Crypt.pm.
That's why it was a module.  If it had been for Perl 4, it would
have been crypt.pl.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)


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

Date: 19 Jul 2000 04:42:08 GMT
From: <danny@lennon.postino.com>
Subject: Duplicate Posts
Message-Id: <8l3bj0$er2$1@lennon.postino.com>

User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.14-5.0 (i586))

Is it something I ate, or is anyone else seeing dozens of duplicate 
articles here? Looks like a news server at openbazaar.net is re-labling
and forwarding articles. Yuck.

-- 
Danny Aldham     Providing Certified Internetworking Solutions to Business
www.postino.com  E-Mail, Web Servers, Web Databases, SQL PHP & Perl


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

Date: Wed, 19 Jul 2000 05:19:44 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: Duplicate Posts
Message-Id: <397539BD.B4892BD6@netstorm.net>

danny@lennon.postino.com wrote:

> User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.14-5.0 (i586))
>
> Is it something I ate, or is anyone else seeing dozens of duplicate
> articles here?

Yeah, me too, except I thought it was something I drank ...

-- Jim



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

Date: Wed, 19 Jul 2000 06:24:03 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: Duplicate Posts
Message-Id: <MPG.13dfe6d7d963b9f79896f4@news>

Jim Mauldin wrote ..
>danny@lennon.postino.com wrote:
>
>> User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.14-5.0 (i586))
>>
>> Is it something I ate, or is anyone else seeing dozens of duplicate
>> articles here?
>
>Yeah, me too, except I thought it was something I drank ...

I had to confirm it on Deja before I was sure .. just added a new filter

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: Wed, 19 Jul 2000 06:38:54 GMT
From: sept00@my-deja.com
Subject: Re: file endings with regexps...
Message-Id: <8l3ids$381$1@nnrp1.deja.com>


> returns 'hidden_file', the last part of the filename, since _ isn't a
> path-or-file-name-part-delimiter in any of the common systems we see.
>
> bart's right, though, it doesn't work for
>
> my $path = '/oops/this/one/has/no/extension';
>
> although the original spec is incomplete,
> should it return the whole path (it does now), or
> 'extension', which isn't really an extension or filetype designator,
or
> '', which is what I lean towards.
>
> What did the original requestor want?

It should return '' in case the file has no ending. This is just to
check if the file having the given filename is safe to display to
anonymous users.

Yes, I am stuck in a windows world, and please don't tease my about
it...

Take care,
Tom


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 19 Jul 2000 09:59:45 +0530
From: "Debjit" <debjit@oyeindia.com>
Subject: Re: file uploading with PerlScript/ASP
Message-Id: <8l4fnd$jhl$1@news.vsnl.net.in>

in form
<form action="/cgi-bin/rupload.cgi" method="post"
ENCTYPE="multipart/form-data">

<input type=file name=picture>
<input type=submit>

</form>
in script
use CGI;
use CGI::Carp qw(fatalsToBrowser);

$cgi = new CGI;
print qq`content-type: text/html

`;
$attachment = $cgi->param('picture');

if ($attachment) {
 $filename = $attachment;
 @filenamearray = split(/\/|\\|:/, $filename);
 $filename = $filenamearray[-1];
 $filectype = $cgi->uploadInfo($attachment);

 $filedata = join '',<$attachment>;
 #Saving to a file
 open(FILE, ">c:/windows/desktop/$filename") or die "$!";
 print FILE $filedata;
 close(FILE);
}

Alex T. wrote in message <3974618E.42D3BE38@hotmail.com>...
>Hi,
>
>I need to be able to upload a file from the user's computer to the
>server.
>When a user logs in into the web-site, he is presented with a web form
>where he has to enter some information, such as name, e-mail, etc.. and
>also specify the file that he wants to have uploaded to the server.
>After he hits submit I need to upload the specified file. I'm using
>PerlScript for ASP.
>
>Could anyone give me any ideas how to do this, or point to some places
>where I can find more information about this.
>
>Thank you in advance!
>
>Alex
>




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

Date: Tue, 18 Jul 2000 19:46:05 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: globbing subdirectories
Message-Id: <slrn8n9uid.tl.tadmc@maxim.metronet.com>

On Tue, 18 Jul 2000 18:02:02 +0100, George Karpodinis <karpo@talk21.com> wrote:

>Is there any one-liner that can search and replace text in all files (*.tex
>for example) of a directory AND its subdirectories ?


one (long) line wrapped for posting:

perl -MFile::Find -e 'find(sub{push @ARGV, $File::Find::name
   if /\.tex$/}, q/./); END{ $^I=q//; s/i/I/g, print while <>}'


You probably need to change the quoting of the last arg, I cannot
test it with double quotes on my system.


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


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

Date: Wed, 19 Jul 2000 00:13:15 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: globbing subdirectories
Message-Id: <slrn8nae7b.sk.tadmc@maxim.metronet.com>

On Tue, 18 Jul 2000 19:46:05 -0500, I, myself <tadmc@metronet.com> wrote:
>On Tue, 18 Jul 2000 18:02:02 +0100, George Karpodinis <karpo@talk21.com> wrote:
>
>>Is there any one-liner that can search and replace text in all files (*.tex
>>for example) of a directory AND its subdirectories ?
>
>
>one (long) line wrapped for posting:
>
>perl -MFile::Find -e 'find(sub{push @ARGV, $File::Find::name
>   if /\.tex$/}, q/./); END{ $^I=q//; s/i/I/g, print while <>}'
                         ^^^^                                 ^
                         ^^^^                                 ^

Errr, I didn't need that part...


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


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

Date: Wed, 19 Jul 2000 06:16:47 GMT
From: carmatron@my-deja.com
Subject: help with pipes
Message-Id: <8l3h46$2do$1@nnrp1.deja.com>

Hello perl community:

I have the next problem with pipes, when I run the next code:

open(OGPIPE,"dvips |");

close(OGPIPE);

$stat = $?;
$stat >>= 8;
print "\nstatus $stat\n";


The ActivePerl 5.005_03 build 522 do this

status 0

but the ActivePerl 5.6 build 616 do this

status 16777215


where is the problem in the code???

Thank for your help, as further information I have Windows98



Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 19 Jul 2000 03:24:47 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: HELP: Pattern Match
Message-Id: <39771ea9.3969707@news.newsguy.com>

kenned57@NoSpam.edu (Cameron Kennedy) wrote:

>try 
>$address=~s/(\bstr?\.?)/Street/ig;

That turns "Street" into "Streeteet" and "stand" into
"Streetand".  Also, the capturing parentheses aren't doing
anything.  Try

  $address =~ s/\bstr?(?:\b|\.)/Street/gi;

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)


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

Date: Tue, 18 Jul 2000 19:52:44 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How can I make variables global when I define them with my?
Message-Id: <slrn8n9uus.tl.tadmc@maxim.metronet.com>

On Tue, 18 Jul 2000 14:27:01 -0400, Edward Waldspurger 
   <ewald@electronicfrontiers.com> wrote:

>$file = $_[0] || die "Template : No template file specified\n";


I think you have a precedence problem there.

If the template file happens to be named '0', you will
issue a very strange diagnostic message, and $file will
be set to 1 !

You are (trying to) test for truth when you should be testing
for existance instead:


   die "Template : No template file specified\n" unless defined $_[0];
   my $file = $_[0];


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


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

Date: Wed, 19 Jul 2000 00:15:45 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How can I make variables global when I define them with my?
Message-Id: <slrn8naec1.sk.tadmc@maxim.metronet.com>

On Tue, 18 Jul 2000 19:52:44 -0500, I, myself <tadmc@metronet.com> wrote:
>On Tue, 18 Jul 2000 14:27:01 -0400, Edward Waldspurger 
>   <ewald@electronicfrontiers.com> wrote:
>
>>$file = $_[0] || die "Template : No template file specified\n";
>
>
>I think you have a precedence problem there.
>
>If the template file happens to be named '0', you will
>issue a very strange diagnostic message, and $file will
>be set to 1 !


Errr, $file isn't going to get "set" either.

Sheesh!


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


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

Date: Wed, 19 Jul 2000 05:05:37 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: how to convert "1.2.3.10" to "01020310"?
Message-Id: <3975366D.901BB381@netstorm.net>

Craig Berry wrote:

> Bernard El-Hagin (bernard.el-hagin@lido-tech.net) wrote:
>
> : This brings up an interesting question. Can this be done in a single
> : substitution?
>
>   s/\.?(\d+)/sprintf '%02d', $1/eg;

I like Craig's 'final answer' on this one for its clarity and brevity, with
two minor changes

    s/(\d+)/printf '%02d', $1/eg;

\.? not needed because we just throw it away anyway.  And I'm sure you meant
printf not sprintf.

-- Jim Mauldin




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

Date: Wed, 19 Jul 2000 05:31:17 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: how to convert "1.2.3.10" to "01020310"?
Message-Id: <snaf95a91nk146@corp.supernews.com>

Jim Mauldin (mauldin@netstorm.net) wrote:
: Craig Berry wrote:
: >   s/\.?(\d+)/sprintf '%02d', $1/eg;
: 
: I like Craig's 'final answer' on this one for its clarity and brevity, with
: two minor changes
: 
:     s/(\d+)/printf '%02d', $1/eg;
: 
: \.? not needed because we just throw it away anyway.  And I'm sure you meant
: printf not sprintf.

Sorry, but neither change works.  If you leave out the \.? part, the
periods get left in the transformed string.  And using printf rather than
sprintf writes the changes to stdout, rather than back into the string on
which we're operating.

Your version sends the right stuff to stdout, but does it in an
unecessarily obscure way, and the *original* poster wanted a string
generated, rather than equivalent output to stdout.  If instead you want
the output without storage, I'd use the map or foreach variants Abigail
and I have been debating lately. 

-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Turning and turning in the widening gyre
   |   The falcon cannot hear the falconer." - Yeats, "The Second Coming"


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

Date: Wed, 19 Jul 2000 05:55:00 GMT
From: Jim Mauldin <mauldin@netstorm.net>
Subject: Re: how to convert "1.2.3.10" to "01020310"?
Message-Id: <39754200.29A5F871@netstorm.net>

Craig Berry wrote:

> Jim Mauldin (mauldin@netstorm.net) wrote:
> : Craig Berry wrote:
> : >   s/\.?(\d+)/sprintf '%02d', $1/eg;
> :
> : I like Craig's 'final answer' on this one for its clarity and brevity, with
> : two minor changes
> :
> :     s/(\d+)/printf '%02d', $1/eg;
> :
> : \.? not needed because we just throw it away anyway.  And I'm sure you meant
> : printf not sprintf.
>
> Sorry, but neither change works.  If you leave out the \.? part, the
> periods get left in the transformed string.  And using printf rather than
> sprintf writes the changes to stdout, rather than back into the string on
> which we're operating.

You're right - original post said "convert", not print.

-- Jim



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

Date: Wed, 19 Jul 2000 06:13:18 GMT
From: tvn007@my-deja.com
Subject: how to delete ))
Message-Id: <8l3gtl$2bd$1@nnrp1.deja.com>

Hi,

I have tried so many way but I cannot delete this characters ))

Example: I have the file as shown below:



(ab
  c)
(xyx)
(zzz)
))

#my script has:

$/ =")";

How can I delete the )) in the file above. The )) is always
at the end of file.

Thanks in advance


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 18 Jul 2000 22:17:54 -0700
From: Jester179 <juniorNOjuSPAM@charter.net.invalid>
Subject: I was wondering if someone will script me a cgi ladder?
Message-Id: <06cd9bdb.e778eefb@usw-ex0104-033.remarq.com>

I need someone to help me script a cgi/perl or asp Gaming
ladder. Plz reply to this or email me at junior@charter.net


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

Got questions?  Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com



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

Date: Wed, 19 Jul 2000 03:52:27 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Modify every file in a directory
Message-Id: <397b258d.5734166@news.newsguy.com>

elephant@squirrelgroup.com (jason) wrote:

>  split /\s/, $_, -1;
>
>will do better

   split /\t/, $_, -1;

would be still better, since Neil was rejoining with tabs
afterward anyway.  There's no point in gratuitously converting
the file from whitespace-delimited to tab-delimited while
modifying it.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)


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

Date: 19 Jul 2000 04:12:26 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Module Versions
Message-Id: <8l39ra$2qv$0@216.155.32.221>

suppose I wanted to print out to a file a list of every module in ./lib 
and ./site_perl AND, if they support the $Module::VERSION scheme, 
include its version number, otherwise left blank. 

what are some ways I can go about this ? 

I can figure most of it out on my own at this point, but I'd really like 
a few pointers on how to traverse the various directories, and also how 
to get the version numbers if they exist from each module without having 
to load them all into RAM one by one. Is it possible to do so 
temporarily, and then reclaim that RAM so I can load the next? 

This is more a question of curiosity on my part than anything else. :) 

It's probably even been done before. 

Any pointers would be recieved gratefully.

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: 19 Jul 2000 05:18:09 GMT
From: Prakash Kailasa <prakash@dakota.gate.net>
Subject: Re: Module Versions
Message-Id: <8l3dmh$1r0s$1@news.gate.net>

use ExtUtils::Installed;
my ($inst) = ExtUtils::Installed->new();
foreach my $mod ($inst->modules()) {
    print $mod, "\t=> ", $inst->version($mod), "\n";
}

The WebDragon <nospam@nospam.com> wrote:
: suppose I wanted to print out to a file a list of every module in ./lib 
: and ./site_perl AND, if they support the $Module::VERSION scheme, 
: include its version number, otherwise left blank. 

/prakash


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

Date: 19 Jul 2000 06:32:07 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: nasty DESTROY behaviour
Message-Id: <8l3i17$jl8$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to 
<arandachristian@hotmail.com.bbs@openbazaar.net>],
who wrote in article <3bRSk1$SOK@openbazaar.net>:
> Uncaught exception from user code:
>         DESTROY created new reference to dead object during global
> destruction.

> I have never seen this before, and don't even know where to begin to
> debug.  Furthermore, it's almost impossible to post the offending code
> since I don't know where it occurs.

Depending on the state of global destructions, you may be able to find
which DESTROY it is: in the debugger: delete $SIG{__DIE__}, then up
the `d'ielevel (sp?) option.

Ilya


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

Date: 19 Jul 2000 06:58:50 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: newbie - like it so far - not so sure I do
Message-Id: <963986594.21640@itz.pp.sci.fi>

In article <8l2vn5$plk$1@slb7.atl.mindspring.net>, Bo wrote:
>What exactly is "regex" ? I know I could look it up somewhere,
 [snip]
>but  ~ /"(.*?)"/ looks like gibberish even after reading some

Well, there you have one.

Actually, only the "(.*?)" part, quotes included, is the actual regex.
The slashes around it tell perl where it starts and ends, and the =~
operator, which you've chopped in half, applies it to a variable.

Regex stands for regular expression.  That probably tells you nothing
more about what they're used for, but at least it might get you better
hits from a search engine.

A regex essentially describes a pattern.  In Perl, and just about
anywhere else you're likely to see one unless you're a mathematician,
they're used specifically to match strings.

The pattern you quoted, for example, matches two double quotes and the
least possible number of characters in between.  Actually, that's not
quite true - it matches the first double quote it can find, and then
as many characters as necessary to reach the next one.  If it can do
that, it also captures anything between the quotes for later use.

How did I know that?  By having read a regular expression tutorial,
and remembering what all the special characters mean.  The dot in that
regexp, for example, matches any character.  Well, except an newline,
but that can be changed by a modifier.  The asterisk after it makes
the previous pattern - the dot, that is - match zero or more times,
instead of just once, and the question mark after it makes it prefer
short matches over longer ones.  (The question is not just a special
character, it has quite a few _different_ special meanings depending
on what comes before it.)

The parentheses tell the regex engine to capture anything matched by
the patterns between them for later use.  They also serve another
purpose of grouping their contents into a single pattern, which could
be repeated using * for example, but that's not used in this case.

The quotes are just literal quotes, and match themselves.


One could write entire books about regular expressions.  Fortunately I
don't have to, since others have already done that.  You could find
one at a local bookstore or library, or you could do a web search for
something like "regular expression tutorial".

Once you know what regular expressions are, you should get familiar
with the Perl regex dialect.  Some of those tutorials are already
geared towards Perl, but the definitive guide is the perlre manpage.
The easiest way to access it, assuming you have perl installed, is to
type "perldoc perlre" at your shell prompt.  Windows users who have
ActiveState perl can also find the documentation in their Start menu,
and those with no perl at all can find it at http://www.perl.com/.

-- 
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The screwdriver *is* the portable method."  -- Abigail
Please ignore Godzilla and its pseudonyms - do not feed the troll.




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

Date: Wed, 19 Jul 2000 00:31:34 -0500
From: "Alejandro Kurczyn" <akurczyn@usa.net>
Subject: Re: Perl Expert? I need help!
Message-Id: <39753c7a_1@excalibur.gbmtech.net>


"Abigail" <abigail@delanet.com> escribió en el mensaje
> If it's speed & memory that are your prime requisites, then what on earth
> are you doing in this group?
>
> You should be going to comp.lang.c.

Don't you think I'm here because I'm interested in Perl?

-sigh-

Why is this so hard to get an answer instead of flames?  Please people, I
made a clear question:

What is the difference (performance wise, internal workings,
I_dont_know_what_else), of using regex to do something a Perl function can
do??? Are "Perl experts" supposed to use regex for everything just because
they know how to code one, because they want to impress newbies or because
there is a legitimate advantage of doing so?

If you don't know, fine. Don't answer. If you want to flame me, please do so
off-group and give peace to everyone else!

Regards,
Alejandro





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

Date: 19 Jul 2000 02:04:22 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Perl Expert? I need help!
Message-Id: <slrn8nai89.3do.abigail@alexandra.delanet.com>

Alejandro Kurczyn (akurczyn@usa.net) wrote on MMDXIV September MCMXCIII
in <URL:news:39753c7a_1@excalibur.gbmtech.net>:
<> 
<> "Abigail" <abigail@delanet.com> escribió en el mensaje
<> > If it's speed & memory that are your prime requisites, then what on earth
<> > are you doing in this group?
<> >
<> > You should be going to comp.lang.c.
<> 
<> Don't you think I'm here because I'm interested in Perl?
<> 
<> -sigh-
<> 
<> Why is this so hard to get an answer instead of flames?  Please people, I
<> made a clear question:
<> 
<> What is the difference (performance wise, internal workings,
<> I_dont_know_what_else), of using regex to do something a Perl function can
<> do??? Are "Perl experts" supposed to use regex for everything just because
<> they know how to code one, because they want to impress newbies or because
<> there is a legitimate advantage of doing so?

You didn't ask that at all. You asked Tad to elaborate on size of source/
executable, disk usage, and development/maintenance time, after he listed
a few possibilities on what you can optimize. You further commented that
your preferences are good performance in terms of speed, I/O and memory.

Hence, it's clear that you value speed, I/O and memory over development
and maintenance time. Therefore, I wondered what you are doing here, as
Perl isn't great when it comes to speed, and horrible when it comes to
memory. But, on the cost of delopment and maintenance time, C gives you
good performance when it comes to speed and memory.


Perhaps you can explain us how "OK, can you give any light on the
other ones?"  as a reply to Tads list means "What is the difference
(performance wise, internal workings, I_dont_know_what_else), of using
regex to do something a Perl function can do?"



Abigail
-- 
$"=$,;*{;qq{@{[(A..Z)[qq[0020191411140003]=~m[..]g]]}}}=*_=sub{print/::(.*)/};
$\=$/;q<Just another Perl Hacker>->();


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

Date: 19 Jul 2000 00:48:51 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: Search & replace String
Message-Id: <slrn8nadqo.3do.abigail@alexandra.delanet.com>

Mark A. Fernandez (zonegraphics@earthlink.net) wrote on MMDXIV September
MCMXCIII in <URL:news:hm7ansk94jc9g9q0g3hv813821p5djcvfc@4ax.com>:
~~ 
~~ I'm trying to write a PERL script that will search and replace all
~~ instances of a text string in all HTML files in my "html_root"
~~ directory and all subdirectories under the "html_root" directory. 

It's Perl, not PERL.

~~ I'm moving my website from one server and domain to another and want a
~~ fast, easy way to change the HREF and SRC links in my HTML files.

If you had used relative links, you wouldn't have to modify a single file.

~~ I've been working with PERL for about 3 weeks now, so please don't
~~ bust a gut laughing at me newbie-ness.  ;)  Here's the script I
~~ created ... doesn't work, naturally.

Well, I guess if it doesn't work, you have a bug. But "doesn't work" is
so extremely vague, we can't do anything with it.



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-


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

Date: Wed, 19 Jul 2000 06:30:03 GMT
From: Charles Weaver <charles_weaver@post.harvard.edu>
Subject: Set cookie after sending text?
Message-Id: <snainbri1nk48@corp.supernews.com>

The only time I have been successful in setting a cookie in a .cgi program 
is if the first header I print is:
 print "Set-Cookie..."

If I have already printed some html text the Set-Cookie line simply shows 
up on the screen as text. Is there a way to set a cookie in a program that 
has already sent text to the screen? 

--
Posted via CNET Help.com
http://www.help.com/


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

Date: Wed, 19 Jul 2000 01:09:52 -0400
From: "MrClyde" <mrclyde@bolomail.dyn.dhs.org>
Subject: Sign Up Script
Message-Id: <8l3dhj$thq$1@news.gate.net>

Does anyone know where I can get a script to work with an account sign up
forms page? I need something that determines if the client's requested
account name is available and  if 2 password enteries they are required to
fill in are identical prior to the form being processed.

Thank You,
    Clyde




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

Date: Wed, 19 Jul 2000 03:48:20 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Splitting on a number: help please
Message-Id: <397a245d.5430218@news.newsguy.com>

clintp@geeksalad.org (Clinton A. Pierce) wrote:
>	abigail@delanet.com (Abigail) writes:

>>        s/[a-z]+/\u$&-/;
>> 
>> should give a decent golf score.
>
>But I wasn't golfing! 

And if he had been, then

          s/\D+/\u$&-/;

would have been three strokes shorter.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)


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

Date: Tue, 18 Jul 2000 22:27:14 -0800
From: Matthew Cline <matt@nightrealms.com>
Subject: Topaz source?
Message-Id: <T3bd5.3728$mL5.161543@news-west.usenetserver.com>

Is there anywhere to download the latest Topaz source?

Thanks in advance.




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

Date: Tue, 18 Jul 2000 22:33:53 -0700
From: Taurean <jaurangNOjaSPAM@crosswinds.net.invalid>
Subject: What does this mean?
Message-Id: <010b13aa.d8f4b80a@usw-ex0108-061.remarq.com>

Does anybody know what this means?

while (<F>) {
	chomp;
	@pare=split(/=/);
	$pare[0]="property\\"."$pare[0]";
	$headinter{"$pare[0]"}=$pare[1];
}

TIA.


* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping.  Smart is Beautiful


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

Date: Wed, 19 Jul 2000 06:28:44 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: What does this mean?
Message-Id: <MPG.13dfe7f341f4e7069896f5@news>

Taurean wrote ..
>Does anybody know what this means?
>
>while (<F>) {
>	chomp;
>	@pare=split(/=/);
>	$pare[0]="property\\"."$pare[0]";
>	$headinter{"$pare[0]"}=$pare[1];
>}

yes

-- 
  jason -- elephant@squirrelgroup.com --


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

Date: 19 Jul 2000 04:23:15 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: WHERE is libnet?????
Message-Id: <8l3afj$3n7$0@216.155.32.221>

In article <3bRE5R$UuQ@openbazaar.net>, 
kj0@mailcity.com.bbs@openbazaar.net (kj0) wrote:

 | I've been searching CPAN for 1 hour trying and failing to find libnet.
 | Can anybody tell me where it is and/or why searching CPAN for it
 | fails?

Bundle::libnet                     1.00  
G/GB/GBARR/Bundle-libnet-1.00.tar.gz

Strongly recommend learning and using the CPAN-shell in the future.. 
best way I've found to download updated modules and auto-install them to 
the correct places. :)

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 3742
**************************************


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