[18963] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1158 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 19 11:08:47 2001

Date: Tue, 19 Jun 2001 08:05:08 -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: <992963107-v10-i1158@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 19 Jun 2001     Volume: 10 Number: 1158

Today's topics:
    Re: [ map { @{ $_ || [ ] } } @$to ] (what does this mea <dg@sfs.nphil.uni-tuebingen.de>
    Re: [ map { @{ $_ || [ ] } } @$to ] (what does this mea (Anno Siegel)
    Re: Add LDAP entry <henryNOSPAM@larioja.org>
    Re: DBM in a CGI (please help) <amittai@amittai.com>
    Re: File::Find skips the leaf nodes in a directory tree <ren@tivoli.com>
        Get ownership info in NT OS <infokeeper@softpro.kharkov.ua>
        Graphical user interfacing? <bop@mypad.com>
        help printing floating point <toga@celsiustech.se>
    Re: help printing floating point (Anno Siegel)
    Re: help printing floating point <wescott@conterra.com>
    Re: help printing floating point <peb@bms.umist.ac.uk>
    Re: help with the perl scripts <gameboy0000@hotmail.com>
    Re: how to validate email address <pne-news-20010619@newton.digitalspace.net>
    Re: matching a list with a regex <bart.lateur@skynet.be>
    Re: multiple file upload (isterin)
        Need to Null a Hash?vvp <vprasad@americasm01.nt.com>
    Re: Need to Null a Hash?vvp <carlos@plant.student.utwente.nl>
        Opinion on 'Mastering Algorithms with Perl' (Bernard El-Hagin)
    Re: Opinion on 'Mastering Algorithms with Perl' <ubl@schaffhausen.de>
        Perl installation on Solaris (Elias_Haddad)
    Re: Perl Tutorials or E-Books <carlos@plant.student.utwente.nl>
    Re: Perl Tutorials or E-Books <Jeremy.Gurney@protherics.com>
    Re: Perl Tutorials or E-Books (Dave Hoover)
        premature end of script or malformed header <christophe@e-xode.com>
    Re: What is ${'string'} ? <mjcarman@home.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 19 Jun 2001 13:18:10 +0200
From: Dale Gerdemann <dg@sfs.nphil.uni-tuebingen.de>
Subject: Re: [ map { @{ $_ || [ ] } } @$to ] (what does this mean?)
Message-Id: <3B2F34F2.44C942AE@sfs.nphil.uni-tuebingen.de>

Thanks everybody for the help. Now that I understand what's going on,
I thought I'd practice a bit by generalizing to a recursive subroutine
for flattening. It seems to work okay, though it seems awkward to me
that you have to predeclare the function. Comments are welcome.

sub flatten;
sub flatten {
  my $array = shift;
  @$array = ( map
      { if ($_) {
           if (ref($_)) {
      flatten $_
    } else {
      ($_)
    }
  } else {
    ( )
  }
      } @$array );
}


@to = ( [ 4,[undef, 5,6] ], 7, undef, [8,9]);

flatten \@to;

# prints out 4 5 6 7 8 9
print "@to\n";

-- Dale Gerdemann




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

Date: 19 Jun 2001 11:45:42 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: [ map { @{ $_ || [ ] } } @$to ] (what does this mean?)
Message-Id: <9gne16$4ct$2@mamenchi.zrz.TU-Berlin.DE>

According to Dale Gerdemann  <dg@sfs.nphil.uni-tuebingen.de>:
> Thanks everybody for the help. Now that I understand what's going on,
> I thought I'd practice a bit by generalizing to a recursive subroutine
> for flattening. It seems to work okay, though it seems awkward to me
> that you have to predeclare the function. Comments are welcome.

You only need to predeclare flatten if you want to write the recursive
call without parentheses.

> sub flatten;
> sub flatten {
>   my $array = shift;
>   @$array = ( map
>       { if ($_) {
>            if (ref($_)) {
>       flatten $_

        flatten( $_);

[rest snipped]

Anno


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

Date: Tue, 19 Jun 2001 12:28:48 +0200
From: Enrique =?iso-8859-1?Q?Ochagav=EDa?= <henryNOSPAM@larioja.org>
Subject: Re: Add LDAP entry
Message-Id: <3B2F2960.545C841C@larioja.org>

Philip Newton escribi=F3:
> =

> Here's one way. From the Net::LDAP manpage:
> .............


Thanks, Thanks, Thanks.


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

Date: Tue, 19 Jun 2001 15:37:59 +0200
From: "Amittai Aviram" <amittai@amittai.com>
Subject: Re: DBM in a CGI (please help)
Message-Id: <9gnklv$76n$1@rznews2.rrze.uni-erlangen.de>

(My response below exchange -- Amittai Aviram.)

"John Hall" <jhall@ifxonline.com> wrote in message
news:SFuX6.54890$%a.2759560@news1.rdc1.sdca.home.com...
> Make sure that the account the webserver is running under has permission
to
> write in the directory where your DBM files will be stored. It has to be
> able to create the files in the directory. Look in the logs for those
kinds
> of failures, after you make your 'or die' statement after the dbmopen
> command more informative.
>
>
> "Amittai Aviram" <amittai@amittai.com> wrote in message
> news:9glkh8$5hg$1@rznews2.rrze.uni-erlangen.de...
> > I am just getting started in both Perl and Unix.  A project I am
building
> > takes data from a form and stores it in a series of DBM database files.
> > Since I use Windows 98 (sorry!) at home, I have been working with Perl
for
> > Windows and the Personal Web Server(PWS), where everything seems to work
> > fine.  Not so on my Unix server.  As a test, I wrote a small script that
> > would create a DBM in my Unix shell account.  This _did_ work when I ran
> the
> > script from the command line, but when I made the necessary small
changes
> > and tried running the script as a true CGI script from my browser, it
did
> > not create the DBM database file.  Other circumstances were identical --
> in
> > both cases, I uploaded the program in ASCII to my CGI-BIN directory and
> > assigned it 755 permissions.  When I point my browser to the script, I
do
> > get the HTML text on my screen (colors, etc.), but no DBM is created.
My
> > account is on a FreeBSD system.  Below is my simple script.  What am I
> doing
> > wrong?  I would be grateful for any suggestions or help with regard to
> > getting a CGI script to read and write data to and from DBM files on a
> Unix
> > server.  Thanks!
> >
> > Amittai amittai@amittai.com
> >
> > #!/usr/local/bin/perl
> >
> > print <<HTML;
> > Content-type: text/html
> >
> > <head>
> > <title>DBM Test</title>
> > </head>
> >
> > <body bgcolor="#dd0000" text="white">
> >
> > <h1>This is a test to see whether a DBM is being created</h1>
> >
> > HTML
> >
> > %fruits =
> >  (
> >   "one" => "apples",
> >   "two" => "oranges",
> >   "three" => "pears",
> >   "four" => "plums",
> >   "five" => "peaches"
> >  );
> >
> > @keys = keys %fruits;
> >
> > print "<p>@keys</p>\n";
> >
> >
> > dbmopen (%DATA, "database2", 0666) || die "$!";
> > %DATA = %fruits;
> > dbmclose (%DATA) || die "$!";
> >
> > print <<HTML;
> > </body>
> > </html>
> > HTML

Thank you very much for the suggestion.  I have learned that the Apache
server is designated as user "nobody," so "nobody" needs to be granted write
as well as read and execute permission.  Since I don't know how to do that
yet, for now, I've simply defined the whole directory as rwx for all three
groups (chmod 777).  This is just for testing -- later, I can make a
separate DBM directory and define that as rwx for "nobody" and rw for all
else.  BTW, I usually do make more informative "die" statements -- wanted to
make this minimal and thought I could rely on the system error message (as I
can in the PWS context), but that was clearly not the case here.  Have
changed it.

Now I have figured out what the other problem was that is causing the server
error.  The server, apparently, cannot handle the following:

use CGI qw(:cgi);
#Create a CGI object to receive the form data (fields) as
#properties.
$query = new CGI;
%fields = $query->Vars;

That is, it can deal with CGI::cgi in the procedural context but not the
object-oriented one.  Have asked the administrator what version of Perl he
is using.

Amittai





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

Date: 19 Jun 2001 09:27:20 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: File::Find skips the leaf nodes in a directory tree?
Message-Id: <m37ky8fstz.fsf@dhcp9-173.support.tivoli.com>

On Tue, 19 Jun 2001, goldbb2@earthlink.net wrote:

> Is there a reason for having unless( -e .... ) { instead of return
> unless( -e .... ); Is there a reason for using $File::Find::name
> instead of $_ ?  Keep in mind that find() has chdir()ed into the
> parent dir of $_ before the wanted sub is called.  Is there a reason
> for doing an explicit close on the filehandle?  It is after all
> stored in a lexical, and will automatically close at the end of the
> scope.  Do you expect uid and gid of www to change at any time
> during the execution of the program?  Why not stick those
> assignments up outside of the sub?

There's pretty much one reason for all of those things: I was coding
on-the-fly.  I do like the explicit close as it makes it very evident
that I have no intent to write to the file subsequently.  Still, a
comment is probably better for that.  Here it is with those changes
and some other changes as well:

#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
@ARGV = "." unless @ARGV;
my($user, $group) = qw/www www/;
my @check_files = qw/index.cgi index.html index.htm/;
my $index_file = "index.html";
my $uid = getpwnam $user or die "Invalid user: $user\n";
my $gid = getgrnam $group or die "Invalid group: $group\n";
find sub {
  return unless -d;  # only care about directories
  for my $file (@check_files) {
    return if -e "$_/$file";
  }
  open my $fh, ">", "$_/$index_file"     # create the file
    or warn "Could not create $_/$index_file, $!\n";
  chown $uid, $gid, "$_/$index_file"
    or warn "Could not chown $_/$index_file, $!\n";
  chmod 0644, "$_/$index_file"
    or warn "Could not chmod $_/$index_file, $!\n";
}, @ARGV;
__END__

-- 
Ren Maddox
ren@tivoli.com


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

Date: Tue, 19 Jun 2001 16:29:11 +0300
From: "çÒÉÎÞÅÎËÏ áÎÄÒÅÊ 378784026" <infokeeper@softpro.kharkov.ua>
Subject: Get ownership info in NT OS
Message-Id: <9gnk9t$2tjs$1@bn.utel.com.ua>

Hi!

How I can get ownership info for file or directory  in NT OS?
Win32::FileSecurity, not help.

Andre.




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

Date: Tue, 19 Jun 2001 08:35:06 -0400
From: "flash" <bop@mypad.com>
Subject: Graphical user interfacing?
Message-Id: <LGHX6.20183$Vl2.1062499@news20.bellglobal.com>

Is it possible to interface with a grapical program (GUI)?
What modules?

This would be on windows.

thanks,

--
#--*--*--*--*--*--*--*--*--*--*--#
#        The smash script archive.       #
#       http://www.floodbox.com       #
#--*--*--*--*--*--*--*--*--*--*--#





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

Date: Tue, 19 Jun 2001 16:18:37 +0200
From: Tobias Gabrielsson <toga@celsiustech.se>
Subject: help printing floating point
Message-Id: <3B2F5F3C.BDF54CD5@celsiustech.se>

I would like to print, on a webpage, a variable like 12.1234567 as 12.12
only. Can anyone help me? I have tride almost everything, but I cannot
make it work. i have tried %.2f, but without any luck.

Thanks in avance, Lena



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

Date: 19 Jun 2001 14:32:27 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: help printing floating point
Message-Id: <9gnnpr$hv5$1@mamenchi.zrz.TU-Berlin.DE>

According to Tobias Gabrielsson  <toga@celsiustech.se>:
> I would like to print, on a webpage, a variable like 12.1234567 as 12.12
> only. Can anyone help me? I have tride almost everything, but I cannot
> make it work. i have tried %.2f, but without any luck.

How did you try?  $x = 12.1234567; printf "%.2f\n", $x; does exactly
that.

Anno


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

Date: Tue, 19 Jun 2001 14:25:58 GMT
From: Mike Wescott <wescott@conterra.com>
Subject: Re: help printing floating point
Message-Id: <ouu21ca6lk.fsf@eriadne.sc.rr.com>

Tobias Gabrielsson <toga@celsiustech.se> writes:

> I would like to print, on a webpage, a variable like 12.1234567 as 12.12
> only. Can anyone help me? I have tride almost everything, but I cannot
> make it work. i have tried %.2f, but without any luck.

Works for me:

$ perl -e 'printf "%.2f\n", 12.1234567;'
12.12

Perhaps you could show us a code fragment that illustrates your
problem.
-- 
	Mike Wescott
	wescott@conterra.com


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

Date: Tue, 19 Jun 2001 15:47:22 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: help printing floating point
Message-Id: <3B2F65FA.DC90195D@bms.umist.ac.uk>

Tobias Gabrielsson wrote:
> 
> I would like to print, on a webpage, a variable like 12.1234567 as 12.12
> only. Can anyone help me? I have tride almost everything, but I cannot
> make it work. i have tried %.2f, but without any luck.
> 

show us some of your code.

using 'printf("%.2f", $var)' should work fine.

e.g.

$a = 12.124576234; 
printf("%.2f", $a);

prints 12.12.

If you post some of your code we might be able to pin-point the problem.

Paul


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

Date: Tue, 19 Jun 2001 19:58:17 +0800
From: gameboy0000 <gameboy0000@hotmail.com>
To: u518615722@spawnkill.ip-mobilphone.net, u518615722@spawnkill.ip-mobilphone.net
Subject: Re: help with the perl scripts
Message-Id: <3B2F3E59.FC3E6D88@hotmail.com>

check the time stamp, and then have copy for those having time stamp
newer than the checked time stamp only.

u518615722@spawnkill.ip-mobilphone.net wrote:

> We need to run the following scripts to change phone #s once a while.
>
> perl -pi.bak -e 's/string1/string2/g' `find /opt2/oracle/product/ 8.1.7/dba/ -name "*" -print`
>
> because we have hundreds of files and sub-directories so we can not
> change them one by one.  Sometimes somebody put a huge dmp files w/o let us know, so we will run out of spaces by running this scripts.
>
> How can we make smarter that it will only make a copy of the files
> that get changed and do not make copy of those that are not changed?
>
> Thanks
>
>
>
> --
> Sent by dbadba62 from hotmail within field  com
> This is a spam protected message. Please answer with reference header.
> Posted via http://www.usenet-replayer.com/cgi/content/new



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

Date: Tue, 19 Jun 2001 12:32:13 +0200
From: Philip Newton <pne-news-20010619@newton.digitalspace.net>
Subject: Re: how to validate email address
Message-Id: <f4auit0qqg9m3ng6r23p5bn47hanaseasv@4ax.com>

On 19 Jun 2001 00:58:09 -0700, h155@ms37.hinet.net (chih-chieh, Huang)
wrote:

> My idea is to check the domain name from email address, i.e.
> if email=abc@abc.com
> then, use ping or nslookup to check whether domain name (abc.com) is valid.
> 
> In using "Ping", system's response will be "abc.com is alive" if this domain
> does exist.

Bad. For example, one of my addresses is Philip.Newton@datenrevision.de
, which is certainly deliverable. But 'ping datenrevision.de' will fail
because there is no host by that name. (Hint: MX vs A DNS RR)

> Then, I am sure "abc.com" exists, but I still can't make sure whether
> "abc@abc.com" is valid.

And that is pretty much impossible to determine without sending mail and
asking for a human response. (VRFY used to work but is now disabled more
often than not.)

> What do you think about my idea?

Do what John Krahn said: read  perldoc -q "valid mail address"

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
Yes, that really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: Tue, 19 Jun 2001 12:59:44 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: matching a list with a regex
Message-Id: <90juitohfatrvl2hmkjct87e1fqq6fhb03@4ax.com>

John W. Krahn wrote:

>How about /(?:\((?!,)|(?<!\(),)(?:\d+|"[^"]*")?(?<!,)\)/
>
>Not much smaller but no repeating pattern.

There must be an error in there, it doesn't accept multiple items, just
one or none.

Ah, yes. Here it is again, modified, and this one seems to work.

	/\((?:(?:(?<=\()|(?<!\(),)(?:\d+|"[^"]*"))*(?<!,)\)/

It's complex. Do you even need the test for comma at the end?

The idea is that you do:

	$term = qr/(?:\d+|"[^"]*")/;
	/\((?:,?$term)*\)/

with extra restrictions:

 * no comma in front of the very first term
 * one comma in front of every other term.

Or:
	/\((?:$term,?)*\)/

with

 * no comma after the last term
 * a comma after every other term

I think it must be possible, using lookahead and/or lookbehind, to get
this into one of these regexes. Preferably understandable, too.  :-)

Perhaps:

	/\((?:$term(?=[,\)]),?)*(?<!,)\)/

Yes, this one looks like it works.

Can this simplified?

	/\((?:$term(?:,(?!\))|(?=\))))*\)/

Could that be it? It does look like a bad case of the Curved Toothpick
Syndrome...

-- 
	Bart.


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

Date: 19 Jun 2001 07:45:08 -0700
From: isterin@hotmail.com (isterin)
Subject: Re: multiple file upload
Message-Id: <db67a7f3.0106190645.77c68d91@posting.google.com>

The browser restricts you to upload only one file at a time per post
request.  You can set it up where you upload one file at a time, but
it then resubmits itself time and time again until all files are
uploaded.

Ilya



"Vassilis G. Tavoultsidhs" <ixanthi@ixanthi.gr> wrote in message news:<9gmq1b$o02$1@foo.grnet.gr>...
> Hi, I don't know if this is the correct newsgroup but anyway.
> I want to make a script to upload multiple files from the users browser to
> my server. I have tried the following :
> 
>      $write_file = "../mydir/images/myfile.jpg";
>      $filepath = "file.jpg";
>      $bytes_read=0;
>      $size='';
>      $buff='';
> 
>      open (WFD,">$write_file") || die "Error opening ${write_file} for
> writing \n";
>      flock (WFD, "1");
> 
>      while ($bytes_read=read($filepath,$buff,2096))
>      {
>          $size += $bytes_read;
>          binmode WFD;
>          print WFD $buff;
>      }
> 
>      close(WFD);
> 
> it does work for one file but if I repeat it for a different $writefile and
> $filepath it will create a file on the server which will have no content.
> Does anyone know what to do?
> 
> Thanks
> 
> Vassilis G. Tavoultsidhs
> Electronics Engineer - Software Engineer
> www.ixanthi.gr


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

Date: Tue, 19 Jun 2001 10:03:34 -0400
From: "Prasad, Victor [FITZ:K500:EXCH]" <vprasad@americasm01.nt.com>
Subject: Need to Null a Hash?vvp
Message-Id: <3B2F5BB6.9F2DE69F@americasm01.nt.com>

Hello,

I am trying to get some info from a database - put it into a has.  But
some of the fields are blank resulting in this error:

Use of uninitialized value at /table1/table1.cgi line 103

Here is the code block:

sub load_category_names
{
   ### Perform the connection using the Mysql driver
   my $dbh = DBI->connect( "dbi:mysql:xxx", "xxx", "xxx" , \%attr )
    or die "Can't connect to database: ", $DBI::errstr, "\n";

   my $sth = $dbh->prepare("select * from table1") or
      err_trap("Cannot prepare the table1 query");
   $sth->execute or err_trap("Cannot execute the table1 query");

        my @cat;
        my $rowhash;
        while ( my @row = $sth->fetchrow_array )
        {
        my %rowhash;
  LINE
103->$rowhash{'sign_off_type','sign_off_desc','global_id','crit1','crit1_desc','crit2','crit2_desc','crit3','crit3_desc'}
= @row;
        push @cat, \%rowhash;
  print $cgi->p("$rowhash");
         }


   err_trap("Error fetching table1") if $DBI::err; 

In some of there records, the last 4 fields are blank - not data - I
suspect this is the reason?  Do I have to put a NULL value in the hash?  

Any help?

Thanks,

V


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

Date: Tue, 19 Jun 2001 16:31:50 +0200
From: "carlos" <carlos@plant.student.utwente.nl>
Subject: Re: Need to Null a Hash?vvp
Message-Id: <9gno0l$qcd$1@dinkel.civ.utwente.nl>

$dbh = $conn->prepare($qry);
$hashref = $dbh->fetchrow_hashref;

--
carlos

"Prasad, Victor [FITZ:K500:EXCH]" <vprasad@americasm01.nt.com> wrote in
message news:3B2F5BB6.9F2DE69F@americasm01.nt.com...
> Hello,
>
> I am trying to get some info from a database - put it into a has.  But
> some of the fields are blank resulting in this error:
>
> Use of uninitialized value at /table1/table1.cgi line 103
>
> Here is the code block:
>
> sub load_category_names
> {
>    ### Perform the connection using the Mysql driver
>    my $dbh = DBI->connect( "dbi:mysql:xxx", "xxx", "xxx" , \%attr )
>     or die "Can't connect to database: ", $DBI::errstr, "\n";
>
>    my $sth = $dbh->prepare("select * from table1") or
>       err_trap("Cannot prepare the table1 query");
>    $sth->execute or err_trap("Cannot execute the table1 query");
>
>         my @cat;
>         my $rowhash;
>         while ( my @row = $sth->fetchrow_array )
>         {
>         my %rowhash;
>   LINE
>
103->$rowhash{'sign_off_type','sign_off_desc','global_id','crit1','crit1_des
c','crit2','crit2_desc','crit3','crit3_desc'}
> = @row;
>         push @cat, \%rowhash;
>   print $cgi->p("$rowhash");
>          }
>
>
>    err_trap("Error fetching table1") if $DBI::err;
>
> In some of there records, the last 4 fields are blank - not data - I
> suspect this is the reason?  Do I have to put a NULL value in the hash?
>
> Any help?
>
> Thanks,
>
> V




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

Date: Tue, 19 Jun 2001 12:41:13 +0000 (UTC)
From: bernard.el-hagin@lido-tech.net (Bernard El-Hagin)
Subject: Opinion on 'Mastering Algorithms with Perl'
Message-Id: <slrn9iuia7.1at.bernard.el-hagin@gdndev32.lido-tech>


Would someone care to give their opinion on the book mentioned
in the subject? Can't find it in Uri's book list.

Cheers,
Bernard
--
perl -l54e's yyw q q tvmrx "h\ywx ersxliv zivp legoiv"qiy;y #a-zA-Z#d-gu-z#
chefghijklmnopqrstuvwxyzcJab-def-uPwxyzc;s j j s u u s t t s r r s
ppevalpereeteueje'


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

Date: Tue, 19 Jun 2001 16:47:11 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Opinion on 'Mastering Algorithms with Perl'
Message-Id: <3B2F73FF.CF19C447@schaffhausen.de>

Bernard El-Hagin schrieb:
> 
> Would someone care to give their opinion on the book mentioned
> in the subject? Can't find it in Uri's book list.

Its a book about algorithms mostly, so buy it if you want to learn
something about them and to learn some tricks about efficient
implementations in Perl. Its not the right book if you want
to learn Perl and it lacks the the amusing sub-tone of other
perl books.

->alte


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

Date: Tue, 19 Jun 2001 11:06:27 +0000 (UTC)
From: Elias_Haddad@tertio.com (Elias_Haddad)
Subject: Perl installation on Solaris
Message-Id: <OFA480F4F3.0976D846-ON80256A70.003D2EF2@tertio.com>

Hi all,
I'm installing pre compiled binaries for Perl 5.6.0 on Solaris 2.7 using
pkgadd.
At the end of the installation I get the message "installation was
successful" but when I do
perl -v
I get the following message:
ld.so.1: perl: fatal: libgdbm.so.2: open failed: no such file or directory

the peculiar thing is that I've installed the gdbm libraries just before
installting Perl, and /usr/local/lib (where libgdbm.so.2 is located) is in
my $LD_LIBRARY_PATH in my .profile file. gcc is also installed.

So it looks like I've done everything right but I don't understand why I'm
getting this error message.
I went to the sunfreeware site and it says that I may have to install a
library called db as well prior to the Perl installation. Can that be the
problem? I doubt it though because I have done a similar installation on
another Solaris 2.7 box without preinstalling db.

Any help please?

Tertio Limited  -  One Angel Square,   Torrens Street,   London  EC1V 1PL
Tel: +44 (0)20 7843 4000 Fax: +44 (0)20 7843 4001 Web http://www.tertio.com
Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of Tertio
Ltd.



-- 
Posted from [212.250.216.229] 
via Mailgate.ORG Server - http://www.Mailgate.ORG


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

Date: Tue, 19 Jun 2001 12:45:22 +0200
From: "carlos" <carlos@plant.student.utwente.nl>
Subject: Re: Perl Tutorials or E-Books
Message-Id: <9gnag1$i7d$1@dinkel.civ.utwente.nl>

www.codebits.com/p5be is kinda neat
--
carlos
:wq
"[coder]" <coder@binbash.net> wrote in message
news:tiu6lup4vk40f6@corp.supernews.com...
> Hey
>
> anyone know where i can find some perl tutorials or free e-books?
>
> thx
>
> [coder]
>
>




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

Date: Tue, 19 Jun 2001 10:53:44 +0100
From: Jeremy Gurney <Jeremy.Gurney@protherics.com>
Subject: Re: Perl Tutorials or E-Books
Message-Id: <3B2F2128.4ABBE9EC@protherics.com>

"[coder]" wrote:

> anyone know where i can find some perl tutorials or free e-books?
> [coder]

Well, there's Picking Up Perl if Bradley M. Kuhn ever gets round to
finishing it.
http://www.ebb.org/PickingUpPerl/

--
Jeremy Gurney                |  Protherics Molecular Design Ltd.
"The views, opinions, and judgements expressed in this message are
solely those of the
author. The message contents have not been reviewed or approved by
Protherics."




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

Date: 19 Jun 2001 06:56:19 -0700
From: redsquirreldesign@yahoo.com (Dave Hoover)
Subject: Re: Perl Tutorials or E-Books
Message-Id: <812589bb.0106190556.72ff6f8b@posting.google.com>

"[coder]" wrote:

> Hey
> 
> anyone know where i can find some perl tutorials or free e-books?
> 
> thx
> 
> [coder]

Here's a good jumping off point:
http://learn.perl.org

Bite the bullet and buy the Llama book...it will help you understand
the basic principles and prepare you to read the meatier stuff (at
least that's how it was for me).

Here's the Llama:
http://www.amazon.com/exec/obidos/ASIN/1565922840/develooper/002-8114095-4474459

HTH

--
Dave Hoover
"Twice blessed is help unlooked for." --Tolkien
http://www.redsquirreldesign.com/dave


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

Date: Tue, 19 Jun 2001 14:55:36 GMT
From: Christophe Gibert <christophe@e-xode.com>
Subject: premature end of script or malformed header
Message-Id: <3B2F6816.A9D937C5@e-xode.com>

I am running a cgi script written in perl that causes an internal server

error. the error logs say "premature end of script" or "malformed header

from script" but the script is running when it is launched from the
shell. And it is so simple that it it can not be wrong
My server is apache 1.3.14

What'ts wrong ?

--
Christophe Gibert
http://www.e-xode.com/cv/christophe.htm
Reportage multimedia interactif : les enfants tibétains exilés
http://www.e-xode.com




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

Date: Wed, 13 Jun 2001 08:59:47 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: What is ${'string'} ?
Message-Id: <3B2771D3.554D86F5@home.com>

Gordon.Haverland@gov.ab.ca wrote:
>"Wyzelli" <wyzelli@yahoo.com> wrote:
>> "Todd Smith" <todd@designsouth.net> wrote:
>> 
>>> print "I have two ${item}s";
>>
>> But that is not the same as
>>
>> print "I have two ${'item'}s";
>>
>> Which is what the OP was talking about.
> 
> I'll settle for descriptions as to why a person would use either, or
> both.  This program I am trying to install has a number of hashes
> scattered throughout it.  All hashes except for one are named, like
> $hash{key}, $item{'key'} or $item{"key"}.

Ah, but that is a completely different beast!

> To me, this looks like the original programmer just made a mistake.

Not really, he was just inconsistent.

> Is there some different about ${key} or ${'key'} which points to its
> use in special circumstances?

Okay, it looks like we need a more thorough explanation...

%foo is a hash. $foo{bar} is the value in the hash %foo with a key of 
'bar'. $foo{'bar'} and $foo{"bar"} are the same thing. You don't 
normally need to quote your keys -- Perl does that for you -- but it is 
necessary if your keys contain certain characters (like spaces) or 
happen to be keywords (like time).

The difference between single and double qoutes is that double quotes 
interpolate, single quotes don't. So '$var' is just the string "dollar-
sign v a r" while "$var" will give you the value of the variable $var.

${foo} is just the variable $foo. All the curly braces do is to offset
the variable name from anything which might come after it. You don't
typically need to do this, but it is useful on occasion, such as in
the following:

    $foo = 'dog';
    print "I have three ${foo}s.\n";

Without the {} perl would look for the variable $foos which isn't what
you want.

${'foo'} is a symbolic reference to the global variable $foo. (It has 
to be a global because you can't take symrefs to lexicals.)

HTH
-mjc


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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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


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


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