[15536] in Perl-Users-Digest
Perl-Users Digest, Issue: 2946 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 4 09:05:22 2000
Date: Thu, 4 May 2000 06:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <957445510-v9-i2946@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 4 May 2000 Volume: 9 Number: 2946
Today's topics:
Re: *** To retrieve remote files regularly? (remove this part)
Re: [RegExp] Matching UPPERCASE words ... (Bart Lateur)
Re: [RegExp] Matching UPPERCASE words ... (Bart Lateur)
Re: BUG? Get comand line parameter with ActiveState Per (Clinton A. Pierce)
Clarify A Code Snippet <skpurcell@hotmail.com>
Re: Clear and then Reuse a package name space (Bart Lateur)
daily pics script <ringo@ringo.net.ru>
Re: get the mails from the inbox in unix (Clinton A. Pierce)
Guess what? the largest online book store Amazon.com <rhchui@yahoo.com>
Re: Guess what? the largest online book store Amazon.co <andersen+@rchland.ibm.com>
Re: Guess what? the largest online book store Amazon.co <xuyli@hotmail.com>
How can I run auto-download file in browser ? <johny@supermedia.pl>
How single-line switch (/s) works in regexps? <gyenesz@westel900.hu>
Re: How single-line switch (/s) works in regexps? nobull@mail.com
how to delete all variables in Z::? <dewitt@jlab.org>
How to print '%' character with printf ? <d.courivaud@esiee.fr>
Re: if file already exists then remove... (Bart Lateur)
Re: if file already exists then remove... <iltzu@sci.invalid>
Re: Newbie needs help splitting file <uackermann@orga.com>
Re: newbie: can't open text file in windows (path to fi <johny@supermedia.pl>
newbie: can't open text file in windows <russ@css2.com>
Re: Perl & delivering Databases? ammar_aganovic@my-deja.com
Re: perl in NT .BAT files Question <sturdevr@yahoo.com>
problem with "system" and file copy (Andreas Boerner)
Re: problem with "system" and file copy <andersen+@rchland.ibm.com>
Re: Q: search/replace and pattern matching (Bart Lateur)
Real and Windows streaming media access? ajs@ajs.com
Re: Regexp speed (was: Help: bol regexp in split string (Bart Lateur)
Re: Saving Uploaded Files using CGI.pm (Bart Lateur)
Re: sprintf in CGI (Bart Lateur)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 04 May 2000 20:53:20 +0800
From: I'm a good man <"goodman888"@hongkong.com(remove this part)>
Subject: Re: *** To retrieve remote files regularly?
Message-Id: <8errtk$a0b$1@news.ctimail.com>
Thorn wrote:
> You crosspost to comp.lang.perl.misc but can't find a PDP ng? Weird!
Yes, I didnt find anything like comp.lang.php.*
I also tried *php* and still got nothing.
I tried this at 3 news servers.
--
Regards,
Fung "http://i.am/goodman888/"
------------------------------
Date: Thu, 04 May 2000 11:15:16 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: [RegExp] Matching UPPERCASE words ...
Message-Id: <391a5ac0.8325586@news.skynet.be>
Larry Rosler wrote:
>I *think* ASCII is a mandatory subset of all current character sets
>(except EBCDIC, of course).
Then take a look in the SYMBOL character set. I wouldn't call it
"Ascii".
Even there, roughly, the (Greek) letters are in the same place as in
ASCII, but at the position of "v" and "V", "lowercase" and "uppercase"
are not the same letter.
And then there is Zapf-Dingbats.
--
Bart.
------------------------------
Date: Thu, 04 May 2000 11:22:20 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: [RegExp] Matching UPPERCASE words ...
Message-Id: <391b5d22.8935308@news.skynet.be>
Ilya Zakharevich wrote:
> my @a;
> for my $char (map chr, 0..255) {
> push @a, $char if $char =~ /\w/ and uc $char eq $char;
> }
> my $pat = join '', @a;
> /[$pat]+/;
>
>and hope that "]" and "-" are not uppercase chars in the given locale. ;-]
I would hope that "]" and "-" are not matched by /\w/.
--
Bart.
------------------------------
Date: Thu, 04 May 2000 12:29:00 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: BUG? Get comand line parameter with ActiveState Perl
Message-Id: <g2eQ4.58613$h01.429752@news1.rdc1.mi.home.com>
[Posted and mailed]
In article <39114338.7E809AC3@mail.sub.uni-goettingen.de>,
Markus Enders <enders@mail.sub.uni-goettingen.de> writes:
>
> Then I updated my computer with ActiveStatePerl 5.6. The result was:
> I do not get any command line input in my Perl program. I mean, the ARGV
> variables are empty. The perl script does not get any parameters from
> the command line. Even programs, which worked before (on an older
> version) won't work anymore.
>
> This happened 4 or 5 weeks ago and I though it could be a bug in
> ActivePerl 5.6.
Post code please. If you claim to have a bug, show us. Conjecture and
speculation won't get you anywhere but put in the loony bin.
--
Clinton A. Pierce Teach Yourself Perl in 24 Hours!
clintp@geeksalad.org for details see http://www.geeksalad.org
"If you rush a Miracle Man,
you get rotten Miracles." --Miracle Max, The Princess Bride
------------------------------
Date: Thu, 4 May 2000 08:03:37 -0500
From: "spurcell" <skpurcell@hotmail.com>
Subject: Clarify A Code Snippet
Message-Id: <39117506$0$8440@wodc7nh1.news.uu.net>
Hello,
I posted a question the other day about stripping out some white space on a
few different variables:
eg.
for ($fish) {
s/^\s+//; s/\s+$//;
}
Then I asked if I had two variables that needed cleaning, then how does this
work, and someone shot me back a line
for ($fish, $lion) {
s/^\s+//; s/\s+$//;
}
Which looked cool, but got me thinking. How does this actually work. I
believe that it sees $fish and $lion as basically a list, and so therefore
each variable ($fish and $lion) gets set to the default variable, and get
cleaned, and replaced?
Did I nail it? Or am I mistaken for how the interpreter reads it?
Thanks for any input.
Still learning all the time
Scott
------------------------------
Date: Thu, 04 May 2000 11:05:49 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Clear and then Reuse a package name space
Message-Id: <3918535e.6434793@news.skynet.be>
Tom Phoenix wrote:
>But it looks to me as if programs written to work in Apache::Registry (or
>similar environments) should use globals only when they intend to pass
>those values along to be used in future requests.
Indeed. A quick fix might be to wrap the main script in a block, and
localizing all globals.
{
local($globalscalar, @globalarray, %globalhash);
# ... main script here
}
If you "use strict", this will force you to declare all globals. You can
use that same list of names to contruct the "local" list.
--
Bart.
------------------------------
Date: Thu, 4 May 2000 14:25:22 +0400
From: "ringo" <ringo@ringo.net.ru>
Subject: daily pics script
Message-Id: <391150c4@news.ptt.ru>
daily pics script
_____________-
Please help!
I need CGI (perl) script to DAILY rotation of pics or links
Where can i found it?
thanx in advance
pls, answer to my email box
ringo@ringo.net.ru
------------------------------
Date: Thu, 04 May 2000 12:36:59 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: get the mails from the inbox in unix
Message-Id: <L9eQ4.58617$h01.429752@news1.rdc1.mi.home.com>
[Posted and mailed]
In article <8erc6k$97d$1@nnrp1.deja.com>,
exhacker@my-deja.com writes:
> In article <8er8f1$5h5$1@nnrp1.deja.com>,
> k_ahg@my-deja.com wrote:
>> I'm actually trying to write a perl program to grep certain mails in
>> my inbox in unix to do some processing.Is it possible to do that can
>> anybody help me.
>
> Kenneth,
> I hope this helps and is not too confusing. It's kinda crude, but hey.
> These are the assumptions I made:
> - The name of the file containing your messages is inboxfile in the
> current directory
> - You want to append all messages containing your pattern to a file
> call outputfile in the current directory
Just a suggestion. On Unix systems, the standard mailbox format dictates
that mail messages start with the regexp /^From\s/. Always.
Therefore one easy way to read in mail messages is like this:
# Untested.
open(MBOX, "mbox") || die "$!"; # Always check for errors
{
local $/=""; # "paragraph" mode
while(<MBOX>) {
if (/^From\s/) {
if ($body) {
print "Header: $header\n";
print "Body: $body\n";
}
$body="";
$header=$_;
} else {
$body.=$_;
}
}
# Process the last message, if any.
if ($body) {
print "Header: $header\n";
print "Body: $body\n";
}
}
close(MBOX);
I have noticed that when using Netscape to POP-down mail from a server
that it mangles the /From\s/ line in some cases. But sendmail, fetchmail
and other MDA/MUA's do it right.
BTW, this example doesn't do anything useful with the messages. That's
your part. :)
--
Clinton A. Pierce Teach Yourself Perl in 24 Hours!
clintp@geeksalad.org for details see http://www.geeksalad.org
"If you rush a Miracle Man,
you get rotten Miracles." --Miracle Max, The Princess Bride
------------------------------
Date: Thu, 04 May 2000 07:06:00 -0400
From: Freelancer <rhchui@yahoo.com>
Subject: Guess what? the largest online book store Amazon.com
Message-Id: <39115998.66ED45A6@yahoo.com>
I told our secretary order two O'Reilly books Java Enterprise in a
Nutshell and
Programming the Perl DBI for me. She ordered from Amazon.com instead
O'Reilly.
Guess what? She got replied said Amazon only has 1 book each on their
stock,
so they could not sell those two books to us any more. (^0^)
BTW, Amazon.com is the largest online book store in the world.
------------------------------
Date: Thu, 04 May 2000 07:31:09 -0500
From: "Paul R. Andersen" <andersen+@rchland.ibm.com>
Subject: Re: Guess what? the largest online book store Amazon.com
Message-Id: <39116D8D.FFAE5CD1@rchland.ibm.com>
I don't want to sound like an advertisement cause I have no interest in
this place but we have found generally better prices and availability on
technical books through bookpool.com, YMMV.
Paul
Freelancer wrote:
> I told our secretary order two O'Reilly books Java Enterprise in a
> Nutshell and
> Programming the Perl DBI for me. She ordered from Amazon.com instead
> O'Reilly.
> Guess what? She got replied said Amazon only has 1 book each on their
> stock,
> so they could not sell those two books to us any more. (^0^)
>
> BTW, Amazon.com is the largest online book store in the world.
--
Paul Andersen
-- I can please only ONE person per day.
-- Today is NOT your day.
-- Tomorrow isn't looking good either.
------------------------------
Date: Thu, 04 May 2000 12:45:55 GMT
From: "newbie" <xuyli@hotmail.com>
Subject: Re: Guess what? the largest online book store Amazon.com
Message-Id: <7ieQ4.47830$fV.2965376@bgtnsc05-news.ops.worldnet.att.net>
Are they good at packing too?
Amazon is more expensive than others like Barnes and Noble, but I always
buy from Amazon because their packing is excellent. The books always get to
my front door in mint condition. Their competitors book arrives crumbled 3
out of 5 times.
"Paul R. Andersen" <andersen+@rchland.ibm.com> wrote in message
news:39116D8D.FFAE5CD1@rchland.ibm.com...
> I don't want to sound like an advertisement cause I have no interest in
> this place but we have found generally better prices and availability on
> technical books through bookpool.com, YMMV.
>
> Paul
>
> Freelancer wrote:
>
> > I told our secretary order two O'Reilly books Java Enterprise in a
> > Nutshell and
> > Programming the Perl DBI for me. She ordered from Amazon.com instead
> > O'Reilly.
> > Guess what? She got replied said Amazon only has 1 book each on their
> > stock,
> > so they could not sell those two books to us any more. (^0^)
> >
> > BTW, Amazon.com is the largest online book store in the world.
>
> --
> Paul Andersen
> -- I can please only ONE person per day.
> -- Today is NOT your day.
> -- Tomorrow isn't looking good either.
>
>
>
------------------------------
Date: Thu, 04 May 2000 12:33:01 +0200
From: Jonathan Kazmierczak <johny@supermedia.pl>
Subject: How can I run auto-download file in browser ?
Message-Id: <391151DD.98259CD2@supermedia.pl>
Hi!
I've problem: In my application I must make function, that downloads
data from database and presents them in the text files. There are
virtual text files; I generate them and send to browser. So I want to
open browser window "Download", not new instance of browser with content
of the file.
Under Netscape this works correctly, but IE4.0 opens new browser window.
How can I make it ?
Here is my code:
#open database, login, execute query
print "Content-type: application/octet-stream\n";
#print "Content-Transfer-Encoding: binary\n";
print "Content-Disposition: inline; filename=$nazwa_pliku\n\n";
while (@data = $sth->fetchrow_array)
{
print "$data[0]\t$data[2]\t ...\n";
}
Johny.
------------------------------
Date: Thu, 04 May 2000 12:42:01 +0200
From: Zoltan Gyenes <gyenesz@westel900.hu>
Subject: How single-line switch (/s) works in regexps?
Message-Id: <fak2hs4ps1fdec6n9ahphhirabe01g651v@4ax.com>
In s/// command I can use the /s switch the matching to treat the
input lines as a (long) single line. I have to use that feature on big
(>70MB) postscript files to scan for a string that (in certain cases)
can be wrapped into 2 lines. Because of that sizes I'm curious about
the way that switch works, does it treat the whole file as a single
line or maybe (I hope) it only joins lines in case of a possible
match?
------------------------------
Date: 04 May 2000 13:04:44 +0100
From: nobull@mail.com
Subject: Re: How single-line switch (/s) works in regexps?
Message-Id: <u9ya5qfrmr.fsf@wcl-l.bham.ac.uk>
Zoltan Gyenes <gyenesz@westel900.hu> writes:
> In s/// command I can use the /s switch the matching to treat the
> input lines as a (long) single line. I have to use that feature on big
> (>70MB) postscript files to scan for a string that (in certain cases)
> can be wrapped into 2 lines. Because of that sizes I'm curious about
> the way that switch works, does it treat the whole file as a single
> line or maybe (I hope) it only joins lines in case of a possible
> match?
The s/// operator operates on $_ or some other single scalar variable
as specified using =~.
The presence of /s on the s/// operator cannot effect the code
(elsewhere in the program) that is responsible for reading the file
into the scalar variable.
So a related question (that's been floating at the back of my mind wrt
to regex support in $/) is as follows:
Given a prefix of string and a pattern is it possible to test if is
necessary to read in more to know if (or what) the pattern will match
in that prefix.
eg.
("foo" . $unread) =~ /f/ # Matches
("foo" . $unread) =~ /o+/ # Matches but we dont know how many
("foo" . $unread) =~ /od/ # Don't know if is maches
("foo" . $unread) =~ /d/ # Doesn't match
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 04 May 2000 08:51:13 -0400
From: Shane Dewitt <dewitt@jlab.org>
Subject: how to delete all variables in Z::?
Message-Id: <39117241.D6B48B7B@jlab.org>
is there a way to undef Z:: so that i can start with empty variables?
example:
foreach (@STUFF) {
open(IN,"./STUFF{$_}");
$q = new CGI(IN);
$q->import_names('Z');
close(IN);
print $Z::STUFF1;
print $Z::STUFF2;
}
i'd like for every variable in 'Z' to be undef each time through the
loop, is this possible?
--
Shane Dewitt Email: dewitt@jlab.org
TR 53C Phone: 757-269-7592
------------------------------
Date: Thu, 04 May 2000 15:02:48 +0200
From: Daniel Courivaud <d.courivaud@esiee.fr>
Subject: How to print '%' character with printf ?
Message-Id: <391174F8.25D1C112@esiee.fr>
Hello world,
I'm a beginner with Perl and I have a probably very basic question but I
found nothing in perldoc and faqs. I want to print a string containing
'%' character:
50 % of the files
and I try many things like __ printf(" %i \% of the
files",$percentage); __ but none of them are working.
Could you help me ?
Thank you for your help
---
Daniel COURIVAUD
---
Dpt Télécommunications et http://www.esiee.fr/tdsweb
Traitement du Signal
---
Groupe ESIEE Paris http://www.esiee.fr/
2 Bld Blaise Pascal
93162 Noisy le Grand
tél.: 01.45.92.67.87
fax: 01.45.92.66.99
------------------------------
Date: Thu, 04 May 2000 11:05:44 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: if file already exists then remove...
Message-Id: <39154b47.4364560@news.skynet.be>
Michael Carman wrote:
>But if you do care about failed attempts at deletion you
>should include a die() or warn() diagnostic, in which case the
>preliminary test with -e is good because it will save you spurious
>errors.
You can reverse the tests.
unlink $file;
warn "Failed to unlink $file: $!" if -e $file;
--
Bart.
------------------------------
Date: 4 May 2000 12:05:51 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: if file already exists then remove...
Message-Id: <957441426.6232@itz.pp.sci.fi>
In article <957427283.510887@shelley.paradise.net.nz>, Tintin wrote:
>This could lead to a security problem. If someone creates link to file (say
>a password file) and you just try to delete the file, BING there goes your
>precious password file (depending on permissions of course).
Um? One of us is making a fool of himself here..
% echo "foo" > foo.txt
% ln foo.txt bar.txt
% ls -l
total 2
-rw------- 2 ikaronen matl 4 May 4 14:55 bar.txt
-rw------- 2 ikaronen matl 4 May 4 14:55 foo.txt
% rm bar.txt
% ls -l
total 1
-rw------- 1 ikaronen matl 4 May 4 14:55 foo.txt
% ln -s foo.txt bar.txt
% ls -l
total 1
lrwxrwxrwx 1 ikaronen matl 7 May 4 14:56 bar.txt@ -> foo.txt
-rw------- 1 ikaronen matl 4 May 4 14:55 foo.txt
% rm bar.txt
% ls -l
total 1
-rw------- 1 ikaronen matl 4 May 4 14:55 foo.txt
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
Please ignore Godzilla and its pseudonyms - do not feed the troll.
------------------------------
Date: Thu, 04 May 2000 12:34:18 +0200
From: Ulrich Ackermann <uackermann@orga.com>
Subject: Re: Newbie needs help splitting file
Message-Id: <3911522A.689899B@orga.com>
Anamarija Kruljac wrote:
>
> Can you give me an example script for the following problem or at least
> point me where should I look for more info on how to do something like that?
> Thank you in advance!
>
> I have something like a flatfile database, an large file with lots of
> records. Something like:
>
> --START LINE--
> Key1: apple
> Key2: green
> Key3: sky
> Key4: high
> .
> .
> .
> --END LINE--
> --START LINE--
> Key1: banana
> .
> .
> .
>
> I'd like to select records from original file, based on different key
> values, and transfer those records to another file. For example, I want all
> records where Key1 contains "apple" and Key2 does not contain "blue" in
> another file. Original files are preety big, in range from 300Mb to 1Gb, so
> I probably couldn't just put whole file into array.
Dear Anamarija,
I do not know if I got you right, but my suggestion would be:
open a filehandle for that database-file:
open DB, "<path/and/name/of/database/file";
open NEWFILE, ">any/path/and/name";
my @record; # needed later
then read each line of that file:
while (my $line = <DB>) {
# Do something
}
and then "#Do something" could be done with regular expressions:
if ($line =~ /--START LINE--/) { #Find --START LINE--
$dont_write = 1;
while ($line !=~ /--END LINE--/) { #Read until --END LINE--
$line = <DB>;
push @record, $line;
} # while
foreach (@record) {
if ($_ =~ /Key1:\svalue1/) { #If Key1 with value1 is found
foreach (@record) {
if ($_ =~ /Key2:\svalue2/) { #check if also Key2 with value2 is
in this record
$dont_write = 0; # if so, I do not want to write it
}
}
} # if
} # foreach
if ($dont_write == 1) { # if I want to write
print NEWLINE "--START LINE--\n";
foreach (@record) {
print NEWFILE $_; # I will write in the new file
}
print NEWLINE "--END LINE--\n";
} # if
Of course I didn't test this script and a _real_ Perl-Guru could do that
in 5 lines.
But I am a newbe as you are and maybe it works ;-)
Greetings, Ulrich
--
Ulrich Ackermann
ORGA Kartensysteme GmbH (SY-PEAT-STA)
Tel.:+49.5254.991-925
mailto:uackermann@orga.com
------------------------------
Date: Thu, 04 May 2000 13:23:01 +0200
From: Jonathan Kazmierczak <johny@supermedia.pl>
Subject: Re: newbie: can't open text file in windows (path to file)
Message-Id: <39115D95.EDC3E4EA@supermedia.pl>
Hello!
> script is in c:\inetpub\wwwroot\cgi-bin and I use
> http://localhost/cgi-bin/test/pl to run it. The html is returned okay.
>
> test.pl
> $worked = open(oFile,">>mylog.log");
Here you have error: current directory in Windows is c:\inetpub\wwwroot.
You must specified full path:
$worked = open(oFile,'>>c:\inetpub\wwwroot\cgi-bin\mylog.log');
Johny.
------------------------------
Date: Thu, 04 May 2000 10:31:25 GMT
From: "Russell England" <russ@css2.com>
Subject: newbie: can't open text file in windows
Message-Id: <1kcQ4.1141$tQ3.172682@news3.cableinet.net>
My first script and I can't get it to work. The open file doesn't seem to
work.
I am using Windows 2000 and installed activeperl from activestate. The
script is in c:\inetpub\wwwroot\cgi-bin and I use
http://localhost/cgi-bin/test/pl to run it. The html is returned okay. I
have set full control permissions for everyone on the directory and the log
file. I also tried running it after deleting the log file.
Its probably something glaringly obvious but I haven't a clue - any help
would be appreciated.
Cheers
Russ
test.pl
#!/usr/bin/perl
use CGI qw(:standard);
$worked = open(oFile,">>mylog.log");
print oFile "Testing\n";
close(oFile);
print "HTTP/1.0 200 OK\n";
print "Content-Type: text/html\n\n";
print "<HTML>\n";
print "<BODY>\n";
if ($worked) {print "Worked\n";}
else {print "Didn't work = \n";}
print "<H4>Hello World</H4>\n";
print "</BODY>\n";
print "</HTML>\n";
------------------------------
Date: Thu, 04 May 2000 10:19:39 GMT
From: ammar_aganovic@my-deja.com
Subject: Re: Perl & delivering Databases?
Message-Id: <8erirj$fsc$1@nnrp1.deja.com>
In article <39107876.F9D3FC49@vpservices.com>,
Jeff Zucker <jeff@vpservices.com> wrote:
> ammar_aganovic@my-deja.com wrote:
> >
> > I need to make a database residing on MySQL available to custom
> > developed software which would be able to access the database
directly.
>
> The slightest search of Perl materials for "MySQL" or of MySQL
materials
> for "Perl" would lead you to the Perl DBI module and its DBD::mysql
> driver. It is a complete solution for accessing MySQL (with or
without
> ODBC) from Perl and also works with just about every other database
> under the sun.
I think you missed the point.
The MySQL DB would not let me connect directly ((My)ODBC, perl, php3)
from any host other that localhost. I was thinking of building some
sort of gateway between the Client & the Server but located at the
server side. I have no problem reading the DBs either with PHP3 or
Perl. The problem is to read the database, and stream the records to
the client, the Delphi client programm would hten read the stream and
store it in it's internal database. After the internal stored DB would
be modified, the information would go in other direction -> the client
would then feed the records to some Perl script which would read the
stream, and update the original database. So I guess I should be look
for streaming with Perl or something. Any help on that?
has anyone done anything similar?
could I use some sort of Perl-Proxy (Gateway?)
Ammar
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 4 May 2000 08:12:12 -0400
From: "BobS" <sturdevr@yahoo.com>
Subject: Re: perl in NT .BAT files Question
Message-Id: <8erpfb$3lp$1@bob.news.rcn.net>
I hate to disappoint those with long faces. If I knew enough about Perl to
write a C-ISAM module (or any other module), _I_ would cheer and applaud in
the streets. Maybe later ;-)
Bob
"Jonathan Stowe" <gellyfish@gellyfish.com> wrote in message
news:8eppla$sv3$1@orpheus.gellyfish.com...
> On Tue, 2 May 2000 13:34:52 -0400 BobS wrote:
> > Thanks for the heads up. I'll keep that in mind. Since the proprietary
> > C-ISAM library does file access, my thought is to let Perl control the
file
> > handler routines already in place. Hmmm, I wonder if Perl has a C-ISAM
> > module ...
> >
>
> I dont think there is though If you were to write a DBI/DBD interface to
> the C-ISAM system you are using and submit it to CPAN I am sure there
> would be cheering and applause in the streets ;-}
>
> /J\
> --
> We'll die together, like a father and son should.
> --
> fortune oscar homer
------------------------------
Date: Thu, 04 May 2000 11:07:42 GMT
From: andreas.boerner@icn.siemens.de (Andreas Boerner)
Subject: problem with "system" and file copy
Message-Id: <391159cd.108765115@news.icn.siemens.de>
Hello,
I have a problem with copy and a system call:
When I enter at command prompt (UNIX) the following command, it works
as expected:
cp ~/dir1/*.c ~/dir2
The following perl routine however does not work:
use strict;
my $command;
my $rc;
$command = "cp ~/dir1/*.c ~dir2";
print $command;
$rc = system($command);
print "rc=$rc\n";
it produces the following output:
command=cp ~/dir1/*.c ~/dir2
cp: cannot access ~/dir1/*.c
rc=512
Has anybody an idea, why this fails ???
------------------------------
Date: Thu, 04 May 2000 07:24:09 -0500
From: "Paul R. Andersen" <andersen+@rchland.ibm.com>
Subject: Re: problem with "system" and file copy
Message-Id: <39116BE8.A6E0CB57@rchland.ibm.com>
Perl does not understand the ~, it is csh, or ksh, or bash, or whatever
shell you are running that handles the tilde. Perl cannot. I wrote a
routine that processes file names and converts the tilde and other
shorthand notations to real names. That works great, especially with Tk
where I can let the users enter as they are used to.
Andreas Boerner wrote:
> Hello,
>
> I have a problem with copy and a system call:
>
> When I enter at command prompt (UNIX) the following command, it works
> as expected:
>
> cp ~/dir1/*.c ~/dir2
>
> The following perl routine however does not work:
>
> use strict;
> my $command;
> my $rc;
>
> $command = "cp ~/dir1/*.c ~dir2";
> print $command;
> $rc = system($command);
> print "rc=$rc\n";
>
> it produces the following output:
>
> command=cp ~/dir1/*.c ~/dir2
> cp: cannot access ~/dir1/*.c
> rc=512
>
> Has anybody an idea, why this fails ???
--
Paul Andersen
-- I can please only ONE person per day.
-- Today is NOT your day.
-- Tomorrow isn't looking good either.
------------------------------
Date: Thu, 04 May 2000 11:05:39 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Q: search/replace and pattern matching
Message-Id: <39133dc4.905383@news.skynet.be>
Jonathan Stowe wrote:
>> $address =~ s/[^\w\.-@]//g;
>
>So you dont think that my colleague £@gellyfish.com should get any mail then ?
Or
"great chips"@potato.com
Uh, at least I think that's a validly formed e-mail address.
--
Bart.
------------------------------
Date: Thu, 04 May 2000 12:42:25 GMT
From: ajs@ajs.com
Subject: Real and Windows streaming media access?
Message-Id: <8err7e$p0p$1@nnrp1.deja.com>
Hello all, I'm wondering if it's possible to access Real and Windows
streaming media from Perl.
e.g., if I have a URL of the form rtsp://... or mms://... what can I do
to verify that that URL can be accessed? LWP/URI does not seem to know
how to cope (need to fetch the most recent versions, though).
I could just connect to the port, but I don't know how to speak the
protocol, so I'd just be verifying that the server is accepting
connections. I suppose I could go read the RFC for rtsp (is MMS a known
quantity?)
Any help would be greatly appreciated, thanks.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 04 May 2000 11:05:42 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Regexp speed (was: Help: bol regexp in split string)
Message-Id: <391449d5.3994530@news.skynet.be>
Daniel Pfeiffer wrote:
>So much for generalisations! :-) $' might slow things down, but split
>/(...)/ seems to be a killer. Of course this dramatic result might
>shift with an increasing number of regexps in the program, but I don't
>use too many.
Using $` and $' will affect ALL regexes. You haven't benchmarked how bad
$` and $' influence the speed of regexes. Benchmarking that won't be
easy. I'm pretty convinced that you'll have to test it in a separate
script.
And I'm not sure, but the mere existence of $`and $' in your program
might even slow down the split in the other test.
Besides, an emulation of a native feature that isn't even twice as slow,
isn't even that bad... ;-)
--
Bart.
------------------------------
Date: Thu, 04 May 2000 11:05:51 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Saving Uploaded Files using CGI.pm
Message-Id: <3919558a.6991183@news.skynet.be>
Larry Rosler wrote:
>The elderly book on CGI.pm has the following code:
>
> $file = param('uplaod');
> $tmpfile = tmpFileName($file);
> rename $tmpfile,"./saved_file.out";
>
>I tried code like this on my Perl 5.6.0 system, and it worked just fine
>(modulo proper setting of the current directory, of course).
Are you sure? "uplaod" looks a bit strange.
>But when I
>searched the Perl 5.005_03 and 5.6.0 documentation for 'tmpFileName' it
>wasn't there!
>
>Would one recommend using this no-longer-documented function, which
>meets the original poster's needs exactly? I would have no hesitation,
>because it *is* in The Book. But why has its description disappeared?
Er...
It's not in the docs for 5.005_03. But plowing through the code, here's
how it works:
In sub read_multipart():
## Generation of the temporary file name:
$tmpfile = new TempFile;
$tmp = $tmpfile->as_string;
## The package TempFile is also in the source file CGI.pm
## Storing it in a hash:
# Save some information about the uploaded file where we can get
# at it later.
$self->{'.tmpfiles'}->{$filename}= {
name => $tmpfile,
info => {%header},
};
## tmpFileName() simply reads back the temporary file name
## from that hash;
sub tmpFileName {
my($self,$filename) = self_or_default(@_);
return $self->{'.tmpfiles'}->{$filename}->{name} ?
$self->{'.tmpfiles'}->{$filename}->{name}->as_string
: '';
}
I can only guess that the reason why it (no longer?) is in the docs, is
because maybe it is "soon" to be replaced by a more mature technique?
--
Bart.
------------------------------
Date: Thu, 04 May 2000 11:05:46 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: sprintf in CGI
Message-Id: <39174c39.4605955@news.skynet.be>
Makarand Kulkarni wrote:
>You can set font using simple style sheets
><style>
> .small {font-size: 8pt; color: #FF0000; font-family: Arial;}
></style>
"Arial" isn't a fixed pitch font.
--
Bart.
------------------------------
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 2946
**************************************