[16984] in Perl-Users-Digest
Perl-Users Digest, Issue: 4396 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 21 14:05:46 2000
Date: Thu, 21 Sep 2000 11:05:25 -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: <969559525-v9-i4396@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 21 Sep 2000 Volume: 9 Number: 4396
Today's topics:
Can't open DBM after upgrading from 5.005 to 5.6 bluearchtop@my-deja.com
Re: Can't open DBM after upgrading from 5.005 to 5.6 <OfficerS@aries.tucson.saic.com>
Re: Can't open DBM after upgrading from 5.005 to 5.6 bluearchtop@my-deja.com
Re: Candidate for the top ten perl mistakes list <stevel@bluetuna.com>
Configure parameter not documented <OfficerS@aries.tucson.saic.com>
Re: Configure parameter not documented <OfficerS@aries.tucson.saic.com>
converting binary string <Kai.Wipplinger@de.bosch.com>
Re: converting binary string <tom.kralidis@ccrs.nrcan.gcDOTca>
Re: converting binary string <aqumsieh@hyperchip.com>
Re: converting binary string (Abigail)
Find String in Text File - Easy Question pgodkin@my-deja.com
Help with Proxy Server Authentication?????????????????? <mkhan@crosscom.com>
Re: how to add months in Perl? <ren.maddox@tivoli.com>
Re: Interpolation on the fly (Dave Sherohman)
IO::Socket advice (Adrian Harris)
Re: IP Address <stevel@bluetuna.com>
Re: IP Address <jeff@vpservices.com>
Re: ITS BEYOND ME! <Chris%2BSaunders@one.net.au>
Re: ITS BEYOND ME! (Jerome O'Neil)
Re: ITS BEYOND ME! <jeff@vpservices.com>
Re: Joining strings <lr@hpl.hp.com>
More Debugging - Please Help <OfficerS@aries.tucson.saic.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 21 Sep 2000 15:36:20 GMT
From: bluearchtop@my-deja.com
Subject: Can't open DBM after upgrading from 5.005 to 5.6
Message-Id: <8qd9th$vq1$1@nnrp1.deja.com>
I can't seem to read any of my DB_File or GDBM_File hashes after
upgrading to 5.6. Is there any solution to this?
THanks
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 21 Sep 2000 09:54:24 -0700
From: Sarah Officer <OfficerS@aries.tucson.saic.com>
Subject: Re: Can't open DBM after upgrading from 5.005 to 5.6
Message-Id: <39CA3D40.B5E6E51B@aries.tucson.saic.com>
Help! We have upgraded to 5.6.0 from 00502, and I find that our
GDBM_FIle hashes (using the Tie::Hash stuff) work on Solaris but not
on our Silicon Graphics machines. Bluearchtop: what platform are
you using? We have gdbm 1.8.0.
The error message I get is:
"Can't call method "FETCH" on an undefined value at
/ATMS/Scripts/gdbm.pl line 23."
The line in question is $ref->FETCH line. Any ideas of why this
would work on a Sun (Solaris 2.8) and not Silicon Graphics (IRIX6.5)
would be appreciates. Maybe bluearchtop & I are having the same
problem?
sub FETCH{
my $self = shift ;
my $ref = $self->{'gdbm'};
$ref->FETCH(@_) ;
}
Thanks,
Sarah
officers@aries.tucson.saic.com
bluearchtop@my-deja.com wrote:
>
> I can't seem to read any of my DB_File or GDBM_File hashes after
> upgrading to 5.6. Is there any solution to this?
> THanks
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Thu, 21 Sep 2000 17:50:44 GMT
From: bluearchtop@my-deja.com
Subject: Re: Can't open DBM after upgrading from 5.005 to 5.6
Message-Id: <8qdhpb$a2i$1@nnrp1.deja.com>
Sorry folks, I figured it out. I had to recomplile and statically link
DB_File instead.
> I can't seem to read any of my DB_File or GDBM_File hashes after
> upgrading to 5.6. Is there any solution to this?
> THanks
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 21 Sep 2000 12:57:00 -0700
From: Steve Leibel <stevel@bluetuna.com>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <stevel-1BFF77.12570021092000@news.dnai.com>
In article <8q8qt1$134$1@watserv3.uwaterloo.ca>,
arpepper@math.uwaterloo.ca (Adrian Pepper [MFCF]) wrote:
> My candidate for the top ten perl mistakes list
>
> Using close instead of closedir to close a handle opened using opendir.
>
>
> Adrian Pepper, MFCF
Thinking that finding the cleverest and most obscure Perl construct for
a given task makes you a programmer.
------------------------------
Date: Thu, 21 Sep 2000 08:37:48 -0700
From: Sarah Officer <OfficerS@aries.tucson.saic.com>
Subject: Configure parameter not documented
Message-Id: <39CA2B4C.904B86B5@aries.tucson.saic.com>
Is there a configure I can use so that installed scripts don't say
#!/foo/bar/perl
but instead say
#!/bin/sh -- # A comment mentioning perl, to prevent looping.
eval 'exec perl -S $0 ${1+"$@"}'
if 0;
which requires me to have perl in my path. I *do* specify a prefix
for where I want perl installed.
Thanks,
Sarah
officers+nospam@aries.tucson.saic.com
------------------------------
Date: Thu, 21 Sep 2000 08:40:04 -0700
From: Sarah Officer <OfficerS@aries.tucson.saic.com>
Subject: Re: Configure parameter not documented
Message-Id: <39CA2BD4.47244340@aries.tucson.saic.com>
Oops. It's a Configure parameter I'm looking for. Something like
-Duse_bang_sh. Is there such a thing? I couldn't find it in the
INSTALL doc.
Sarah Officer wrote:
>
> Is there a configure I can use so that installed scripts don't say
^parameter
>
> #!/foo/bar/perl
>
> but instead say
>
> #!/bin/sh -- # A comment mentioning perl, to prevent looping.
> eval 'exec perl -S $0 ${1+"$@"}'
> if 0;
>
> which requires me to have perl in my path. I *do* specify a prefix
> for where I want perl installed.
>
> Thanks,
>
> Sarah
> officers+nospam@aries.tucson.saic.com
------------------------------
Date: Thu, 21 Sep 2000 17:09:17 +0200
From: Kai Wipplinger <Kai.Wipplinger@de.bosch.com>
Subject: converting binary string
Message-Id: <39CA249D.4B0C95F2@de.bosch.com>
hello,
i have a binary string like '00010001' and i want to convert it in an
integer value. After reading the documentation i found in the
description of oct() following sentence:
(If EXPR happens to start off
with 0x, interprets it as a hex string. If EXPR starts off with 0b,
it is interpreted as a binary string.)
The following will handle decimal, binary, octal, and hex in the
standard Perl or C notation:
Trying following script didn't work correctly, only 0 is printed (seems
to use numbers up to the b and to interpret it as octal):
#! perl -w
use strict;
my $value = oct('0b0001000');
printf "%d",$value;
Do i understand the documentation wrong or is 0b not supported by oct?
Greetings
Kai
PS:
Perl Version:
This is perl, version 5.005_03 built for MSWin32-x86-object
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-1999, Larry Wall
Binary build 521 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 12:26:50 Oct 16 1999
Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5.0 source
kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using `man perl' or `perldoc perl'. If you have access to
the
Internet, point your browser at http://www.perl.com/, the Perl Home
Page.
OS:
windows NT
------------------------------
Date: Thu, 21 Sep 2000 12:25:48 -0400
From: "Tom Kralidis" <tom.kralidis@ccrs.nrcan.gcDOTca>
Subject: Re: converting binary string
Message-Id: <8qdcqc$8t32@nrn2.NRCan.gc.ca>
The Cookbook has an example of converting to/from binary to/from decimal:
sub dec2bin {
my $str = unpack("B32", pack("N", shift));
$str =~ s/^0+(?=\d)//; # otherwise you'll get leading zeros
return $str;
}
sub bin2dec {
return unpack("N", pack("B32", substr("0" x 32 . shift, -32)));
}
Hope this helps.
..Tom
=================================
Tom Kralidis
GIS / Systems Specialist
Canada Centre for Remote Sensing
Tel: (613) 947-1828
http://www.nrcan.gc.ca/~tkralidi/
=================================
"Kai Wipplinger" <Kai.Wipplinger@de.bosch.com> wrote in message
news:39CA249D.4B0C95F2@de.bosch.com...
> hello,
>
> i have a binary string like '00010001' and i want to convert it in an
> integer value. After reading the documentation i found in the
> description of oct() following sentence:
>
> (If EXPR happens to start off
> with 0x, interprets it as a hex string. If EXPR starts off with 0b,
> it is interpreted as a binary string.)
> The following will handle decimal, binary, octal, and hex in the
> standard Perl or C notation:
>
> Trying following script didn't work correctly, only 0 is printed (seems
> to use numbers up to the b and to interpret it as octal):
>
> #! perl -w
> use strict;
>
> my $value = oct('0b0001000');
> printf "%d",$value;
>
> Do i understand the documentation wrong or is 0b not supported by oct?
>
> Greetings
>
> Kai
>
> PS:
>
> Perl Version:
> This is perl, version 5.005_03 built for MSWin32-x86-object
> (with 1 registered patch, see perl -V for more detail)
>
> Copyright 1987-1999, Larry Wall
>
> Binary build 521 provided by ActiveState Tool Corp.
> http://www.ActiveState.com
> Built 12:26:50 Oct 16 1999
>
>
> Perl may be copied only under the terms of either the Artistic License
> or the
> GNU General Public License, which may be found in the Perl 5.0 source
> kit.
>
> Complete documentation for Perl, including FAQ lists, should be found on
> this system using `man perl' or `perldoc perl'. If you have access to
> the
> Internet, point your browser at http://www.perl.com/, the Perl Home
> Page.
>
> OS:
>
> windows NT
------------------------------
Date: Thu, 21 Sep 2000 16:29:00 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: converting binary string
Message-Id: <7awvg590aa.fsf@merlin.hyperchip.com>
Kai Wipplinger <Kai.Wipplinger@de.bosch.com> writes:
> i have a binary string like '00010001' and i want to convert it in an
> integer value.
The perlfunc documentation has the following example in the section
explaining the pack() command:
sub bintodec {
unpack("N", pack("B32", substr("0" x 32 . shift, -32)));
}
--Ala
------------------------------
Date: 21 Sep 2000 17:53:09 GMT
From: abigail@foad.org (Abigail)
Subject: Re: converting binary string
Message-Id: <slrn8skilt.5fq.abigail@alexandra.foad.org>
Kai Wipplinger (Kai.Wipplinger@de.bosch.com) wrote on MMDLXXVIII
September MCMXCIII in <URL:news:39CA249D.4B0C95F2@de.bosch.com>:
::
:: (If EXPR happens to start off
:: with 0x, interprets it as a hex string. If EXPR starts off with 0b,
:: it is interpreted as a binary string.)
::
:: Perl Version:
:: This is perl, version 5.005_03 built for MSWin32-x86-object
^^^^^^^^^^^^^^^^
It would be a good idea to read the documentation that comes with your
perl, instead of from random source. Then you won't try to do 5.6.0
semantics on a 5.005 Perl.
Abigail
--
$_ = "\nrekcaH lreP rehtona tsuJ"; my $chop; $chop = sub {print chop; $chop};
$chop -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()
-> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> () -> ()
------------------------------
Date: Thu, 21 Sep 2000 17:16:20 GMT
From: pgodkin@my-deja.com
Subject: Find String in Text File - Easy Question
Message-Id: <8qdfoe$7g5$1@nnrp1.deja.com>
I confess that I have little perl experience. I want to find the number
of occurences of a multi-word text string in a text file.
$text_string = "THIS IS A TEST";
open(LOGFILE, "/../mytext_file.txt");
@lines = grep /"$text_string"/,readline LOGFILE;
$count = @lines;
print $count; **** ALWAYS PRINTS ZERO
close(LOGFILE);
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 20 Sep 2000 12:31:12 -0500
From: "Mohammad Khan" <mkhan@crosscom.com>
Subject: Help with Proxy Server Authentication???????????????????????
Message-Id: <39ca3af1$0$228@wodc7nh0.news.uu.net>
Hi,
I have written a perl program which posts to different web sites. Now
this program is able to pass through the proxy server successfully, if the
proxy server doesn't prompt for login and password information.
Now one of our customers who is using this perl program has a proxy
server which requires login/password authentication, before letting the
program to access the outside web sites.
Now I have found proxy_authenticate function in Auth.pm under
"perl/site/lib/HTTP/Headers" directory, but I have no idea how to use this
function. I will appreciate if somebody can give me example of this
function.
Here is initial part of my sample code.
sub post_sample
{
use LWP::UserAgent;
$ua = new LWP::UserAgent;
$ua->agent("AgentName/0.1 " . $ua->agent);
$ua->proxy(['http', 'ftp'] => 'http://www.crosscom.com');
:
:
:
:
} # sub post_sample
Thanks.
------------------------------
Date: 21 Sep 2000 11:58:25 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: how to add months in Perl?
Message-Id: <m3d7hxu1fy.fsf@dhcp11-177.support.tivoli.com>
yudelin@my-deja.com writes:
> Hi,
>
>
> Does Perl have a function (or Module) can do adding months easily? What
> I am looking for is some function similar to add_months(d,n) function in
> Oracle, so you can just put a date (d) and the number of months(n) and
> get a results back. For example, a date of '31-mar-00' with n= "-1"
> should give you '29-feb-00' (be able to take care of leap year issue),
> not '31-feb-00' or '28-feb-00'.
>
> Can Date::Calc do this?
Yes.
$ perldoc Date::Calc
[snip]
o `($year,$month,$day) = Add_Delta_YMD($year,$month,$day,
$Dy,$Dm,$Dd);'
This function serves to add a years, months and days
offset to a given date.
[snip]
If the resulting date happens to fall on a day beyond
the end of the resulting month, like the 31st of April
or the 29th of February (in non-leap years), then the
day is replaced by the last valid day of that month in
that year (e.g., the 30th of April or 28th of February).
[snip the rest]
So...
$ perl -MDate::Calc=Add_Delta_YMD -le '
print join":"=>Add_Delta_YMD(2000,3,31,0,-1,0)'
Gives: 2000:2:29
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Thu, 21 Sep 2000 16:51:18 GMT
From: esper@news.visi.com (Dave Sherohman)
Subject: Re: Interpolation on the fly
Message-Id: <slrn8skf46.1cf.esper@pchan.dojo>
On Thu, 21 Sep 2000 16:57:41 +0100, Nicolas MONNET <nico@monnet.to> wrote:
> Needless to say, he who uses this kind of construct
> with $user a user provided value in any kind of interactive
> program, and most specifically CGIs, is bound to experience
> various security issues ...
Absolutely. I'm using it on sysadmin-provided values, which could be argued
to be only slightly better, but I figure we're talking about a perl script
here and the sysadmin could just edit the script itself with the same effect.
(Even worse, although I'm printing it now, to work out the details, it's
ultimately going to be passed to system() or exec()... The point is actually
to allow a system-specific command to be placed in a config file so the
sysadmin doesn't need to edit the script itself.)
Anyone who does that with input obtained from an untrusted source deserves
what they get.
--
"Two words: Windows survives." - Craig Mundie, Microsoft senior strategist
"So does syphillis. Good thing we have penicillin." - Matthew Alton
Geek Code 3.1: GCS d- s+: a- C++ UL++$ P+>+++ L+++>++++ E- W--(++) N+ o+
!K w---$ O M- V? PS+ PE Y+ PGP t 5++ X+ R++ tv b+ DI++++ D G e* h+ r++ y+
------------------------------
Date: Thu, 21 Sep 2000 19:06:07 +0200
From: adrian@duual.com (Adrian Harris)
Subject: IO::Socket advice
Message-Id: <adrian-2109001906070001@192.168.0.109>
Can anyone point me to some documentation/tutorials onine that go beyond
the official IO::Socket and IO::Select module documentation?
Thanks in advance,
Adrian
------------------------------
Date: Thu, 21 Sep 2000 12:59:27 -0700
From: Steve Leibel <stevel@bluetuna.com>
Subject: Re: IP Address
Message-Id: <stevel-D4BBBD.12592721092000@news.dnai.com>
In article <MPG.14325fd11004d18698968a@news.siol.net>, Marvin
<ales.romaniuk@zag.si> wrote:
> Hello !
>
> I would like to make a CGI form and that every person can submit only
> once. Is there any function that returns IP of remote host properly
> (remote_addr() returns always "").
>
> Thanks
I don't think uniquing on IP addr will help, because most people are on
dialups with dynamic IP addrs. They will have a different IP addr each
time they reconnect.
Another try might be with cookies. That way they'd have to either use a
different computer or else clear their cookie file in order to submit
twice.
------------------------------
Date: Thu, 21 Sep 2000 10:45:30 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: IP Address
Message-Id: <39CA493A.836C1A32@vpservices.com>
Steve Leibel wrote:
>
> In article <MPG.14325fd11004d18698968a@news.siol.net>, Marvin
> <ales.romaniuk@zag.si> wrote:
>
> > Hello !
> >
> > I would like to make a CGI form and that every person can submit only
> > once.
> ...
> Another try might be with cookies. That way they'd have to either use a
> different computer or else clear their cookie file in order to submit
> twice.
<off_topic>
Or they could turn cookies off or use a browser that doesn't enable them
in the first place.
Yes you could disenfranchize anyone who lacked a cookie-enabled browser
or who turned off cookies, but then you would also be disenfranchizing
anyone coming from a situation where multiple people use the same
computer (a school, a library, an internet cafe, a public access center,
etc.). Your cookie "solution" penalizes the honest users (especially
those who can not afford an individual computer) to protect against the
dishonest ones and, as you mention, it wouldn't even be fully effective
against the dishonest ones.
</off_topic>
--
Jeff
------------------------------
Date: Fri, 22 Sep 2000 01:11:40 +1000
From: "Chris Saunders" <Chris%2BSaunders@one.net.au>
Subject: Re: ITS BEYOND ME!
Message-Id: <39ca24fd@pink.one.net.au>
Thankyou, most constructive of you.
The point is I DON'T have a Unix machine, and I have a script that appears
to require one.
If you've got any more useful suggestions, like perhaps learning how to lay
bricks every time I need to fix a crack in my wall, please feel free to let
me know. I was after the kind help of someone who could point me in the
right direction, and I am grateful to those who did.
Forgive me for thinking that this was one of the great benefits of the
internet and the pooling of global knowledge.
I'm off to learn how to make shoes now, cuz my lace just came undone.
Abigail <abigail@foad.org> wrote in message
news:slrn8sk77k.5fq.abigail@alexandra.foad.org...
: Chris Saunders (Chris%2BSaunders@one.net.au) wrote on MMDLXXVIII
: September MCMXCIII in <URL:news:39c9e424@pink.one.net.au>:
: // Hiya,
: // I am a graphic designer, which means that (for now at least) I am a
: // not-particularly-brilliant web-designer. And my perl skills are
: // non-existent. I've managed to cheat, however, by downloading a freebee
from
: // an address I got from a link through Dreamweaver.
: //
: // My problem: I have tried to create a form for the first time. Done it
ok,
: // and downloaded a perl script that seems to have the features I need
(judging
: // by the descriptions), but its readme talks about server cgi_bins and so
: // forth.
: //
: // WTF? Is it referring to a Unix machine, in which case I know nothing
about
: // it.
: //
: // I am just a poor little button clicker trying to set up a form, I have
some
: // programming knowledge, but not in perl or any scripting.
: //
: // How can I use this script (or any other that I dl) to process my form
(just
: // a simple post to my email address)?
:
: Go learn Perl. And if you need to do something on a Unix machine and need
: Unix knowledge, go ahead and learn. Or perhaps you should hire someone
: to do the work. Please don't come here to be spoon fed.
:
: // Anyone that can help me I will be more than happy to provide you with
any
: // equal graphic design services to compensate your time and expertise.
: //
: // I have a copy of the form (the whole website if you want it, its only
about
: // 600kb) and the script (13k) with its readme files.
: //
: // Seriously, I would be so grateful to anyone that could help me out
here, its
: // a business website, and I'm tryna construct an order form for a new
: // business.
:
: All the more the reason to hire a professional.
:
:
:
: Abigail
: --
: sub camel
(^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
: h[{e
**###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
:
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@
#@);
: print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.|
|d)&&$llama."\n");
------------------------------
Date: Thu, 21 Sep 2000 16:40:18 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: ITS BEYOND ME!
Message-Id: <SRqy5.197$CN6.106310@news.uswest.net>
"Chris Saunders" <Chris%2BSaunders@one.net.au> elucidates:
> If you've got any more useful suggestions, like perhaps learning how to lay
> bricks every time I need to fix a crack in my wall, please feel free to let
> me know.
If you don't know how to fix a crack in your wall, and you need it fixed,
you have two options.
Pay someone else, or learn it yourself.
> I was after the kind help of someone who could point me in the
> right direction, and I am grateful to those who did.
The answer to your questions can't be had here. They are gleaned from
study and experience. Your best bet, as someone with no experience at
all is your local book store, or public library.
It's not here. This isn't a help desk.
--
"Civilization rests on two things: the discovery that fermentation
produces alcohol, and the voluntary ability to inhibit defecation.
And I put it to you, where would this splendid civilization be without
both?" --Robertson Davies "The Rebel Angels"
------------------------------
Date: Thu, 21 Sep 2000 10:26:48 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: ITS BEYOND ME!
Message-Id: <39CA44D8.71E9F6E4@vpservices.com>
Chris Saunders wrote:
>>> ... downloaded a perl script
>>> ... its readme talks about server cgi_bins and so forth.
>>> ... WTF? Is it referring to a Unix machine?
>>
>> [snip: advice from others to go back to square one]
>>
> Forgive me for thinking that this was one of the great benefits
> of the internet and the pooling of global knowledge.
>
> I'm off to learn how to make shoes now, cuz my lace just came undone.
If you come to a newsgroup about gloves and ask why your shoe keeps
falling off your ear, don't be surprised when people suggest you learn
some basics before proceeding.
There is no necessary connection between CGI, Perl, and UNIX. You need
to learn the basics of what a CGI script is and how it operates before
proceeding to mucking with a particular script or a particular language
or a particular operating system. If you think you can skip that step,
you are mistaken. A baisc book on the web or on CGI would be a good
place to start.
--
Jeff
------------------------------
Date: Thu, 21 Sep 2000 10:05:00 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Joining strings
Message-Id: <MPG.1433df9bb18ba88098ada7@nntp.hpl.hp.com>
In article <4a013293d4g.soper@soundhouse.co.uk> on Wed, 20 Sep 2000
23:11:57 +0100, Geoff Soper <g.soper@soundhouse.co.uk> says...
> In article <MPG.1432c3406758f13498ada3@nntp.hpl.hp.com>,
> Larry Rosler <lr@hpl.hp.com> wrote:
> > Perl would tell you why not, if you tested for failure of the operation
> > and printed a diagnostic that included $!. The reason doesn't have to
> > do with string concatenation. Your way works fine, and there are many
> > other ways too.
>
> I actually stripped the error reporting out for the sake of simplicity
> while quoting!
A poor policy for posting in this newsgroup, which supports checking for
the success of OS requests at every opportunity. As the arguments were
formatted correctly, if the rename function failed it had to be due to
an OS condition which would be reported in $!.
> > The curly brackets separate the symbol $location from the desired
> > suffix. Many would leave the trailing '/' off of $location, and use it
> > as a separator:
>
> > ... ">$location/file" ...
>
> I don't quite understand this, I leave the last '/' off when setting the
> variable up? So is the '/' reserved and results in the end of a string
> name? And if it's reserved how does it come to still put itself between
> the path and name as I require?
No, '/' is not reserved to signify the end of an identifier. An
identifier is a string that begins with a letter and contains only
alphanumerics or underscore. So the '/' delimits the symbol and is
literally part of the final concatenated string.
...
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 21 Sep 2000 10:22:33 -0700
From: Sarah Officer <OfficerS@aries.tucson.saic.com>
Subject: More Debugging - Please Help
Message-Id: <39CA43D9.14EC41CF@aries.tucson.saic.com>
I did more debugging of my stuff (I didn't write it), and I found
that I am failing to open the gdbm file on the silicon graphics
machine. It works fine on the solaris box. Now I'm really curious
about the architecture that BLUEARCHTOP is using.
Sarah
officers@aries.tucson.saic.com
Sarah Officer wrote:
>
> Help! We have upgraded to 5.6.0 from 00502, and I find that our
> GDBM_FIle hashes (using the Tie::Hash stuff) work on Solaris but not
> on our Silicon Graphics machines. Bluearchtop: what platform are
> you using? We have gdbm 1.8.0.
>
> The error message I get is:
>
> "Can't call method "FETCH" on an undefined value at
> /ATMS/Scripts/gdbm.pl line 23."
>
> The line in question is $ref->FETCH line. Any ideas of why this
> would work on a Sun (Solaris 2.8) and not Silicon Graphics (IRIX6.5)
> would be appreciates. Maybe bluearchtop & I are having the same
> problem?
>
> sub FETCH{
> my $self = shift ;
> my $ref = $self->{'gdbm'};
> $ref->FETCH(@_) ;
> }
>
> Thanks,
>
> Sarah
> officers@aries.tucson.saic.com
>
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4396
**************************************