[16256] in Perl-Users-Digest
Perl-Users Digest, Issue: 3668 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 14 14:06:38 2000
Date: Fri, 14 Jul 2000 11:05:26 -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: <963597926-v9-i3668@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 14 Jul 2000 Volume: 9 Number: 3668
Today's topics:
Re: A Newbie Perspective [Was Re: ATTENTION PERL MACHO <care227@attglobal.net>
Re: A Newbie Perspective [Was Re: ATTENTION PERL MACHO <mhofer@jpmorgan.com>
Re: Another newbie seeks help and assistance... nobull@mail.com
Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! <thunderbear@bigfoot.com>
Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! <jeffahill@lucent.com>
Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!! <rhomberg@ife.ee.ethz.ch>
Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!! <russ_jones@rac.ray.com>
Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!! (NP)
Re: ATTENTION PERL MEATHEADS <godzilla@stomp.stomp.tokyo>
Re: cookies <cal@iamcal.com>
Re: Creating a directory with perl on Solaris 2.6 nobull@mail.com
detecting commonly misspelled words <brian@my-deja.com>
Re: Does file locking in perl on rh6.2 linux just not w (M.J.T. Guy)
Re: Error from unsupported lookbehind (M.J.T. Guy)
Re: file endings with regexps... <mhofer@jpmorgan.com>
Re: file endings with regexps... <bart.lateur@skynet.be>
Re: file endings with regexps... <care227@attglobal.net>
Re: file endings with regexps... <mhofer@jpmorgan.com>
Re: file endings with regexps... <care227@attglobal.net>
Re: File::Find example (M.J.T. Guy)
Flock unsupported on which systems? <toddg@linux45.ma.utexas.edu>
Re: Flock unsupported on which systems? (Michel Dalle)
Re: Flock unsupported on which systems? <samara_biz@hotmail.com>
Re: Getting a host's local ip addresses nobull@mail.com
Help with database access via DBI... <agarian@my-deja.com>
Re: how to append lines to the end of file <fabascal@gredos.cnb.uam.es>
Re: how to convert "1.2.3.10" to "01020310"? <bart.lateur@skynet.be>
Re: how to convert "1.2.3.10" to "01020310"? <godzilla@stomp.stomp.tokyo>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 14 Jul 2000 11:19:38 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: A Newbie Perspective [Was Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!]
Message-Id: <396F2F8A.3B3EA2F3@attglobal.net>
Elaine -HFB- Ashton wrote:
>
> Philip Lees wrote:
> > I'm struggling on with Perl, but I don't expect to get any help from
> > this newsgroup.
>
> You are a wise person.
>
Elaine,
By saying the above, you seem to imply that no one is able to get
help from the people in this NG, one of those people being yourself.
There are 3 reasons that I see people come to this NG for:
1. To help out
2. To get help on a specific problem
3. To learn Perl
Which group do you fit in? If you are here to learn or to solve a
specific problem, then you must recognize that there are people here
who can help you. If you are here to help, then you would believe
that this is a good place for others to seek aid. Your continuing
presence in this NG conflicts with your statments regarding the
nature of this group, and makes me think you are just here to stir
the shit, which is also contradictory to your comments.
Kinda hypocritical, I say.
------------------------------
Date: Fri, 14 Jul 2000 11:49:47 -0400
From: "Michael D. Hofer" <mhofer@jpmorgan.com>
Subject: Re: A Newbie Perspective [Was Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!]
Message-Id: <396F369B.A8657A91@jpmorgan.com>
Drew Simonis wrote:
>
> Elaine -HFB- Ashton wrote:
> >
> > Philip Lees wrote:
> > > I'm struggling on with Perl, but I don't expect to get any help from
> > > this newsgroup.
> >
> > You are a wise person.
> >
>
> Elaine,
> By saying the above, you seem to imply that no one is able to get
> help from the people in this NG, one of those people being yourself.
> There are 3 reasons that I see people come to this NG for:
>
> 1. To help out
> 2. To get help on a specific problem
> 3. To learn Perl
[snippage]
you forgot, perhaps
4. Write me a script/do my homework project for free, please?
--
Michael D. Hofer
------------------------------
Date: 14 Jul 2000 17:10:32 +0100
From: nobull@mail.com
Subject: Re: Another newbie seeks help and assistance...
Message-Id: <u9og40u1zb.fsf@wcl-l.bham.ac.uk>
paul.linehan@datalex.ie (Paul Linehan) writes:
> the title explains my situation
Yes it does. However this is an inappropriate thing for it to do. If
you want to go fishing and can't start your car then "want to go
fishing" describes your situation, "can't start my car" tells people a
lot more about your problem.
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> we have a few Unix boxes lying around here and
> I want to use some perl on them.
Yes, but that fact does not make Unix questions on-topic in this
newsgroup any more than car repair would be on-topic in
rec.outdoors.fishing.
Actually having read your post again I now realise you are not asking
any questions at all. Maybe you did have a Perl question that you
intended to ask and were just setting the scene but then forgot to ask
the question.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 14 Jul 2000 17:36:06 +0200
From: =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <396F3366.375F7F72@bigfoot.com>
p3rlc0dr@my-deja.com wrote:
> ? Perhaps this will, by extension, cure your affliction as well.
>
> CAN YOU WRITE ME A GUESTBOOK PLEASE?
Why don't you ask Godzilla (frequent poster here)?
She will most probably be happy to share her talents as well
as views.
--
Thorbjørn Ravn Andersen "...plus...Tubular Bells!"
http://bigfoot.com/~thunderbear
------------------------------
Date: Fri, 14 Jul 2000 11:04:15 -0500
From: Jeff H <jeffahill@lucent.com>
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <396F39FF.53764FA5@lucent.com>
The WebDragon wrote:
> All you do is shout at us lately. :P
Maybe in addition to not knowing English very well, she doesn't know where the
Caps Lock key is, either!
------------------------------
Date: Fri, 14 Jul 2000 18:25:20 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!!!!!
Message-Id: <396F3EF0.E48AB61A@ife.ee.ethz.ch>
Jeff H wrote:
>
> The WebDragon wrote:
> > All you do is shout at us lately. :P
>
> Maybe in addition to not knowing English very well, she doesn't know where the
> Caps Lock key is, either!
She should probably use the Microsoft Certified Method to turn off the
capslock: reboot
- Alex
------------------------------
Date: Fri, 14 Jul 2000 10:39:44 -0500
From: Russ Jones <russ_jones@rac.ray.com>
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!
Message-Id: <396F3440.5902F9BA@rac.ray.com>
NP wrote:
> <kidding emphasis="REALLY">
> Since I've bought all of Randal's books and I'm sure that he's loaded--
> I personally wouldn't mind if he bought me a beer next time. :-)
> </kidding>
Loaded on all that beer?
--
Russ Jones - HP OpenView IT/Operatons support
Raytheon Aircraft Company, Wichita KS
russ_jones@rac.ray.com 316-676-0747
Quae narravi, nullo modo negabo. - Catullus
------------------------------
Date: Fri, 14 Jul 2000 17:08:50 GMT
From: nvp@spamnothanks.speakeasy.org (NP)
Subject: Re: ATTENTION PERL MACHOES!!!!!!!!!!!!!!!
Message-Id: <COHb5.36984$t91.444201@news4.giganews.com>
On Fri, 14 Jul 2000 10:39:44 -0500, Russ Jones <russ_jones@rac.ray.com> wrote:
: NP wrote:
: > <kidding emphasis="REALLY">
: > Since I've bought all of Randal's books and I'm sure that he's loaded--
: > I personally wouldn't mind if he bought me a beer next time. :-)
: > </kidding>
:
: Loaded on all that beer?
What beer? I'm not gonna drink any if I have to buy it all myself. :-)
--
Nate II
------------------------------
Date: Fri, 14 Jul 2000 10:34:06 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: ATTENTION PERL MEATHEADS
Message-Id: <396F4F0E.A6E4365D@stomp.stomp.tokyo>
Thorbjørn Ravn Andersen wrote:
> p3rlc0dr@my-deja.com wrote:
> > ? Perhaps this will, by extension, cure your affliction as well.
> > CAN YOU WRITE ME A GUESTBOOK PLEASE?
> Why don't you ask Godzilla (frequent poster here)?
> She will most probably be happy to share her talents as well
> as views.
Might as well ask me. Based on my long observations
of this group, there are only three of us regulars
left here capable of true Perl programming. Ironically,
all three of us are female.
Perhaps you have encountered one of my guestbook
scripts out on the net. Mine are those guestbooks
which crash your system when you try to crash one
of my guestbooks. I am sure you personally have
experienced this oddity.
Godzilla!
------------------------------
Date: Fri, 14 Jul 2000 16:51:15 +0100
From: "Cal Henderson" <cal@iamcal.com>
Subject: Re: cookies
Message-Id: <MFGb5.390$Ew5.8559@news6-win.server.ntlworld.com>
: I have done cookies before and had no trouble--But for some reason when I
: put
:
: my $cookname='favorite';
: my $packedcookie=cookie(-NAME=>$cookname,
: -VALUE=>$favo,
: );
: print header(-COOKIE=>$packedcookie);
:
: it prints the cookie code on a HTML page. Its the same code I used in the
: past with no trouble...Any Ideas why it's not generatating a cookie?? Why
: is it generating a page like this(which is what the cookie code should
look
: like-but it comes up on an HTML page):???
:
: Set-cookie:
:
favorite=1.%3Ca%20href%3D%22http%3A%2F%2Fwww.ej-ses.com%2Fsunglass%2Fcgi%2Fs
:
how%2Fangel%2FINV%2Fgidget.inv%22%3Eangel%20gidget%3C%2Fa%3E2.%3Ca%20href%3D
:
%22http%3A%2F%2Fwww.ej-ses.com%2Fsunglass%2Fcgi%2Fshow%2Fangel%2FINV%2Fspryt
:
e.inv%22%3Eangel%20spryte%3C%2Fa%3E%3CBR%3E3.%3Ca%20href%3D%22http%3A%2F%2Fw
:
ww.ej-ses.com%2Fsunglass%2Fcgi%2Fshow%2Fangel%2FINV%2Fpurrr.inv%22%3Eangel%2
:
0purrr%3C%2Fa%3E%3CBR%3E4.%3Ca%20href%3D%22http%3A%2F%2Fwww.ej-ses.com%2Fsun
: glass%2Fcgi%2Fshow%2Fangel%2FINV%2Fpurrr.inv%22%3Eangel%20purrr%3C%2Fa%3E;
: path=/cgi-bin/ Date: Thu, 13 Jul 2000 18:04:32 GMT Content-type: text/html
:
: Thanks for any help
Since this code would usually appear in the header, you must be printing a
header before printing this. The cookie code needs to go before the header
is printed.
--
Cal Henderson
sub a{my$a=reverse shift;$a=~y/b-z/a-y/;unshift@a,$a;}sub b{$c.=reverse
shift; while(length($c)>=$b[0]){a(substr($c,0,$b[0]));$c=substr($c,$b[0]);
shift@b;}}@b=(6,3,5,4,10,6,4,4,2,1);$a="l?jouipv"."ezvmxpbuxih";$a.=
",jofoqqibmzamsfsfxfjtuiIg";while($a ne ""){b(substr($a,0,2));$a=
substr($a,2);}print join(" ",@a);
------------------------------
Date: 14 Jul 2000 17:06:17 +0100
From: nobull@mail.com
Subject: Re: Creating a directory with perl on Solaris 2.6
Message-Id: <u9sntcu26e.fsf@wcl-l.bham.ac.uk>
"Mike Mesarch" <mesarch2@cs.com> writes:
> $mode = sprintf"%04o", $mode & 07777;
Remove this line. It is the cause of your problem.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 14 Jul 2000 17:05:55 GMT
From: Brian <brian@my-deja.com>
Subject: detecting commonly misspelled words
Message-Id: <8knh96$lbc$1@nnrp1.deja.com>
Does anyone know if there are any packages out there that will suggest
a correction for a misspelled word. I.e. return 'coffee' for 'cofee' or
'coffe'?
Does anyone have any experience in writing one?
I searched CPAN but came up with nothing.
--
--Brian
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 14 Jul 2000 17:03:25 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Does file locking in perl on rh6.2 linux just not work?
Message-Id: <8knh4t$r3u$1@pegasus.csx.cam.ac.uk>
Frank Samuelson <fwslsm@cnsp.com> wrote:
>
>The following script prints:
>->0<-
>immediately, no matter how many incarnations of it I start within
>5 seconds of each other. bucko is in the local directory on a
>local filesystem.
Well, that tells you that flock() has failed. But if you refuse to
look at $!, you're unlikely to discover *why* it failed.
Mike Guy
------------------------------
Date: 14 Jul 2000 16:46:05 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Error from unsupported lookbehind
Message-Id: <8kng4d$q94$1@pegasus.csx.cam.ac.uk>
Peter B. Ensch <peterbe@home.com> wrote:
>> >
>> > I want to use the positive lookbehind construct
>> > (?<=PATTERN) as in:
>
>No. It's supported on my home system (perl 5.005_03) but
>not at work (perl 5.005).
It's been present in all versions of Perl since 5.005.
From pod/perlre.pod in perl5.005:
=item C<(?E<lt>=pattern)>
A zero-width positive lookbehind assertion. For example, C</(?E<lt>=\t)\w+/>
matches a word following a tab, without including the tab in C<$&>.
Works only for fixed-width lookbehind.
I find that perl5.005 accepts the syntax without complaint.
5.005 is an odd version of Perl to be running. It was never publically
released as it had bugs on at least some platforms. The first public
version of perl5.005_xx was perl5.005_02. It's possible you're running
into one of those bugs.
So upgrade.
Mike Guy
------------------------------
Date: Fri, 14 Jul 2000 11:04:58 -0400
From: "Michael D. Hofer" <mhofer@jpmorgan.com>
Subject: Re: file endings with regexps...
Message-Id: <396F2C1A.E77CA6CB@jpmorgan.com>
Okay, but why not
my $path = "/mitglied/sd.fjn.sdf.html";
my $ending = (split '\.',$path)[-1];
??
jason wrote:
>
> sept00@my-deja.com wrote ..
> >I'm trying to get a file ending out of a variable. Now I've been trying
> >to solve it with a regexp for about an hour (online documentation and
> >books as well) and I really can't get it to work, so this is what I've
> >got:
> >
> > $path = "/mitglied/sdfjnsdf.html";
> > $ending = $path;
> >
> > @temp = split ('\.', $ending);
> > $length = scalar @temp;
> >
> > $ending = @temp[$length - 1];
> >
> >How can this be done in a simple regexp?!?
>
> no need to use a regex .. you know the character you're looking for ..
> and you want everything after the right-most one of them
>
> this seems to be what you're trying to get (excuse me if I adjusted your
> input slightly)
>
> my $path = "/mitglied/sd.fjn.sdf.html";
>
> my $ending = substr $path, rindex( $path, '.') - length($path) +1;
>
> --
> jason -- elephant@squirrelgroup.com --
--
Michael D. Hofer
Internet Services
212 235 6415
------------------------------
Date: Fri, 14 Jul 2000 18:28:20 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: file endings with regexps...
Message-Id: <8teumsceuu832lhuvpcdruev761g5mmsiu@4ax.com>
Michael D. Hofer wrote:
>Okay, but why not
>
>my $path = "/mitglied/sd.fjn.sdf.html";
>my $ending = (split '\.',$path)[-1];
my $path = "/my/file/has/no/extension/oops";
--
Bart.
------------------------------
Date: Fri, 14 Jul 2000 12:28:48 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: file endings with regexps...
Message-Id: <396F3FC0.D4691612@attglobal.net>
"Michael D. Hofer" wrote:
>
> Okay, but why not
>
> my $path = "/mitglied/sd.fjn.sdf.html";
> my $ending = (split '\.',$path)[-1];
>
> ??
my $path = '.hidden_file';
------------------------------
Date: Fri, 14 Jul 2000 13:33:36 -0400
From: "Michael D. Hofer" <mhofer@jpmorgan.com>
Subject: Re: file endings with regexps...
Message-Id: <396F4EF0.5333B763@jpmorgan.com>
Drew Simonis wrote:
>
> "Michael D. Hofer" wrote:
> >
> > Okay, but why not
> >
> > my $path = "/mitglied/sd.fjn.sdf.html";
> > my $ending = (split '\.',$path)[-1];
> >
> > ??
>
> my $path = '.hidden_file';
returns 'hidden_file', the last part of the filename, since _ isn't a
path-or-file-name-part-delimiter in any of the common systems we see.
bart's right, though, it doesn't work for
my $path = '/oops/this/one/has/no/extension';
although the original spec is incomplete,
should it return the whole path (it does now), or
'extension', which isn't really an extension or filetype designator, or
'', which is what I lean towards.
What did the original requestor want?
--
Michael D. Hofer
------------------------------
Date: Fri, 14 Jul 2000 13:53:42 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: file endings with regexps...
Message-Id: <396F53A6.6E47A36D@attglobal.net>
"Michael D. Hofer" wrote:
>
> Drew Simonis wrote:
> >
> > "Michael D. Hofer" wrote:
> > >
> > > Okay, but why not
> > >
> > > my $path = "/mitglied/sd.fjn.sdf.html";
> > > my $ending = (split '\.',$path)[-1];
> > >
> > > ??
> >
> > my $path = '.hidden_file';
>
> returns 'hidden_file', the last part of the filename, since _ isn't a
> path-or-file-name-part-delimiter in any of the common systems we see.
>
My point exactly. The OP will get the file name instead of the
file extension. I think the OP is stuck in a Windows world where
extensions mean something.
------------------------------
Date: 14 Jul 2000 17:10:26 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: File::Find example
Message-Id: <8knhi2$r8e$1@pegasus.csx.cam.ac.uk>
Graham Wood <graham.wood@iona.com> wrote:
>I've been writing heretical scripts using the Unix find command to list all
>files below a specified directory and would like to become orthodox and
>start using perl modules to do it instead.
>
>I've read the perldoc File::Find entry but I think I missed something in
>there.
>
>Can someone show me a script that does the equivalent of just:
> find * -print
>ie just find and list all the files, using the File::Find module?
You can easily construct File::Find examples using the find2perl
utility installed with Perl.
Mike Guy
------------------------------
Date: 14 Jul 2000 16:27:47 GMT
From: Todd Gillespie <toddg@linux45.ma.utexas.edu>
Subject: Flock unsupported on which systems?
Message-Id: <8knf23$dle$1@geraldo.cc.utexas.edu>
Hi, I'm recoding a few scripts to work on an indefinite number of systems; right now I'm using flock to
control access to the data files, but a co-worker told me that flock isn't supported on several
OS'es. I didn't find evidence of that in the documentation. (Is there a perldoc called 'things perl
passes to the OS, which will screw you over'?)
So does anyone here know a) better docs, or b) unsupported systems?
thanks for anyone's time.
------------------------------
Date: Fri, 14 Jul 2000 16:37:53 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Flock unsupported on which systems?
Message-Id: <8knfr4$ec2$1@news.mch.sbs.de>
In article <8knf23$dle$1@geraldo.cc.utexas.edu>, Todd Gillespie <toddg@linux45.ma.utexas.edu> wrote:
>Hi, I'm recoding a few scripts to work on an indefinite number of systems;
> right now I'm using flock to
>control access to the data files, but a co-worker told me that flock isn't
> supported on several
>OS'es. I didn't find evidence of that in the documentation. (Is there a
> perldoc called 'things perl
>passes to the OS, which will screw you over'?)
>
>So does anyone here know a) better docs, or b) unsupported systems?
>
a) try "perldoc perlport"
b) see answer in a)
HTH,
Michel.
------------------------------
Date: Fri, 14 Jul 2000 13:31:06 -0400
From: "Alex T." <samara_biz@hotmail.com>
Subject: Re: Flock unsupported on which systems?
Message-Id: <396F4E5A.29A6B256@hotmail.com>
"perldoc perlport" doesn't say flock() is not supported on Windows systems... So would it be safe to
assume that it IS supported?
Thanks!
Alex
Michel Dalle wrote:
> In article <8knf23$dle$1@geraldo.cc.utexas.edu>, Todd Gillespie <toddg@linux45.ma.utexas.edu> wrote:
> >Hi, I'm recoding a few scripts to work on an indefinite number of systems;
> > right now I'm using flock to
> >control access to the data files, but a co-worker told me that flock isn't
> > supported on several
> >OS'es. I didn't find evidence of that in the documentation. (Is there a
> > perldoc called 'things perl
> >passes to the OS, which will screw you over'?)
> >
> >So does anyone here know a) better docs, or b) unsupported systems?
> >
>
> a) try "perldoc perlport"
> b) see answer in a)
>
> HTH,
>
> Michel.
------------------------------
Date: 14 Jul 2000 17:07:48 +0100
From: nobull@mail.com
Subject: Re: Getting a host's local ip addresses
Message-Id: <u9r98wu23v.fsf@wcl-l.bham.ac.uk>
"Christoph Vogel" <Christoph.Vogel@Corbach.de> writes:
> Does someone know about a way to get an array of local ip addresses
> (e.g. eth, ppp, slip) without processing the output of unix/linux'
> ifconfig?
Install SNMP on your machine and interogate the
ip.ipAddrTable.ipAddrEntry.ipAdEntAddr table using the SNMP modules
from CPAN.
There are other ways (using sockets and IOCTLs directly or the /proc
filesystem just as ifconfig or the SNMP agent do) but they are less
portable.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 14 Jul 2000 16:59:02 GMT
From: Agarian <agarian@my-deja.com>
Subject: Help with database access via DBI...
Message-Id: <8kngsb$kub$1@nnrp1.deja.com>
Hello,
I hope someone here can shed a little light on the following problem
for me. I have Sybase ASA 6.0.3, apache 1.3.12, DBI 1.13 and DBD::ASAny
1.07, Perl 5.005_03 running on Linux (Slackware 7.0)
I have a script that I can run as user 'www' it runs flawlessly at the
command prompt but when I call the same script from a browser I get the
following error in my apache error_log file...
DBI->connect failed: unknown error 2385 (DBD: login failed) at
./router_selection.pl line 3
Can't call method "prepare" on an undefined value at
./router_selection.pl line 4.
I put the line `touch /wwwroot/touchfile`; in the script and the user
and group were the same as I had used to run it from the command prompt.
The command line I use to start the server is:
dbeng6 -ud -n ENGINE_NAME database.db
and my connection string (line 3 of router_selection.pl) is
use DBI;
my $dbh =
DBI->connect("DBI:ASAny:","UID=dba;PWD=sql;ENG=ENGINE_NAME","na");
The apache webserver runs under user 'www' as well.
Does anybody have any suggestions...
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 14 Jul 2000 17:17:45 +0200
From: Federico Abascal <fabascal@gredos.cnb.uam.es>
To: tvn007@my-deja.com
Subject: Re: how to append lines to the end of file
Message-Id: <396F2F19.41D51D67@gredos.cnb.uam.es>
> Here what I have so far:
>
> #########################################
> $data_file ='test.file';
> open(SCORES,$data_file)|| die "cannot open test file";
>
> $i=0;
> $expression = "p_S|p_X";
> while (<SCORES>){
>
> chomp;
> if ($_ =~ /$expression/){
> $i++;
> }
>
> }
>
> if ($i <500){
>
> $line_to_add = 500 - $i;
>
> # can some one show me how to add
> # extra lines at the end of test.file so that
> the total number of line is 500 lines?
> where each line is: XXX
>
>
You can do this (if I understood you):
close(SCORES)
open(SCORES, ">>".$data_file) {
for($i = 0; $i < $line_to_add; $i++) {
print SCORES "what you want\n";
}
}
je, je, check if you get 409, 500 or 501 lines and modify the program
Regards,
Federico
------------------------------
Date: Fri, 14 Jul 2000 18:28:18 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: how to convert "1.2.3.10" to "01020310"?
Message-Id: <rleumscsrofagjb2gmm2du0qph02jff4h7@4ax.com>
Godzilla! wrote:
>Test One Input: 2.1.3.14
>Test One Output: 2010314
I think you'll find you're missing a leading zero (for the 2).
My personal attempt would look like:
$output = join '', map { sprintf "%02d", $_ } split /\./, $input;
--
Bart.
------------------------------
Date: Fri, 14 Jul 2000 10:22:52 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: how to convert "1.2.3.10" to "01020310"?
Message-Id: <396F4C6C.E194212F@stomp.stomp.tokyo>
Bart Lateur wrote:
> Godzilla! wrote:
> >Test One Input: 2.1.3.14
> >Test One Output: 2010314
> I think you'll find you're missing a leading zero (for the 2).
Hmm.. I see this now. He does want a zero upfront.
$string = "0$string";
Thank you for pointing this out although I have
a feeling this thread is just another one of the
many bogus threads here.
Godzilla!
------------------------------
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 3668
**************************************