[13370] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 780 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 13 15:07:26 1999

Date: Mon, 13 Sep 1999 12:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 13 Sep 1999     Volume: 9 Number: 780

Today's topics:
    Re: $sth->rows function in DBI-Oracle (Larry Rosler)
    Re: $sth->rows function in DBI-Oracle <jeff@vpservices.com>
    Re: baffle about flock() please help! <khowe@performance-net.com>
    Re: bin2hex and back again <khowe@performance-net.com>
    Re: buying perl book (Help me) mikedel@ix.netcom.com
    Re: Can't get list to sort... (Larry Rosler)
        CGI calls another CGI <jstraumann@worldnet.att.net>
    Re: CGI calls another CGI <makkulka@cisco.com>
    Re: Comparing against today's date? <sariq@texas.net>
        copy dave_pomeroy4266@my-deja.com
    Re: Deleting spaces in a string <makkulka@cisco.com>
    Re: Design Advice needed on Sending Data to Client (Alan Curry)
    Re: File IO Question <jstraumann@worldnet.att.net>
        file renaming or copying dave_pomeroy4266@my-deja.com
    Re: Good way to learn PERL (Larry Rosler)
        I need a date function... <jjbattle@veribest.dot.com>
    Re: multiple perl's <ltl@rgsun5.viasystems.com>
    Re: multiple perl's <info@juvex.com>
    Re: multiple perl's <sariq@texas.net>
    Re: newbie: need help,LEARNING FROM A BOOK mikedel@ix.netcom.com
    Re: Perl build on SCO Openserver 5.0.5 (Mike Hopkirk(hops))
        Perl Y2k <lkong@hns.com>
    Re: Perl Y2k <cs004@wg.waii.com>
    Re: regexp with variables containing unknown data <bbarnett@nospamhere.L8R.net>
    Re: regexp with variables containing unknown data <ltl@rgsun5.viasystems.com>
        Win32 PERL and UNC <lucp@nortelnetworks.com>
    Re: Y2K bugs on the Internet <news@elmbronze.demon.co.uk>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Mon, 13 Sep 1999 11:04:17 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: $sth->rows function in DBI-Oracle
Message-Id: <MPG.1246dc8184ca8f48989f4d@nntp.hpl.hp.com>

In article <37DD3768.4D801D6@cbmi.upmc.edu> on Mon, 13 Sep 1999 13:42:00 
-0400, tsui <tsui@cbmi.upmc.edu> says...
> Hi there,
> 
>   I found that the sth->rows in the DBI for oracle doesn't return the
> right number of fetched rows.  any suggestion?

From the document DBI::DBI:

For select statements it is generally not possible to know how many rows 
will be returned except by fetching them all. Some drivers will return 
the number of rows the application has fetched so far but others may 
return -1 until all rows have been fetched. So, use of the rows method, 
or $DBI::rows, with select statements is not recommended. 

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


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

Date: 13 Sep 1999 18:15:44 GMT
From: Jeff Zucker <jeff@vpservices.com>
To: tsui <tsui@cbmi.upmc.edu>
Subject: Re: $sth->rows function in DBI-Oracle
Message-Id: <37DD3E4F.C669F073@vpservices.com>

tsui wrote:
> 
> Hi there,
> 
>   I found that the sth->rows in the DBI for oracle doesn't return the
> right number of fetched rows.  any suggestion?

Suggestion #1: read the DBI docs which explicitly state that $sth->rows
is not guaranteed to work on select statetments.

Suggestion #2. count the rows by hand during your fetch (yes, it's
tedious, but it's the only reliable way to know how many rows were
fetched).

-- 
Jeff


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

Date: Mon, 13 Sep 1999 15:43:29 -0300
From: "Kevin Howe" <khowe@performance-net.com>
Subject: Re: baffle about flock() please help!
Message-Id: <1EbD3.145967$5r2.217449@tor-nn1.netcom.ca>

There is a new module which takes care of the Flock problem:

FlockDir - override perl flock() for network or portability purposes

SYNOPSIS

use File::FlockDir qw (open close flock);
open (FH, ">$path");
flock(FH, 2);
close FH;

DESCRIPTION

A flock module for Windows9x and other systems lacking
a good perl flock() function (not platform specific)

Works well,
Kevin

Wyzelli wrote in message <_qMC3.8$I96.886@vic.nntp.telstra.net>...
>> > sleep(3600);
>> > flock(FILE,LOCK_UN);
>> > close(FILE);
>>
>> And of course that's a waste of at least one line of code. There's very
>> little reason to ever explicitly unlock a file from Perl.
>>
>>
>> Cheers!
>>
>> --
>> Tom Phoenix       Perl Training and Hacking       Esperanto
>> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>>
>
>That's interesting and something I never caught from the docs... is it
>because the lock is released when the file is closed anyway?
>
>Wyzelli
>It is better to ask a stupid question and learn something than not ask it
>and remain ignorant.
>
>




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

Date: Mon, 13 Sep 1999 15:39:44 -0300
From: "Kevin Howe" <khowe@performance-net.com>
Subject: Re: bin2hex and back again
Message-Id: <wAbD3.145966$5r2.217456@tor-nn1.netcom.ca>

I had found the Convert::BinHex module, but if you read it's docs it says
the following:

NAME
Convert::BinHex - extract data from ==MACINTOSH BINHEX FILES ==

==ALPHA WARNING==: this code is currently in its Alpha release. ==THINGS MAY
CHANGE DRASTICALLY== until the interface is hammered out: if you have
suggestions or objections, please speak up now!

Not exactly the most stable of modules, and it is designed for Macintosh
files specifically.

As it turns out though, you don't need any modules becuase this can all
easily be done with Perl using the "binmode", "pack" and "unpack" functions
as follows:

# open file
open (F,"presentation.ppt");
binmode (F);
@binary = <F>;
close F;

$binary = join('',@binary);
#print $binary;

# convert from binary to hex
my $hex = unpack "H*", $binary;

# save to text file
open (F,">presentation.txt");
print F $hex;
close F;

# open text file
open (F,"chex");
$hex = <F>;
close F;

# convert from hex to binary
my $binary = pack "H*", $hex;
my $hex = unpack "H*", $binary;
#print $binary;

#save to new binary
open (F,">new presentation.ppt");
binmode(F);
print F $binary;
close F;


Chris Nandor wrote in message ...
>In article <s2BB3.127940$5r2.190165@tor-nn1.netcom.ca>, "Kevin Howe"
><khowe@performance-net.com> wrote:
>
># I would like to be able to store binary files such as .gif files in my
># databases.  I read that this could be done by converting the binary file
to
># hexidecimal to store it in the database, and then converting it back
># (hexidecimal to binary) when the item is to be used.
>#
># I have found several scripts which convert from binary to hexidecimal
># (binhex.pl, Data::HexDump) but these do not to the conversion back to
># binary. On the perl site under
http://www.perl.com/CPAN/scripts/index.html
># there are 2 scripts bin2hex and hex2bin which appear to solve the
problem,
># but are meant to be used as command-line programs, and could not easily
be
># hacked into something useful. I'd like to make a module which would make
># this simple, as follows:
>#
># $Convert = new BinHexConvert;
># $Convert->bin2hex(@lines);
># $Convert->hex2bin(@lines);
>#
># What exactly do you need to do to convert between the two?
>#
># Much thanks.
>
>Just a wild suggestion, but the Convert::BinHex module might do what you
>are looking for.  :)
>
>    http://search.cpan.org/search?module=Convert::BinHex
>
>In the future, you can just use http://search.cpan.org/ ... if you had
>typed "binhex" in the main text box on the main page and hit return, you
>would have found it.
>
>--
>Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
>%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])




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

Date: Mon, 13 Sep 1999 18:06:26 GMT
From: mikedel@ix.netcom.com
Subject: Re: buying perl book (Help me)
Message-Id: <7rjeeq$c9$1@nnrp1.deja.com>

These books are probably the essential books for learning / Using perl.
Here are links to reading the reviews on amazon. I bought them, and
they are fantastic books:

http://www.amazon.com/exec/obidos/ASIN/1565922840/productlink
Learning Perl

http://www.amazon.com/exec/obidos/ASIN/1565921496/productlink
Programming Perl (2nd Edition)

http://www.amazon.com/exec/obidos/ASIN/1565922433/productlink
Perl Cookbook

O reilly books are far and away the best books out there for perl
reference.

I hope this helps!


In article <37d93a96.0@news.pacifier.com>,
  Neil <neil@pacifier.com> wrote:
> sine2117@my-deja.com wrote:
> > Hello, anyone have a good tip of a nice perl book. like perl
cookbook or
> > something ?
>
> These are the standard introductory books:
>
> "The Perl Cookbook" is an introductory learn-by-example book.
>
> "Learning Perl" is a gentle introduction to Perl, for those with
little
> programming experience.
>
> "Programming Perl" is an introduction for those with programming
experience.
>
> Neil
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 13 Sep 1999 11:21:31 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Can't get list to sort...
Message-Id: <MPG.1246e08a5c99c746989f4f@nntp.hpl.hp.com>

In article <37DD35EC.768C3CE1@synopsys.com> on Mon, 13 Sep 1999 10:35:40 
-0700, David Amann <dove@synopsys.com> says...
> Hi Brant,
> 
> >   Can anyone give me a sort statement?
> 
> Try this:
> 
>     @sorted_field = sort alpha @field;
>     sub alpha { $a cmp $b };
> 
> Hope this helps;

It surely won't.

It sorts the array based on the lexicographic ordering of each of the 
data elements, rather than on a particular field (as was requested).  It 
also happens to be the default sort, so using the subroutine only slows 
things down.

Posting it twice doesn't make it any more helpful, by the way.

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


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

Date: Mon, 13 Sep 1999 14:22:24 -0400
From: "John J. Straumann" <jstraumann@worldnet.att.net>
Subject: CGI calls another CGI
Message-Id: <37DD40E0.A5AA8494@worldnet.att.net>

Hey All:

Is it possible to use a form POST method to call a CGI, and that CGI
pulls the information off the form, attaches some more information which
I want to remain private, and then calls another CGI on another server?

TIA.

John.


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

Date: Mon, 13 Sep 1999 11:41:08 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: CGI calls another CGI
Message-Id: <37DD4544.A641B468@cisco.com>

[ "John J. Straumann" wrote:

> Is it possible to use a form POST method to call a CGI, and that CGI
> pulls the information off the form, attaches some more information which
> I want to remain private, and then calls another CGI on another server?

Yes.  Read the following docs..
perldoc  LWP::UserAgent
perldoc HTTP::Request::Common
--




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

Date: Mon, 13 Sep 1999 12:59:34 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Comparing against today's date?
Message-Id: <37DD3B86.963266FB@texas.net>

Larry Rosler wrote:
> 
> [Posted and a courtesy copy sent.]
> 
> In article <7rj4fv$to$1@bgtnsc03.worldnet.att.net> on Mon, 13 Sep 1999
> 10:52:01 -0400, Glenn Kauffman <glenn.kauffman@worldnet.att.net> says...
> ...
> > sub ConverttoYYYYMMDD
> > {
> >  my ($date_in) = @_;
> >  my @temp = split('/', $date_in);
> >  if (length($temp[0]) < 2) { $temp[0] = "0$temp[0]"; }
> >  if (length($temp[1]) < 2) { $temp[1] = "0$temp[1]"; }
> >  return "$temp[3]$temp[1]$temp[2]";
> > }
> 
> That last line should be "$temp[2]$temp[0]$temp[1]".
> 
> But why not replace the last three lines by simply this:
> 
>     sprint '%d%.2d%.2d' => @temp[2, 0, 1]

We know you meant 'sprintf' :)

Or maybe:

sub ConverttoYYYYMMDD
{
 sprintf '%d%.2d%.2d' => (split '/', $_[0])[2, 0, 1];   
}

> > sub main
> > {
> >  my $date1 = "09/09/1999";
> >  my $date2 = "09/10/1999";
> >  if (ConverttoYYYYMMDD($date1) gt ConverttoYYYYMMDD($date2))
> >  {
> >   print "Greater Than";
> >  }
> > }
> 
> Above quoted so we can see (guess) that the input order is M/D/Y.

OK, then I'll include it, too.

- Tom


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

Date: Mon, 13 Sep 1999 18:13:52 GMT
From: dave_pomeroy4266@my-deja.com
Subject: copy
Message-Id: <7rjesk$ph$1@nnrp1.deja.com>

I am trying to either rename a file in win32 perl
or copy that same file in win32.  When I copy it
the status returns true but the new file is
empty.  When I try to rename it the status
returns false and no new file.  Is this copy
actually work in perl 5 for win32?  Does anyone
know?  Thanks for the help.
Dave Pomeroy


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 13 Sep 1999 11:30:03 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: Deleting spaces in a string
Message-Id: <37DD42AB.C59A7DB1@cisco.com>

[ Vincent BEZARD wrote:

> Please, help me,
>
> I have a string witch looks like "23 6659 478", and I want to del all the
> spaces, in order to get a interger like "236659478". I tried =~ s/\s+//, but

$string=~ tr/ //d;
--



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

Date: Mon, 13 Sep 1999 18:45:57 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: Design Advice needed on Sending Data to Client
Message-Id: <FDbD3.8333$N77.652041@typ11.nn.bcandid.com>

In article <5w6D3.7538$N77.609667@typ11.nn.bcandid.com>,
Kragen Sitaker <kragen@dnaco.net> wrote:
>In article <QVgC3.2461$x7.56225409@nr1.ottawa.istar.net>,
>Caitlyn Hay <caithay@hotmail.com> wrote:
>>What is the standard way of doing this?
>
>Using HTTP, which includes several increasingly awful, but
>well-supported, ways of solving the problems you mention.

There are other things in the universe besides HTTP. For text transfers,
there is the good old "end with dot on a line by itself, and double initial
dots in the data" method used by SMTP and NNTP.

SMTP and FTP has multi-line replies that look like
250-line 1
250-line 2
250 last line has no hyphen

FTP transfers use a separate data connection which is usually closed to
indicate an EOF. But it doesn't have to be - MODE B allows for persistent
data connections. It's much like HTTP chunked mode, actually. I don't know
why most servers don't implement it.

Sorry for the detour, I know the original poster asked about HTTP but I can't
tell from the context whether she really _wanted_ to use HTTP, or just hadn't
thought about other ways to design a text-transfer protocol.

>See the HTTP/1.1 definition:
>http://www.normos.org/ietf/rfc/rfc2068.txt

RFC2616 obsoletes 2068 (and no I don't know what the differences are, I just
happen to have 2616 nearby)
-- 
Alan Curry    |Declaration of   | _../\. ./\.._     ____.    ____.
pacman@cqc.com|bigotries (should| [    | |    ]    /    _>  /    _>
--------------+save some time): |  \__/   \__/     \___:    \___:
 Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman


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

Date: Mon, 13 Sep 1999 14:57:58 -0400
From: "John J. Straumann" <jstraumann@worldnet.att.net>
Subject: Re: File IO Question
Message-Id: <37DD4936.F40B99B8@worldnet.att.net>

Yes, but it doesn't work. Only prints element 0 and then exits...

Tom Briles wrote:
> 
> "John J. Straumann" wrote:
> >
> > When I tried this:
> >
> > if ( open( outFile, ">>$dataFile" ) )
> > {
> >   for ( $r=0; $r<25; $r++ )
> >   {
> >     print outFile ( "$input[ $r ]" );
> >   }
> >   close( outFile );
> > }
> >
> > it doesn't work, only prints the first data element and then nothing...
> 
> That code will print the first 25 elements of @input...all on the same
> line.  Is that your intention?
> 
> - Tom


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

Date: Mon, 13 Sep 1999 18:15:48 GMT
From: dave_pomeroy4266@my-deja.com
Subject: file renaming or copying
Message-Id: <7rjf08$s9$1@nnrp1.deja.com>

I am trying to either rename a file or copy it.  When I attempt to
rename it the status returns false.  When I copy it the status returns
true but the new file is empty.  Anyone have any ideas?  I am in win32.
Thanks for all your help.
Dave Pomeroy


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 13 Sep 1999 11:10:09 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Good way to learn PERL
Message-Id: <MPG.1246dddfdec2db77989f4e@nntp.hpl.hp.com>

In article <7rjc7k$ukg$1@nnrp1.deja.com> on Mon, 13 Sep 1999 17:28:56 
GMT, mikedel@ix.netcom.com <mikedel@ix.netcom.com> says...
> Here are two books that are absolutely esential to learning perl:
> 
> This is the  constumate tutorial for learning the in, outs, and
> flexibility of perl:
> 
> http://www.amazon.com/exec/obidos/ASIN/1565922840/productlink
> Learning Perl (2nd Edition)
> 
> This book is the Perl reference manual for all the stuff perl does:
> http://www.amazon.com/exec/obidos/ASIN/1565921496/productlink
> Programming Perl (2nd Edition)
> 
> This has some good refernce for creating perl - CGI scripts.
> http://www.amazon.com/exec/obidos/ASIN/0471168963/productlink
> The Cgi/Perl Cookbook
> 
> These links will take you to amazon so you can read the reviews.

So will http://www.amazon.com/

Repeatedly publishing these personal links in order to pick up 
commissions is really tacky.  Imagine if everyone did that!

All you will achieve is to ensure that many people will add you to their 
killfiles, so you won't get the benefit of their knowledge if you post 
any real messages.

I drew this to your attention last week, yet you persist.  The next time 
will cause me to do what I have never done before -- to initiate a 
killfile of my own, of which you will be the only member.  You will have 
achieved unique status.  How very cool!

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


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

Date: Mon, 13 Sep 1999 13:33:07 -0500
From: "Jeff Battle" <jjbattle@veribest.dot.com>
Subject: I need a date function...
Message-Id: <fsbD3.8313$N77.650060@typ11.nn.bcandid.com>

Visual Basic (I'm a newbie, forgive me if it's bad taste to mention VB in
this group) has a function called Weekday().  Give it a date and it returns
a number representing the day of the week. I can get the weekday of the
current day but I need the weekday of any entered date.

What's the easiest way to do this in Perl?




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

Date: 13 Sep 1999 18:34:42 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: multiple perl's
Message-Id: <7rjg42$6e1$2@rguxd.viasystems.com>

Kragen Sitaker <kragen@dnaco.net> wrote:
:>In article <37DD2947.DE25D9E1@networkengines.com>,
:>jerrad pierce  <jerrad@networkengines.com> wrote:
:>>is there a way for one perl process to access the values of variables in
:>>another perl process? (they're both running under the same effective and
:>>real UID's)

:>That is, can Perl do shared memory?  Not really.  (You can do shmsegs
:>and so forth, but you can't put variables in shared memory.)

:>You have to communicate explicitly.

But you can fake it.  :->  

See IPC::Shareable.

-- 
// Lee.Lindley   /// Programmer shortage?  What programmer shortage?
// @bigfoot.com  ///  Only *cheap* programmers are in short supply.
////////////////////    50 cent beers are in short supply too.


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

Date: Mon, 13 Sep 1999 20:47:57 +0200
From: "Michiel Trimpe" <info@juvex.com>
Subject: Re: multiple perl's
Message-Id: <937248349.5824.0.pluto.c29fe444@news.demon.nl>

Jerrad,

You should check out perlipc from the Perl POD's. It explains pretty much
everything you can do in that field

GL, Michiel Trimpe

--
--------------------------------------
Juvex Web Development

   Michiel Trimpe - General Manager

De Verver 13
5506 BH Veldhoven
The Netherlands
tel:   +31 40 2535539
fax:   +31 40 2543346
email: info@juvex.com

jerrad pierce <jerrad@networkengines.com> wrote in message
news:37DD2947.DE25D9E1@networkengines.com...
> okay, now I know this probably isn't possible, and can think of why if
allowed and not done properly could be bad, BUT
>
> is there a way for one perl process to access the values of variables in
> another perl process? (they're both running under the same effective and
real UID's)
>
> Just thought I'd ask.
>
> PS> Please (b)cc me with any replies as well as posting's, thanks!




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

Date: Mon, 13 Sep 1999 13:44:12 -0500
From: Tom Briles <sariq@texas.net>
To: jerrad pierce <jerrad@networkengines.com>
Subject: Re: multiple perl's
Message-Id: <37DD45FC.1195644E@texas.net>

[courtesy copy emailed to jerrad@networkengines.com]

jerrad pierce wrote:
> 
> okay, now I know this probably isn't possible, and can think of why if allowed and not done properly could be bad, BUT
> 
> is there a way for one perl process to access the values of variables in
> another perl process? (they're both running under the same effective and real UID's)
> 
> Just thought I'd ask.
> 
> PS> Please (b)cc me with any replies as well as posting's, thanks!

Perhaps you'd find what you need in the perlipc manpage.

- Tom


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

Date: Mon, 13 Sep 1999 18:13:44 GMT
From: mikedel@ix.netcom.com
Subject: Re: newbie: need help,LEARNING FROM A BOOK
Message-Id: <7rjesd$pe$1@nnrp1.deja.com>

Here are other books that may help you on your perl journey. I have
found them invaluable references:

http://www.amazon.com/exec/obidos/ASIN/1565922840/productlink
Learning Perl

http://www.amazon.com/exec/obidos/ASIN/1565921496/productlink
Programming Perl (2nd Edition)

http://www.amazon.com/exec/obidos/ASIN/1565922433/productlink
Perl Cookbook

I hope this helps!


In article <7psda7$mr8$1@nnrp1.deja.com>,
  zev0@my-deja.com wrote:
> I dont understand the concepts, of perl,when do you use " this and
when
> do you use 'this,.?2.) what means,exponentation,?and precedence?in
> simple jargon,even a newbie will understand,. am learning from the
book
> perl 5 interactive course,i hope i can do it, with the communitys WEB
> help!does any perl programmer want to help me with corresponding
> through e-mail,?if i have any questions?on my journy,to become a perl,
> programmer,! THANK YOU!!!!!!
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 13 Sep 1999 18:55:11 GMT
From: hops@sco.com (Mike Hopkirk(hops))
Subject: Re: Perl build on SCO Openserver 5.0.5
Message-Id: <HOPS.99Sep13115511@charmstr.sco.com>

In article <37d8fff4_2@newsread3.dircon.co.uk> Jonathan Stowe <gellyfish@gellyfish.com> writes:

Initially I had similar problems tho with DB_File rather than SDBM_File.

    test fails DB_File cannot resolve fsync
    works ok if add -lc when build DB_File.so
        ( explicitly chg ext/DB_File/Makefile.PL 
            my $LIB = "-ldb" ;          ->   my $LIB = "-ldb -lc" ;
        ditto Makefile

The generic fix seems to be to modify Makefile.PL as follows

        Add these lines line to Makefile.PL about line 10
            # osr5 link against libc to get static dependencies 
            $LIB = "-ldb -lc" if $Config{'osvers'} =~ '3\.2v5\.0\..' ;
        then 
            make config;make

>I have just built Perl 5.005.03 on SCO Openserver 5.0.5 with the the
>Openserver development kit 5.1.1a.
>
>It appears to build OK however I get a worrying failure in the tests:
>
>lib/sdbm...........Can't load '../lib/auto/SDBM_File/SDBM_File.so' for module 
>SDBM_File: dynamic linker: ./perl: invalid relocation type 3 at 0x804cd2d4 
>at ../lib/DynaLoader.pm line 169.

>at lib/sdbm.t line 14

With above fixes sdbm test compleste fine ...


>I subsequently tried to build a couple of modules (DBI notably) and they
>failed their tests after dumping core.
>
>Has anyone seen this and fixed it before or perhaps give me an idea what
>would give rise to this 'invalid reloacation' in the dynamic loader so I
>can try to fix it myself.

some of the libc symbols are only available in statically linked form at
linktime - if dynamic objects refer to those symbols and they're 
not already available in the shared object or executable you'll get
errors like those mentioned ..


FWIW the only changes needed for osr5.0.5 to the base dist were as follows

Post configuration (config.sh)
    ensure removal of any use of csh    d_csh='undef' in config.sh

    test fails DB_File cannot resolve fsync
    works ok if add -lc when build DB_File.so
        ( explicitly chg ext/DB_File/Makefile.PL 
            my $LIB = "-ldb" ;          ->   my $LIB = "-ldb -lc" ;
        ditto Makefile
    or 
        Add these lines line to Makefile.PL
            # osr5 link against libc to get static dependencies 
            $LIB = "-ldb -lc" if $Config{'osvers'} =~ '3\.2v5\.0\..' ;
        then 
            make config;make

----------------
All tests successful.
u=1.12  s=0.63  cu=95.18  cs=26.62  scripts=187  tests=6748
208 charmstr:...perl5/perl5.005_03> ./perl -I ./lib t/lib/s
safe1.t        sdbm.t         selectsaver.t  soundex.t      
safe2.t        searchdict.t   socket.t       symbol.t       
$ LD_LIBRARY_PATH=`pwd` ./perl -I ./lib t/lib/sdbm.t 
1..18
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok 10
ok 11
ok 12
ok 13
ok 14
ok 15
ok 16
ok 17
ok 18
--
- hops

Everything disclaimed (including disclaimer)
------<hops@sco.com>--------------------------------------
Mike Hopkirk (hops)  |       Whenever possible steal code.
SCO Inc              |          Tom Duff. (ex) Bell Labs





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

Date: Mon, 13 Sep 1999 14:26:21 -0400
From: Li Kong <lkong@hns.com>
Subject: Perl Y2k
Message-Id: <37DD41CD.7A39B79@hns.com>

How can I get a 4-digital year using localtime()?

--
Li Kong



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

Date: Mon, 13 Sep 1999 13:55:53 -0500
From: Art Haas <cs004@wg.waii.com>
Subject: Re: Perl Y2k
Message-Id: <37DD48B9.464EA908@wg.waii.com>

Li Kong wrote:
> 
> How can I get a 4-digital year using localtime()?
> 

#!/usr/local/bin/perl

use strict;

my $year = (localtime(time))[5];
$year += 1900;
print sprintf "This year is %d\n", $year;

Running this produces ....

% perl year.pl
This year is 1999
%

Read your documentation on localtime if something still
isn't clear, and remember to 'use strict;'
-- 
###############################
# Art Haas
# (713) 689-2417
###############################


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

Date: Mon, 13 Sep 1999 18:39:58 GMT
From: Brad Barnett <bbarnett@nospamhere.L8R.net>
Subject: Re: regexp with variables containing unknown data
Message-Id: <37DD44F4.541DD1DD@nospamhere.L8R.net>

Tom Briles wrote:
> 
> Brad Barnett wrote:
> >
> 
> <snipped quotemeta reference>
> 
> > Many thanks, oh god of perl ;)  Heh, even more thanks for perldoc, which
> > I never even knew existed ;)
> 
> Then before you write *even one* more line of Perl code, read:
> 
> perldoc perldoc
> perldoc perltoc
> 
> and go from there.
> 
> *Always* do your best to find an answer in the documentation before
> posting a question here.  There are numerous advantages.
> 
> - Tom

Go away tom, go away home


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

Date: 13 Sep 1999 18:22:14 GMT
From: lt lindley <ltl@rgsun5.viasystems.com>
Subject: Re: regexp with variables containing unknown data
Message-Id: <7rjfcm$6e1$1@rguxd.viasystems.com>

Brad Barnett <bbarnett@nospamhere.L8R.net> wrote:
:>Hmm, well, quotemeta seems to rule, except for some reason, it doesn't
:>;)  I don't know why this is happening, but let me give an example :

:>$a = "it.some.we[";
:>$b = "it.some.we[";

:>$c = quotemeta $a;
:>$d = quotemeta $b;

:>Now, at this point 

:>$c == "it\.some.\we\[" and $d == "it\.some.\we\["

Not exactly.  You misplaced a backslash and you are using the numeric
equality test operator to express an equality of strings.  You really
meant:

$c eq "it\.some\.we\[" and $d eq "it\.some\.we\["

:>But :

:>if ($c =~ /$d/) {something();}

:>Doesn't happen.... er, why??!

Because the string in $c contains literal backlashes.  The
backslashes in $d are interpreted as quoting the next metacharacter
from interpretation as the regular expression is compiled.  So you
have a string "$c" that looks like this:

"it\.some.\we\["

And you are matching it with a regular expression that looks like this:

/it\.some\.we\[/

The 2 strings are equal.  But the string does not match the regular 
expression.  The regular expression matches a string that contains

1) The characters 'it'
2) followed by the literal period '.'
3) followed by the characters 'some'
4) followed by the literal period '.'
5) followed by the string 'we'
6) followed by the literal left bracket character '['

But your string contains
1) The characters "it"
2) followed by the literal backslash '\'
3) followed by the literal period '.'
 ...

You shoud get the picture now.


Did you really mean to see if the strings were equal at that point?
Or was your mistake saying "$c = quotemeta $a" instead of 
just "$c = $a"?

Keep reading.  Also, just try things.  You can clarify much that way.


-- 
// Lee.Lindley   /// Programmer shortage?  What programmer shortage?
// @bigfoot.com  ///  Only *cheap* programmers are in short supply.
////////////////////    50 cent beers are in short supply too.


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

Date: Mon, 13 Sep 1999 14:55:53 -0400
From: "Luc Poirier" <lucp@nortelnetworks.com>
Subject: Win32 PERL and UNC
Message-Id: <7rjhaq$8ba$1@bmerhc5e.ca.nortel.com>

I'm trying to gather some information through a form in IIS 4 using PERL for
Win32 (ActiveState 519). I'm trying to save the data to a file on another NT
server - in a hidden share. I can't get the data to be written on a remote
server (with Full Access for all).

$msg = "test\n";

open (DATA, ">\\\\myserver\\hidden\$\\myfile.txt");
print DATA $msg;
close (DATA);

The above just doesn't work when I perform this through IIS. It does work
through a command line. Any thoughts?

Thanks

Luc






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

Date: Mon, 13 Sep 1999 20:01:31 +0100
From: Dave Eastabrook <news@elmbronze.demon.co.uk>
Subject: Re: Y2K bugs on the Internet
Message-Id: <+sGk5BALoU33EwZT@elmbronze.demon.co.uk>

on Sun, 12 Sep 1999 Jonathan Stowe <gellyfish@gellyfish.com> wrote
>In comp.lang.perl.misc Dave Eastabrook <news@elmbronze.demon.co.uk> wrote:
>> on Sat, 11 Sep 1999 Lawrence Kirby <fred@genesis.demon.co.uk> wrote
>>>
>>>That everybody else has missed the point, of course.
>> 
>> Brave man, and correct IMHO.
>> 
>> We all have to start somewhere, and *produce* under budget pressure:
>> 
>> http://www.elmbronze.co.uk/year2000/perlprob.htm
>> 
>
>Well thankyou for referring to my post in the previous thread on this matter.

I've seen some of the heat, back in csy2k as well.  Jocelyn is perhaps a
little - strident - in her comments against programmers.  But points she
raises are valid all the same, and I can sympathise with her campaigning
spirit.  Y2k as a bad case of BO is something you believe in - or don't.
I wanted to try and do an even-handed page, but one which still managed
to get a useful point across.  Still haven't heard from Gl^H^H my host.


>A further number of articles that provide a deeper critique of various of
>Matt Wright's scripts could be found by more searching on Deja News.
>
>e.g:
>
>      <http://www.deja.com/getdoc.xp?AN=479798920&fmt=text>

Well, I'm a novice, just started learning Perl (CGI, JavaScript) 2 weeks
or so ago.  But I can follow your points mostly.  It also looks to me as
though there are 9 Januarys in the year in the board script, and that
the script is an initial draft which was left up by mistake!


>It does sadden me that an ISP could be so clueless as to offer one of these
>scripts for its customers use (and I work for an ISP).

I might have to consider moving the webspace somewhere else.  And yet 
they got a good write up in .net and a good name generally.

Still, I suppose the scripts are useful to homepage authors who don't
depend on them for anything important.  And I'd guess that there are
thousands who use the formmail one.  Trouble is that I doubt that
homepages are the only use - as in the case of my hosts.

Well, jumping in the deep end on this issue I was prepared to don the
asbestos in a hurry, but so far thanks, I managed to survive ... :)

:Dave         [back to lurking and lurning!]
-- 
Ain't Y2k hilaryarse - http://www.elmbronze.co.uk/year2000/humour/
Dave Eastabrook;  all anonymous donations gratefully acknowledged.
Major credit cards welcome, secure payment facility is on the way.


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

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

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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


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