[13974] in Perl-Users-Digest
Perl-Users Digest, Issue: 1384 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 15 14:10:36 1999
Date: Mon, 15 Nov 1999 11:10:21 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942693021-v9-i1384@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 15 Nov 1999 Volume: 9 Number: 1384
Today's topics:
Re: Perl Wizards (David H. Adler)
Re: Perl-CPAN CD-ROM? + Best Linux Distrib for Perl? (Brett W. McCoy)
PerlShop, Minivend <jconsi@magicnet.net>
Please help me create a file with perl (Jonas Nilsson)
Re: Redirect to LOCAL file <flavell@mail.cern.ch>
Re: redirect() / exec() <gellyfish@gellyfish.com>
Re: Removing all combinations of spaces/tabs at end of (GlenHovde)
Re: Removing all combinations of spaces/tabs at end of <lr@hpl.hp.com>
Re: Secure Sockets ??? perlkeith@hotmail.com
Re: Serious memory leak in MacPERL? (Chris Nandor)
Slurping output form system(runme.exe) <hattons@cpkwebser5.ncr.disa.mil>
Re: Slurping output form system(runme.exe) <sariq@texas.net>
Sort by more than one element URGENT. <cbrunet@locus.ca>
Re: Sort by more than one element URGENT. <jeffp@crusoe.net>
Re: sort lists together <lr@hpl.hp.com>
Re: SQL query problems (newbie) <lr@hpl.hp.com>
Re: Strange Problems going on with DBD::Solid <gellyfish@gellyfish.com>
Re: Stripping off ^Ms from file <lr@hpl.hp.com>
Re: Stripping off ^Ms from file <mbridgwater@lmn.net>
Re: unwanted refresh with Apache server <newsposter@cthulhu.demon.nl>
Re: Using files (Brett W. McCoy)
Re: Which Search engine script? <gellyfish@gellyfish.com>
Re: Win32::ODBC use of uninitialized value warnings <hartleh1@westat.com>
Re: Writing binary files in perl <sjohns17@uic.edu>
Re: Writing binary files in perl <theglauber@my-deja.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 15 Nov 1999 13:45:38 -0500
From: dha@panix.com (David H. Adler)
Subject: Re: Perl Wizards
Message-Id: <slrn830l6c.fra.dha@panix.com>
On 13 Nov 1999 03:34:41 -0600, Abigail <abigail@delanet.com> wrote:
>David H. Adler (dha@panix.com) wrote on MMCCLXIV September MCMXCIII in
>~~
>~~ I'm a Perl Druid, if that's any help. :-)
>
>
>I hope you live close to Central Park....
Close enough... you can actually see it from my apartment. Well, you
can see a tiny sliver of it through the other buildings if you look
really hard, anyway... :-)
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
perl -e '$_ = (join "", (map (chr, (shift =~ /.../g))));print "$_\n"
;' 106117115116032097032110121032112101114108032104097099107101114
------------------------------
Date: Mon, 15 Nov 1999 18:52:02 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: Perl-CPAN CD-ROM? + Best Linux Distrib for Perl?
Message-Id: <slrn830lmk.39i.bmccoy@moebius.foiservices.com>
Also Sprach Mark Summerfield <summer@chest.ac.uk>:
>Which Linux distribution is the best for Perl work -- I'm defining
>'best' as being the one with the most Perl modules in addition to the
>standard ones, and best environment for Perl coding. At present I use
>Debian 2.1 which I find excellent in these regards except for the fact
>that it uses 5.004 and there are some features of 5.005, e.g. qr//, that
>I'd really like to use.
You don't have to be stuck with any version of Perl or any version of
Linux -- download the version of Perl you want and install it. I do it
all the time with Red Hat -- and without RPM!
--
Brett W. McCoy bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek) http://www.foiservices.com
FOI Services, Inc./DIOGENES 301-975-0110
---------------------------------------------------------------------------
------------------------------
Date: Mon, 15 Nov 1999 13:49:13 -0500
From: John Considine <jconsi@magicnet.net>
Subject: PerlShop, Minivend
Message-Id: <383055A9.5E9DB608@magicnet.net>
Has any one had experience using PerlShop, Minivend or anyother shopping
cart. Which one do you find more useful? Which one is better for larger
shopping carts? I am looking to use a shopping cart but want to invest
my time in learning the one that will provide the most benefit.
Thanks
------------------------------
Date: Mon, 15 Nov 1999 18:43:40 GMT
From: jonas.nilsson@mbox326.swipnet.se (Jonas Nilsson)
Subject: Please help me create a file with perl
Message-Id: <3831542b.105869973@news1.tninet.se>
Hello.
I don't know so much perl. I think a script that create a file should
look something like this, but I get a Internal Server Error all the
time. Does anyone know what's wrong please tell me. Thanks.
My script:
#!/usr/bin/perl
open(FILE,">>jonas") \n";
print FILE"Test\n";
close(FILE);
`chmod 666 jonas`;
Thanks
Jonas
------------------------------
Date: Mon, 15 Nov 1999 17:57:55 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Redirect to LOCAL file
Message-Id: <Pine.HPP.3.95a.991115174714.15434E-100000@hpplus01.cern.ch>
On Mon, 15 Nov 1999, Crawfishy wrote:
> I normally use the LOCATION header in my cgi's to redirect the browser to a
> new page
This is a CGI question, and doesn't even have a little bit of Perl in it
- not even if you happen to be programming in Perl; it belongs on
comp.infosystems.www.authoring.cgi (f'up)
> but as I understand it, you must use a full URL for location to
> work.
Then try re-reading the CGI spec again. The original one at
hoohoo.ncsa.uiuc.edu would suffice, I think.
You must use a full URL if you desire an external redirection
transaction to be performed, that much is true. With an absolute local
URLpath, the Location: CGI header also "works", but it does something
quite different.
> Is there a way to use a relative address to redirect.
The CGI specification requires either a fully-specified URL, or
an absolute local URLpath. The consequences of using a relative URL
are not defined.
> The reason for
> this is that if I put full urls and then move the pages/scripts to another
> server, I will have to redo all the urls.
No: the information that you need for computing the absolute URL is
right there in the CGI environment.
------------------------------
Date: 15 Nov 1999 12:39:42 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: redirect() / exec()
Message-Id: <80ouue$1et$1@gellyfish.btinternet.com>
On Sun, 14 Nov 1999 09:31:05 -0000 marcus armand wrote:
> Hello,
> I am new to perl so any help would be appreciated.
>
> I have a password script that validates and then redirects to another web
> site.
> That bit works fine. I have use the CGI.pm module Redirect to achieve this.
> However I want to run another script after the redirect with:
>
> exec("/cgi-bin/script arguments");
>
> Nothing happens after the redirect.
>
You will have to fork - close the STDOUT and STDIN in the child , redirect in
the parent and do your exec in the child.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 15 Nov 1999 18:12:21 GMT
From: glenhovde@cs.com (GlenHovde)
Subject: Re: Removing all combinations of spaces/tabs at end of string
Message-Id: <19991115131221.07456.00001453@ng-fe1.news.cs.com>
>Simple.
>
>$MyString =~ s/\s*$//;
>
strips everything from the first space char to end of line (forgot the ^)
------------------------------
Date: Mon, 15 Nov 1999 10:58:43 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Removing all combinations of spaces/tabs at end of string
Message-Id: <MPG.1299f7c175d0aad398a206@nntp.hpl.hp.com>
In article <19991115131221.07456.00001453@ng-fe1.news.cs.com> on 15 Nov
1999 18:12:21 GMT, GlenHovde <glenhovde@cs.com> says...
> >Simple.
> >
> >$MyString =~ s/\s*$//;
>
> strips everything from the first space char to end of line (forgot the ^)
Huh? Maybe you are confusing some aspects of shell globbing with the
different semantics in regular expressions.
What you describe could be written as:
$MyString =~ s/\s.*$//;
or even simpler as:
$MyString =~ s/\s.*//;
The best regex, as has been posted several times already, is
$MyString =~ s/\s+$//;
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 15 Nov 1999 17:50:45 GMT
From: perlkeith@hotmail.com
Subject: Re: Secure Sockets ???
Message-Id: <80ph5j$bpt$1@nnrp1.deja.com>
can't net::ssleay help this task??? i am still doing research about
this...
Keith Chang
>
> > Does anyone know if it is possible to use SSL to create a secure
> > socket connection from perl.
>
> If there's a module which does what you want, it should be listed in
> the module list on CPAN. If you don't find one to your liking, you're
> welcome and encouraged to submit one! :-) Hope this helps!
>
> http://www.cpan.org/
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 15 Nov 1999 18:01:30 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Serious memory leak in MacPERL?
Message-Id: <pudge-1511991301330001@192.168.0.77>
I suggest you use the MacPerl mailing lists.
http://www.macperl.org/
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: Mon, 15 Nov 1999 12:44:07 -0500
From: "Steven T. Hatton" <hattons@cpkwebser5.ncr.disa.mil>
Subject: Slurping output form system(runme.exe)
Message-Id: <38304667.20FBA2D2@cpkwebser5.ncr.disa.mil>
We have been trying to figure out it there is a way to run a command
line executable in NT and slurp the output back into a perl variable.
For example:
Suppose I have a variable called $binData and an executable called
processBinData.exe which takes input form a file using a -f switch, and
outputs to standard out.
C:\processBinData.exe -f binData.file
dumps output to screen.
I want something like:
system( $resultData= "processBinData.exe -f $binData" );
Where $resultData would contain the results of processBinData. And -f
$binData would treat the contents of $binData as the input file from the
command line. Of course THIS DOES NOT WORK!
If someone can understand what I am asking, and has more of a clue than
I do, please let me know how you would approach this.
Thanks,
Steve
------------------------------
Date: Mon, 15 Nov 1999 12:25:04 -0600
From: Tom Briles <sariq@texas.net>
Subject: Re: Slurping output form system(runme.exe)
Message-Id: <38305000.8C7298C5@texas.net>
"Steven T. Hatton" wrote:
>
> We have been trying to figure out it there is a way to run a command
> line executable in NT and slurp the output back into a perl variable.
From perldoc -f system:
"This is NOT what you want to use to capture the output from a command,
for that you should use merely..."
Oh darn, the rest scrolled by too quickly to read. You'll have to read
it yourself, I guess.
- Tom
------------------------------
Date: Mon, 15 Nov 1999 12:27:14 -0500
From: "Christian Brunet" <cbrunet@locus.ca>
Subject: Sort by more than one element URGENT.
Message-Id: <WmXX3.123$li5.7702@wagner.videotron.net>
Hi,
Hi would like to sort on more than one element and here is the way I'm
trying it.
Example : 4.15. Sorting a List by Computable Field - Perl CookBook.
This final example compactly sorts colon-separated data, as from Unix's
passwd file. It sorts the file numerically by fourth field (group id), then
numerically by the third field (user id), and then alphabetically by the
first field (user name).
print map { $_->[0] } # whole line
sort {
$a->[1] <=> $b->[1] # gid
||
$a->[2] <=> $b->[2] # uid
||
$a->[3] cmp $b->[3] # login
}
map { [ $_, (split /:/)[3,2,0] ] }
`cat /etc/passwd`;
Here is my code :
ex.: @G_Final_Element
=.default.cfg,liaison_v305-dev-old,ereiher,19981207.134217
so,
$G_Final_Element[0] = .default.cfg(ELEMENT),
liaison_v305-dev-old(BRANCHE),
ereiher(NOM D'USAGER),
19981207.134217(DATE)
Hi want to sort by BRANCHE then by NOM D'USAGER and then by ELEMENT.
while ($elem = <@G_Final_Element>) {
@G_Sorted = map { $elem->[0] } # Ligne complete
sort { $a->[1] cmp $b->[1] || # BRANCHE
$a->[2] cmp $b->[2] || # NOM D'USAGER
$a->[3] cmp $b->[3] } # ELEMENT
map { [ $elem, (split/,/)[1,2,0] ] }
@G_Final_Element;
}
My code seems identical to the example in the CookBook of Perl.
Can someone help me out.
If you need more details, please contact me.
Thanks in advance.
--
Christian Brunet
Responsable Gestion de la Configuration
Locus Dialogue
cbrunet@locus.ca
Tel : 514-954-3804 ext: 2074
Tel : 1-888-GO-LOCUS
Fax : 514-954-3805
www.locus.ca
------------------------------
Date: Mon, 15 Nov 1999 13:49:26 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Sort by more than one element URGENT.
Message-Id: <Pine.GSO.4.10.9911151345571.24181-100000@crusoe.crusoe.net>
[posted & mailed]
The while loop is NOT needed at all. Remove it, and change references to
$elem to $_ instead.
> while ($elem = <@G_Final_Element>) {
>
> @G_Sorted = map { $elem->[0] } # Ligne complete
>
> sort { $a->[1] cmp $b->[1] || # BRANCHE
> $a->[2] cmp $b->[2] || # NOM D'USAGER
> $a->[3] cmp $b->[3] } # ELEMENT
>
> map { [ $elem, (split/,/)[1,2,0] ] }
> @G_Final_Element;
> }
Si tu veux la reponse en francais, je peux le faire.
--
MIDN 4/C PINYAN, USNR, NROTCURPI http://www.pobox.com/~japhy/
jeff pinyan: japhy@pobox.com perl stuff: japhy+perl@pobox.com
"The Art of Perl" http://www.pobox.com/~japhy/book/
CPAN ID: PINYAN http://www.perl.com/CPAN/authors/id/P/PI/PINYAN/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
------------------------------
Date: Mon, 15 Nov 1999 10:37:00 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: sort lists together
Message-Id: <MPG.1299f2a61276fbad98a202@nntp.hpl.hp.com>
In article <x7ogcvwx4t.fsf@home.sysarch.com> on 15 Nov 1999 11:13:54 -
0500, Uri Guttman <uri@sysarch.com> says...
> >>>>> "A" == Abigail <abigail@delanet.com> writes:
>
> A> Uri Guttman (uri@sysarch.com) wrote on MMCCLXVII September MCMXCIII in
> A> <URL:news:x7u2mowet3.fsf@home.sysarch.com>:
> A> // >>>>> "A" == Abigail <abigail@delanet.com> writes:
> A> //
> A> // A> I'm not really happy with the name "index sort".
> A> //
> A> // index sort is the well known name for that variation/transform. the
> A> // underlying sort algorithm gets its own name. you can do an index sort
> A> // with quick, bubble, shell, etc., sorts. so take your complaint up with
> A> // the sort algorithm textbooks and academia.
>
> A> I must be reading different textbooks than you. Neither Knuth, Cormen,
> A> Leiserson and Rivest, Harrel, or Orwant, Hietaniemi and Macdonald have
> A> the term 'index sort' in their index. Nor can I remember stumbling upon
> A> the name in the 10 years I spend at academic institutions.
>
> well, it is not a term i invented and i have heard it from multiple
> sources. i don't have a large set of algorithm texts like you do to
> research but i bet 2000 quatloos that index sort is a known name for
> that variation.
A quick Altavista search for '+"index sort" +algorithm' came up wih the
following (among several others):
http://anusf.anu.edu.au/wyrd/cxml/ssortb.3sciport.html
<QUOTE>
...
incd Integer.
This is an optional argument needed only if an index sort
is requested. If an indexed sort is requested, incd
contains the increment between elements of vector id.
DESCRIPTION
SSORTB can perform an in-place or indexed sort in ascending or
descending order. An in-place sort overwrites the input data vector
with the sorted output. An indexed sort returns a permuted index
vector which can be used to access the unmodified data vector in
its sorted order.
...
</QUOTE>
Note that the author uses 'index sort' and 'indexed sort'
interchangeably. Perhaps we should be calling it the latter.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 15 Nov 1999 10:51:33 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: SQL query problems (newbie)
Message-Id: <MPG.1299f61129b4444a98a205@nntp.hpl.hp.com>
In article <382FD8BD.D91BC5AD@BrightSite.nl> on Mon, 15 Nov 1999
10:56:13 +0100, Eduard Keilholz <E.Keilholz@BrightSite.nl> says...
...
> $dbh->Query(insert into ComUsers values
> ('$UIN','$First','$Last','Address','$HouseNr',
> '$Mailassr','ZIP','$City','$Country')) || die "query: InsertData
> returned: $Mysql::db_errstr\n";
...
> UserFile is just a textfile with information seperated by : signs. This
> file is a kind of temporary file with some information about deactivated
> users in it. Now when a user gets activated, I want the information out
> of the textfile, and stored in a MySQL database. Everything runs fine,
> but only the SQL Query doesn't work... Is there anybody who can tell me
> what's wrong?
Not only cannot that 'work', it can't even compile, as it isn't valid
Perl. You need to supply a string argument, not a bunch of barewords.
Try this (where I have also taken the liberty of inserting scalar
variables instead of string literals for 'Address' and 'Zip', where you
forgot to):
$dbh->Query(qq{ insert into ComUsers values
('$UIN', '$First', '$Last', '$Address', '$HouseNr',
'$Mailassr', '$ZIP', '$City', '$Country' })) || die
"query: InsertData returned: $Mysql::db_errstr\n";
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 15 Nov 1999 13:34:25 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Strange Problems going on with DBD::Solid
Message-Id: <80p251$1f4$1@gellyfish.btinternet.com>
On Sat, 13 Nov 1999 00:12:47 -0800 Anish Mehra wrote:
> Hi All,
>
> I recently tried my luck with 'Solid' Database (www.solidtech.com) and
> installed DBI (as 'root') along with the Database driver module -
> DBD::Solid. Since then, I am getting strange error while trying to run the
> script, on the command line, which connects to the 'Solid' database and
> makes transaction. The following is the situation - I provide the following
> input on the command line:
> 1) $ perl script.pl (Goes Successful; Pretty Good)
> 2) $ ./script.pl (Reports unable to load modules of DBD::Solid and that this
> module might have not installed properly)
>
I would suspect that the perl in your $PATH that you are getting in 1) is
not the same as the one you have put in the shebang line in 2) - you
should determine where the perl is by using whichever method is appropriate
for your OS or shell ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Mon, 15 Nov 1999 10:45:31 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Stripping off ^Ms from file
Message-Id: <MPG.1299f4a69d360e0d98a204@nntp.hpl.hp.com>
In article <382FC10C.4B023673@pobox.winthrop.edu> on Mon, 15 Nov 1999
08:15:08 +0000, Ryan T. Rhea <zzrhear@pobox.winthrop.edu> says...
+ Veronica wrote:
+
+ > Hi all,
+ >
+ > I have an Oracle database on a Unix box. On it, I use the DBI module
+ > in perl to SELECT an "address" field from the database, and write it
+ > tp file. For users who input the "address" field into the database
+ > via a Windows machine, when the "address" field is saved to file, I
+ > get ^M characters where the users had pressed "ENTER" on their
+ > Windows machines.
+ >
+ > I've tried to strip off these characters using "binmode" and
+ > "tr/\015//d;", but was not successful. Does anyone know how to
+ > remove the ^M characters?
+ >
+ > TIA,
+ > Veronica
+
+ Veronica,
+ Maybe you can use the chop() function. For example if you had an open
+ file ADDRESSBOOK, with a variable $address:
+
+ open(ADDRESSBOOK, "/home/veronica/addressbook");
+ while ($address = <ADDRESSBOOK>) {
+ chop($address);
+ print ADDRESSBOOK $address;
+ }
+
+ Hope that helps,
That's not likely to help, for a couple of reasons.
1. chop() removes the last character from a string. As the strings in
question ('lines') end either with "\012" or with "\015\012", chop-ping
isn't going to get rid of the "\015".
2. Printing back to a file opened for input isn't likely to work.
As for the original question, the quoted code
tr/\015//d;
or
tr/\cM//d;
should certainly do what is desired -- remove all ^M characters.
Another approach is to convert explicitly the "\015\012" sequence to
"\012" with a regex.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 15 Nov 1999 13:53:37 -0500
From: "Mark Bridgwater" <mbridgwater@lmn.net>
Subject: Re: Stripping off ^Ms from file
Message-Id: <80pkpe$qj6$1@news.gate.net>
Veronica,
In Windows, those are actually two characters: A carriage return followed by
a linefeed. You might try searching for the combination of ASCII 13 followed
by ASCII 10. You can verify this by using a hex editor to view a text file,
and you'll see that each lines ends with "0D 0A".
Veronica <ronnie@post1.com> wrote in message
news:382FB7DB.48396A27@post1.com...
> Hi all,
>
> I have an Oracle database on a Unix box. On it, I use the DBI module in
> perl to SELECT an "address" field from the database, and write it to
> file. For users who input the "address" field into the database via a
> Windows machine, when the "address" field is saved to file, I get ^M
> characters where the users had pressed "ENTER" on their Windows
> machines.
>
> I've tried to strip off these characters using "binmode" and
> "tr/\015//d;", but was not successful. Does anyone know how to remove
> the ^M characters?
>
> TIA,
> Veronica
------------------------------
Date: 15 Nov 1999 18:22:24 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: unwanted refresh with Apache server
Message-Id: <80pj10$8g6$1@internal-news.uu.net>
Re'em Bar <reembar@netvision.net.il> wrote:
> I would have raised the subject in a more appropriate newsgroup, but it
> seems all the experts are here :)
And the experts are probably getting very tired of anwering questions of
people that _know_ they are asking in the wrong place.
Erik
------------------------------
Date: Mon, 15 Nov 1999 18:57:35 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: Using files
Message-Id: <slrn830m10.39i.bmccoy@moebius.foiservices.com>
Also Sprach Andrew Longworth <Andrew_Longworth@bigfoot.com>:
>Hi, I have a problem with a file. There is a text file that contains
>information that I need to use in a script. There are sometime spaces and
>newlines and tabs around the text.
>How can I ignore these and simply retrieve the data?
You seem to have a real knack for asking questions that are covered in the
first chapter of virtually every Perl book, as well as oodles of places in
the bundled documentation. Do a little research and then come back.
--
Brett W. McCoy bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek) http://www.foiservices.com
FOI Services, Inc./DIOGENES 301-975-0110
---------------------------------------------------------------------------
------------------------------
Date: 15 Nov 1999 00:27:51 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Which Search engine script?
Message-Id: <80nk27$16s$1@gellyfish.btinternet.com>
In comp.lang.perl.misc Mike Thompson <mpthompson@home.net> wrote:
>
> At Atomz.com we have just removed monthly search limits for both the
> free and the paid search engine service. If you have a site with less
> than 500 pages you can use the exact same search engine as used at
> www.oreilly.com and www.webmonkey.com for free. Even if you have one
> of the busiest sites on the web -- and we should all have such
> problems :-).
>
Yeh sure but trim your followups as this has nothing to do with Perl now.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Mon, 15 Nov 1999 13:28:23 -0500
From: HHH <hartleh1@westat.com>
Subject: Re: Win32::ODBC use of uninitialized value warnings
Message-Id: <383050C7.82EF87FD@westat.com>
Neale Morison wrote:
>
> Brett W. McCoy <bmccoy@news.lan2wan.com> wrote in message
> news:slrn82tuk9.l5i.bmccoy@dragosani.lan2wan.com...
> > On Sun, 14 Nov 1999 23:18:48 +1100, Neale Morison
> > <nmorison@ozemail.com.au> wrote:
> > What variables is Perl saying are uninitialized?
>
> Perl is complaining about uninitialised variables in the Win32::ODBC module
> It gives me line numbers. Here are the lines from the Win32::ODBC module in
> a little context:
> foreach (@Results){
> s/ +$//; # HACK #### 261
> $self->{'data'}->{ ${$self->{'fnames'}}[$num] } = $_; #### 260
> $num++; }
The problem is that $num, while defined (line 249 I believe) is not
initialized. The first time the code reaches this foreach loop, you get
this error. Add a line to ODBC.pm outside and before the loop (I added
it at line 250) which initializes $num as follows
$num = 0 ;
and the errors should go away. The problem with this fix is that it is
not portable. Does Dave Roth hang out here?
HHH
------------------------------
Date: Mon, 15 Nov 1999 12:13:24 -0600
From: Seth David Johnson <sjohns17@uic.edu>
Subject: Re: Writing binary files in perl
Message-Id: <Pine.A41.4.10.9911151212460.372332-100000@tigger.cc.uic.edu>
On Mon, 15 Nov 1999, vsam1 wrote:
> Is there any function in Perl that writes the binary equivalent
> of the characters you want into binary files. I tried "pack" but it
> doesn't seem to give me the desired result when I try to view the file
> using ghex.
Some code perhaps?
------------------------------
Date: Mon, 15 Nov 1999 18:39:26 GMT
From: The Glauber <theglauber@my-deja.com>
Subject: Re: Writing binary files in perl
Message-Id: <80pk0l$e4o$1@nnrp1.deja.com>
In article <067edcc0.ddc17b36@usw-ex0107-050.remarq.com>,
vsam1 <gte017gNOgtSPAM@prism.gatech.edu.invalid> wrote:
> Is there any function in Perl that writes the binary equivalent
> of the characters you want into binary files. I tried "pack" but it
> doesn't seem to give me the desired result when I try to view the file
> using ghex.
>
> Any help will be greatly appreciated.
What do you mean, exactly? Is chr() the function you are looking for?
--
Glauber Ribeiro
theglauber@my-deja.com
"Opinions stated are my own and not representative of Experian"
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 1384
**************************************