[11463] in Perl-Users-Digest
Perl-Users Digest, Issue: 5063 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 5 06:07:20 1999
Date: Fri, 5 Mar 99 03:00:20 -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 Fri, 5 Mar 1999 Volume: 8 Number: 5063
Today's topics:
$1 gets clobbered (Jim and Paula)
Re: $1 gets clobbered <Michael.Cameron@nospam.technologist.com>
FAQ 1.5: What is perl6? <perlfaq-suggestions@perl.com>
Re: FAQ 9.19: How do I send mail? <cassell@mail.cor.epa.gov>
File Question (Newbie) <no_amaring@jps.net>
Re: Getting rid of ^M dave@mag-sol.com
Re: Getting rid of ^M <Philip.Newton@datenrevision.de>
Re: hash from split in one step dave@mag-sol.com
Re: help using system() <Philip.Newton@datenrevision.de>
Help With Code pvdkamer@inter.NL.net
Re: Help: How to pass thru apostrophe <Philip.Newton@datenrevision.de>
Re: Help: How to pass thru apostrophe <Philip.Newton@datenrevision.de>
Re: How would I split out specific elements? (Larry Rosler)
Re: MS Excel to HTML converter? (Justin)
Re: Need Help with Regular expressions (bilge)
Re: Perl comment <Philip.Newton@datenrevision.de>
SID identification for CDs... <ketanp@BLAHNOSPAMBLAHxwebdesign.com>
Re: swallowing old lady <uri@home.sysarch.com>
Re: swallowing old lady (Jonathan Stowe)
Re: THOSE REVISED FAQ-ITEMS FROM TOM C. (Ilya Zakharevich)
Unix to NT conversion info@gadnet.com
Re: Updating Access database using Perl/CGI <morrowc@his.com>
Re: Updating Access database using Perl/CGI <"rhrh@hotmail.com,or,rhardicr"@ford.com>
Re: URGENT! Where Do You Hide The CGI Cards From The Sp (Bart Lateur)
warning: unquoted string...... <xy@nowere.net>
Re: Yesterday! dave@mag-sol.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 05 Mar 1999 06:45:11 GMT
From: gemhound@gemhound.com (Jim and Paula)
Subject: $1 gets clobbered
Message-Id: <36df7b2e.3308952@news.primeline.com>
Can someone please explain to me why $1 is getting clobbered in the
last line below?
It becomes uninitialized and I get an undefined warning when I try to
print it even though I'm not using pattern memory. I thought you
could use $# just like any other variable as long as you didn't fill
it up again with pattern memory or go out of the block.
use diagnostics;
$string = "this is not good";
$string =~ /(not)/;
print $1 , "\n"; # prints "not"
if ($1 =~ /not/){ print "Say what?";}
print $1 , "\n";
------------------------------
Date: Fri, 05 Mar 1999 09:35:54 +0000
From: Michael Cameron <Michael.Cameron@nospam.technologist.com>
To: Jim and Paula <gemhound@gemhound.com>
Subject: Re: $1 gets clobbered
Message-Id: <36DFA57A.53146A1A@nospam.technologist.com>
Jim and Paula wrote:
> Can someone please explain to me why $1 is getting clobbered in the
> last line below?
>
> It becomes uninitialized and I get an undefined warning when I try to
> print it even though I'm not using pattern memory. I thought you
> could use $# just like any other variable as long as you didn't fill
> it up again with pattern memory or go out of the block.
>
> use diagnostics;
>
> $string = "this is not good";
>
> $string =~ /(not)/;
>
> print $1 , "\n"; # prints "not"
>
> if ($1 =~ /not/){ print "Say what?";}
>
> print $1 , "\n";
Try:
if ($1 =~ /(not)/){ print "Say what?";}
Note the parenthesis. It looks like the $# vars work when patterns
contain sub-patterns. If anyone cares to elaborate I would be interested
in finding out why.
Regards,
Michael
------------------------------
Date: 5 Mar 1999 01:39:54 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 1.5: What is perl6?
Message-Id: <36df985a@csnews>
(This excerpt from perlfaq1 - General Questions About Perl
($Revision: 1.21 $, $Date: 1999/01/26 09:55:05 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq1.html
if your negligent system adminstrator has been remiss in his duties.)
What is perl6?
Perl6 is a semi-jocular reference to the Topaz project. Headed by
Chip Salzenberg, Topaz is yet-another ground-up rewrite of the
current release of Perl, one whose major goal is to create a more
maintainable core than found in release 5. Written in nominally
portable C++, Topaz hopes to maintain 100% source-compatibility
with previous releases of Perl but to run significantly faster
and smaller. The Topaz team hopes to provide an XS compatibility
interface to allow most XS modules to work unchanged, albeit
perhaps without the efficiency that the new interface uowld
allow. New features in Topaz are as yet undetermined, and will be
addressed once compatibility and performance goals are met.
If you are a hard-working C++ wizard with a firm command of
Perl's internals, and you would like to work on the project, send
a request to perl6-porters-request@perl.org to subscribe to the
Topaz mailing list.
There is no ETA for Topaz. It is expected to be several years
before it achieves enough robustness, compatibility, portability,
and performance to replace perl5 for ordinary use by mere
mortals.
--
Installing unix fixes the [VMS] bug.
-Barry Shein
------------------------------
Date: Thu, 04 Mar 1999 10:38:15 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: FAQ 9.19: How do I send mail?
Message-Id: <36DED317.9023FCAA@mail.cor.epa.gov>
George Crissman wrote:
> It would be a help if you could expand this faq to include:
> ** mailx
> ** qmail
> ** mail
> ** port 25 access
George, this is a good point.. and perhaps 'blat' ought to be
mentioned, even if tchrist is noted unix-centric. :-)
But... you probably ought to send your comment to
perlfaq-suggestions@perl.com
so your suggestions can make their way into future FAQ docs.
Especially if you ever figure out how to do this with 'mail'
or 'qmail'. I wouldn't mind learning that.
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Thu, 4 Mar 1999 20:08:56 -0800
From: "amaring" <no_amaring@jps.net>
Subject: File Question (Newbie)
Message-Id: <36dfcefd.0@news1.jps.net>
I am new at this and don't see the problem... I am opening/creating a file
that is defined in a variable
Now, when I create the file I use this code
$list = "file";
open(SRC, '>$list.src')||&Error("Can't Open Source File!");
Now, when this creates the file it creates a file actually named "$list.src"
instead of "file.src".
Can someone please point out the problem to me, I assume it has something to
do with the parentheses etc. But I can't be sure...
Thank You
--Remove "no_" from my address--
------------------------------
Date: Fri, 05 Mar 1999 09:21:54 GMT
From: dave@mag-sol.com
Subject: Re: Getting rid of ^M
Message-Id: <7bo7nc$80h$1@nnrp1.dejanews.com>
In article
<93FC37484AE94431.AF00EC6CCB0B644D.3399BC3470455A35@library-proxy.airnews.net
>, robert@iminet.com (Robert Saunders) wrote:
>
> I am sure this is very simple.. but I have a data files that gets
> created and I open it up and want to take out the ^M at the end of
> several lines..
>
> I have tried the simple
>
> $data_line =~ s/\^M//ig;
>
> With no luck.. it doesnt seem to want to remove it.. I have been
> looking the perl books I have but so far have not ran across the
> symbol..
I know you've now solved your problem, but it might be useful and go back a
couple of steps to find out why your data file has the extra ^M characters in
it. There's an article at <http://www.mag-sol.com/Articles/> that might be of
help.
Dave...
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 05 Mar 1999 11:38:40 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Getting rid of ^M
Message-Id: <36DFB430.C5A7DA5D@datenrevision.de>
Robert E Webb wrote:
>
> This should work:
>
> #!/usr/bin/perl -p0777
>
> s/\015$//;
I think not. If I understand correctly, -0777 will slurp in the whole
file as a single string. Then your regular expression will match at the
end of the string. You have removed the last ^M, but not all the ones on
the lines in the middle. I think you need either to leave off the -0777
(so that each line will have its ^M cut off) or add the /m modifier
(make ^ and $ match inside the string, too) to the regular expression,
like so: s/\015$//m; (alternately, you can replace \015 by \cM, I
think, to show that you're looking for ^M, but that's a minor matter).
Cheers,
Philip
------------------------------
Date: Fri, 05 Mar 1999 09:12:00 GMT
From: dave@mag-sol.com
Subject: Re: hash from split in one step
Message-Id: <7bo74r$7ie$1@nnrp1.dejanews.com>
In article <7bkdlo$u82$1@nnrp1.dejanews.com>,
vicuna@my-dejanews.com wrote:
> lo
>
> Would be high droogy if someone could grok me the glimmer. Feeling should be
> doable but can't find my way to one step it.
>
> so:
> my %pretty;
>
> my $this ='would be key | want be value';
> ($lame_key, $lame_value) = split(/\|/,$this);
> $pretty{$lame_key} = $lame_value;
>
> but two step, want one.
>
> ($cool_key,$pretty{$cool_key}) = split(/\|/,$this);
>
> No no no! $cool_key is not, but what instead? Inquiring minds want to know!
>
> can:
>
> %pretty = (%pretty,split(/\|/,$this));
>
> but smells of Horse Mackerel.
>
> Glimmerings?
Do you speak English?
I think you want:
%pretty = split(/\|/, $this);
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 05 Mar 1999 11:32:25 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: help using system()
Message-Id: <36DFB2B9.4648E81@datenrevision.de>
cindy_conway@my-dejanews.com wrote:
>
> Hi All,
>
> I am trying to use system() on a Perl script running on an NT system. I need
> to invoke a windows application called Bar Tender.I've written it like this:
>
> system("bartend") #bartend.exe is the program file
>
> When I run the script, nothing happens. If I write the same line of code, and
> I try to invoke an application that is located under the winnt directory
> (like, say, notepad or pblush), it runs no problemo.
>
> Anyone else ever run into this?
This sounds as if bartend.exe is not in your path. What do you get
when you type 'path' at the command prompt? (Or, equivalently, what's
the value of $ENV{PATH} in Perl?)
I would suggest putting in the full path to the program, as in
system "C:/Program Files/Bar Tender/bartend.exe";
(You can also use backslashes to separate the path components, but then
they have to be doubled, as in C:\\WinNT\\ etc. - and forward slashes
work just fine, which is why I prefer them even on Windows platforms)
Cheers,
Philip
------------------------------
Date: Fri, 05 Mar 1999 09:31:56 GMT
From: pvdkamer@inter.NL.net
Subject: Help With Code
Message-Id: <36dfa1d3.929379@news.wxs.nl>
Hello All,
I'm not that kind of good perl programmer at all, but i need help to
speed up this script. This script is way to slow but i do not have the
knowledge to make it faster.
Please all the usefull comments are welcome.
Script purpose :
Compare two ascii files without delimmeters and without CTRL-LF
The record lenght for both file is 256 characters fixed.
find unique code from best20 in best40 and make a som of field $Opp
Compare this with the field $Oppervlakte in best20
If not the same print a line ......
Begin Script :
=======================================================
#!/usr/bin/perl
#### Query1.cgi
####
use CGI ':standard';
$FileNaam = (param('FileNaam'));
print header;
chkbest();exit;
sub chkbest
{
print "<b>Querynaam : Grondoppervlakte Stuf20 <> Som
Toegekende oppervlakte Stuf40<br>Deelbestand : $FileNaam
</b><hr><br>";
ReadBest("best20");
ReadBest("best40");
$y=1;
$Teller = 0;
while ($best20[$y] ne "")
{
$Oppervlakte = substr($best20[$y],136,8);
$Objectnummer = substr($best20[$y],2,12);
$reccordid = substr($best20[$y],2,12);
$x=1;
$Opp=0;
while ($best40[$x] ne "")
{
if ($Objectnummer eq substr($best40[$x],2,12))
{
$Opp=$Opp+substr($best40[$x],31,8);
}
$x = $x+1;
}
if ("$Oppervlakte" ne "$Opp")
{
$Teller=$Teller+1;
print "<br>Objectnummer = ";
print qq~<A TARGET="popup" ONCLICK="clicker(this)"
HREF="/cgi-bin/popup.cgi?reccordid=$reccordid&FileNaam=$FileNaam">$reccordid</A>~;
print " (Opp. in Best20 = $Oppervlakte)";
print " (Som Opp. in Best40 = $Opp)";
}
$y=$y+1;
}
print "<br><br>Totaal aantal Records : ";
print $Teller;
}
sub ReadBest
{
my $max = shift(@_);
open(FILE, "$Lpath/$FileNaam.dta/$max") or print "Bestand
$Lpath/$FileNaam.dta/$max niet gevonden";
$$max["0"]="Leeg";
$x=0;
while ($$max["$x"] ne "")
{
$x=$x+1;
read(FILE, $$max["$x"], 256);
}
$TotRec = $x;
close(FILE)
}
sub varbest40
{
$var[1] = "RecordID (93.11) 001002j ";
$var[2] = "WOZ-Object Nummer (01.01) 003014j ";
$var[3] = "Kadestrale gemeente code (51.10) 015005j ";
$var[4] = "Sectie (51.20) 020002j ";
$var[5] = "Perceelnummer (51.30) 022005j ";
$var[6] = "Perceelindexletter (51.40) 027001j ";
$var[7] = "Perceelindexnummer (51.50) 028004j ";
$var[8] = "Toegekende Oppervlakte (52.10) 032008j ";
$var[9] = "Meegetaxeerde Oppervlakte (52.20) 040008j ";
$var[10] = "Mutatiecode (81.10) 048001j ";
$var[11] = "ingangsdatum (81.20) 049008jd";
$var[12] = "Einddatum (81.30) 057008j ";
$var[13] = "Filler 065192n ";
}
sub varbest20
{
$var[1] = "RecordID (93.11) 001002j ";
$var[2] = "WOZ-Object Nummer (01.01) 003012j ";
$var[3] = "Woonplaatsnaam (10.20) 015040j ";
$var[4] = "Straatnaam (11.10) 055024j ";
$var[5] = "Huisnummer (11.20) 079005j ";
$var[6] = "Huisletter (11.30) 084001n ";
$var[7] = "Huisnummertoevoeging (11.40) 085004n ";
$var[8] = "Aanduiding bij huisnummer (11.50) 089002n ";
$var[9] = "Postcode (11.60) 091006j ";
$var[10] = "Lokatie omschrijving (11.70) 097040n ";
$var[11] = "Grondoppervlakte (12.10) 137008j ";
$var[12] = "Gebruikscode (12.20) 145002j ";
$var[13] = "Code bebouwd/onbebouwd (14.10) 147001j ";
$var[14] = "Meegtaxeerde Oppervlakte bebouwd (14.20)148008j ";
$var[15] = "Aandeel waaarde bebouwd (14.30) 156011j ";
$var[16] = "Getaxeerde waarde (15.10) 167011j ";
$var[17] = "Waardepeildatum (15.20) 178008jd";
$var[18] = "Bijzondere waarderingscode (15.30) 186003j ";
$var[19] = "Mutatiecode (81.10) 189001j ";
$var[20] = "Ingansdatum (81.20) 190008jd";
$var[21] = "Einddatum (81.30) 198008jd";
$var[22] = "Sraatcode (11.11) 206005n ";
$var[23] = "Aanduiding valutasoort (12.20) 211003n ";
$var[24] = "Code blokeren (15.50) 214002n ";
$var[25] = "Filler 216041n ";
}
===========================================================
End Script
------------------------------
Date: Fri, 05 Mar 1999 11:22:10 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Help: How to pass thru apostrophe
Message-Id: <36DFB052.64320161@datenrevision.de>
Dean Enix wrote:
>
> The following perl statement works okay
>
> `/usr/bin/cut -d'|' -f1,3- $results \> filtered.out`;
>
> but when I try to change the delimiter to ' (apostrophe) it doesn't get
> passed thru...
>
> What are the rules here?
>
> Any suggestions on a solution?
Here's mine:
`/usr/bin/cut -d\' -f1,3- $results \> filtered.out`;
i.e. escape the ' so the shell won't interpret it.
Cheers,
Philip
------------------------------
Date: Fri, 05 Mar 1999 11:22:44 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Help: How to pass thru apostrophe
Message-Id: <36DFB074.6D8A2F33@datenrevision.de>
Dean Enix wrote:
>
> The following perl statement works okay
>
> `/usr/bin/cut -d'|' -f1,3- $results \> filtered.out`;
Why are you putting a backslash before '>' ?
Cheers,
Philip
------------------------------
Date: Thu, 4 Mar 1999 23:28:26 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How would I split out specific elements?
Message-Id: <MPG.11492775321f90f9896e6@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <36e4631e.19982721@news.supernews.com> on Fri, 05 Mar 1999
04:53:02 GMT, Alan Young <alany@2021.com >says...
...
> foreach my $item (@items) {
> ($itm, $qty) = split /\|/;
This splits $_, but the loop items are in $item. Make up your mind!
> @ITEM = split /\|/, $Inventory{$itm};
> my @item = [qw!$itm $qty $ITEM[5] $ITEM[6] \
> {(($ITEM[6]*$qty)*100)/100!)]
There are at least six different errors in this expression! Are you out
to set a record?
1. Square brackets create a reference to an anonymous array, not a
list. You need parentheses.
2. You cannot use qw() simply to save commas, because it doesn't
support interpolation of variables. Its definition is
split ' ', ' word0 word1 ... wordn ';
Note the single-quotes on the string!
3. The backslash looks more like C than Perl.
4. There is an unbalanced '{' in there.
5. The arithmetic *100/100 is a no-op, because Perl uses floating-point
arithmetic by default. You could use the int() function, but sprintf()
is better.
6. There is no terminating semicolon.
You shouldn't post code that is syntactically invalid (semantics is
another matter). If your real code did compile, you should copy-and-
paste it into your post, not type it in again.
The following is my best guess at what you want:
my @item = ($itm, $qty, $ITEM[5], $ITEM[6],
sprintf('%.2f', $ITEM[6] * $qty));
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 05 Mar 1999 08:15:06 GMT
From: shazam@cheesewhiz.kraft.com (Justin)
Subject: Re: MS Excel to HTML converter?
Message-Id: <slrn7dv82i.cdr.shazam@colo.brain.com>
On Thu, 4 Mar 1999 22:04:06 +0100, Boris <boris.petrovic@pu.tel.hr> wrote:
>Gary Kakazu wrote in message <36DEC986.F1578F4F@tdstelecom.com>...
>>I'd like to automate the process of taking Microsoft Excel files and
>>displaying them on the web. Are there any perl modules that will take an
>>Excel file (.xls format) and convert it to an HTML table?
>
>I guess it is possible, but I think you will be far more satisfied if you
>let Excel generate those tables for you (when saved, for example). That way
>your server will be happy.
Well, you could always use the OLE::Storage module. It looks like I'm gonna
need it for an instranet project at my company.
Justin
------------------------------
Date: 5 Mar 1999 07:19:00 GMT
From: serling@radioactivex.iadfw.net (bilge)
Subject: Re: Need Help with Regular expressions
Message-Id: <8C8F89D3C1163BCC.9B829DCB66B16E8C.9CFE230BF45B9E1C@library-proxy.airnews.net>
Nima Mortazavi nima.m@lyckseleNOSPAM.net blared:
>Hi
>
Try adding a print statement to the text file such that
it surrounds the text:
print <<"EOF";
hi $name
.
.
.
EOF
Then in your program, once you've collected the information
in the variables, just require() the text file.
#!/usr/local/bin/perl
$name = 'bob';
require 'text.dat';
-------------
prints "hi bob", for example. It's considerably easier
than parsing the file yourself.
--------------------------------------------------------------
>I have a text file with following row :
>
>=========
>Hi $name How are you
>My name is $info{'name'}
>This file is /etc/$fil.txt
>I am working on Usa/$city/street
>=======
>
>Now , In my perl program, I want read the text file and replace the
>variables in text file
>with the existing value of variable , I use the following code in my
>program.
>
>================
>$name = 'Jack' ;
>$fil = 'readme' ;
>$info{'name'} = 'Nima' ;
>$city = 'Lycksele' ;
>open (Hfil,"<$mytextfile") ; @Harray = <Hfil> ; close (Hfil) ;
>for ($Hm = 0; $Hm <= $#Harray; $Hm++) {
>$Harray[$Hm] =~ s/\$(\w+)/${$1}/g; # My Regular expressions
>print "$Harray[$Hm]" ;
>}
------------------------------
Date: Fri, 05 Mar 1999 10:46:21 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Perl comment
Message-Id: <36DFA7ED.8B920B09@datenrevision.de>
George Crissman wrote:
>
> On Mon, 01 Mar 1999 12:07:06 +0100, Philip Newton wrote:
> >KC wrote:
> >> dubing wrote:
> >> > Is there any easy way to comment out a block of Perl code (like how
> >> > /*....*/
> >> > is used in C) instead of putting '#' at the beginning of each line
> >> > line by line?
> >> Nope. The pound sign is it.
> >...and the advantage over C comments is that Perl comments can be
> >"nested" ... if a line begins with '#' and you add another one, it's
> >still a comment, whereas /* /* ... */ */ will usually cause problems :)
>
> ...unless you set the "allow nested comments" flag in the compiler ...
...which will promptly break your code when you port it to another
system with a different C compiler...
Cheers,
Philip
------------------------------
Date: Fri, 05 Mar 1999 04:06:07 -0500
From: Ketan Patel <ketanp@BLAHNOSPAMBLAHxwebdesign.com>
Subject: SID identification for CDs...
Message-Id: <36DF9E7F.4B5B6232@BLAHNOSPAMBLAHxwebdesign.com>
I'm not sure if this is the right place to ask this question, but I
figure if I need it for a perl script, perhaps someone else did too...
Every book published has a unique identification number printed on it
(ISBN number) and this is the number used by sites such as Amazon and
others to keep track of their books...
It seems as though music CDs also have a unique number (SID number), and
sites such as CDNow and Amazon also use this number to keep track of
items...
Finding a book's ISBN number is as simple as looking at the back cover,
but does anyone know how to find out a CD's SID number? Is it related
to the UPC code in any way? Any ideas?
Thanks!
------------------------------
Date: 05 Mar 1999 00:56:18 -0500
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: swallowing old lady
Message-Id: <x7ogm8cwe5.fsf_-_@home.sysarch.com>
i think this settles it. perl is the best language for writing old
campfire and drinking songs (100 bottles of beer contest).
spread the word. i expect headlines in the times tomorrow!
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Fri, 05 Mar 1999 09:42:15 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: swallowing old lady
Message-Id: <36dfa608.2805222@news.dircon.co.uk>
On 05 Mar 1999 00:56:18 -0500, Uri Guttman <uri@home.sysarch.com>
wrote:
>
>i think this settles it. perl is the best language for writing old
>campfire and drinking songs (100 bottles of beer contest).
>
Heres another I thought up in lieu of my morning coffee -
#!/usr/bin/perl -w
use strict;
my %animals = (
cats => 'Meow',
dogs => 'Woof',
cows => 'Moo',
sheep => 'Bah',
horses => 'Nay',
ducks => 'Quack'
);
my $farmer = 'Old MacDonald';
my $establishment = 'farm';
my $tenure = 'had';
my $eio = 'ee aye ee aye o';
my $animal_loquacity = 2;
my ($animal,@noises) = ();
for $animal (keys %animals)
{
push @noises,$animals{$animal};
print "$farmer $tenure a $establishment\n";
print $eio,"\n";
print "And on that $establishment he $tenure some $animal\n";
print $eio,"\n";
for ( reverse @noises )
{
print "With a ", $_ x $animal_loquacity, " here\n";
print "And a ", $_ x $animal_loquacity, " there\n";
print "Here a $_, there a $_ everywhere a ",
$_ x $animal_loquacity,"\n";
}
print "$farmer $tenure a $establishment\n";
print $eio,"\n";
}
With my apologies to the original author of the song.
I couldnt reach any consensus on the noise that llamas and camels make
I'm afraid
/J\
------------------------------
Date: 5 Mar 1999 07:03:22 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: THOSE REVISED FAQ-ITEMS FROM TOM C.
Message-Id: <7bnvjq$nf3$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Uri Guttman
<uri@home.sysarch.com>],
who wrote in article <x7k8wwcw7z.fsf@home.sysarch.com>:
> i think they are useful in other ways too. several of them have sparked
> threads about the faq text itself and the its subject. if some improvements
> to the faq result for this autoposting, all the better. in fact the
> continuity is good as some of them will always get some people looking
> at it with an eye for improvement which is good.
What is good? When people think that the snippets are posted for
comments, comment on them, then get shitted on by Tom?
Ilya
------------------------------
Date: Fri, 05 Mar 1999 11:28:03 GMT
From: info@gadnet.com
Subject: Unix to NT conversion
Message-Id: <36dfbf16.94740752@news.newsguy.com>
I have written some banner exchange freeware (see URL below) and it
works fine on unix. I have had several requests to convert it to run
on NT, but I don't know anything about NT. Is there somewhere that
explains the unix/NT perl conversion issues (or someone who wants to
do it for me ;-))
Bannerplus Banner Exchange Software
http://www.gadnet.com/bplus
------------------------------
Date: Fri, 05 Mar 1999 00:01:14 -0500
From: Chris Morrow <morrowc@his.com>
To: Michael Geehan <michael.geehan@kcl.ac.uk>
Subject: Re: Updating Access database using Perl/CGI
Message-Id: <36DF651A.32A17915@his.com>
DBD::ODBC
from a Win32 platform this is reported to work well enough...
-Chris
Michael Geehan wrote:
>
> Is there any way to use Perl to read data from and write data to,
> a microsoft Access Database?
>
> Mike
>
> --
>
> Michael Geehan
> Email: michael.geehan@kcl.ac.uk
> URL: Temporarily off-line!
> Phone: 0958-496-564
> ----------------------------------------
> ' Fixation is the way to death,
> Fluidity is the way to life'
> Miyamoto Musashi
------------------------------
Date: Fri, 05 Mar 1999 10:18:15 +0000
From: Richard H <"rhrh@hotmail.com,or,rhardicr"@ford.com>
Subject: Re: Updating Access database using Perl/CGI
Message-Id: <7boavu$7068@eccws1.dearborn.ford.com>
Michael Geehan wrote:
>
> Is there any way to use Perl to read data from and write data to,
> a microsoft Access Database?
>
> Mike
Loads of ways
on windoze - WIN32::ODBC
on unix - DBI::ODBC
DBD
etc.
Richard H
------------------------------
Date: Fri, 05 Mar 1999 09:59:55 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: URGENT! Where Do You Hide The CGI Cards From The Spiders?
Message-Id: <36dfaa9c.8298398@news.skynet.be>
Larry Rosler wrote:
>Would it be possible for you to show us the man page for crypt on your
>FreeBSD system? A web search didn't turn one up for me.
See for yourself.
http://www.mediamind.be/cgi-bin/media/man.pl?crypt
Something does look not too kosher.
Bart.
------------------------------
Date: Fri, 5 Mar 1999 09:19:40 +0100
From: "mrnobody" <xy@nowere.net>
Subject: warning: unquoted string......
Message-Id: <7bo44a$luk@fstgal00.tu-graz.ac.at>
Hi there,
I want to open a file and put the content of the file (html-file) into the
array $formulardaten which will be
changed by another part of the script.
for opening and reading out the file I use the following code:
open (offenedatei, "<$tempdatei");
$formulardaten=<offenedatei>;
close (offenedatei);
when running the script with -w
I always get the following warning:
Unquoted string "offenedatei" my clash with future reserved word at
..........
Does anybody know how to handle this warning ???
please send a e-mail mailto:wiwa@sbox.tu-graz.ac.at
thanks
walter
--
Walter Winter
Technical University Graz
Institute for Chemical Engineering
Inffeldgasse 25 A-8010 Graz
Tel: ++43/316/481300-0
Fax: ++43/316/481300-4
------------------------------
Date: Fri, 05 Mar 1999 09:33:15 GMT
From: dave@mag-sol.com
Subject: Re: Yesterday!
Message-Id: <7bo8cr$8f6$1@nnrp1.dejanews.com>
In article <WeID2.10078$Ge3.39532024@news.itd.umich.edu>,
mcafee@waits.facilities.med.umich.edu (Sean McAfee) wrote:
> In article <36DF479F.379A5D5@mailexcite.com>,
> Aaron Au <aaronau@mailexcite.com> wrote:
> >I want to input a date code (mmddyyyy)(03011999) and output the last day
> >format(02281999).
> >Does anyone have a simple script?
>
> First, install the Date::Calc module.
>
> Then:
>
> use Date::Calc qw(Add_Delta_Days);
>
> sub previous_day {
> $_[0] =~ /^(\d\d)(\d\d)(\d\d\d\d)$/;
> sprintf("%02d%02d%04d", (Add_Delta_Days($3, $1, $2, -1))[1,2,0]);
> }
Or, using the standard Perl library.
my ($d, $m, $y) - (localtime(time - 24*60*60))[3 .. 5];
my $yesterday = sprintf("%02d%02d%4d", $d, $m+1, $y+1900);
--
Dave Cross
Magnum Solutions Ltd: <http://www.mag-sol.com/>
London Perl M[ou]ngers: <http://london.pm.org/>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
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 5063
**************************************