[16231] in Perl-Users-Digest
Perl-Users Digest, Issue: 3643 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 12 18:20:49 2000
Date: Wed, 12 Jul 2000 15:20:36 -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: <963440436-v9-i3643@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 12 Jul 2000 Volume: 9 Number: 3643
Today's topics:
reg expression not working. WHY??? <pdmos23@geocities.com>
Re: reg expression not working. WHY??? <pdmos23@geocities.com>
Re: reg expression not working. WHY??? <care227@attglobal.net>
Re: regex question <rrindels@arkansas.net>
Re: regex question <care227@attglobal.net>
Re: regex question <rrindels@arkansas.net>
Re: regex question <lr@hpl.hp.com>
Re: rookie:delete <tags> in xml files? (Doran)
Scripts for online Tests/Quizzes with Boolean calculati (Edward)
sdbm record size restrictions desarollador@my-deja.com
sending mail from perl <gte941n@prism.gatech.edu>
Re: sending mail from perl <samara_biz@hotmail.com>
Re: sending mail from perl (Will England)
Re: sending mail from perl <arolfe@genome.wi.mit.edu>
Re: sending mail from perl desarollador@my-deja.com
Re: session tracking <samara_biz@hotmail.com>
Re: sorting issue <lr@hpl.hp.com>
Re: stat->mtime trouble newsposter@cthulhu.demon.nl
Re: stat->mtime trouble <tony_curtis32@yahoo.com>
Re: Strange Characters Like  ? <bart.lateur@skynet.be>
Thanks to both of you! aaronmolnar@my-deja.com
Re: this is a test mindspring is screwing up their news <dpalmeNOSPAM@unitedtraffic.com>
Vary $" through array? <tony@blackstar.co.uk>
Re: Vary $" through array? <bart.lateur@skynet.be>
Re: Which one is better? $_[0] or shift? <nospam@nospam.com>
Re: Which one is better? $_[0] or shift? <nospam@nospam.com>
write to database pooh23@my-deja.com
Re: write to database <sariq@texas.net>
Re: XML Modules (Doran)
XML::Simple question (Doran)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 12 Jul 2000 19:34:59 GMT
From: Pasquale <pdmos23@geocities.com>
Subject: reg expression not working. WHY???
Message-Id: <396CCA05.F60F6000@geocities.com>
Can someone please help me "see the light" as to where the problem is
with this snippet of code? I've tried manipulating it in many different
ways, but it seemed to make no difference. The conditional statement
does not seem to be matching/working?? Thanks in advance!!
Pasquale
$address = $formdata{'address'};
$price = $formdata{'price'};
open(LOGFILE, "test.log");
@entries = <LOGFILE>;
close(LOGFILE);
foreach $line(@entries) {
chomp($line);
@cells = split(/::/, $line);
if ($address eq $cells[3]) {
$cells[0] = $price;
last;
}
}
------------------------------
Date: Wed, 12 Jul 2000 19:37:07 GMT
From: Pasquale <pdmos23@geocities.com>
Subject: Re: reg expression not working. WHY???
Message-Id: <396CCA84.D898EFB@geocities.com>
OOOPS! Not reg expression, conditional stament.
Pasquale wrote:
> Can someone please help me "see the light" as to where the problem is
> with this snippet of code? I've tried manipulating it in many different
> ways, but it seemed to make no difference. The conditional statement
> does not seem to be matching/working?? Thanks in advance!!
> Pasquale
>
> $address = $formdata{'address'};
> $price = $formdata{'price'};
>
> open(LOGFILE, "test.log");
> @entries = <LOGFILE>;
> close(LOGFILE);
>
> foreach $line(@entries) {
> chomp($line);
> @cells = split(/::/, $line);
> if ($address eq $cells[3]) {
> $cells[0] = $price;
> last;
> }
> }
------------------------------
Date: Wed, 12 Jul 2000 15:58:33 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: reg expression not working. WHY???
Message-Id: <396CCDE9.A07EC5E@attglobal.net>
Pasquale wrote:
>
> The conditional statement
> does not seem to be matching/working?? Thanks in advance!!
> Pasquale
>
> $address = $formdata{'address'};
> $price = $formdata{'price'};
You aren't using CGI.pm, are you? Thats likely your third mistake.
(I assume you haven't used -w or strict pragma either)
> open(LOGFILE, "test.log");
Should read: open LOGFILE, "test.log" or die "Can't open: $!\n";
> @entries = <LOGFILE>;
> close(LOGFILE);
>
> foreach $line(@entries) {
> chomp($line);
> @cells = split(/::/, $line);
> if ($address eq $cells[3]) {
> $cells[0] = $price;
> last;
> }
> }
Try this, its easier to type, but a little more cloudy. I'll also
added some print statments that should make debugging easier. You'll
remove them when you've seen the problem.
for(@entries) { # work with the default $_ varible
chomp; # works on $_ by default
@cells = split /::/; # also works on $_ by default
if ($address eq $cells[3]) {
$cells[0] = $price;
last;
}
}
So, for a completed snippet (sans the CGI.pm way of getting data), we
have:
my $address = $formdata{'address'};
my $price = $formdata{'price'};
print $address, "\n";
print $price, "\n";
open LOGFILE, "test.log" or die "Can't open logfile: $!\n";
chomp(@entries = <LOGFILE>); #nasty newlines
close(LOGFILE);
for(@entries)
{
@cells = split /::/;
print $cells[3], "\n";
if ($address eq $cells[3])
{
$cells[0] = $price;
last;
}
}
But you are aware that they array is being clobbered with
each iteration. I'm sure thats why you've included the last
command, but I just wanted to make sure.
------------------------------
Date: Wed, 12 Jul 2000 14:23:28 -0500
From: "Rodney Rindels" <rrindels@arkansas.net>
Subject: Re: regex question
Message-Id: <mG3b5.4$PI1.1342@news-west.usenetserver.com>
I am using Mason and mod_perl on apache. The question I have is in regards
to matching a password string , strict is in use by default under Mason.
if ($pass1=~/[!@#$%^&*()]/){
#cannot continue to register
} else {
#ok register
}
I thought this would not allow the character in the [] to be in the string
,
but this also fails if a 0 is in the string all other numeric values work
correctly. It does not matter where the 0 is in the string whether
$pass1="foo0" or $pass1="10" or $pass1="0bar"
am is missing something here. I have read through the entire perl faqs,
perldoc, and the 6 books on perl that I have.
Thanks,
Rodney
------------------------------
Date: Wed, 12 Jul 2000 15:35:19 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: regex question
Message-Id: <396CC877.F894F31@attglobal.net>
Rodney Rindels wrote:
>
> if ($pass1=~/[!@#$%^&*()]/){
> #cannot continue to register
> } else {
> #ok register
> }
$pass1 =~ /[!@#$%^&*()]/
This says the value in $pass1 matches either an ! or an @ or an #
and so on. You have not created a negated charachter class by using
a !. Instead, you should have been using a ^, such as this example:
[^!@#$%^&*()]
But there is an easier way. You can use the shorthand \W to match
anything that is _not_ a word charachter. (word being considered
[a-zA-Z0-9_] ) With this bit of new information, you can shorten
your match to
$pass1=~/[\W]/ # tests $pass1 for non-word chars.
Now go read http://www.perl.com/pub/doc/manual/html/pod/perlre.html
------------------------------
Date: Wed, 12 Jul 2000 14:56:50 -0500
From: "Rodney Rindels" <rrindels@arkansas.net>
Subject: Re: regex question
Message-Id: <o94b5.41$PI1.5094@news-west.usenetserver.com>
I tried the \W but missed the []
Thanks,
Rodney
Drew Simonis <care227@attglobal.net> wrote in message
news:396CC877.F894F31@attglobal.net...
> Rodney Rindels wrote:
> >
> > if ($pass1=~/[!@#$%^&*()]/){
> > #cannot continue to register
> > } else {
> > #ok register
> > }
>
>
> $pass1 =~ /[!@#$%^&*()]/
>
> This says the value in $pass1 matches either an ! or an @ or an #
> and so on. You have not created a negated charachter class by using
> a !. Instead, you should have been using a ^, such as this example:
>
> [^!@#$%^&*()]
>
> But there is an easier way. You can use the shorthand \W to match
> anything that is _not_ a word charachter. (word being considered
> [a-zA-Z0-9_] ) With this bit of new information, you can shorten
> your match to
>
> $pass1=~/[\W]/ # tests $pass1 for non-word chars.
>
> Now go read http://www.perl.com/pub/doc/manual/html/pod/perlre.html
------------------------------
Date: Wed, 12 Jul 2000 13:55:46 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: regex question
Message-Id: <MPG.13d67b2a72ecf5f098abc4@nntp.hpl.hp.com>
[Reordered for logical sequencing of statements and responses.
In article <o94b5.41$PI1.5094@news-west.usenetserver.com> on Wed, 12 Jul
2000 14:56:50 -0500, Rodney Rindels <rrindels@arkansas.net> says...
> Drew Simonis <care227@attglobal.net> wrote in message
> news:396CC877.F894F31@attglobal.net...
...
> > $pass1=~/[\W]/ # tests $pass1 for non-word chars.
> I tried the \W but missed the []
Really? Considering that the [] are superfluous in that regex, I don't
see how it should much matter that you missed them.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 12 Jul 2000 21:32:33 GMT
From: doran@NOSPAMaltx.net (Doran)
Subject: Re: rookie:delete <tags> in xml files?
Message-Id: <396ce2f4.20713233@news2.brandx.net>
>How can I delete text between special <tags> in a xml-file with a
>perl-script??
>I need to search a xml-file, delete some text between tags und output the
>"cleaned" file to another file.
>However, I don't know exactly how?
You probably should think of it as extracting the data from between
the tags, rather than deleting the tags.
Use one of the XML parser modules to get at the data. XML::Simple may
be the best for you, but XML::Parser, or XML::DOM may be needed if
you're doing something fancy.
Use those modules to extract the data and put it into variables. Then
you can create a new file with those variables and do whatever you
want with your old XML file.
The above modules, like all perl modules, can be found at CPAN.
Good luck,
Doran...
------------------------------
Date: Wed, 12 Jul 2000 20:03:19 GMT
From: Dedwahl@usa.net (Edward)
Subject: Scripts for online Tests/Quizzes with Boolean calculation ?
Message-Id: <396cca65.8928721@news.cybercity.dk>
Dear Friends,
I am in need of interactive Perl scripts that can handle
a quiz/test on a webpage where you have two choices at each
question/line and then do some Boolean calculations like:
IF (LINE 1 = FALSE) AND (LINE 2 = TRUE) THEN
create a certain predefined line in the response page sent
back as the reply to the finished testpage.
In fact I want to make a similar test to the one found on
http://www.careerdiscovery.com/fastcompany/
I have searched many Perl archives but only found more
or less the same test/quiz scripts - but they only seam to
ad true score (and may be calculate averages, % levels
etc. and NOT doing Boolean calculations).
I would appeciate very much if you could help me find
suitable scripts (not necessarily free- or sharewre).
Regards Edward Wahl
(delete "D" in email address)
------------------------------
Date: Wed, 12 Jul 2000 19:19:44 GMT
From: desarollador@my-deja.com
Subject: sdbm record size restrictions
Message-Id: <8kigch$guk$1@nnrp2.deja.com>
I am developing a quick and dirty application on
NT (not my choice) and so there is no DB_File,
etc. for storing hash-tied data. I have read
that the record restriction (1K) in SDBM can be
modified, but I have not been able to find out
how. Thanks for any and all help.
dave
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 12 Jul 2000 18:32:47 GMT
From: Benjamin David Garrison <gte941n@prism.gatech.edu>
Subject: sending mail from perl
Message-Id: <8kidkf$n7s$2@news-int.gatech.edu>
is there a way to send mail from perl from a windows platform?
and, what are the modules that would be required for that?
--
Ben Garrison * ICQ#20300203 * IM ben628496 * www.ben.f2s.com
- There's a fine line between sitting through a calculus leture and
sleeping -- Oh wait! No there isn't.
------------------------------
Date: Wed, 12 Jul 2000 15:28:56 -0400
From: "Alex T." <samara_biz@hotmail.com>
Subject: Re: sending mail from perl
Message-Id: <396CC6F8.9A2ADF42@hotmail.com>
Hey!
Yes, of course, there is. Here's how you do it:
You have your global variables which don't change:
#e-mail variables
$mailsender = 'your_e-mail@domain.com';
$mailserver = 'mail.domain.edu';
Then you have a subroutine: (You have to have libnet module installed,
ask again if you need directions on how to install this module)
####################################################################
#sends an e-mail
#input: subject, mailto, mailbody
#output: e-mail
####################################################################
sub Email{
#passing the parameters
my( $subject, $mailto, $mailbody) = @_;
use Net::SMTP;
$smtp = Net::SMTP->new($mailserver);
$smtp->mail($mailsender);
$smtp->to($mailto);
$smtp->data();
$smtp->datasend("Subject: $subject\n");
$smtp->datasend("To: $mailto\n");
$smtp->datasend("From: $mailsender\n\n");
$smtp->datasend($mailbody);
$smtp->datasend();
$smtp->quit;
} #Email
So, then to send an e-mail all you have to do is to call this subroutine
like:
&Email('You subject goes here',
'the-person-you-want-to-email@somewhere.com', 'Hey there! This is a
short e-mail');
Hope that helps!
Alex
Benjamin David Garrison wrote:
> is there a way to send mail from perl from a windows platform?
>
> and, what are the modules that would be required for that?
>
> --
> Ben Garrison * ICQ#20300203 * IM ben628496 * www.ben.f2s.com
> - There's a fine line between sitting through a calculus leture and
> sleeping -- Oh wait! No there isn't.
------------------------------
Date: Wed, 12 Jul 2000 19:43:51 GMT
From: will@mylanders.com (Will England)
Subject: Re: sending mail from perl
Message-Id: <slrn8mpin4.s8.will@mylanders.com>
On 12 Jul 2000 18:32:47 GMT, Benjamin David Garrison
<gte941n@prism.gatech.edu> wrote:
>is there a way to send mail from perl from a windows platform?
>and, what are the modules that would be required for that?
>
Er. Well, do you have any kind of SMTP server on the LAN?
Exchange servers often can have or do have SMTP turned on.
If so, Net::SMTP is your friend. That's my usual solution.
Failing that, there are sendmail workalikes for Windows NT,
but I have not had much success getting them working.
Post a bit more info about your environment and what you
want to do, and we'll see what we can figure out.
Will
--
"If Al Gore invented the Internet, then I invented spellcheck!"
Dan Quayle, quoted at the National Press Club, 8/3/1999
pgpkey at http://will.mylanders.com/pub_pgp.asc
Recovery page: http://will.mylanders.com/ will@mylanders.com
------------------------------
Date: 12 Jul 2000 15:49:23 -0400
From: Alex Rolfe <arolfe@genome.wi.mit.edu>
Subject: Re: sending mail from perl
Message-Id: <yjchf9vyvr0.fsf@darwin.wi.mit.edu>
Benjamin David Garrison <gte941n@prism.gatech.edu> writes:
> is there a way to send mail from perl from a windows platform?
> and, what are the modules that would be required for that?
The Mail::Sendmail module should this, though I haven't actually tried
it on windows. It's available from CPAN.
Alex
------------------------------
Date: Wed, 12 Jul 2000 19:51:23 GMT
From: desarollador@my-deja.com
Subject: Re: sending mail from perl
Message-Id: <8kii7k$1q7$1@nnrp1.deja.com>
In article <8kidkf$n7s$2@news-int.gatech.edu>,
Benjamin David Garrison <gte941n@prism.gatech.edu> wrote:
> is there a way to send mail from perl from a windows platform?
>
> and, what are the modules that would be required for that?
>
> --
> Ben Garrison * ICQ#20300203 * IM ben628496 * www.ben.f2s.com
> - There's a fine line between sitting through a calculus leture and
> sleeping -- Oh wait! No there isn't.
>
I was once forced to write a Perl script to run on NT, and here is how I
did the email thing:
There is program that is freeware that is called either BLAT.EXE or
DBLAT.exe and it can send email on NT. There is also a version of
sendmail for NT and there are other ways as well, but DBLAT is simple.
The code would look something like this:
#NT version using DBLAT.exe, a simple mail program
$mailer = 'C:\\Winnt\\system32\\DBLAT.EXE'; # set path to
DBLAT executable on NT Web server
$tmpfilename="C:\\TEMP\\dst$$.tmp";
open (MESSAGE, ">$tmpfilename") || die "can't open temp file $!";
#print e-mail
print MESSAGE <<End_of_Mail;
######put message here#######3
End_of_Mail
close MESSAGE;
#send e-mail
open (DUMMY, "| $mailer $tmpfilename -f $from -t $to -s $subject") ||
(die "Can't open $mailer $!\n");
close DUMMY;
unlink("$tmpfilename") || die "can't close temp file $!"; #delete
temp file
If this doesn't work look around; I remember seeing other solutions, but
most seemed to require you to install some sort of a program and I don't
know if you are in the position to do that. You could always just turn
to the good and install Unix......
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 12 Jul 2000 14:36:21 -0400
From: "Alex T." <samara_biz@hotmail.com>
Subject: Re: session tracking
Message-Id: <396CBAA4.7291BC47@hotmail.com>
I'm doing something similar and I'm using PerlScript for Active Server
Pages. My script index.asp controls the output of all the web-pages in the
web-site. There are protected pages, which you can not view unless you're
logged on and pages accessible to all.
Try to look at www.perlscripters.com to get some ideas.
Alex
dbottoms98@my-deja.com wrote:
> To All,
>
> Does anyone know where I can get some good info and examples on session
> tracking in Perl?? I want it so that users have to login to view all
> the pages in a website!! Not just login on the first page but be able
> to type in a url of a page in the site without loggin in!
>
> Thanks
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Wed, 12 Jul 2000 11:27:55 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: sorting issue
Message-Id: <MPG.13d658874a0b31f798abbe@nntp.hpl.hp.com>
In article <963396510.3191@itz.pp.sci.fi> on 12 Jul 2000 11:34:11 GMT,
Ilmari Karonen <iltzu@sci.invalid> says...
> In article <slrn8mn6ui.4q5.tadmc@magna.metronet.com>, Tad McClellan wrote:
> >On 11 Jul 2000 22:10:29 GMT, D.W. <dpalmeNOSPAM@unitedtraffic.com> wrote:
> >
> >>I need to sort the miles as they are computed so that when the list is
> > ^^^^^^^^^^^^^^^^^^^^
> >You cannot do this (if I'm reading it correctly).
> >You cannot sort a list if the list is not yet complete.
>
> In the trivial sense that you can't sort (or do anything else with)
> the entire list until it exists, you're correct. However, keeping the
> list sorted as it is generated is quite simple:
<Snip insertion-sort code, which is quadratic>
You cannot sort a list EFFICIENTLY if the list is not yet complete.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 12 Jul 2000 18:32:45 GMT
From: newsposter@cthulhu.demon.nl
Subject: Re: stat->mtime trouble
Message-Id: <8kidkd$l1r$2@internal-news.uu.net>
Sean Lavelle <slavelle@concentus-tech.com> wrote:
Code:
> $stats = stat($dir_list[$i]);
> if($dir_list[$i] eq ""){}
> else{
> # check if modified in the last 24 hours -- this is where it bombs
> out
> if(($now_time - $stats->mtime)<$day_sec){
> print $mod_list[$j]; print " "; print $stats->mode; print "\n";
> $j++;
> }
> }
Error:
> Can't call method "mtime" on an undefined value at
> lookingglass.pl line 28.
So it is likely that $stats is undefined. stat returns a null list if
the stat fails. So check the result of stat and display the error
message if it fails.
Erik
------------------------------
Date: 12 Jul 2000 14:35:55 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: stat->mtime trouble
Message-Id: <87itubb0pw.fsf@limey.hpcc.uh.edu>
>> On Wed, 12 Jul 2000 13:26:23 -0400,
>> Sean Lavelle <slavelle@concentus-tech.com> said:
> I am trying to run down directories and check the
> mod times of the files in them but I get these (fatal)
> errors alot:
> Can't call method "mtime" on an undefined value
> at lookingglass.pl line 28.
> $stats = stat($dir_list[$i]);
Did the stat() succeed? (Are you stat()ing in the right
directory?)
Are you overloading stat() with File::stat?
hth
t
--
"With $10,000, we'd be millionaires!"
Homer Simpson
------------------------------
Date: Wed, 12 Jul 2000 21:13:47 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Strange Characters Like  ?
Message-Id: <oqfpms0npvbm4lobo5muas2ru0ugsjfqem@4ax.com>
Axl wrote:
>Running a "cut and paste your resume here" form submittal, there are
>some odd characters that keep turning up. Right now they are all
>replaced with a dash (-), since I'm assuming they're some kind of
>bulleted list character. But it would be nice to know exactly what
>characters these are supposed to represent. Would there be maybe a
>translation chart somewhere?
>
>& # 61623 ;
>& # 61608 ;
>& # 61656 ;
Not a Perl question.
But yes, there are lists available. The numeric code is the Unicode
character code, of which ISO-Latin-1 is a subset. See the FTP site for
<ftp://ftp.unicode.org/Public/>.
Convert the above numbers to 4 digits hex, and look 'em up in the file
available from <ftp://ftp.unicode.org/Public/UNIDATA/NamesList.txt>.
foreach (61623, 61608, 61656) {
printf "%04X\n", $_;
}
However, I get "F0B7", "F0A8", "F0D8" which are in the "private use
area" E000-F8FF. Gee, that ain't much use either. It looks like these
characters are not standardized.
--
Bart.
------------------------------
Date: Wed, 12 Jul 2000 20:08:26 GMT
From: aaronmolnar@my-deja.com
Subject: Thanks to both of you!
Message-Id: <8kij7b$2fm$1@nnrp1.deja.com>
Sorry it's not really a PERL question but I knew you guys would know
what I should do.
Thanks again!
In article
<Pine.OSF.4.21.0007120227490.27676-100000@mail.med.upenn.edu>,
Nico Zigouras <zigouras@mail.med.upenn.edu> wrote:
> You have to quote it in the form, like:
>
> print "<input..... value=\"$user_name\">";
> <input..... value="Joe Smith">
>
> More of a CGI question, but whatever...
>
> On Wed, 12 Jul 2000 aaronmolnar@my-deja.com wrote:
>
> > Date: Wed, 12 Jul 2000 03:18:55 GMT
> > From: aaronmolnar@my-deja.com
> > Newsgroups: comp.lang.perl.misc
> > Subject: "VALUE" of web form fields stops at spaces?
> >
> > I'm using PERL to retrieve user info so that the user can change
> > it and submit it for update. When I use a scalar as the value in
> > one of the form fields only the first word gets displayed.
> >
> > ex: $user_name eq "Joe Smith";
> > print "<input..... value=$user_name>";
> >
> > This only inserts "Joe" into the web field instead of "Joe Smith".
> >
> > Has anyone else had a similar problem? What can I do?
> >
> > Thanks a lot for any help.
> >
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 12 Jul 2000 11:53:38 -0500
From: "D.W." <dpalmeNOSPAM@unitedtraffic.com>
Subject: Re: this is a test mindspring is screwing up their news servers AGAIN
Message-Id: <8kidj6$tef$1@slb0.atl.mindspring.net>
I would have if Mindspring would give us access to it.
Douglas
Drew Simonis wrote in message <396C9814.3A427F6C@attglobal.net>...
>"D.W." wrote:
>>
>> It appears that Mindspring has flushed their entire cache of news
articles
>> and I'm just testing to make sure that I can at the very least POST
>> SOMETHING.
>
>Please use alt.test or a similar group.
------------------------------
Date: Wed, 12 Jul 2000 18:25:07 GMT
From: Tony Bowden <tony@blackstar.co.uk>
Subject: Vary $" through array?
Message-Id: <7K2b5.832$oN1.14267@news2-win.server.ntlworld.com>
Idly wondering ...
Is there any way of setting $" to a different value whilst it's printing
the array?
Something along the lines of
@foo = qw/1 10 100/;
$" = sub { "." x length($a) }
print "Foo = @foo\n";
[where $a and $b would be magically set to the variables either side of
the current 'gap']
which would then print:
1.10..100
I've no real reason for this, and I know that you could almost always do
it a better way, but I'm curious if there's any way at all of playing with $"
like this during the print ...
Tony
--
-----------------------------------------------------------------------------
Tony Bowden | Belfast, NI | tb@tmtm.com | www.tmtm.com | www.blackstar.co.uk
If I'm feigning coherence and calmness Laugh with me
-----------------------------------------------------------------------------
------------------------------
Date: Wed, 12 Jul 2000 22:24:59 +0200
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Vary $" through array?
Message-Id: <6ukpmsopv24l52gh7ifsqos6cvju94apcs@4ax.com>
Tony Bowden wrote:
>Is there any way of setting $" to a different value whilst it's printing
>the array?
No, for the simple reason that "@ary" is turned into
join $", @ary
automatically. Snapshot of $" at one point in time, and used everywhere
between the list items.
--
Bart.
------------------------------
Date: 12 Jul 2000 20:27:33 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: Which one is better? $_[0] or shift?
Message-Id: <8kikbl$6b7$a@216.155.32.201>
In article <smnffsbind6162@corp.supernews.com>, cberry@cinenet.net (Craig
Berry) wrote:
| Tad McClellan (tadmc@metronet.com) wrote:
| : "existance" and "truth" are not the same thing.
|
| Aha! A Perl hacker *can* have Buddha-nature!
ROFL!
from the Koan of Silence bleeds the kernel of truth. :>
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: 12 Jul 2000 20:28:59 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: Which one is better? $_[0] or shift?
Message-Id: <8kikeb$6b7$b@216.155.32.201>
In article <6s6pms47aev7h16fphb1n3sq9lo2uqfipi@4ax.com>, Bart Lateur
<bart.lateur@skynet.be> wrote:
| Abigail wrote:
|
| >][ The interest in the '??' operator -- (A ?? B) is the same as (defined
| >A
| >][ ? A : B) -- seems to have waned.
| >
| >I don't think the interest has waned. But why bother reviving it when
| >it unleases some of the most bitter flames I've seen, and the pumpking
| >vetos it anyway?
|
| Get another pumpking.
|
| ;-)
why, it's not midnight yet... ? :D
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: Wed, 12 Jul 2000 18:59:46 GMT
From: pooh23@my-deja.com
Subject: write to database
Message-Id: <8kif6m$v5p$1@nnrp1.deja.com>
Hello,
Does anyone know of tutorials on how to write to database from perl?
Thanks.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 12 Jul 2000 14:19:00 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: write to database
Message-Id: <396CC4A4.472A7305@texas.net>
pooh23@my-deja.com wrote:
>
> Hello,
> Does anyone know of tutorials on how to write to database from perl?
Which database?
Most likely you'll want to use DBI with the applicable driver.
http://www.symbolstone.org/technology/perl/DBI/doc/tpj5/index.html
and
perldoc -q database
- Tom
------------------------------
Date: Wed, 12 Jul 2000 21:27:38 GMT
From: doran@NOSPAMaltx.net (Doran)
Subject: Re: XML Modules
Message-Id: <396ce274.20585283@news2.brandx.net>
PerlMonth has some good articles on parsing XML. Be sure and check the
back issues too.
http://www.perlmonth.com
Good luck
db
On Mon, 3 Jul 2000 00:53:14 +0100, "Dr Joolz"
<julius_mong@hotmail.com> wrote:
>Dear All, I'm trying to learn about the XML package, such as Parser, DOM,
>Generator etc, could someone tell me where I could find these modules for
>download and code examples of how to use them?
>
>Thanks,
> Jules
>
>***24 hours in a day...24 beers in a case...coincidence?***
>
>
------------------------------
Date: Wed, 12 Jul 2000 21:46:52 GMT
From: doran@NOSPAMaltx.net (Doran)
Subject: XML::Simple question
Message-Id: <396ce40d.20994038@news2.brandx.net>
Below is an example of a subroutine I use to parse an XML file using
XML::Simple. When I have the forcearray option set to '1' (just like
in the docs), my server goes into overload for a couple of minutes and
is pretty much unavailable until I can kill the process or until my
web server times out.
When I name the specific node however ('fnot' in the example below), I
don't have this problem.
Any ideas as to why?
The XML file that's being parsed isn't particularly hairy. It's maybe
100 lines long with 50 or 60 distinct nodes. No attributes. Like I
said, pretty simple.
The web server is IIS running on a beefy Win2k machine.
The Perl is Activestate v5.6. The XML::Simple module is 1.04.
Here's the routine:
my ($xml);
sub xml_parse{
# First check for a value
my $xml_file = 'd:\path\to\file.xml';
# Bring in the XML Parser
use XML::Simple;
# Read the file
# Force the data into an array, even if it's single items
# This works fine
$xml=XMLin($xml_file, forcearray => ['fnot']);
# This effectively locks up the system
# $xml=XMLin($xml_file, forcearray => '1');
# So does this
# $xml=XMLin($xml_file, forcearray => 1);
}
Any insights are most welcome.
Thanks,
Doran...
------------------------------
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 3643
**************************************