[9441] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3036 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 1 09:17:12 1998

Date: Wed, 1 Jul 98 06:01:08 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 1 Jul 1998     Volume: 8 Number: 3036

Today's topics:
    Re: \c@ in Perl, perl & perl + modules (M.J.T. Guy)
    Re: ANNOUNCEMENT: clpa doesn't accept perl announcement <jimbo@soundimages.co.uk>
        array of objets <Robert.Rehammar@emw.ericsson.se>
    Re: Date calculation formula needed (Steffen Beyer)
        DES crypt <clint@netcomuk.co.ukXX>
    Re: error using time on NT (Jeffrey R. Drumm)
        find a number with regular expression <Robert.Rehammar@emw.ericsson.se>
    Re: find a number with regular expression <quednauf@nortel.co.uk>
    Re: find a number with regular expression <tjchamberlain@hotmail.com>
    Re: goto disallowed outside blocks?! (M.J.T. Guy)
    Re: Gurus or perl hackers a quick question!! <JDobson@rnib.org.uk>
    Re: Gurus or perl hackers a quick question!! (Charlie Stross)
    Re: how much filespace ? (Sigi)
    Re: how much filespace ? <qdtcall@esb.ericsson.se>
    Re: How to in perl <matt@pcr7.pcr.com>
    Re: HOW TO: freestanding modules? (M.J.T. Guy)
    Re: http client file download? <aas@sn.no>
    Re: i've got a forking problem (Dan Perez)
    Re: Installing perl5004 binary IRIX 6.2 = "bad product" justinb@ignored.cray.com
    Re: localtime(time); gets wrong date <heribert.wettels@sueddeutsche.de>
    Re: Migration from Msql to Oracle <scgyong@dev.bbcom.co.kr>
        Oracle(Solaris) <-> oraperl <-> NeXT  ? <walle@guff.net>
    Re: perl and environment parameters?? (Charlie Stross)
    Re: problems with script (M.J.T. Guy)
    Re: PUZZLE: dutree (old) (Honza Pazdziora)
        QUE: DBD-Oracle 0.50 problems. <mike@tech.eurodyn.com.gr>
    Re: Replacing "stuff" via Regex... HELP! <jeka@ints.net>
    Re: running a cgi/perl program every 7 am? (Charlie Stross)
    Re: Running Unix Script in Perl (Charlie Stross)
    Re: Running Unix Script in Perl <perlguy@inlink.com>
        Sort subroutine and other scopes ? pope@netguide.dk
    Re: Sort subroutine and other scopes ? <zenin@bawdycaste.org>
        Uploading image files <tjchamberlain@hotmail.com>
    Re: Use strict with CGI.pm (M.J.T. Guy)
    Re: Webresource.net <perlguy@inlink.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 1 Jul 1998 10:31:28 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: \c@ in Perl, perl & perl + modules
Message-Id: <6nd360$8g3$1@pegasus.csx.cam.ac.uk>

Alan Barclay <gorilla@elaine.drink.com> wrote:
>I'm writing a program which is going to do some binary data manipulation,
>including some embeded NUL (\c@ or 0x00) characters.
>
>1) perl has no problems storing, copying or manipulating using it's
>own functions, eg $a=pack("cc",65,0), $b=unpack("cc",$a), $a=$b, etc.

Mostly true.   The only counterexample I know is that warn() and die()
truncate their arguments at a NUL.    This is a bug; it might get
mended someday.


Mike Guy


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

Date: 01 Jul 1998 10:52:21 +0100
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: ANNOUNCEMENT: clpa doesn't accept perl announcements!
Message-Id: <un2at6gq2.fsf@jimbosntserver.soundimages.co.uk>

Dear Randall,

Hear, hear!

Take your time. As you clearly state, what's a few weeks or even
months? I fully support the course of action you have clearly
defined. If Tom C. has a problem with your moderation, maybe he is
spending far too little time dealing with the documentation
maintainence issues he's constantly raising and should get on with
that arena as a positive alternative and contribution.

Best Wishes,
Jim Brewer


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

Date: Wed, 01 Jul 1998 09:36:06 +0100
From: Robert Rehammar <Robert.Rehammar@emw.ericsson.se>
Subject: array of objets
Message-Id: <3599F4F6.9D9E52A8@emw.ericsson.se>

How do I create an array of objects ??

\\Robert Rehammar


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

Date: 1 Jul 1998 08:59:38 GMT
From: sb@engelschall.com (Steffen Beyer)
Subject: Re: Date calculation formula needed
Message-Id: <6nctpq$h9q$1@en1.engelschall.com>

Derek Romeyn <romeyde@mc0115.mcclellan.af.mil> wrote:

> Thanks for the suggestions.  One question on this one though.  I am
> probably reading this wrong.

> What would happen then with 8013 and 0132?  Wouldn't that end up
> comparing 1998 to 1990 instead of 2000?

Yes indeed.

You will have to change the line $year += 1900; to suit whatever your format
requires.

For instance $year += $year ? 1900 : 2000;

>> use Date::Calc qw(:all);
>> 
>> my $annoying = 8013;
>> 
>> my ($year,$day) = $annoying =~ /^(\d+)(\d{3})$/;
>> 
>> $year += 1990;
>>
>> $min = Date_to_Days(1998,6,20);
>> $max = Date_to_Days(1999,1,1);   #  or whatever you need...
>> 
>> $test = Date_to_Days($year,1,1) + $day - 1;
>> 

-- 
    Steffen Beyer <sb@engelschall.com>
    Free Perl and C Software for Download: www.engelschall.com/u/sb/download/


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

Date: Wed, 1 Jul 1998 13:24:33 +0100
From: "Clinton Gormley" <clint@netcomuk.co.ukXX>
Subject: DES crypt
Message-Id: <6nd9sp$5v3$1@taliesin.netcom.net.uk>

I'm running PERL with IIS 4.0 on NT

I am trying to use the DES Crypt module at
ftp://unix.hensa.ac.uk/mirrors/perl-CPAN/modules/by-module/Crypt

It requires Make to install it (about which I know nothing, nada, and less
than that)

I've tried copying the relevant directory into my lib folder, but when I try
to use it, it gives me the error : "Can't find loadable object for
Crypt::DES in @INC (lalalalalala....)

Anybody aware of a Win32 way of using this module, or alternatively, a
module I could use to encrypt data on NT?

Thanks

Clint
clinton@netcomuk.co.uk




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

Date: Wed, 01 Jul 1998 11:21:32 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: error using time on NT
Message-Id: <359a1810.1030716241@news.mmc.org>

[ posted to comp.lang.perl.misc; a courtesy copy was mailed to the cited author
and cc'ed to the orignal poster ]

On Wed, 01 Jul 1998 02:06:31 GMT, sowmaster@juicepigs.com (Bob Trieger) wrote:

>[ posted and mailed ]
>
>"Michael Equi" <mequi@newtonline.com> wrote:
>-> I am trying to do something very simple, but am getting an error.
>-> I want to get the current time. I have tried:
>-> 
>-> $string =time;
>-> 
>-> I also tried:
>-> 
>-> use Time::localtime;
>-> 
>-> printf "Year is %d\n", localtime->year() + 1900;
>-> 
>-> as a test but I always get the response:
>-> 
>-> "The system cannot accept the time entered.
>-> Enter the new time:"
>-> 
>-> Any ideas?
>
>The documentation is your friend.
>
>perldoc -f localtime

The first attempt above is certainly odd, but the second works just fine on my
NT system. Of course, the documentation will always help, but he appears to be
on the right track.

I think it's a broken perl . . . perhaps updating to GSAR's perl port will
help.

For the original poster's reference:

http://www.perl.com/CPAN-local/ports/winNT/Standard/x86/perl5.00402-bindist04-bc.zip

-- 
                               Jeffrey R. Drumm, Systems Integration Specialist
                       Maine Medical Center - Medical Information Systems Group
                                                            drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me


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

Date: Wed, 01 Jul 1998 08:12:41 +0100
From: Robert Rehammar <Robert.Rehammar@emw.ericsson.se>
Subject: find a number with regular expression
Message-Id: <3599E169.DACB46B@emw.ericsson.se>

How do I find out if a srtring contains a number with $string[0]=~/???/.

\\Robert Rehammar


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

Date: Wed, 01 Jul 1998 13:47:16 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: find a number with regular expression
Message-Id: <359A2FD4.5F2B9482@nortel.co.uk>

Robert Rehammar wrote:
> 
> How do I find out if a srtring contains a number with $string[0]=~/???/.
> 

In the perlre documentation you will find that \d matches a digit...
       ^^^^^^^^^^^^^^^^^^^^
Then you can use your usual regexp stuff to match the kind of number you want to
match.


-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: Wed, 01 Jul 1998 22:58:00 +1000
From: Toby Chamberlain <tjchamberlain@hotmail.com>
Subject: Re: find a number with regular expression
Message-Id: <359A3258.D18D975A@hotmail.com>

I ain't no expert, but I'd try.

if ($string[0] =~ /[0-9]/)        to find if it contained any numerical
characters (eg the "9" in "I ate 9 apples" or the "7" in "and threw 7 of
them up"
 ... or ....
if ($string[0] =~ /98/)           to find if had the specific number "98"
anywhere in it (eg. the "98" in "win98 sucks", or "the 1998 Memorial Geek
Convention")

Hope that helps
Toby


Robert Rehammar wrote:

> How do I find out if a srtring contains a number with $string[0]=~/???/.
>
> \\Robert Rehammar





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

Date: 1 Jul 1998 12:40:31 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: goto disallowed outside blocks?!
Message-Id: <6ndanv$h9k$1@pegasus.csx.cam.ac.uk>

Russ Allbery  <rra@stanford.edu> wrote:
>
>Hmm... from perldiag:
>
>     Can't "goto" outside a block
>         (F) A "goto" statement was executed to jump out of what
>         might look like a block, except that it isn't a proper
>         block.  This usually occurs if you tried to jump out of
>         a sort() block or subroutine, which is a no-no.  See the
>         goto entry in the perlfunc manpage.
>
>Normally that error message is only supposed to apply if you try to do a
>goto out of a sub that sort was calling.  But if you think about what
>doing a goto out of a signal handler is doing, that's a pretty evil thing
>to try to do; your code is running at some arbitrary time at which Perl's
>own internal state may not be consistent, and you're trying to longjump()
>into some completely different set of code.
>
>I think the answer is "you really don't want to do that; you want to find
>a different way of accomplishing the same thing."

Which is probably to use eval {} and die();


Mike Guy


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

Date: Wed, 01 Jul 1998 10:09:29 +0100
From: James Dobson <JDobson@rnib.org.uk>
Subject: Re: Gurus or perl hackers a quick question!!
Message-Id: <3599FCC9.8E1B5EA0@rnib.org.uk>

> Thanks for all the code and pointers. I went with F.Quednau in the end. He
> only had two lines (basically ;-)  ). The only problem now is the spacing,
> but I will have to see if that will affect my perl scripts.



> I'm not to sure about using one line solutions, as the only person who
> tends to understand them is the person who wrote them !!

James

>> ($line, $rest) = split(/>/);
>
>> ($name, $mail, $gender) = split(/-/, $rest);
>
> ( This piece of code will spilt a line like 1 > Mr X - MrX@X.com - Male)





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

Date: Wed, 01 Jul 1998 11:12:50 GMT
From: charlie@antipope.org (Charlie Stross)
Subject: Re: Gurus or perl hackers a quick question!!
Message-Id: <slrn6pk6f1.8gm.charlie@cs.ed.datacash.com>

In the name of Kibo the Compassionate, the Merciful,
on Tue, 30 Jun 1998 23:29:45 -0400,Ronald J Kimball
the supplicant <rjk@coos.dartmouth.edu> implored:

>non-greedy matching is never useful at the end of a regex.

Buggrit, I knew there was something I was missing. 

Time to read the nutshell regexp book ...



--Charlie


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

Date: Wed, 01 Jul 1998 10:18:31 GMT
From: sigi@mail2me.de (Sigi)
Subject: Re: how much filespace ?
Message-Id: <359a0bc9.14074201@news.isk.de>

Russ Allbery <rra@stanford.edu> wrote:

>du -s /var/test/job
>
>This is one of those cases where better tools already exist to solve the
>problem and reimplementing them in Perl is likely a waste of your time.

Ok. Thanks. I think I had tomatoes on my eyes.  :-)

But now there is a problem: If I check the filespace with "du -sPx
directory" I get a wrong result! Example 1: filespace 500,404 bytes,
du said 734 kbytes. Example 2: filespace 2,240 bytes, du said 12
kbytes. What did I do wrong?

Sigi.

>-- 
>#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
>$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
> 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
>rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print



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

Date: 01 Jul 1998 13:43:57 +0200
From: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: how much filespace ?
Message-Id: <is1zs5g5j6.fsf@godzilla.kiere.ericsson.se>

sigi@mail2me.de (Sigi) writes:

> But now there is a problem: If I check the filespace with "du -sPx
> directory" I get a wrong result! Example 1: filespace 500,404 bytes,
> du said 734 kbytes. Example 2: filespace 2,240 bytes, du said 12
> kbytes. What did I do wrong?

You either didn't read the manpage (in which case you're at fault),
you didn't understand the manpage or you got the GNU du manpage (in
which case you're not at fault). du counts the space allocated for the
file, not the number of bytes in it. If that explanation doesn't make
any sense to you, ask for an explanation in some newsgroup about Unix.
-- 
		    Calle Dybedahl, UNIX Sysadmin
       qdtcall@esavionics.se  http://www.lysator.liu.se/~calle/


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

Date: 1 Jul 1998 11:55:56 GMT
From: "Matt Heusser" <matt@pcr7.pcr.com>
Subject: Re: How to in perl
Message-Id: <01bda4de$fa5aedc0$47eb1bcc@XSTA71.pcr.com>

lan -

how about something like this?

#---------------
#sample.pl
my $counter
$counter = 1;
while (<>) {
  if ($counter>6) print $_;
  $counter++;
{
#-------------EOF

from the command line:

sample.pl inputfile.txt > outputfile.txt

but, of course, there's more than one way to do it.

Matt H.
ac123@simpatico.ca wrote in article
<359a6ed1.1213157@news1.on.sympatico.ca>...
> I am new to perl and would like to do the following sed command but
> all in perl:
> 
> sed 1,6d filename
> 
> This sed command removes the top six lines from the file.
> How do I do this all in perl.
> 
> The reason why I want to do this in perl is because I am on a win32
> platform running Perl and don't have access to sed.  Many people have
> said that if I had perl I didn't need sed for win32.
> 
> Ian
> ac123@sympatico.ca
> 
> 


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

Date: 1 Jul 1998 12:13:37 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: HOW TO: freestanding modules?
Message-Id: <6nd95h$fc2$1@pegasus.csx.cam.ac.uk>
Keywords: Python

k y n n  <NOSPAMkEynOn@panix.comNOSPAM> wrote:
>
>Hi.  I'm trying to learn how to use packages and modules in Perl, but
>after mucking around for a while, I haven't managed to figure out a
>way to write a module so that it can also be called by itself as a
>freestanding script.  For example, suppose I have a module, call it
>frotz.pm, containing one single function, call it frotz, for export.
>Is it possible to arrange matters so that I can call frotz.pm from the
>Unix shell command line, while at the same time being able to use
>something like:
>
>  use frotz;
>  ...
>  $x = &frotz::frotz();
>
>in another module/script?

Look at the module Diagnostics.pm and the script splain, both in the
standard distribution.    You'll see they are actually the same thing,
giving an example of what you want.

>A related question is, is it possible to find out dynamically whether
>the current scope is the same as main:: ?

Don't quite understand why you'd want to know that, but you can use
the special variable __PACKAGE__:

   if (__PACKAGE__ eq 'main') { ... }

Alternatively, if you are in a subroutine and want to know the package
of your caller, see the caller() function in perlfunc.


Mike Guy


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

Date: 01 Jul 1998 14:15:50 +0200
From: Gisle Aas <aas@sn.no>
Subject: Re: http client file download?
Message-Id: <m3u3516a2x.fsf@furu.g.aas.no>

s123@ptd.net writes:

> Does anyone know how to download a file using something like LWP?

Yup!

> I can retrieve and submit using post, however, when I want to retrieve
> a special non-html file (you know when you are in a browser and it
> asks you to save a file that your are downloading) I get an error.
> Can maybe I need some special  Accept command in my headers?

Perhaps you need to show the code you are running and tell us what the
error is.

-- 
Gisle Aas


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

Date: 1 Jul 1998 12:52:40 GMT
From: dperez@blue.seas.upenn.edu (Dan Perez)
Subject: Re: i've got a forking problem
Message-Id: <6ndbeo$q32$1@netnews.upenn.edu>

My question is not so much how to get around this problem, but what
the problem is and how/why it occurs.

Tom Christiansen (tchrist@mox.perl.com) wrote:
: Only output buffering is affected by $|, not input buffering.  I believe
: you have three different problems here.  The input buffers are duplicated.

This is something that fork which isn't a problem.

: The seek pointers are shared and advance together in all processs (but
: buffer consumption doesn't). 

Fine, but in my script, only the parent process
reads from the input buffer, meaning that the seek pointers only
change in the parent process and that buffer consumption only takes
place in the parent process.  The children do nothing to the input
buffer and seek pointers.

: The scheduling of the different process
: is non-deterministic.

For my purposes, this is not a problem.  I would like all of the
processes to work in parallel and the order in which they work is not
important.

The fix that is being used is to read the file into an array and then
do a foreach loop on that array, with the fork'ing occuring in that
foreach loop.  That circumvents the unsolved problem.

Dan


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

Date: 01 Jul 1998 07:45:39 -0500
From: justinb@ignored.cray.com
Subject: Re: Installing perl5004 binary IRIX 6.2 = "bad product"
Message-Id: <o8naf6twxho.fsf@springer.cray.com>

"Rick K" <ismkoehlerism@nmism-us.campus.mci.net> writes:

> Perhaps I can't see the forest for the trees, but I"m having problems
> installing the "latest" perl 5.004 pre-compiled binary for SGI IRIX 6.2.
> 
> The file: perl5.004-6.2-shrp.tardist from typical source
> The method used: inst -f filename
> The results: "ERROR: The product perl5.004-6.2-shrp.tardist is bad"
> 
> Has anyone else encountered the same problem?  Has anyone else
> figured out a solution?  Should I be wearing my dunce cap?

According to our bugs database, this may well be a well known
(old) problem which has been fixed in patch 2673 (IRIX 6.2)
and 2923 (IRIX 6.4).   If you're on support try to get these
patches on a CD.  Otherwise, if you can download it: you may
get the recommended patches from http://support.sgi.com

-justinb

-- 
Justin Banks - Silicon Graphics Inc. Eagan, MN
Frisbeetarianism, n.:
    The belief that when you die, your soul goes up
    on the roof and gets stuck.


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

Date: Wed, 01 Jul 1998 11:03:40 +0200
From: Heribert Wettels <heribert.wettels@sueddeutsche.de>
Subject: Re: localtime(time); gets wrong date
Message-Id: <3599FB6C.252E2F69@sueddeutsche.de>

Michael J Gebis wrote:

> You now have a karmic debt to this group for asking a question
> which is directly answered in the man page.  Don't worry, though: you
> can pay your karmic debt by helping out someone else on this group.
> And remember: the universe doesn't give credit for rude answers.

Yes, and worst is: I found it in the camel book just *after* sent off the
posting. Really was angry with myself for being so blind and stupid. But
could have been worse, I didn't get a single flame.

Heribert




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

Date: Wed, 01 Jul 1998 18:19:00 +0900
From: "Kim, Ki-Yong" <scgyong@dev.bbcom.co.kr>
Subject: Re: Migration from Msql to Oracle
Message-Id: <3599FF04.932A468@dev.bbcom.co.kr>

I mean, "is there no problem for using query or fetchhash?"

- scgyong@nownuri.net -



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

Date: Wed, 1 Jul 1998 11:17:29 +0200
From: Fredrik Wahl <walle@guff.net>
Subject: Oracle(Solaris) <-> oraperl <-> NeXT  ?
Message-Id: <Pine.LNX.3.95.980701111128.11857A-100000@beyond.malmo.lth.se>


Is there anyone out there with experience of setting up a connection to an
Oracle db, running on Solaris from a NeXT using oraperl?

All tips are welcome how to set up a system like this in an easy way.

thanks in adv.
/W



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

Date: Wed, 01 Jul 1998 11:20:46 GMT
From: charlie@antipope.org (Charlie Stross)
Subject: Re: perl and environment parameters??
Message-Id: <slrn6pk6tt.8gm.charlie@cs.ed.datacash.com>

In the name of Kibo the Compassionate, the Merciful,
on 1 Jul 1998 06:33:28 GMT,DUTOIT
the supplicant <abcdm@wanadoo.fr> implored:

>Hello,
>
>I want to know all the environment parameters like PATH wich are used like
>that:
>$oldPATH=$ENV{"PATH"}; 

keys() are your friend:

foreach (keys %ENV) {
    print "$_ = $ENV{$_}\n";
}

>For example, I'm looking for how to know the current directory.

Be careful; I'm not certain that all shells will give you this information.
Look at Cwd.pm.

>More,I want to use secured payment online  (SSL). I'm looking for how to
>put https://... instead of http://...

This is not a perl question; it's an HTTP question. Go and read up on
the SSL protocol and secure HTTP if you want to know what https: means.
You might find http://www.w3.org/ useful.

As for secure payment systems, the water gets deeper the further in you go ...



-- Charlie (banging his head on the APACS-29b protocol right now)


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

Date: 1 Jul 1998 11:21:12 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: problems with script
Message-Id: <6nd638$bcd$1@pegasus.csx.cam.ac.uk>

Bob Trieger <sowmaster@juicepigs.com> wrote:
>
>The first is better than the silly shit of the second, but neither is checking 
>the status of the open and when reading a file the `<' is just a wasted 
>keystroke.

It isn't wasted.   Quite apart from any stylistic considerations, what
if $fileserv begins with ">" or "|" ?


Mike Guy


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

Date: Wed, 1 Jul 1998 09:59:21 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: PUZZLE: dutree (old)
Message-Id: <adelton.899287161@nemesis>

Jaime Metcher <metcher@spider.herston.uq.edu.au> writes:

> The only hash I can see in this program is the one referred to by *kid,
> which has a name given by the first line of output from du.  But I can't
> see where %kid is used, only @kid.
> 
> Another question (the first being, "Huh?"):
> 
> Is
>      local($root, *kid, $him) = @_[0,0];
> 
> a shorthand for
> 
>      local $root = $_;
>      local *kid = $_;

	local $root = $_[0];
	local *kid = $_[0];

I believe.

--
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
                   I can take or leave it if I please
------------------------------------------------------------------------


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

Date: Wed, 01 Jul 1998 12:06:00 +0300
From: Tsoukalos Mihalis <mike@tech.eurodyn.com.gr>
Subject: QUE: DBD-Oracle 0.50 problems.
Message-Id: <3599FBF8.ADE45D21@tech.eurodyn.com.gr>

Hi to everyone and good month.

I have some problems trying to use the Oraperl module that comes with
the DBD-Oracle 0.50.
I think it has to do with some environment variables but I have tried
many things.
The BDI package works fine.

Here there are the error messages:

@castrato ~/oracle perl -e "use Oraperl"
install_driver(Oracle) failed: Can't load
'/usr/local/lib/perl5/site_perl/sun4-s
olaris/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: ld.so.1: perl:
fatal:
relocation error: file
/opt/app/oracle/product/8.0.4/lib/libclntsh.so.1.0: symbo
l slpmprodstab: referenced symbol not found at
/usr/local/lib/perl5/sun4-solaris
/5.004/DynaLoader.pm line 155.

 at (eval 1) line 2

        DBI::install_driver('DBI', 'Oracle') called at
/usr/local/lib/perl5/site
_perl/Oraperl.pm line 58
        require Oraperl.pm called at -e line 1
        main::BEGIN() called at
/usr/local/lib/perl5/site_perl/Oraperl.pm line 0
        eval {...} called at /usr/local/lib/perl5/site_perl/Oraperl.pm
line 0
BEGIN failed--compilation aborted at -e line 1.

In order to help you help me here there are some usefull data:

@castrato ~/oracle dir
/usr/local/lib/perl5/site_perl/sun4-solaris/auto/DBD/Orac
le/Oracle.so
-r-xr-xr-x   1 root     staff      75216 Jul  1 10:13
/usr/local/lib/perl5/site_
perl/sun4-solaris/auto/DBD/Oracle/Oracle.so*
@castrato ~/oracle dir
/opt/app/oracle/product/8.0.4/lib/libclntsh.so.1.0
-rwxr-xr-x   1 oracle   dba      7385900 May 22 18:06
/opt/app/oracle/product/8.
0.4/lib/libclntsh.so.1.0*
@castrato ~/oracle dir
/usr/local/lib/perl5/sun4-solaris/5.004/DynaLoader.pm
-r--r--r--   1 root     staff      22883 Jun 29 18:05
/usr/local/lib/perl5/sun4-
solaris/5.004/DynaLoader.pm
@castrato ~/oracle echo $PERL5LIB
/usr/local/lib/perl5:/usr/local/lib/perl5/site_perl/sun4-solaris:/usr/local/lib/

perl5/site_perl:/usr/local/src/perl5.004/lib:/home/salusa/mike/lib/perl:/home/sa

lusa/mike/lib/perl/SGMLS:/usr/local/lib/perl5:/usr/local/lib/perl5/site_perl/auto/DBI

Please help me if you can as this is urgent.

many thanks in advance,
mihalis

--
--------------------------------------
Name: Mihalis Tsoukalos
Software Engineer
mailto:mike@tech.eurodyn.com.gr
Home Email: mailto:diogenes@hol.gr



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

Date: Wed, 01 Jul 1998 14:26:54 +0300
From: "Eugeny A. Pisarenko" <jeka@ints.net>
Subject: Re: Replacing "stuff" via Regex... HELP!
Message-Id: <359A1CFD.2C8A27B@ints.net>

Robert Stutes wrote:
> 
> I realize this is fairly simple minded (and not very elegant) but you
> could try breaking comma delimited string up into an array of tokens and
> then test each token in the array for the presence of a '"'.  If you
> find a quoted token, nuke it from the array.
> 
> Consider the following code:
> 
> #!/usr/local/bin/perl
> $words='data,data,data,number,text,"string",data,
> stuff,"nuther",stuff,text,"two words",text,"last words"';
> @words=split(',',$words);
> print "$words\n";
> for($i = 0; $i ?= $#words; $i++) {
>     if($words[$i] =~ /"/) {
>         splice(@words,$i,1);
>     }
> }
> print join(',', @words),"\n";
> 
Hi!
And how about:

#!/usr/local/bin/perl
$words='data,data,data,number,text,"string",data,
stuff,"nuther",stuff,text,"two words",text,"last words"';
$words=~s/(^|,)"[^"]+"(,|$)/$1$2/gx;
print "$words\n";

> Like I said, not elegant, but it works!
> 
> Bob S.
> 
> Mike Cisar wrote:
> ?

-- 
Eugeny A. Pisarenko
mailto:jeka@ints.net


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

Date: Wed, 01 Jul 1998 11:28:18 GMT
From: charlie@antipope.org (Charlie Stross)
Subject: Re: running a cgi/perl program every 7 am?
Message-Id: <slrn6pk7c1.8gm.charlie@cs.ed.datacash.com>

In the name of Kibo the Compassionate, the Merciful,
on Tue, 30 Jun 1998 07:43:23 -0700,Larry Rosler
the supplicant <lr@hpl.hp.com> implored:

>Instead of looping forever, one would use the sleep() function to wake up 
>at appropriate intervals, check the time, and go back to sleep if 
>necessary.  The only significant cost is one process in the process 
>table.

Um, you could also use alarm() to send a SIGALRM after an appropriate
number of seconds, and set a trap for it (via $SIG{ALRM}) that triggers
the desired action? Have the perl program sleep until it's needed --
sleep is interruptable by SIGALRM. This comes in handy when you want 
some other process to wake the perl script up as necessary,
at some arbitrary time.



-- Charlie


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

Date: Wed, 01 Jul 1998 11:29:15 GMT
From: charlie@antipope.org (Charlie Stross)
Subject: Re: Running Unix Script in Perl
Message-Id: <slrn6pk7dq.8gm.charlie@cs.ed.datacash.com>

In the name of Kibo the Compassionate, the Merciful,
on Wed, 01 Jul 1998 08:47:20 +0100,Steve Leach
the supplicant <steve.leach@virgin.net> implored:

>Is it possible to run a unix script from within a perl script.

Yes. see the perlfunc manpage.

>If so HOW ? (its got me stuck).

Clue: system().

It is a good idea to read the manpages (or the camel book, or the faq) 
before posting on usenet.


-- Charlie



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

Date: Wed, 1 Jul 1998 11:13:41 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Running Unix Script in Perl
Message-Id: <359A19E5.24C181B5@inlink.com>

Have you tried the "system" command, the "exec" command or using the
`scriptname` (backticks)?

All three will call an external program.  "exec" won't come back after
it has run though...

HTH,

Brent


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

Date: Wed, 01 Jul 1998 09:57:05 GMT
From: pope@netguide.dk
Subject: Sort subroutine and other scopes ?
Message-Id: <6nd15f$gd8$1@nnrp1.dejanews.com>



I have now written a universal tree object/package whatever, in which anything
can be inserted (it just handles references so anything can be handled).

Now, my main program which has created this object is the only place where
anything about the elements are known.

I have tried writing a sort function in my main, and passing "main::sortfunc"
to my sort routine in the tree object (which calls sort on itself and
children). This does not work. It is probably my $a and $b that are wrong
(they are only defined in the Tree package I guess) and using NG_Tree::$a and
NG_Tree::$b does not look right for me.

What is the correct solution to this ?

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


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

Date: 1 Jul 1998 12:01:22 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Sort subroutine and other scopes ?
Message-Id: <899295038.621612@thrush.omix.com>

pope@netguide.dk wrote:
	>snip<
: I have tried writing a sort function in my main, and passing "main::sortfunc"
: to my sort routine in the tree object (which calls sort on itself and
: children). This does not work.

	Code, code!  Post your code!
	Error messages (if any), post your error messages!

: It is probably my $a and $b that are wrong

	$a and $b are magic.

: (they are only defined in the Tree package I guess)

	Nope.

: and using NG_Tree::$a and NG_Tree::$b does not look right for me.

	They are passed to any sub that sort() uses.

: What is the correct solution to this ?

	What have you tried so far?

-- 
-Zenin
 zenin@archive.rhps.org


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

Date: Wed, 01 Jul 1998 22:14:41 +1000
From: Toby Chamberlain <tjchamberlain@hotmail.com>
Subject: Uploading image files
Message-Id: <359A2831.2796B4A@hotmail.com>

Hi there...

 .. I'm trying to upload stuff through the web using a
multipart/form-dataHTML form and a Perl CGI script. Everything works
fine except when I try to upload images.  The image in question is
around 2k in size, and $ENV{CONTENT_LENGTH} is just over 2k, but the
read() returns 0 bytes... I've tried dumping the read data out to the
web and it looks like this :

-----------------------------932131817039
Content-Disposition: form-data; name="GIFFILE";
filename="C:\HTML\CyberOne\KidsGame\pizza.gif"
Content-Type: image/gif

GIF89a


And that's it..sometimes there's a line or two of #%#4jl3%^4j6l  after
the GIF89a before it stops. As you can see the contents of the .gif
haven't been included properly and none of the other form elements
(there are two after this) have come through either.  I've tried
explicitly binmoding both the input and output streams in case one of
the .gif bytes was being read as EOF but that didn't work.  As I said
the code works fine for HTML and other text files.  What have I
forgotten to do???

Thanks
Toby <tjchamberlain@hotmail.com>



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

Date: 1 Jul 1998 11:14:49 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Use strict with CGI.pm
Message-Id: <6nd5n9$b78$1@pegasus.csx.cam.ac.uk>

Ken MacFarlane  <ksm@sas.upenn.edu> wrote:
>
>I believe that the original problem with "use strict" only occurs with
>"-values", since "values" is a Perl builtin name.

And that's a bug, which will be mended in perl5.004_05.


Mike Guy


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

Date: Wed, 1 Jul 1998 12:18:47 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Webresource.net
Message-Id: <359A2927.57CDA2D1@inlink.com>

Now what is wrong with using a library that is 10x smaller to simply get
data from the calling form?

Yes, I AM using CGI.pm now and really like it.  But I have no problem
using cgi-lib.pl scripts when I don't need all of the power of CGI.pm.

I do believe that CGI.pm is a VERY powerful module, but I don't see why
you would need to put someone down because they still use it.  Does it
make THAT much difference when the end result is the same?

Brent Michalski


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

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

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