[7633] in Perl-Users-Digest
Perl-Users Digest, Issue: 1259 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 1 23:17:17 1997
Date: Sat, 1 Nov 97 19:01:51 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 1 Nov 1997 Volume: 8 Number: 1259
Today's topics:
AutoLoad error using odbc.pm (Cornelius Griffin)
Re: Better ways to... <ase@seanet.com>
Re: CHMOD 755 PLEASE HELP!! (I R A Aggie)
Re: Continuations in perl? (Tushar Samant)
Re: Cookies <rootbeer@teleport.com>
file locking on win95 (Hussein)
help!: sfio compile problems, Solaris 2.6, gcc 2.7.2.3 afc@c2o.com
HELP: splitting a word in perl (Andy Rutledge)
Re: HELP: splitting a word in perl <smantri@osf1.gmu.edu>
Re: HELP: splitting a word in perl (Mike Stok)
IRC bot <serginho@mail.serve.com>
Re: Memory problems - how can I fix? (Jason Gloudon)
Re: Memory problems - how can I fix? (Ilya Zakharevich)
OLE, ADODB, can't call EOF()!? help... (Wesley)
Re: OPEN WON'T WORK IN PERL-WIN32? (Tad McClellan)
Re: Perl 5.004_04 is available (Maintenance Release 4 f <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: Perl aborts executing a program under a differend U (brian d foy)
Re: Perl for NT and ARGV parameters <ase@seanet.com>
Re: Perl Format Command <gnew@southernvirginia.edu>
Re: perl newbie needs help <rdaniel@surfsouth.com>
Re: Perl Suffix (Was: Can perl be maken to Compiler ins <dformosa@st.nepean.uws.edu.au>
Re: The Gecko Book (Learning Perl on Win32 Systems) <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Re: Unexplainable error: Useless use of private variabl <ase@seanet.com>
Unique Identifier (Maurizio Coppari)
Re: Unique Identifier (Tad McClellan)
Re: Unique Identifier <phousto@cse.dnd.ca>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 1 Nov 1997 15:59:26 -0500
From: Escrubb@att.net (Cornelius Griffin)
Subject: AutoLoad error using odbc.pm
Message-Id: <MPG.ec519bd9f2cb69b989680@netnews.att.net>
When using odbc.pm and the required drivers to access information
in an oracle database, I receive the error "Goto undefined subroutine
&AutoLoader::AUTOLOAD at c:\perl.... line 861".
The error occurs after the information has been successfully
retrieved.
Can anyone point me in the right direction to determine where I
may further check my configuration? or where I can find more information
on the AutoLoad functionality? Using NT4, Win32Perl build 307, updated
odbc.pll.
BTW, the error doesn't occur on 95 with the same configuration.
Thank you.
Cornelius
------------------------------
Date: Sat, 1 Nov 1997 17:18:47 -0800
From: "Allen Evenson" <ase@seanet.com>
Subject: Re: Better ways to...
Message-Id: <63gkcs$35i@q.seanet.com>
Matti Kinnunen wrote in article ...
>In article (Shetal N. Patel) writes:
>
> Here's how I'm doing this:
> $fmac=3D"123456789abc";
> @fmac=3D($fmac=3D~/(\S\S)(\S\S)(\S\S)(\S\S)(\S\S)(\S\S)/);
> $fmac=3Djoin(":",@fmac);
> print "$fmac\n";
>
> The print gives me "12:34:45:78:9a:bc" (unless I missed some syntax
> above). Any suggestions on how I could do this differently (more
> efficiently, faster, simpler, etc).
>
>Simpler :
>
>machine% echo "12ASD3456789" | perl -pe 's/(\S{2})/$1:/g'
>12:AS:D3:45:67:89:
>machine%
>--=20
>* matti.kinnunen@helsinki.fi *
>* http://universe.pc.helsinki.fi/~matti/contact.html *
>* +358-(0)40-593 50 91 but try first +358-(0)9-191 23978 *
#!/usr/bin/perl -w
$fmac=3D"123456789abc";
print join(":",($fmac =3D~/(\S\S)/g)),"\n";
works as well....
--------------
Allen S. Evenson <ase@seanet.com>
PGP fingerprint =3D 79 2F 58 0A EF 44 F9 72 14 27 C1 96 47 B4 E2 7F
------------------------------
Date: Sat, 01 Nov 1997 12:30:01 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: CHMOD 755 PLEASE HELP!!
Message-Id: <-0111971230010001@aggie.coaps.fsu.edu>
In article <3453C442.3E93@ontario.canada>, John W <nospam@ontario.canada> wrote:
+ Now which command, and what path do I use?
Did you consider asking your ISP? that _is_ why you're paying _them_
money, isn't it?
LART: this ain't a perl question, and we ain't the help desk.
Followups...
James
--
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: 1 Nov 1997 19:47:48 -0600
From: scribble@shoga.wwa.com (Tushar Samant)
Subject: Re: Continuations in perl?
Message-Id: <63gm44$hjm@shoga.wwa.com>
ajh@rtk.com writes:
>Does Perl support Scheme style continuations?
In my limited knowledge, I don't think call with current continuation
is available to the programmer. If you are only thinking about bits of
code, Perl scalars can refer to code (which can be a closure); a text-
book example would read like this:
sub fac {
my($n, $cont) = @_;
if ($n == 0) {
&$cont(1);
}
else {
fac($n-1, sub { my $f = shift; &$cont($n*$f) })
}
}
fac(5, sub { print shift });
This will print 5! as expected.
------------------------------
Date: Sat, 1 Nov 1997 08:01:38 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Lauri Laakso <lauri.laakso@samoilu.net>
Subject: Re: Cookies
Message-Id: <Pine.GSO.3.96.971101075742.5238D-100000@usertest.teleport.com>
On Sat, 1 Nov 1997, Lauri Laakso wrote:
> My cookies doesn't always work.
Well, I don't see any Perl problem in the Perl code that you posted. Maybe
the problem is in your implementation of the protocols. You should check
the docs, FAQs, and newsgroups relevant to the protocols that you're
using. Good luck!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: Sat, 01 Nov 1997 20:06:35 GMT
From: hussein@vt.edu (Hussein)
Subject: file locking on win95
Message-Id: <345b8bc1.187846174@news.vt.edu>
hi
i am trying to convert a set of perl scripts from a unix machine to
win95. however, the original code uses a lot of file locking and i've
just found out that flock is only available on NT. is there any other
way i can go about locking files ?
thanx
ttfn
hussein
------------------------------
Date: Sat, 01 Nov 1997 16:12:08 -0600
From: afc@c2o.com
To: kpv@research.att.com,afc@c2o.com
Subject: help!: sfio compile problems, Solaris 2.6, gcc 2.7.2.3
Message-Id: <878416806.27234@dejanews.com>
I'm trying to compile sfio on a fresh Solaris 2.6 machine using
gcc 2.7.2.3 which has has already itself compiled and installed cleanly
and compiled perl5.004 cleanly.
I made the recommended changes to the sfio makefile in order to get
iffe to use gcc and produce a decent FEATURE/sfio file. There was
a patch to sfhdr.h posted here but it was rejected on my version (a
recent download from AT&T Research) and it appears that the one-line
change it wanted to make had already been done.
Now, I get an error on the first file it tries to compile:
gcc -c -I. -O sfclose.c In file included from sfhdr.h:275, from
sfclose.c:1:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.6/2.7.2.3/include/sys/mman.h:14
9: parse error before `off64_t' *** Error code 1
While I'm inclined to think it's a compiler install or version problem,
the fact that it cleanly compiled and installed itself and perl5 makes
me think the compiler is okay.
Any ideas???
TIA,
AFC
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Sat, 01 Nov 1997 11:32:16 -0600
From: andyrut@usa.net (Andy Rutledge)
Subject: HELP: splitting a word in perl
Message-Id: <andyrut-0111971132170001@lnk1-ppp-1.binary.net>
Is there any way to split a string into an array with each element in the
array being a different letter of the string?
For example:
I'd like to split the word "computer" into an array [c,o,m,p,u,t,e,r]
using the split function. What pattern do I use (in split) to do this?
If you can help me out, please e-mail me at andyrut@usa.net
Thanks!
------------------------------
Date: Sat, 1 Nov 1997 14:11:25 -0500
From: shiva mantri <smantri@osf1.gmu.edu>
To: Andy Rutledge <andyrut@usa.net>
Subject: Re: HELP: splitting a word in perl
Message-Id: <Pine.OSF.3.95q.971101140921.19052A-100000@osf1.gmu.edu>
@array = split(//,$line);
shiva..
On Sat, 1 Nov 1997, Andy Rutledge wrote:
:::Is there any way to split a string into an array with each element in the
:::array being a different letter of the string?
:::
:::For example:
:::
:::I'd like to split the word "computer" into an array [c,o,m,p,u,t,e,r]
:::using the split function. What pattern do I use (in split) to do this?
:::
:::If you can help me out, please e-mail me at andyrut@usa.net
:::Thanks!
:::
:::
Shiva Mantri
---
7032738119,7039938736
------------------------------
Date: 2 Nov 1997 02:06:24 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: HELP: splitting a word in perl
Message-Id: <63gn70$pq5@news-central.tiac.net>
In article <andyrut-0111971132170001@lnk1-ppp-1.binary.net>,
Andy Rutledge <andyrut@usa.net> wrote:
>Is there any way to split a string into an array with each element in the
>array being a different letter of the string?
>
>For example:
>
>I'd like to split the word "computer" into an array [c,o,m,p,u,t,e,r]
>using the split function. What pattern do I use (in split) to do this?
@letter = split (//, 'computer');
will leave $letter[0] as 'c' etc.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: 2 Nov 1997 01:31:54 GMT
From: "Sergio Stateri Jr" <serginho@mail.serve.com>
Subject: IRC bot
Message-Id: <01bce72e$c364db50$01010ac0@serginho>
Hi ! I'm doing an IRC bot in Perl and I'm having any problems :
(/^:(\S+)\!\S* PRIVMSG SampaBot :canal(.+)/i) && &send_canal($1,$2,$3);
this line call the sub send_canal. I'd like to pass, per example :
canal #test my message...
then the bot'll send the message "my message..." to the channel #test,
but...When I do this, bot send only "my" to the channel...Is there any way
to put all the words after the "canal xxxxxxx" in an unique $variable ? I
know that what's happening now is because the "my" is $3 and "message..."
would be $4, but in this way I woudln't know how many $n I'd have...
Thanks for any help...
--
=================================
Sergio Stateri Jr
Sao Paulo (SP) Brazil
e-mail : serginho@mail.serve.com
=================================
------------------------------
Date: 1 Nov 1997 22:35:05 GMT
From: jgloudon@bbn.remove.com (Jason Gloudon)
Subject: Re: Memory problems - how can I fix?
Message-Id: <63gaqp$3fq$1@daily.bbnplanet.com>
M.J.T. Guy (mjtg@cus.cam.ac.uk) wrote:
: Tom Phoenix <rootbeer@teleport.com> wrote:
: >On Tue, 28 Oct 1997, Ryan wrote:
: But that raises a couple of other points:
: i) each element of the 1..100000 array is taking nearly 100 bytes.
: I know Perl is prodigal with memory, but this seems excessive.
Sure you are doing the right math ?
: ii) With the foreach, the test took 28 secs on my aging system. The
: for version took 38 secs. Conventional wisdom seems to have it
: that the C-style for is the fastest form of loop, but it appears
: not to be true here.
You must have forgotten (or didn't notice ) that perl does all arithmetic
using double arithmetic. Try putting use integer in or just before the
for loop. On aging hardware that can't sling doubles as fast as ints, like
the ancient 100Mhz pentium that I checked the difference on, this helps
a great deal. Something not often mentioned.
Jason Gloudon
------------------------------
Date: 2 Nov 1997 00:13:16 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Memory problems - how can I fix?
Message-Id: <63ggis$ocv$1@agate.berkeley.edu>
In article <63fai9$em0$1@lyra.csx.cam.ac.uk>,
M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
> Tom Phoenix <rootbeer@teleport.com> wrote:
> >On Tue, 28 Oct 1997, Ryan wrote:
> >
> >> foreach (1..100000) {
> >
> >As Ilya has pointed out, in current versions of Perl, this becomes a list
> >of 100000 scalars at compile time - and they stick around for your entire
> >script! My rule of thumb is that, if a list from .. may have more
> >than about 1000 elements, you should code it explicitly with something
> >like the three-part for loop.
> >
> > for ($_ = 1; $_ <= 100000; $_++) {
> >
> >Does that fix (most of) your memory problem?
>
> When I tried the original, it took 9.8M. With the for loop it took
> only 400k. So that does indeed explain the memory use.
>
> But that raises a couple of other points:
>
> i) each element of the 1..100000 array is taking nearly 100 bytes.
> I know Perl is prodigal with memory, but this seems excessive.
I think this is related to Perl upgrading all elements of the long
array from IV (small, circa 20byte/elt) to PVNV (big, circa 56
byte/elt), and you using non-effecient malloc.
Here are my results (with Jumbo Malloc patch, it might be - finally -
merged into 5.004_54):
I:\perlold>env PERL_DEBUG_MSTATS=2 perl -e "for (1..100000) {$i+=$_}"
Memory allocation statistics after compilation: (buckets 4(4)..528380(524288)
14116 free: 150 8 43 8 11 1 1 2 1 0 0 0 0 0 0 0 0
442 77 70 0 4
4912216 used: 105 119 146 54 5 7 3 3224 1 0 1 0 0 0 0 0 3
69 93 270 84 21
Total sbrk(): 5007360/65:163. Odd ends: pad+heads+chain+tail: 0+13444+0+67584.
Memory allocation statistics after execution: (buckets 4(4)..528380(524288)
10068 free: 150 8 43 8 11 1 1 1 0 0 0 0 0 0 0 0 0
442 77 29 0 4
7313260 used: 105 119 146 54 5 7 3 3225 1 0 1 0 0 0 0 0 3
69 93 100271 84 21
Total sbrk(): 7368704/78:176. Odd ends: pad+heads+chain+tail: 0+22848+0+22528.
I:\perlold>env PERL_DEBUG_MSTATS=2 perl -e "for (1..100000) {$t = $_; $i+=$t}"
Memory allocation statistics after compilation: (buckets 4(4)..528380(524288)
15768 free: 150 8 38 7 11 1 1 2 1 0 0 0 0 0 0 0 0
440 76 69 40 4
4912580 used: 105 119 151 55 5 7 3 3224 1 0 1 0 0 0 0 0 3
71 94 271 86 21
Total sbrk(): 5009408/65:163. Odd ends: pad+heads+chain+tail: 0+13476+0+67584.
Memory allocation statistics after execution: (buckets 4(4)..528380(524288)
14700 free: 150 8 38 7 11 1 1 1 1 0 0 0 0 0 0 0 0
440 76 67 40 4
4913648 used: 105 119 151 55 5 7 3 3225 1 0 1 0 0 0 0 0 3
71 94 273 86 21
Total sbrk(): 5009408/65:163. Odd ends: pad+heads+chain+tail: 0+13476+0+67584.
> ii) With the foreach, the test took 28 secs on my aging system. The
> for version took 38 secs. Conventional wisdom seems to have it
> that the C-style for is the fastest form of loop, but it appears
> not to be true here.
Not here.
Ilya
------------------------------
Date: 1 Nov 1997 17:28:26 GMT
From: wkc@amanda.dorsai.org (Wesley)
Subject: OLE, ADODB, can't call EOF()!? help...
Message-Id: <63forq$ks9@snews1.zippo.com>
Keywords: OLD, ADODB, ODBC, EOF
I got an error msg: Can't call method "EOF" without a package or object
reference at db.pl line 7.
The program db.pl:
use OLE;
$conn = CreateObject OLE "ADODB.Connection" ||
die "CreateObject: $!";
$conn->Open("myODBC","myID","myPassword");
$sql = "select * from myTable";
$RS = $conn->Execute($sql);
while(!$RS->EOF()) {
for ( $i = 0; $i < $RS->Fields->Count; $i++ ) {
print $RS->Fields($i)->value
}
$RS->MoveNext;
}
Pls heeelp...
Please email me at wkc@cetus.net
Thanks
Wesley
------------------------------
Date: Sat, 1 Nov 1997 17:08:40 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: OPEN WON'T WORK IN PERL-WIN32?
Message-Id: <opcg36.t52.ln@localhost>
John Grubb (jgrubb@gte.net) wrote:
: Just started trying to run a perl script on an NT server, running
: Netscape Enterprise Server. The script works fine except for openning
: the output file for appending. The script works fine on a Solaris server
: running Enterprise Server.
: The code follows:
: open (FILEHANDLE, ">>$file");
You should ALWAYS check the return value from open. In normal programming
and *especially* when you are having some problem related to opening
files:
open(FILEHANDLE, ">>$file") || die "could not open '$file' $!";
Maybe $! will contain something useful...
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 1 Nov 1997 11:26:40 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Perl 5.004_04 is available (Maintenance Release 4 for Perl5.004)
Message-Id: <63fvp9$djb@mtinsc04.worldnet.att.net>
John Nolan wrote in message <345B4F2F.68D0@voicenet.com>...
>Tim Bunce wrote:
>> The development track is focused on major enhancements to Perl and will
>> typically have a fairly long major release cycle. Work on 5.005 (which
>> will include threading and improved compiler support) is underway now.
>> Alpha releases for 5.005 have subversion numbers starting from 5.004_50.
> ^^^^^^^^^^
>
>So, Perl 5.005 will be subversive?
>
>I guess on Windows platforms it will perform illegal operations. :P
Thereby conforming to all of the other Windows programs on the market . . .
>
>--John Nolan
------------------------------
Date: Sat, 01 Nov 1997 17:15:15 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Perl aborts executing a program under a differend Uid
Message-Id: <comdog-ya02408000R0111971715150001@news.panix.com>
In article <345a8821.1398449@news-2.csn.net>, frelbel@csnN0SPAM.net wrote:
>Perl aborts with the following message:
>
>YOU HAVEN'T DISABLED SET-ID SCRIPTS IN THE KERNEL YET!
>FIX YOUR KERNEL, PUT A C WRAPPER AROUND THIS SCRIPT, OR USE -u AND
>UNDUMP!
>Anyone have any ideas on this?
>a) how to avoid/fix the perl problem
well, the error message gives you three options...
>b) another way to execute a perl script in another user's directory
>as that user?
have that user execute it?
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Sat, 1 Nov 1997 18:00:35 -0800
From: "Allen Evenson" <ase@seanet.com>
Subject: Re: Perl for NT and ARGV parameters
Message-Id: <63gmr8$3bu@q.seanet.com>
=20
Mark Nielsen wrote in article <6384bn$r56$1@auto.med.ohio-state.edu>...
>I usually Execute a perl script in a batch file or command like
>perl MyPerlScripts.pl $Argv1 $Argv2
>
>It always works for me.=20
>
>Mark=20
>
>
while I do this too I have run up against a problem. Suppose your using =
the standard
@rem =3D '--*-Perl-*--
@echo off
perl -x -S %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
@rem ';
#!perl -w
#line 8
generated by pl2bat.bat script supplied with win/dos perl distributions.
if you supply less than 9 arguments and want to pipe or redirect output. =
the msdos "shell" (if you can call it that) sucks up the redirection =
and/or piping and sends them to the perl interpreter. Perl may or may =
not have a problem with this depending on the application.
To get around this I usually run the script outside of it's .bat wrapper =
to get the "shell" to actually see the necessary commands.=20
I'm sure there's a way around this I just haven't discovered it yet.
--------------
Allen S. Evenson <ase@seanet.com>
PGP fingerprint =3D 79 2F 58 0A EF 44 F9 72 14 27 C1 96 47 B4 E2 7F
------------------------------
Date: Sat, 01 Nov 1997 18:30:10 -0500
From: "Gary C. New" <gnew@southernvirginia.edu>
Subject: Re: Perl Format Command
Message-Id: <345BBB81.1D25@southernvirginia.edu>
>
> I have not looked at that one. Probably because in gets only a two Camel
> rating at Tom Christiansen's "Camel Critiques" Perl book review page:
>
> http://language.perl.com/critiques/index.html
>
Thanks for the URL. I wish I would have known that before I bought
this one.
> Without seeing any code, we can't say much for sure, but:
>
> You declared your format to have the same name as the filehandle, or
> you are using select()?
How about this:
format STDOUT =
@*
$input
.
$input = 'This is a test. This is a test. This is a test. This is a
test. This is a test. This is a test. This is a test. This is a test.';
write;
# Now this is where I'm having the problem. I want to print the #
filehandle STDOUT using the print command, but to the screen. How #
would you accomplish this?
> I generally try to get a small example working from the command line
> before incorporating the code into a CGI script. Or, use CGI.pm for
> easy off-line debugging.
I'll try that.
>
> Glad to help.
>
> If you can find time to answer a few questions here yourself, you will
> have paid me back ;-)
>
Will do... Thanks again for your help.
--
Gary C. New
gnew@southernvirginia.edu
Resume: http://www.geocities.com/CapeCanaveral/4749/resume.htm
------------------------------
Date: Sat, 01 Nov 1997 19:59:38 -0500
From: Randy <rdaniel@surfsouth.com>
Subject: Re: perl newbie needs help
Message-Id: <345BD07A.23BF49B9@surfsouth.com>
Andy Sutorius wrote:
> I have looked at all the FAQ's I can possibly stand.
>
> I need to download a "freeware" editor so that I may write and compile
> and debug Perl. I have Perl 4 and 5 but nothing is making sense in how
> to get the program up and running.
>
> I am a fair C++ programmer but I do not have the editor on my computer
> anymore.
> How can I go about getting a program to code Perl for CGI?
>
> Please respond to sender andy@solution4u.com
> and group
>
> --
> Andy Sutorius
> Image Solutions
> visit http://www.sutorius.com
>
> ____International Webmasters Association____
> Charlotte, North Carolina Chapter
> *Chairman*
> http://www.irwa.org
I have used the Apache server to write simple cgi scripts. You have to
read the
documentation and set some variables for your system. Once you do that
then
you can start the httpd daemon and your browser to run scripts. As for an
editor,
I use vi and I make sure the first line is "#!/usr/bin/perl" and make
sure the file
is executable. (chmod 755 <filename>.The perl binary will do the rest. I
hope this helps.
------------------------------
Date: 1 Nov 1997 19:42:48 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Perl Suffix (Was: Can perl be maken to Compiler instead of interpreter?)
Message-Id: <878413305.381050@cabal>
In <34584915.168A7472@absyss.fr> Doug Seay <seay@absyss.fr> writes:
>? the platypus {aka David Formosa} wrote:
>>
>> I like it because it tells me what the things writton in. This way I know
>> weather to load it into my editor or hunt around for the sorce.
>Do your shell scripts end in .sh too?
Yes and No. By the use of a symbolic link my shell scrips both end in and
don't end in a .sh
--
Please excuse my spelling as I suffer from agraphia see the url in my header.
Never trust a country with more peaple then sheep.
Save the ABC Is $0.08 per day too much to pay? ex-net.scum and proud
I'm sorry but I just don't consider 'because its yucky' a convincing argument
------------------------------
Date: Sat, 1 Nov 1997 11:39:10 -0800
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: The Gecko Book (Learning Perl on Win32 Systems)
Message-Id: <63g0gn$fdu@mtinsc04.worldnet.att.net>
Cameron Dorey wrote in message <345A51C6.D0819DFA@mail.uca.edu>...
- * snip * -
>I would have only liked to see two minor changes: (1) another short
>appendix, listing the meanings of the Special Variables (the $whatevers)
>that are used in the book, since as it is you have to search for them
>through the index; and (2) a typeface for the program code with a more
>distinguishing {} symbol, since with my eyesight getting not so good, I
>mistook them for () too many times.
Well, the special $(whatever) variables are listed in depth in Programming
Perl, which now that you've finished the Gekko Book you certainly must get.
I bought the magenta Llama Book when it came time for me to learn the One
True Language because, frankly, it was cheaper than the Camel Book and it
looked like it would be good for someone just starting out. Two days later I
wished I'd bought the Camel Book at the same time. You're right, though,
about the braces. I couldn't get
$foo = %myhash($bar);
to work, and it frustrated me for five Internet days (that's about three
hours in objective time) until a friendly guru showed me the error of my
ways.
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
------------------------------
Date: Sat, 1 Nov 1997 17:08:03 -0800
From: "Allen Evenson" <ase@seanet.com>
Subject: Re: Unexplainable error: Useless use of private variable in void context
Message-Id: <63gjoo$345@q.seanet.com>
Baruch Even wrote in article ...
>Hello,
>
>I'm new to perl and trying to write my first program, I get the =
following
>message on a while clause: "Useless use of private variable in void =
context"
>
>I'm using use strict and a few more diagnostics pragmas but I cant find =
the
>reason to the problem.
>
>the loop goes as follows:
>
>my $fail =3D 0;
>my $banNbr =3D -1;
>
>while ($banNbr=3D=3D-1)
>{
> something...;
> if (something) { $banNbr =3D=3D 0 ;}
>}
>
>the error appears on the while section, and I cant figure the reason.
>
[snip]
Did you use -w ? Doing so should tell you that the line 'if =
(something) { $banNbr =3D=3D 0;}'
is your problem..
You want =3D not =3D=3D. =3D is for assignment =3D=3D is for numerical =
equality testing.
Hope that Helps,
----------------
Allen S Evenson <ase@seanet.com>
PGP fingerprint =3D 79 2F 58 0A EF 44 F9 72 14 27 C1 96 47 B4 E2 7F
------------------------------
Date: 1 Nov 1997 18:01:05 GMT
From: coppari@cirfid.unibo.it (Maurizio Coppari)
Subject: Unique Identifier
Message-Id: <63fqp1$161@sirio.cineca.it>
I need to generate an unique identifier, and I don't want to use a database (or
a file) just for this.
The identifier should be unique also when the process terminates (so I can't
use the process id $$).
I can concatenate the process id with other information like date and time, but
I suppose there is a better method.
Thank you for your attention and for any suggestions
Maurizio Coppari
------------------------------
Date: Sat, 1 Nov 1997 17:19:23 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Unique Identifier
Message-Id: <rddg36.a72.ln@localhost>
Maurizio Coppari (coppari@cirfid.unibo.it) wrote:
: I need to generate an unique identifier, and I don't want to use a database (or
: a file) just for this.
: The identifier should be unique also when the process terminates (so I can't
: use the process id $$).
: I can concatenate the process id with other information like date and time, but
: I suppose there is a better method.
That's basically it. PID and time in some form.
Perl FAQ, part 5:
----------------------------------------
=head2 How do I make a temporary file name?
Use the process ID and/or the current time-value. If you need to have
many temporary files in one process, use a counter:
BEGIN {
use IO::File;
use Fcntl;
my $temp_dir = -d '/tmp' ? '/tmp' : $ENV{TMP} || $ENV{TEMP};
my $base_name = sprintf("%s/%d-%d-0000", $temp_dir, $$, time());
sub temp_file {
my $fh = undef;
my $count = 0;
until (defined($fh) || $count > 100) {
$base_name =~ s/-(\d+)$/"-" . (1 + $1)/e;
$fh = IO::File->new($base_name, O_WRONLY|O_EXCL|O_CREAT, 0644)
}
if (defined($fh)) {
return ($fh, $base_name);
} else {
return ();
}
}
}
Or you could simply use IO::Handle::new_tmpfile.
----------------------------------------
: Thank you for your attention and for any suggestions
^^^^^^^^^^^^^^^
Use the docs, Luke.
grep temp *.pod | grep file
lead me to the answer in about 15 seconds (I'm a slow typist) ...
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 01 Nov 1997 23:35:16 GMT
From: Phil Houstoun <phousto@cse.dnd.ca>
Subject: Re: Unique Identifier
Message-Id: <345BBB0C.14064087@cse.dnd.ca>
Maurizio Coppari wrote:
>
> I need to generate an unique identifier, and I don't want to use a database (or
> a file) just for this.
>
> The identifier should be unique also when the process terminates (so I can't
> use the process id $$).
>
> I can concatenate the process id with other information like date and time, but
> I suppose there is a better method.
>
> Thank you for your attention and for any suggestions
> Maurizio Coppari
There may be a better method but that's exactly what we've been doing
to generate a unique id, concatenate pid and time (i.e. the time_t
datatype). It's worked well for over five years now.
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". 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 1259
**************************************