[16078] in Perl-Users-Digest
Perl-Users Digest, Issue: 3490 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 27 11:05:39 2000
Date: Tue, 27 Jun 2000 08:05:14 -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: <962118313-v9-i3490@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 27 Jun 2000 Volume: 9 Number: 3490
Today's topics:
Re: C prog access to dbi? <gellyfish@gellyfish.com>
Re: CGI Business Directory <rob13@rock13.com>
Command line args to apps in perl?? wmcn@my-deja.com
Embedding images into Perl script <vlad@soft-tronik.ru>
Re: Executing Perl scripts from within a web browser (jason)
file input <Gizzzmo@pandora.be>
Re: file input <tina@streetmail.com>
Re: file input <aqumsieh@hyperchip.com>
Re: hash and translation <mdemello@pound.ruf.rice.edu>
Re: hash and translation (Clinton A. Pierce)
Re: hash and translation <mdemello@pound.ruf.rice.edu>
Re: hash and translation <care227@attglobal.net>
Re: hash and translation (Clinton A. Pierce)
Re: http_referer...halp <gellyfish@gellyfish.com>
i'm stuck! help? nobody@nowhere.com
Image size change by Perl <lucas@cplhk.com>
Locales not loading at startup... <tonyboy@earthling.net>
Matching an octal doglovers@rocketmail.com
Re: Matching an octal <tony_curtis32@yahoo.com>
Re: Matching an octal rmore1@my-deja.com
Newbie tutorial help.... spheroid_snm@my-deja.com
Re: Newbie tutorial help.... <care227@attglobal.net>
Perl module -- English - Japanese, Japanese - English malverian@my-deja.com
Perl module -- English - Japanese, Japanese - English malverian@my-deja.com
Re: perl/Tk again...what widget called a function? <care227@attglobal.net>
Re: Pricelist... How to ? (Laurence V.)
Re: Pricelist... How to ? <ceaton@techmgmtresources.com>
Re: regex - slurp file and extract email addresses <thommy-p@bigfoot.com>
Re: regex - slurp file and extract email addresses <care227@attglobal.net>
Re: Scheduled script <Peter.Dintelmann@dresdner-bank.com>
Re: Solution needed <care227@attglobal.net>
SORRY!! I thought I messed up! malverian@my-deja.com
Start process with Perl/VMS <coucoureux.p@fr.ibm.com>
Syntax Question Not Found in Camel <skpurcell@hotmail.com>
Re: Syntax Question Not Found in Camel (Clinton A. Pierce)
Re: Syntax Question Not Found in Camel <Peter.Dintelmann@dresdner-bank.com>
Re: Web Hosting <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 27 Jun 2000 11:54:36 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: C prog access to dbi?
Message-Id: <0C065.310$iP2.43486@news.dircon.co.uk>
On Mon, 26 Jun 2000 23:19:30 -0400, cc Wrote:
> Jonathan Stowe wrote:
>
>> On Sun, 25 Jun 2000 11:28:31 -0400 cc wrote:
>> > Does anyone know how to call dbi from a C program. We want to
>> > distribute binaries and source. Actually, we wrote the whole system in
>> > java and the performance is not acceptable, so we are exploring the
>> > possibility of writing a database io component in dbi. We want to
>> > distribute binaries if possible to simplify installation. Ideas?
>> >
>>
>> I dont think that is very sensible. Most database vendors will provide
>> a C interface which you can write to. I would look to the documentation
>> for the database.
>>
>
> We are familiar with most of the c interfaces to databases, we have written
> them for oracle, sybase, ms-sqlserver, etc. However we are looking for the
> maintainability of odbc across platforms. This system is a distributed one,
> that will need to run on all platforms, hence the interest in dbi. Can't
> the dbi modules be accessed from C, that then can be linked into Java.
>
But the point is that the vast majority of the DBD drivers are written in C
over the vendors libraries in the first place. So even if it were possible
to use them from a C program what would be the point of adding another
layer ?
/J\
------------------------------
Date: Tue, 27 Jun 2000 06:19:23 -0400
From: "Rob - Rock13.com" <rob13@rock13.com>
Subject: Re: CGI Business Directory
Message-Id: <39587FAB.BE7D63E4@rock13.com>
Robb Charlton wrote:
>
> Hello,
>
> I'm looking for a cgi program that I once saw online. It's for creating
> a directory of local businesses and letting people do keyword searches of
> that data. It integrates with MS Access. Can anyone help?
>
> Thanks,
> Robb
Might have something at cgi-resouces.com or in CPAN
--
Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/
------------------------------
Date: Tue, 27 Jun 2000 10:47:40 GMT
From: wmcn@my-deja.com
Subject: Command line args to apps in perl??
Message-Id: <8ja0o8$1l6$1@nnrp1.deja.com>
> >The app the script should be launching is in the /sbin/
> >of a debian system. Is there something I'm missing.
>
> Check $ENV{PATH} is from a CGI.
> Is /sbin in your PATH on the server or are you using a full path to
it?
> Does it use any other programs not in your PATH?
> Does the user that CGI runs as have permission to run it (testing -x
$cmd
> will tell you).
>
I just tested the ENV and /sbin is in the path, I believe
the problem may be the way I'm passing args to the shell
script.
For example if my shell script is something stupid like
/bin/ls $TYPE $EXTENSION
where $TYTE = $1 and
$EXTENSION = $2
how do I pass/read/parse the args from a perl script.
How do I call the script from withing perl passing the arguements
correctly.
print "/home/script variable-A_from_FORM variable-B_from_FORM";?
/home/script variable-A_from_FORM variable-B_from_FORM;
Thanks,
Later,
Bill
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 27 Jun 2000 15:59:02 +0400
From: "Vladimir Rybintsev" <vlad@soft-tronik.ru>
Subject: Embedding images into Perl script
Message-Id: <8ja4om$22d5$1@storm.comstar.ru>
I find some Perl script, which generates HTML page with some
images.
Something like:
$fG=<<'fC';
M1TE&.#=A$@`/`+,``/_2+N.[*<>D)*J,'XYU&G)>%55&$#DO"QT8!@```/__
M_____________________R'Y!`$```D`+``````2``\```1F,,E)C3DT4T0"
M$(B6'0)@`H6$I*-WHE+!4NZ+D>&$E)]1$@D$P)`A``*%4`>!&`1RDD/@B2`2
MF*594"`P-(D(Z:<(P`@"!XX'O1'<7B<B118<P,L9CJIF`HYR.R=L&E`)!29N
%(@D1`#L`
fC
...
...
<img src=$fG>
...
So in variable $fG is encoded image. But what kind of encoding is used?
Does'nt seems like uuencode or Base64.
I never meet before with such methods.
May be, sombody knows?
------------------------------
Date: Tue, 27 Jun 2000 10:35:58 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: Executing Perl scripts from within a web browser
Message-Id: <MPG.13c320d06c3c835c989753@news>
Dragonia Radar Freedom, C.S. writes ..
>I'm trying to get a simple script to run from within a web browser.
you need a web server (and the associated HTTP headers in your Perl
program)
>Any and all help would be greatly appreciated. I've been searching
>FAQs[...]
at the command prompt type
perldoc -q "Web programming"
and read the FAQs listed there
--
jason - elephant@squirrelgroup.com -
------------------------------
Date: Tue, 27 Jun 2000 11:07:54 GMT
From: "Christophe Gijbels" <Gizzzmo@pandora.be>
Subject: file input
Message-Id: <eW%55.87288$6t3.104499@afrodite.telenet-ops.be>
Hi
Is there a way to make sure that when I read a line from a file, and that
line has the string $variable. That $variable gets his value and so when I
print it, not $variable is printed but his value ?
Content of the file:
This is the line whith the variable : $variable
This is another line
test.pl
#!/usr/bin/perl
open (FILE, "file");
$variable=10;
while (defined ($line=<FILE>))
{
print "$line\n";
}
close FILE;
I've tried many different things but it keeps on printing $variable.
And using regulaire expressions isn't that useful because this example shows
one variable but I want to use it on a lot of variables.
Is this possible or is it just a fantasie of me ?
Christophe
------------------------------
Date: 27 Jun 2000 14:17:16 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: file input
Message-Id: <8jad1c$4l4e$2@ID-24002.news.cis.dfn.de>
hi,
Christophe Gijbels <Gizzzmo@pandora.be> wrote:
> Is there a way to make sure that when I read a line from a file, and that
> line has the string $variable. That $variable gets his value and so when I
> print it, not $variable is printed but his value ?
hm, you could replace it with s///
$line =~ s/\$variable/$variable/g;
or if you read it in all at one:
{local $/;
$lines = <FILE>;
$lines =~ s/\$variable/$variable/gs;
}
tina
--
http://tinita.de \ enter__| |__the___ _ _ ___
tina's moviedatabase \ / _` / _ \/ _ \ '_(_-< of
search & add comments \ \ _,_\ __/\ __/_| /__/ perception
"The Software required Win98 or better, so I installed Linux."
------------------------------
Date: Tue, 27 Jun 2000 14:25:47 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: file input
Message-Id: <7ak8fbdwur.fsf@merlin.hyperchip.com>
"Christophe Gijbels" <Gizzzmo@pandora.be> writes:
> Is there a way to make sure that when I read a line from a file, and that
> line has the string $variable. That $variable gets his value and so when I
> print it, not $variable is printed but his value ?
Yes, it is possible, and it is even a FAQ!
Please search the FAQs for any question you might have in the future,
before posting. It saves time and bandwidth.
As to your question, type 'perldoc -q expand'. Around 30 lines down,
you'll see the question:
How can I expand variables in text strings?
--Ala
------------------------------
Date: 27 Jun 2000 11:15:59 GMT
From: Martin Julian DeMello <mdemello@pound.ruf.rice.edu>
Subject: Re: hash and translation
Message-Id: <8ja2df$7fq$1@joe.rice.edu>
Pascal POTTIER <ppo@infovista.fr> wrote:
> I'm sorry to as such a basic question, but i am not a Perl expert :(.
> I have a hash with translations { "bread" => "pain" , "stupid" => "stupide"
> , "Microsoft" => "split" } that i want to apply to a string.
> My basic way of doing it is with foreach on the keys of the hash and then
> with replacement (i need help on replacement too !!!)
> Is there any other way more efficient as the hash and the string will be
> very large ?
This takes just one pass through the string (and multiple lookups of the
hash, but that's what hashes are for, after all)
#!/usr/bin/perl -w
use strict;
my $text = " Testing: 'bread' and 'Microsoft' should be replaced.";
my %tr = ("bread" => "pain", "Microsoft" => "split", "should" => "have",
"be" => "been", "replaced" => "substituted");
my @temp = split /([\W])/, $text;
foreach(@temp){ $_ = $tr{$_} if defined $tr{$_}; }
print join("", @temp)."\n";
Or, replacing the last three lines with something slightly more compact
print join("",map {defined $tr{$_}?$tr{$_}:$_} split /([\W])/, $text)."\n";
The split /([\W])/ assumes that all the keys in your hash are alphanumeric
(i.e. it extracts all the 'words' from the string and checks them against
the hash). If your keys contain nonalphanumeric characters, you could
try splitting on whitespace.
(Caveat - I'm still somewhat new to perl, but I did test the code)
--
Martin DeMello
------------------------------
Date: Tue, 27 Jun 2000 13:47:08 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: hash and translation
Message-Id: <wf265.11598$fR2.143422@news1.rdc1.mi.home.com>
[Posted and mailed]
In article <8ja2df$7fq$1@joe.rice.edu>,
Martin Julian DeMello <mdemello@pound.ruf.rice.edu> writes:
> Pascal POTTIER <ppo@infovista.fr> wrote:
>> I have a hash with translations { "bread" => "pain" , "stupid" => "stupide"
>> , "Microsoft" => "split" } that i want to apply to a string.
>
> #!/usr/bin/perl -w
> use strict;
>
> my $text = " Testing: 'bread' and 'Microsoft' should be replaced.";
>
> my %tr = ("bread" => "pain", "Microsoft" => "split", "should" => "have",
> "be" => "been", "replaced" => "substituted");
>
> my @temp = split /([\W])/, $text;
> foreach(@temp){ $_ = $tr{$_} if defined $tr{$_}; }
>
> print join("", @temp)."\n";
>
> Or, replacing the last three lines with something slightly more compact
>
> print join("",map {defined $tr{$_}?$tr{$_}:$_} split /([\W])/, $text)."\n";
>
> [...]
> (Caveat - I'm still somewhat new to perl, but I did test the code)
Or a bit more compact, and concise as well:
$text=~s/\b(\W+)\b/exists($tr{$1})?$tr{$1}:$1/ge;
print $text;
--
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: 27 Jun 2000 14:19:57 GMT
From: Martin Julian DeMello <mdemello@pound.ruf.rice.edu>
Subject: Re: hash and translation
Message-Id: <8jad6d$fc1$1@joe.rice.edu>
Clinton A. Pierce <clintp@geeksalad.org> wrote:
>> Pascal POTTIER <ppo@infovista.fr> wrote:
>>> I have a hash with translations { "bread" => "pain" , "stupid" => "stupide"
>>> , "Microsoft" => "split" } that i want to apply to a string.
> Or a bit more compact, and concise as well:
> $text=~s/\b(\W+)\b/exists($tr{$1})?$tr{$1}:$1/ge;
> print $text;
Neat. One mistake - it ought to be \w+ rather than \W+
Why exists() rather than defined(), though? (Apart from having a lower golf
score, of course :)). I'd have thought the right thing to do if someone used
undef to remove a hash entry would be to simply not translate the key,
rather than have the program generate an error and stop.
--
Martin DeMello
------------------------------
Date: Tue, 27 Jun 2000 10:31:31 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: hash and translation
Message-Id: <3958BAC3.8B2C0498@attglobal.net>
Martin Julian DeMello wrote:
>
> Why exists() rather than defined(), though? (Apart from having a lower golf
> score, of course :)). I'd have thought the right thing to do if someone used
> undef to remove a hash entry would be to simply not translate the key,
> rather than have the program generate an error and stop.
>
undef is a perfectly fine value for a hash key, but would not be
found by a defined() check, possibly causing unexpected behaviour.
Using exists() saves you that chance.
Check out the discussion in the documentation:
http://www.perl.com/pub/doc/manual/html/pod/perlfunc/exists.html
------------------------------
Date: Tue, 27 Jun 2000 14:59:59 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: hash and translation
Message-Id: <Pj365.11610$fR2.144074@news1.rdc1.mi.home.com>
[Posted and mailed]
In article <3958BAC3.8B2C0498@attglobal.net>,
Drew Simonis <care227@attglobal.net> writes:
> Martin Julian DeMello wrote:
>>> $text=~s/\b(\W+)\b/exists($tr{$1})?$tr{$1}:$1/ge;
>>> print $text;
>>Neat. One mistake - it ought to be \w+ rather than \W+
You are, of course, correct. Typo!
>> Why exists() rather than defined(), though? (Apart from having a lower golf
>> score, of course :)). I'd have thought the right thing to do if someone used
>> undef to remove a hash entry would be to simply not translate the key,
>> rather than have the program generate an error and stop.
>>
>
> undef is a perfectly fine value for a hash key, but would not be
> found by a defined() check, possibly causing unexpected behaviour.
What you meant to say, I hope, is that undef is a perfectly fine value
for a hash VALUE...etc...
Because testing for an existing key like this:
# Bad code!
if (defined $hash{key}) {
#...
}
Tests whether the value at key is defined.
What you said was something along the lines of this:
# Bad code!
$a=undef;
if (defined $hash{$a}) {
#...
}
Can actually come out true if:
$a=undef;
$hash{$a}="HLAHALGHALHLAG";
if (defined $hash{$a}) {
#....
}
--
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: Tue, 27 Jun 2000 11:58:33 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: http_referer...halp
Message-Id: <JF065.311$iP2.43486@news.dircon.co.uk>
On Mon, 26 Jun 2000 21:36:09 +0100, Bob H Wrote:
>
> It seems that all I need is a 'simple' http_referrer file to do the job that
> I need. My problem is, what is a http_referrer file, how do I write one,
> where do I park it, am I capable of making it work?
>
I would ask in the more appropriate comp.infosystems.www.servers.unix .
/J\
------------------------------
Date: Tue, 27 Jun 2000 13:34:25 +0200
From: nobody@nowhere.com
Subject: i'm stuck! help?
Message-Id: <39589141.85273001@nowhere.com>
Hi there,
I've got a (really strange?) perl problem:
I hava a program that fills a numer of arrays (all going well); then I
want to use every element of that array in a regular expression to match
it to a word; but, immediately after the if that matches the 2 words,
the array is completely empty...! I can't figure out why. Here's the
piece of code:
#searh for context-sensitive names
for($i=0; $i<@c_roles_entry; $i++) {
$c_role = $c_roles_entry[$i];
if(($samples[$word_nr -1] =~ /($c_role)/) ||
($samples[$word_nr + 1] =~ /($c_role)/)) {
&mark_name($word_nr, $word_nr +
&is_uc_series($word_nr) - 1, $c_roles_type[$i]);
$found = 1;
}
}
$c_role is the i-th element of the array, and thats the one in the
regexp; a word from the array @samples is matched against it...
If anyone knows a solution, please mail to michelgr@hexon.cx
Thanx a lot!
Michel
------------------------------
Date: Tue, 27 Jun 2000 19:39:08 +0800
From: "Lucas Tsoi" <lucas@cplhk.com>
Subject: Image size change by Perl
Message-Id: <8ja3pf$fsr1@imsp212.netvigator.com>
Hi
I am to ask that could I change the image size by Perl,
i.e. from high pixel values to low pixel values?
------------------------------
Date: Tue, 27 Jun 2000 09:01:45 -0400
From: Anthony Lalande <tonyboy@earthling.net>
Subject: Locales not loading at startup...
Message-Id: <B57E1DF9.458B%tonyboy@earthling.net>
On RedHat, Sybperl has recently started spewing out warnings at startup
saying that it couldn't load locales:
warning: setlocale(LC_CTYPE, "") failed.
warning: LC_ALL = "en_US", LC_CTYPE = "(null)", LANG = "en_US",
warning: falling back to the "C" locale.
I have looked into the locales documentation, and installed glibc-2.1.3
(without a restart; is Linux like a Mac where you need to restart after
installations??).
All the necessary locales seem to be in place in /usr/share/locale/, and my
LC_ALL and LANG variables equal to 'en_US'. My
/opt/sybase/locales/locales.dat file does have an en_US entry:
[linux]
locale = en_US, us_english, iso_1
... and in the /opt/sybase/locales/ directory is another directory named
us_english, containing a file called 'iso_1'.
I don't have a SYBASE env variable; do I need one? How do I make the
warnings go away?
Thanks,
- Anthony Lalande
------------------------------
Date: Tue, 27 Jun 2000 13:47:28 GMT
From: doglovers@rocketmail.com
Subject: Matching an octal
Message-Id: <3958afeb.45481516@news.erols.com>
I have been working on this for days, it's embarrassing.
The letter m is ascii 109. Why does this keep evaluating to false?
"m" =~ /\0109/;
Thanks
------------------------------
Date: 27 Jun 2000 09:32:23 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Matching an octal
Message-Id: <8766qvxki0.fsf@limey.hpcc.uh.edu>
>> On Tue, 27 Jun 2000 13:47:28 GMT,
>> doglovers@rocketmail.com said:
> I have been working on this for days, it's embarrassing.
> The letter m is ascii 109. Why does this keep evaluating
> to false?
> "m" =~ /\0109/;
^
^
To answer initially with another question:
which digits can be used in octal?
Character 'm' has the ASCII code 155
8
if ('m' =~ /\155/) {
print "yes\n";
} else {
print "no\n";
}
hth
t
--
"With $10,000, we'd be millionaires!"
Homer Simpson
------------------------------
Date: Tue, 27 Jun 2000 14:35:05 GMT
From: rmore1@my-deja.com
Subject: Re: Matching an octal
Message-Id: <8jae2o$bh6$1@nnrp1.deja.com>
In article <3958afeb.45481516@news.erols.com>,
doglovers@rocketmail.com wrote:
> I have been working on this for days, it's embarrassing.
>
> The letter m is ascii 109. Why does this keep evaluating to false?
>
> "m" =~ /\0109/;
Try it on octal:
perl -e 'print ( "m" =~ /\155/ ? "Match\n" : "No match\n");'
or hex:
perl -e 'print ( "m" =~ /\x6D/ ? "Match\n" : "No match\n");'
--
=============================
Richard More
http://www.richmore.com/
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 27 Jun 2000 13:49:41 GMT
From: spheroid_snm@my-deja.com
Subject: Newbie tutorial help....
Message-Id: <8jabdd$9cf$1@nnrp1.deja.com>
I'd like to know how to save a data from single inputbox
named "pageTitle" by <form
action="http://www.saunalahti.fi/spheroid/cgi-bin/addPage.pl"> to a
file NEWFILE, "newfile.html".
So, I need information on how to make a new file with data taken from
inputbox in a form at some .html.
TIA
spheroid.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 27 Jun 2000 10:08:04 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Newbie tutorial help....
Message-Id: <3958B544.B938D03F@attglobal.net>
spheroid_snm@my-deja.com wrote:
>
> So, I need information on how to make a new file with data taken from
> inputbox in a form at some .html.
------------------------------------------------------------------
#!/usr/bin/perl -w #should also use the T switch for CGI
use strict;
use CGI qw/:standard/;
my $webparm = param('pageTitle'); #assuming textbox not textfield
open NEWFILE, ">newfile.html" or die $!;
print NEWFILE "$webparm";
close NEWFILE;
------------------------------------------------------------------
Did you even bother to try?
------------------------------
Date: Tue, 27 Jun 2000 13:27:51 GMT
From: malverian@my-deja.com
Subject: Perl module -- English - Japanese, Japanese - English
Message-Id: <8jaa43$8cg$1@nnrp1.deja.com>
Is there a perl module(s) that will translate English - Japanese and
Japanese - English? If so please tell me, thankyou!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 27 Jun 2000 13:25:33 GMT
From: malverian@my-deja.com
Subject: Perl module -- English - Japanese, Japanese - English
Message-Id: <8ja9vq$849$1@nnrp1.deja.com>
Is there a perl module(s) that will translate English - Japanese and
Japanese - English? If so please tell me, thankyou!
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 27 Jun 2000 09:33:49 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: perl/Tk again...what widget called a function?
Message-Id: <3958AD3D.C9285EA3@attglobal.net>
Aaron wrote:
>
> I read it once before, but I can't locate it again now when I need to
> know how to do it. Within a generic function, how do I know what widget
> called the function?
> Thanks for the help.
>
> Aaron
Sounds like you are the type of person who would really enjoy
comp.lang.perl.tk
All Perl/Tk, all the time!
------------------------------
Date: Tue, 27 Jun 2000 10:56:11 GMT
From: lv@claradot.codot.uk (Laurence V.)
Subject: Re: Pricelist... How to ?
Message-Id: <3958763b.3357787@news.clara.net>
On Tue, 27 Jun 2000 09:19:51 GMT, "Martin Jörgensen" <major@chello.se> wrote:
>I am currently working on a site which will contain prices from lots of
>computer hardware resellers worldwide. I therefore need an easy way to keep
>the prices on the site updated.
>
>What I need is this:
<snip>
>I will be getting a host which supports both cgi and asp...
Get a host which supports Java Servlets.. then code the solution in Java/Servlets/JDBC etc..
L.
PS. I think you're in the wrong ng talking about ASP :-)
------------------------------
Date: Tue, 27 Jun 2000 14:46:09 GMT
From: "Chris Eaton" <ceaton@techmgmtresources.com>
Subject: Re: Pricelist... How to ?
Message-Id: <R6365.26536$7I1.498495@news1.rdc2.on.home.com>
Holy massive crossposting Batman!
"Martin Jörgensen" <major@chello.se> wrote in message
news:Xk_55.1031$WU.9868@nntp1.chello.se...
> I am currently working on a site which will contain prices from lots of
> computer hardware resellers worldwide. I therefore need an easy way to
keep
> the prices on the site updated.
>
> What I need is this:
> - The resellers should be able to edit their own prices (or better, a
script
> that reads from their page automatically)
You can do both of those in ASP easily enough. Then again you can probably
do it in several other ways as well, but I can't say that from experience.
It is probably better to have them updating them then to attempt to read
their pages, since a HTML change will really mess things up. If they can
make XML versions of their prices, you could pull the data from that very
easily.
> - I want a top 10 of the prices, meaning the 10 cheapest.
Simple database query, no problem.
> - I want to do the whole database searchable.
Again, simple query, no problem.
> Are there any scripts out there which will do this (or some of it) ? And
> which language will do the better job ?
Well... lets see where you posted this...
the Java supporters will say Java.
the Perl supporters will say Perl.
The ASP supporters will insert their favorite language and say use ASP with
that language. (vbscript in my case)
Exactly what do you end up using should depend on what you know right now,
how much you want to learn, what you want to learn, and if you want it to
work properly in the Unix world or not. (If you do, then don't bother with
ASP at all, because even though there is a Unix implementation of ASP,
unless they've also ported over all the COM objects that make it useful,
there is no real point. Its also pretty expensive.)
Really, you didn't give enough information for anybody to give an objective
opinion on whats best for you, so we're stuck saying "go with X" simply
because *we* tend to like it more for whatever reason.
Best bet would be to ask yourself the following questions:
- Is this going to be on a Microsoft Webserver (IIS)? If not, ignore ASP
completely. I'll let the Perl and Java people fight out just what to use in
Unix land, because quite honestly I don't know. I'd probably use PHP, simply
because I actually have some clue how to use it (unlike Perl and Java), but
I'm hardly qualified to give an opinion on which one of those three is
better.
- If it is, what type of database will it be using? Do you have an SQL
Server of some type, or are you just going to use something simple like a
text file or a Microsoft Access database? If your using an Access database,
then ASP is probably a good bet, because there is tons of help available for
using it with Access. (note: Access will *not* work well under anything
remotely resembling heavy load.)
- Do you have any experience with any of the languages yourself? If you do,
that might be a good place to start.
- Do you have support staff who have experience with these things? If you
do, going with what they know may be a good place to start also.
Good luck!
:-)
--
--
Chris Eaton
Network Administrator
Technical Management Resources Inc.
1-800-811-1456 ext.136
http://www.techmgmtresources.com
------------------------------
Date: Tue, 27 Jun 2000 12:33:25 +0200
From: "Thomas Plehn" <thommy-p@bigfoot.com>
Subject: Re: regex - slurp file and extract email addresses
Message-Id: <8ja019$rl2$14$1@news.t-online.com>
>How do I tell perl to start checking at the whitespace closest to the
>front of "@" and stop at the whitespace closest to the back of "@"?
I thought this should indicate that the email-address is seperated by spaces
from the other things in an address line of the file.
If something like
Name Address fred and barney@something.com hompage-url
is possible, you can't get the valid email-address "fred and
barney@something.com" from an normal line of text seperated by spaces.
Even MSOutlook assumes that email-addresses contain no spaces to mark them
blue in an email-text.
I conclude that this problem can't be solved if the textfile contains
email-addresses with spaces in them.
------------------------------
Date: Tue, 27 Jun 2000 09:51:42 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: regex - slurp file and extract email addresses
Message-Id: <3958B16E.1AB3486C@attglobal.net>
Chris Sorensen wrote:
>
> If I don't ask .. how will I lean the syntax of regular expressions .. I
> keep checking all the books I have (camel, llama, pocketbook) and I'm
> having a hard time understanding how to correctly describe an email
> address .. so I asked a question
>
Mastering Regular Expressions. Its the Owl book (the Hip Owl? heh)
In fact, the book ends with an example regualr expression to match
an email address. Its a 16,000+ byte regular expression. Just shows
the scope of such a match when you want to get an email address "from
the wild".
That book is tops on my chart, and one I'm really enjoying reading.
It has an entire (huge) chapter on regular expressions with Perl, well
worth the investment.
------------------------------
Date: Tue, 27 Jun 2000 12:50:21 +0200
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: Scheduled script
Message-Id: <8ja0te$7no3@intranews.dresdnerbank.de>
Hi,
sinewave schrieb in Nachricht <3957C530.ABBE49A1@lineone.net>...
>I want to somehow run a script on a daily basis that will automatically
>generate and send e-mails where someone has posted their email details.
>What is the best way of doing this.
depends on the OS you are running.
1. On any flavor of UNIX you will find cron. See the man pages
for cron, crontab...
2. On NT use the scheduler service and the command line at
utility or the more friendly winat from the NT resource kit.
Sending email from Perl can be done with several modules.
The simplest one is Net::SMTP. Have a look at CPAN.
Best regards,
Peter Dintelmann
------------------------------
Date: Tue, 27 Jun 2000 09:59:58 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Solution needed
Message-Id: <3958B35E.AA682AF4@attglobal.net>
Tokyo Rose Butler wrote:
>
> Hello there,
>
> I work with a non-profit organization and we're looking for a solution
> to one of our problems. Our web site lists our board members and our
> chapter's individual information. We're looking for a way to allow each
> of our board members and our chapters to update their own information by
> just filling in a form.
I wrote something exactly like that. Its really quite trivial,
assuming that you are storing their information in a database.
A bit more bothersome if you have to edit HTML on the fly, but
not very hard.
Why not post what you've tried so far and I'm sure many will be
glad to assist. (You did not that this isn't a place to solicit
programers, didn't you? This is a technical newsgroup, not the
monster board)
------------------------------
Date: Tue, 27 Jun 2000 13:32:53 GMT
From: malverian@my-deja.com
Subject: SORRY!! I thought I messed up!
Message-Id: <8jaae5$8g6$1@nnrp1.deja.com>
This was my first time seperating newsgroups by a comma to send
multiple at the same time! Sorry, I thought I screwed it up. This
pertains to the Japanese-English module thing.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 27 Jun 2000 14:49:32 +0200
From: Pierre Coucoureux <coucoureux.p@fr.ibm.com>
Subject: Start process with Perl/VMS
Message-Id: <3958A2DB.2B1C12@fr.ibm.com>
Does anyone know how to start a process asynchronously with Perl on VMS
and how to get the returned status code of this new process?
I want to replace the famous sequence fork + exec and waitpid that
workss on Unix platform.
I have tried using system() but it works only in synchronous mode
(without /NOWAIT) and I'm not sure to get the status code in this case.
Example:
$command = "spawn/nowait mcr disk\$usr:[ptpc.testperl]prog.exe 11";
$processDesc = system $command;
Maybe, the good solution would be to use the lib$spawn system call but I
don't know how to do that and if it is possible.
------------------------------
Date: Tue, 27 Jun 2000 08:30:02 -0500
From: "spurcell" <skpurcell@hotmail.com>
Subject: Syntax Question Not Found in Camel
Message-Id: <3958aca8$0$6022@wodc7nh1.news.uu.net>
Hello,
I was reading Andrew Johnstons book "Effective Perl Programming" last night,
and ran into the following snippet of code.
$dir ||= './';
I have never ran into the or equal operator. Can someone help explain what
that does?
Thanks
Scott K Purcell
------------------------------
Date: Tue, 27 Jun 2000 13:40:11 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Syntax Question Not Found in Camel
Message-Id: <%8265.11597$fR2.143422@news1.rdc1.mi.home.com>
[Posted and mailed]
In article <3958aca8$0$6022@wodc7nh1.news.uu.net>,
"spurcell" <skpurcell@hotmail.com> writes:
> Hello,
> I was reading Andrew Johnstons book "Effective Perl Programming" last night,
> and ran into the following snippet of code.
>
> $dir ||= './';
>
> I have never ran into the or equal operator. Can someone help explain what
> that does?
Sure you have! You just don't recognize it. Or rather, you don't recognize
the form.
Most operator structure of the form:
valuex = valuex op valuey
can be re-written
valuex op= valuey
Remember $x.=$y? That's just shorthand for $x = $x . $y
How about $x*=$y? That's just $x = $x * $y
And so your expression reduces to:
$dir = $dir || './';
Which effectively sets $dir to ./ if it's false.
--
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: Tue, 27 Jun 2000 16:41:00 +0200
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: Syntax Question Not Found in Camel
Message-Id: <8jaedt$7n84@intranews.dresdnerbank.de>
Hi,
spurcell schrieb in Nachricht <3958aca8$0$6022@wodc7nh1.news.uu.net>...
>and ran into the following snippet of code.
>
>$dir ||= './';
>
>I have never ran into the or equal operator. Can someone help explain what
>that does?
it's a short form for
$dir = $dir || './';
Thus $dir is assigned the value './' if it was false before.
(This construct is often used to initialize variables with
default values.)
Peter Dintelmann
------------------------------
Date: Tue, 27 Jun 2000 12:03:09 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Web Hosting
Message-Id: <1K065.313$iP2.43486@news.dircon.co.uk>
On Mon, 26 Jun 2000 22:00:17 +0100, sinewave Wrote:
>
> Does anybody know where I can find a free ISP who will allow me to run C
> & Perl scripts as well as have access to the server command line.
>
http://dmoz.org/Computers/Internet/Commercial_Services/Web_Hosting/Free/
or ask in some comp.infosystems.www.* newsgroup ...
/J\
------------------------------
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 3490
**************************************