[11773] in Perl-Users-Digest
Perl-Users Digest, Issue: 5373 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 13 14:07:44 1999
Date: Tue, 13 Apr 99 11:00:21 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 13 Apr 1999 Volume: 8 Number: 5373
Today's topics:
Re: Best way to do this regexp? <cassell@mail.cor.epa.gov>
Re: Calling Oracle Stored Procedures from Perl (John D Groenveld)
Re: clueless message <Allan@due.net>
Converting from octal to decimal <mrizzo@ismd.ups.com>
Re: Creating an empty file. <gellyfish@gellyfish.com>
Re: does this directory exist <duke@anti.ccu.ut.ee>
Re: does this directory exist (Sam Holden)
Re: does this directory exist (David Cantrell)
Re: does this directory exist <cassell@mail.cor.epa.gov>
format markaw2091@my-dejanews.com
Re: Hash symbol '%' a stylized what? <cassell@mail.cor.epa.gov>
Re: Help: From Unix to NT <gellyfish@gellyfish.com>
Re: How to connect to WinNT Oracle database from Perl? (Gus)
Re: How to connect to WinNT Oracle database from Perl? <jwarner@tivoli.com>
Re: How to write a format to an array instead of a file <cassell@mail.cor.epa.gov>
Re: How to write a format to an array instead of a file branboles@netscape.net
Re: implement useradd in perl chris+usenet@netmonger.net
Re: Novice needs learning suggestions (Bart Lateur)
Re: Novice needs learning suggestions <gellyfish@gellyfish.com>
osdep.o source file ijg@csc.liv.ac.uk
Re: Pragma docs (Sam Holden)
Re: Pragma docs <Jochen.Stenzel.gp@icn.siemens.de>
Problem with my & local declarations (Mike Mckinney)
Re: Q: Hash tables!!! <cassell@mail.cor.epa.gov>
Re: SQL using the ODBC module (Gus)
start script at foreign server <pscheidt@writeme.com>
Re: TPJ still shipping? <gregm@well.com>
Re: TPJ still shipping? <cassell@mail.cor.epa.gov>
Re: Where we can get perl code snippets? (Randal L. Schwartz)
Re: Where we can get perl code snippets? <cassell@mail.cor.epa.gov>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 13 Apr 1999 10:48:53 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Best way to do this regexp?
Message-Id: <37138385.B443040E@mail.cor.epa.gov>
Greg McCann wrote:
>
> I am new to regexps and I am wondering if I have found the best way to extract
> the pathname from $0. This is what I came up with. I'm matching "/" or "\"
> because I don't know if this will be on a *nix or NT server (I'm working on NT
> now).
>
> Just in case I am entirely on the wrong track I should explain that my purpose
> is to determine the absolute path of my script's home directory so that my
> script can know where to locate files which are always in the same place
> relative to the script's home directory, even if the script is moved to a
> different system or run from a different directory. If there is a better way to
> do this please let me know. I've tried using relative paths in the script, but
> they always seem to be relative to the directory that the script is run from,
> not the script's own home directory.
>
> #!/usr/bin/perl -w
> use strict;
>
> my $path_name = $0;
> print "My program is: $path_name\n";
>
> # return everything up to and including the last "/" or "\"
> $path_name =~ s/(.*[\/|\\]).*/$1/;
> print "It is in directory: $path_name\n";
>
> Greg
You might look at File::Basename instead.
And don't forget that $0 can be spoofed. The path from $0 might be
less than useful for your purposes. In your place, I would opt for
defining an environment variable with the path in it, and snatch that
out of the aether when in your program. That can be munged as well,
so YMMV.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: 13 Apr 1999 12:19:33 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Calling Oracle Stored Procedures from Perl
Message-Id: <7evqql$q0f$1@tholian.cse.psu.edu>
In article <3712fc3a.0@nnrp1.news.uk.psi.net>,
Oliver Henlich <ohenlich@conduitgroup.com> wrote:
>Has anyone ever managed to call oracle stored procedures from perl?
For the last several versions of DBD::Oracle, t/plsql.t has included
sample code. Goto http://www.cpan.org/ and download the newest tarball.
John
groenveld@acm.org
------------------------------
Date: Tue, 13 Apr 1999 13:09:58 -0400
From: "Allan M. Due" <Allan@due.net>
Subject: Re: clueless message
Message-Id: <7evtpc$60j$1@samsara0.mindspring.com>
For those of you who can still see my empty message. Sorry about that.
Tried to do something too quickly while distracted. A deadly combo.
AmD
------------------------------
Date: Tue, 13 Apr 1999 12:37:44 -0400
From: "Mike Rizzo" <mrizzo@ismd.ups.com>
Subject: Converting from octal to decimal
Message-Id: <7evrhd$sns6@innsrv.ismd.ups.com>
Ok, here is the deal, I have a value being returned from stat, from an
earlier question/answer I found out that the number is being returned as an
Octal number. The following code,
perl -e "printf('Mode is %0o',(stat($ARGV[0]))[2])" fn
prints out the octal number in a more usable and readable decimal
number, however when I try to run this little perl script,
******************************************
$oct = $ARGV[0];
$dec = oct($oct);
print "octal is $oct , decimal is $dec";
******************************************
The value I am getting in $dec is not correct,
When i pass it in 16895, I get the value of $dec to be 14, when in
fact should be 40777 according to the perl line above,
Any ideas as to why the the oct() function is not converting
the number properly.
Thanks
------------------------------
Date: 13 Apr 1999 16:59:51 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Creating an empty file.
Message-Id: <371369f7.0@newsread3.dircon.co.uk>
Steven Filipowicz <s.filipowicz@orades.nl> wrote:
>
>
> Sam Holden wrote:
>
>> perldoc -f open
>
> Does it automaticly create a file then?
Look :
fatmog:~/radius/blah$ ls
fatmog:~/radius/blah$ perl -e'open(BLAH,">blahfile");'
fatmog:~/radius/blah$ ls
blahfile
fatmog:~/radius/blah$ ls -al
total 2
drwxr-xr-x 2 tdcjs users 1024 Apr 13 16:59 ./
drwxr-xr-x 4 tdcjs users 1024 Apr 13 16:58 ../
-rw-r--r-- 1 tdcjs users 0 Apr 13 16:59 blahfile
fatmog:~/radius/blah$
Happy now ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: 13 Apr 1999 16:18:52 GMT
From: Anti Veeranna <duke@anti.ccu.ut.ee>
Subject: Re: does this directory exist
Message-Id: <7evqpc$t3e$1@kadri.ut.ee>
jewing@eng.utoledo.edu wrote:
: How can I check that a directory exists?
: if my directory is $mDir/images
: what should I use?
if (-e "$mdir/images") { ... do something ... }
Anti
------------------------------
Date: 13 Apr 1999 16:27:47 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: does this directory exist
Message-Id: <slrn7h6s43.4bb.sholden@pgrad.cs.usyd.edu.au>
On Tue, 13 Apr 1999 11:48:18 -0400, jewing@eng.utoledo.edu wrote:
>I found an answer, but if there is a shorter way could someone post it
>please
>John
>
>#------------------------------------------------------------------
># This subroutin checks to see if the file past is a directory
># It returns 1 if it is and 0 if it is not.
>#------------------------------------------------------------------
>sub check_if_dir
>{
> local ($file_name) = @_;
> open(infile, "$file_name") or &error_open_file($file_name);
> local (@filedata) = stat(infile);
> local ($file_type_mode) = $filedata[2];
> local ($dir_flag)=0;
> $dir_flag = 0;
> if ($file_type_mode >= 16000 && $file_type_mode < 17000){
> $dir_flag = 1;
> }
> return "$dir_flag";
>}
sub check_if_dir
{
-d $_[0];
}
It returns true or false as opposed to 1 ot 0 - which I suspect is much
more useful anyway.
Of course you wouldn't really wrap it up in a function...
--
Sam
Perl is the Cliff Notes of Unix.
--Larry Wall
------------------------------
Date: Tue, 13 Apr 1999 16:31:55 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: does this directory exist
Message-Id: <3713713a.5073234@news.insnet.net>
On Tue, 13 Apr 1999 11:48:18 -0400, jewing@eng.utoledo.edu enlightened
us thusly:
>I found an answer, but if there is a shorter way could someone post it
>please
Look into if(-d ...)
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Tue, 13 Apr 1999 10:09:20 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: does this directory exist
Message-Id: <37137A40.75D69E3E@mail.cor.epa.gov>
Anti Veeranna wrote:
>
> jewing@eng.utoledo.edu wrote:
> : How can I check that a directory exists?
>
> : if my directory is $mDir/images
> : what should I use?
>
> if (-e "$mdir/images") { ... do something ... }
>
> Anti
But that has the disadvantage that it will also appear to be true if
the images directory does *not* exist, and a plain file named images
is there instead. Use the -d flag instead of -e and you won't have
that problem.
HTH,
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Tue, 13 Apr 1999 15:56:56 GMT
From: markaw2091@my-dejanews.com
Subject: format
Message-Id: <7evpg3$5hk$1@nnrp1.dejanews.com>
Hi there,
Following on from my previous problem (which I am grateful for the help) I now
have a problem with the "format" function. Using it within the context of my
Perl Script is not a problem, but I am having problems trying to format it.
here is a snippet of my code:
format frm_Report =
@<< @<<<<<<<<<< ^*
$counter, lc($&), $descrip
.
What I am looking to achieve is:
1 file1.pl This is my description. As you can now
see there is a new line/carriage return
and as such I want the paragraph to be formated
like this.
2 file2.pl This is the second entry. No LF/CR.
3 file3.pl This is the 3rd line. Again, no LF/CR.
Instead I am getting:
1 file1.pl This is my description. As you can now
see there is a new line/carriage return and as such I want the paragraph to be
formated
like this.
2 file2.pl This is the second entry. No LF/CR.
3 file3.pl This is the 3rd line. Again, no LF/CR.
I was under the impression that using the ^* would ensure the layout was
continuous. Any advice greatly welcomed at mawilliams@walsh-international.com
or maw@markaw.demon.co.uk. BTW, I am using perl on win32.
Regards,
-MAW-
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 13 Apr 1999 10:59:27 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Hash symbol '%' a stylized what?
Message-Id: <371385FF.F6EA2CD9@mail.cor.epa.gov>
Matthew O. Persico wrote:
>
> Jonathan Stowe wrote:
> >
> > On 12 Apr 1999 07:40:16 -0700, gerg@shell1.ncal.verio.com (Greg
> > Andrews) wrote:
> >
> > >damian@cs.monash.edu.au (Damian Conway) writes:
> > >>
> > >> 4. Perl Institute known as Department of Perl Affairs.
> > >>
> > >
> > >s/Department/Ministry/ perhaps?
> > >
> >
> > It depends whether this body will be headed by A Secretary of State
> > for Perl Affairs or a Minister for Perl Affairs of course ...
> >
> > /J\
>
> Ok, two questions:
>
> 1) How do we go about getting Larry to be knighted? Or should we just go around calling him Sir Larry anyway?
It might be easier to get him certified. [c.f. the FAQ]
> 2) If Sir Larry were Brittish, what animal would have been the Perl Mascot? Certainly not a camel, yes?
And why not? The British Empire wasn't afraid to use the appropriate
beast
of burden in any clime. And Peter O'Toole sure made camels look like
the
thing to use in the desert in 'Lawrence of Arabia'...
^^^^^^^^
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: 13 Apr 1999 17:20:02 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help: From Unix to NT
Message-Id: <37136eb2.0@newsread3.dircon.co.uk>
Eckbert Dollhofer <eckbert.dollhofer@at.siemens.de> wrote:
> Could anybody help me? I know how to run perl scripts (as CGI) on UNIX
> but now I have to do the same on NT. I would like to know what changes
> have to be made.
> Is it correct to replace the line #!/usr/local/bin/perl by nameoffile.pl
> ?
> When I use a path do I have to writ wwwroot/myname/nameoffile od do type
> wwwroot\myname\nameoffile ?
> and so on.
> I would try this on my own but our firewall-team needs a lot of time to
> install th files in the cgi-bin.
The majority of these are server questions and best asked in a group
that is interested in servers. Some of your questions are answered in
the burgeoning documentation that comes with more recent ActiveState
Perl distributions.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Tue, 13 Apr 1999 16:02:31 GMT
From: spg@quokka.com (Gus)
Subject: Re: How to connect to WinNT Oracle database from Perl?
Message-Id: <37136963.44777636@news.earthlink.net>
DBD::Oracle works fine on NT.
The following connects to my Oracle DB on NT..
If you have multiple instances running, you will need to add the SID
of the db you want to use.
my $dbh = DBI->connect("dbi:Oracle:", "username", "password")
|| die "Cant connect to $DSN: $DBI::errstr";
my $mysql = "SELECT * FROM SOMETABLE" ;
my $sth = $dbh->prepare($mysql) || print "Can't prepare statement";
my $rc = $sth->execute || print "Can't execute SQL Statement";
$rc = $dbh->disconnect;
gus
On Tue, 13 Apr 1999 07:24:24 GMT, agniora@usa.net wrote:
>I looked at the DBD::Oracle module, but the documentation contains only the
>how-to for Oracle on Linux, but with NT it would be different, and i dont know
>much about Oracle DBA etc so i would need more specific details as to what
>to look for, what file to change and what else to do to connect to Oracle.
>could someone please help.
>let me know also at the following email
>smnayeem@agni.com
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 13 Apr 1999 09:15:36 -0500
From: John Warner <jwarner@tivoli.com>
Subject: Re: How to connect to WinNT Oracle database from Perl?
Message-Id: <37135188.920850BA@tivoli.com>
Once you have DBI and DBD::Oracle modules installed, you need to set up a System
DSN to point to your Oracle database. After that you can do something like the
following to connect to your Oracle database:
local $dbh, $sth;
local $srvr = 'System_DSN_Name_Here';
local $uname='read';
local $upwd='only';
local $dbtype='Oracle';;
die "Cannot do \$dbh->connect: $DBI::errstr\n" unless $dbh =
DBI->connect($srvr,$uname,$upwd,$dbtype);
#...build SQL statement string here...
&execSQL($sqlstmt);
sub execSQL{
my $count = 0;
my @row;
$sth = $dbh->prepare("@_") or die "Couldn't prepare: \n\t@_\nError:
$DBI::errstr\n";
$sth->execute() or die "Couldn't execute: \n\t@_\nError: $DBI::errstr\n";
while( @row = $sth->fetchrow()) {
$array[$count]=$row[0];
$count++;
}
if (defined $sth){$sth->finish;}
&sortResults(@array); #Performs a Schwartzian Transformation on @array.
See the Perl FAQs.
}
Hope this helps...
agniora@usa.net wrote:
> I looked at the DBD::Oracle module, but the documentation contains only the
> how-to for Oracle on Linux, but with NT it would be different, and i dont know
> much about Oracle DBA etc so i would need more specific details as to what
> to look for, what file to change and what else to do to connect to Oracle.
> could someone please help.
> let me know also at the following email
> smnayeem@agni.com
--
John Warner Tivoli Systems Inc.
Sales Support Engineer 9442 Capital Of Texas Hwy North
Sales Infrastructure Group Austin, TX 78759
john_warner@tivoli.com
------------------------------
Date: Tue, 13 Apr 1999 10:19:42 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: How to write a format to an array instead of a filehandle?
Message-Id: <37137CAE.639C1D36@mail.cor.epa.gov>
Uri Guttman wrote:
>
> >>>>> "DC" == David Cassell <cassell@mail.cor.epa.gov> writes:
>
> DC> branboles@netscape.net wrote:
> >>
> >> I am trying to use a format and write it to an array instead of it going to
> >> standard output. I would like to do something like this:
> >>
> >> @newarray=write FORMAT;
> >>
> >> I don't want to use a temporary file, if I can get around it. Is there any
> >> way to do this? Any help would be greatly appreciated! THANKS!
>
> DC> Umm, pardon my confusion, but why? Really, I'd like to know.
>
> i don't know his reasons but i could imagine some very easily. i tend to
> build strings before i print them so i can send them to multiple places.
Good point. Still, I was curious, since I see this coming far more
frequently from web-coders.
> DC> write() sends output to a filehandle. It isn't designed for outputting
> DC> to a named array, which is *not* a filehandle.
>
> but the format stuff has a func called formline which does exactly what
> the poster wants. it formats to $^A. see perlform for more info.
Neat. I learn stuff all the time from reading this ng.
> DC> If you're trying to set up tables on a website, this isn't the way
> DC> to go. Proportional fonts won't pay any attention to your
> DC> alignment.
>
> true but he didn't mention nor hint that this was a web related
> request. but format could be used on the web with some fixed font html
> like PRE, etc.
Perhaps. But for most of my needs, sprintf() is more useful and
more flexible. YMMV.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Tue, 13 Apr 1999 17:44:22 GMT
From: branboles@netscape.net
To: tchrist@mox.perl.com
Subject: Re: How to write a format to an array instead of a filehandle?
Message-Id: <7evvpl$b9l$1@nnrp1.dejanews.com>
Due to no one else's fault but my own, I guess it wasn't obvious to me in the
manpage. I think that I am better off using 'sprintf'. But, needless to
say, I now have one more weapon to add to my (small) arsenal of Perl
knowledge! :) Thanks for everyone's input. It has been (as usual) a
tremendous help.
Brandon Boles
branboles@netscape.net
In article <37135ec5@cs.colorado.edu>,
tchrist@mox.perl.com (Tom Christiansen) wrote:
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc,
> branboles@netscape.net writes:
> :I am trying to use a format and write it to an array instead of it going to
> :standard output.
>
> Just convert my swrite() function in perlfunc(1) to an array thing
> instead. Was it not obvious in the manpage?
>
> --tom
> --
> I know I'm a pig-ignorant slut. --Andrew Hume
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 13 Apr 1999 17:46:59 GMT
From: chris+usenet@netmonger.net
Subject: Re: implement useradd in perl
Message-Id: <7evvuj$q4n$1@schenectady.netmonger.net>
In article <m13e247bt7.fsf@halfdome.holdit.com>,
Randal L. Schwartz <merlyn@stonehenge.com> wrote:
> And I never saw the need for a crutch like "useradd", except to
> implement local policy (mail aliases here, standard .cshrc there). So
> when people ask for "useradd", I tend to respond "Well, you'll need to
> customize it almost entirely, so why are you asking for a stock one?"
So they don't have to reinvent the whole wheel, probably reinventing
the same old mistakes and security holes all over again?
The minimum, I suppose, is "edit the passwd file, create a directory,
and set its ownership". Well, that's not so trivial once you start
doing it. "edit the passwd file" involves locking. On FreeBSD it
also involves rebuilding a database. There are some things there
that make me nervous to consider an experienced sysadmin but novice
Perl programmer trying to automate.
Personally, I feel that one of the biggest problems with computing
today is that programmers forget (or perhaps subconsciously block out)
what these machines are actually capable of. And then when someone says
"why are you typing six commands to add a user instead of letting the
machine do the work?", we say "bah, that's just a crutch!"
I don't consider it a crutch that my newsreader inserts headers and a
signature, and tells my editor to put the cursor between them, instead
of making me type "References: <7enmqb$6n4$1@dove.qut.edu.au>
<x7g165p3rb.fsf@home.sysarch.com> <37133DE4.3891D3E6@home.com>
<m13e247bt7.fsf@halfdome.holdit.com>" by hand. Now, I appreciate
the fact that they are there, and that I could edit them.. one of
the things I hate most in the world about the Microsoft/Apple way
of doing things is the lack of control they give you. But I try
to keep in mind that if there's a possibility that the program can
work a little harder to guess what the user wants and make that the
easy choice (while keeping the hard things possible), it should be
done.
Whoops, I meant to just say the first sentence. These rants keep
forcing themselves out.
--
Christopher Masto <chris+usenet@netmonger.net>
Director of Operations, NetMonger Communications, Inc.
"Behold the Power of Cheese"
------------------------------
Date: Tue, 13 Apr 1999 16:08:08 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Novice needs learning suggestions
Message-Id: <3713696e.9541351@news.skynet.be>
[posted and mailed]
m_stelly@my-dejanews.com wrote:
>Where can a start-from-scratch CGI novice best learn quickly about using
>PERL? I am familiar with other web languages, but I'm now itching to learn
>how to get more power out of my pages.
Well... there are some books available on programming CGI with Perl.
Check out the critiques at <www.perl.com>.
Online: check out the links on
<http://reference.perl.com/query.cgi?section=cgi>. There are also the
dedicated sites like Webmonkey and the articles from Brent Michalski on
WebReview <http://webreview.com/wr/pub/Perl>. And there's Randal L.
Schwartz' WebTechniques columns on
<http://www.stonehenge.com/merlyn/WebTechniques/>.
There. More than enough to get you started.
Bart.
------------------------------
Date: 13 Apr 1999 17:17:04 -0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Novice needs learning suggestions
Message-Id: <37136e00.0@newsread3.dircon.co.uk>
m_stelly@my-dejanews.com wrote:
> Hi all,
>
> Where can a start-from-scratch CGI novice best learn quickly about using
> PERL? I am familiar with other web languages, but I'm now itching to learn
> how to get more power out of my pages.
>
Whats a web language ? And are you sure that Perl is one ?
I would start at:
<http://www.perl.com>
Where you will begin to discern some of the directions to follow.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
------------------------------
Date: Tue, 13 Apr 1999 15:57:15 GMT
From: ijg@csc.liv.ac.uk
Subject: osdep.o source file
Message-Id: <7evpgm$5hp$1@nnrp1.dejanews.com>
Hi all,
Anyone know what the osdep.c/osdep.o library does?
The Cclient.pm module seems to use it to do a remsh (Lord alone knows why it
needs to). I can't read all of the source here at work and I suspect it has
something to do with the Perl source code (could be wrong though).
So if some illumination could be provided, (even a few stabs in the dark may
help) I would appreciate it.
--
Ian J. Garlick
<ijg@csc.liv.ac.uk>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 13 Apr 1999 16:05:47 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Pragma docs
Message-Id: <slrn7h6qqr.2ms.sholden@pgrad.cs.usyd.edu.au>
Hr. Jochen Stenzel <Jochen.Stenzel.gp@icn.siemens.de> wrote:
>> >I'm searching for the docs about pragmas and think there was a website
>> >anywhere about it, under "underdocumented features" or so. I cannot find
>> >it again. Does somebody know where this pages are located? Or where I
>> >can found ALL pragmas documented?
>>
>> 'perldoc perlmodlib' lists the pragmas.
>> 'perldoc <pragma>' gives documentation on a particular pragma.
>>
>> I'm assuming perlmodlib lists 'ALL' pragmas, if not then I guess it is time
>> to submit a bug report (although the wording doesn't say it lists all the
>> pragmas).
>
>Thanks for this, I searched the docs (even by "perldoc perl") but did not
>found this. Unfortunately, perlmodlib seems to be incomplete. I know there is
>a "fields" pragma which is not listet in perlmodlib ...
Yes I see that.
Does anyone know if that is an oversight? Or if it is due to be added later
(fields is newish after all)? Or if there is no intention of keeping
perlmodlib up to date?
You could try listing all the [a-z]*.pm files in the root of the perl
library directory... Not pretty, and I guess it might miss some...
I guess that makes the answer : ls /usr/lib/perl5/[a-z]*.pm
--
Sam
Some of you know what the Perl slogan on Windows is, and you can say it
with me: "It's a good thing there's more than one way to do it, because
most of them don't work." --Larry Wall
------------------------------
Date: Tue, 13 Apr 1999 18:23:24 +0200
From: "Hr. Jochen Stenzel" <Jochen.Stenzel.gp@icn.siemens.de>
Subject: Re: Pragma docs
Message-Id: <37136F7C.AA2B0988@icn.siemens.de>
> >Thanks for this, I searched the docs (even by "perldoc perl") but did not
> >found this. Unfortunately, perlmodlib seems to be incomplete. I know there is
> >a "fields" pragma which is not listet in perlmodlib ...
>
> Yes I see that.
>
> Does anyone know if that is an oversight? Or if it is due to be added later
> (fields is newish after all)? Or if there is no intention of keeping
> perlmodlib up to date?
I sent a bug report and Tom Christiansen answered that it will be added some day.
There is an up to date list on the web (the page I was looking for) at
http://www.perl.com/CPAN-local/doc/manual/html/lib/index.html.
> You could try listing all the [a-z]*.pm files in the root of the perl
> library directory... Not pretty, and I guess it might miss some...
>
> I guess that makes the answer : ls /usr/lib/perl5/[a-z]*.pm
Thank you for your help!
J. Stenzel
------------------------------
Date: Tue, 13 Apr 1999 17:29:25 GMT
From: mike@mike.local.net (Mike Mckinney)
Subject: Problem with my & local declarations
Message-Id: <slrn7h6vkv.14c.mike@mike.local.net>
I've written the following, but I can't seem to use either my or local to
delcare the variables, because it either breaks the code entirely, or reports
typographical errors. I realize the error is occuring because I'm using a
naked block for a redo, but I carefully read up on it in Learning Perl, and I
don't see why it won't work.
Below is the code :
}
sub CATALOG_ENTRY {
START : {
print "Enter the book title : ";
chomp( local $title = <STDIN> ); # can't use either my or local
^^^^^^^^^^^^
using either my or local keeps the variable from being used
later within the same function, CATALOG_ENTRY, so when I try
to join the variables, $title is undef
open( BOOK_FILE, "books.pdb" ) || die "Couldn't open books.pdb: $!";
while( <BOOK_FILE> ) {
if( /^$title:/i ) {
print "You have already cataloged this book.\n";
print "Start over ? ";
chomp( my $repeat = <STDIN> );
exit unless $repeat =~ /^y/i ;
redo START;
}
}
}
print "Who is the Author : ";
chomp( my $author = <STDIN> );
print "Is it fiction or nonfiction : ";
chomp( my $fictionor = <STDIN> );
print "What type of book is it ( mystery, horror, scifi, etc.. ) : ";
chomp( my $classification = <STDIN> );
print "Enter a rating for the book ( 1-10 ) : ";
chomp( my $rating = <STDIN> );
@book = join( ":", $title,$author,$fictionor,$classification,$rating );
open( BOOK_FILE, ">>books.pdb" ) || die
"Couldn't open books.pdb : $! ";
print BOOK_FILE @book,"\n" ;
close( BOOK_FILE ) || warn "Couldn't close books.pdb : $! ";
}
Any help or advice greatly appreciated.
--
mikemck@austin.rr.com
------------------------------
Date: Tue, 13 Apr 1999 10:35:52 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Q: Hash tables!!!
Message-Id: <37138078.2DAF254E@mail.cor.epa.gov>
Sam Holden wrote:
>
> Jim Kangosjdrvi <Jim.Kangosjarvi@Abc.se> wrote:
> >Hi
> >
> >When i create a hash table and then add 1000's of variables to it then it
> >grows few MB (ex. 5 MB).
> >And when i Delete all the Variables, the size of the hash table is still
> >several 5 MB.
> >
> >Why doesnt it decrease?
> >
> >Please, show a small Source example how i should write if i want to decrease
> >the database when i delete data from the hash table.
>
> Memory is cheap. Allocating memory takes time. Thus I suspect perl keeps
> the memory around to reuse later on. Since in most cases the hash will
> grow again.
>
> Even if perl did free the memory, there is a chance that it wouldn't be
> returned to the OS anyway. Depending on your OS of course (and your libc
> I guess).
Of the OS'es with which I have some familiarity, I can't think of one
off
the top of my head that will work this way. Your program can free
memory
that it can then use again, but that memory does not get reclaimed by
the
OS until your program exits. And not necessarily then either, with at
least one OS I can think of, which doesn't need to be mentioned by
name.
:-)
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: Tue, 13 Apr 1999 16:05:39 GMT
From: spg@quokka.com (Gus)
Subject: Re: SQL using the ODBC module
Message-Id: <37136b28.45230277@news.earthlink.net>
First guess is you have a problem with quotes, but without seeing
sample code, it's just a wild guess.
gus
On Tue, 13 Apr 1999 09:17:32 GMT, chatswood@my-dejanews.com wrote:
>I've been experimenting with the ODBC module for a web-based project, and have
>been reasonably successful using an sql command to get information out of an
>Access97 database.
>
>However, my current objective is to use an "insert into" statement to append a
>new record to the database. The SQL query itself works from inside Access but
>doesn't seem to operate via the ODBC connection.
>
>Any help appreciated?
>
>Maurice Kelly
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 13 Apr 1999 19:40:48 +0200
From: Markus Pscheidt <pscheidt@writeme.com>
Subject: start script at foreign server
Message-Id: <371381A0.26FF2CDE@writeme.com>
is there a way that a perl script can start another script on another
server which has root privileges?
--
## Markus Pscheidt alias pscheidt@writeme.com ##
homepage found at http://jota.sm.luth.se/~x97-mpt
------------------------------
Date: Tue, 13 Apr 1999 09:25:09 -0700
From: Greg McCann <gregm@well.com>
Subject: Re: TPJ still shipping?
Message-Id: <37136FE5.15A1C9CE@well.com>
Wappinger Mary wrote:
>
> Is The Perl Journal still shipping? I ordered a year's subscription and
> all the back issues almost a month ago, and I have yet to receive them.
> Mail to Mr. Orwant doesn't seem to be getting me anywhere.
>
> Has anyone else successfully purchased TPJ?
I ordered my subscription plus all back issues late last week and they arrived
Monday by priority mail. I was impressed by the quick service. Sounds like
something fell through the cracks in your case.
Greg
--
======================
Gregory McCann
http://www.calypteanna.com
"Be kind, for everyone you meet is fighting a great battle." Saint Philo of
Alexandria
------------------------------
Date: Tue, 13 Apr 1999 10:05:06 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: TPJ still shipping?
Message-Id: <37137942.87231194@mail.cor.epa.gov>
Greg McCann wrote:
>
> Wappinger Mary wrote:
> >
> > Is The Perl Journal still shipping? I ordered a year's subscription and
> > all the back issues almost a month ago, and I have yet to receive them.
> > Mail to Mr. Orwant doesn't seem to be getting me anywhere.
> >
> > Has anyone else successfully purchased TPJ?
>
> I ordered my subscription plus all back issues late last week and they arrived
> Monday by priority mail. I was impressed by the quick service. Sounds like
> something fell through the cracks in your case.
You should have received them some time ago. Any kleptomaniac closet
Perl freaks in your neighborhood? :-) Seriously, you might want to
check with TPJ. I ordered my back issues and subscription last month,
and the back issues came in five days. Arrived on my birthday, for a
nice birthday present. Issue #13 came in the mail last week.
David
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: 13 Apr 1999 09:00:38 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Where we can get perl code snippets?
Message-Id: <m1wvzg5x3t.fsf@halfdome.holdit.com>
>>>>> "=?euc-kr?B?udrBvrq5IChQYXJrLCBKb25nLVBvcmsp?=" == =?euc-kr?B?udrBvrq5IChQYXJrLCBKb25nLVBvcmsp?= <euc-kr> writes:
=?euc-kr?B?udrBvrq5IChQYXJrLCBKb25nLVBvcmsp?=> Where is perl code snippets??
=?euc-kr?B?udrBvrq5IChQYXJrLCBKb25nLVBvcmsp?=> Do you know?
Some fairly complete examples can be found at my magazine column
archives, along with some fairly readable (if occasionally obscure)
text...
http://www.stonehenge.com/merlyn/UnixReview/
http://www.stonehenge.com/merlyn/WebTechniques/
Thanks to Miller-Freeman for both paying me to do these columns, *and*
then letting me give them away for free after they've hit the street.
print "Just another Perl hacker,"
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Tue, 13 Apr 1999 10:12:46 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Where we can get perl code snippets?
Message-Id: <37137B0E.4BEF9F5B@mail.cor.epa.gov>
Randal L. Schwartz wrote:
>
> >>>>> "=?euc-kr?B?udrBvrq5IChQYXJrLCBKb25nLVBvcmsp?=" == =?euc-kr?B?udrBvrq5IChQYXJrLCBKb25nLVBvcmsp?= <euc-kr> writes:
>
> =?euc-kr?B?udrBvrq5IChQYXJrLCBKb25nLVBvcmsp?=> Where is perl code snippets??
> =?euc-kr?B?udrBvrq5IChQYXJrLCBKb25nLVBvcmsp?=> Do you know?
>
> [text snipped]
Boy Randal, it drives me nuts when you post these JAPH things in your
text as well as your sig. And I can't even get these to compile.
:-)
--
David Cassell, OAO
cassell@mail.cor.epa.gov
Senior Computing Specialist phone: (541)
754-4468
mathematical statistician fax: (541)
754-4716
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 5373
**************************************