[25742] in Perl-Users-Digest
Perl-Users Digest, Issue: 7982 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 16 14:05:55 2005
Date: Sat, 16 Apr 2005 11:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 16 Apr 2005 Volume: 10 Number: 7982
Today's topics:
BASIC XML help <bdabaum@gmail.com>
Re: BASIC XML help <tadmc@augustmail.com>
Creating m3u list from opendir listing <sheukels=cuthere=@yahooo.co.uk>
Re: DBI update <youdontknowme@stranger.com>
Re: DBI update <youdontknowme@stranger.com>
Re: DBI update <youdontknowme@stranger.com>
Re: DBI update <youdontknowme@stranger.com>
Re: DBI update <tadmc@augustmail.com>
Do You Want To Know For Sure That You Are Going To Heav RonGrossi382594@yahoo.com
Re: Is Perl open source? <comdog@panix.com>
Re: Matching strings in a binary file thanks a lot Ta <jbl02NO@SPAMhotmail.com>
Matching strings in a binary file <jbl02NO@SPAMhotmail.com>
Re: Matching strings in a binary file <tadmc@augustmail.com>
Parsing user-entered content to remove rude words <gmills@nilELEPHANTdram.com>
Re: Parsing user-entered content to remove rude words <tadmc@augustmail.com>
Re: Parsing user-entered content to remove rude words <mark.clementsREMOVETHIS@wanadoo.fr>
Re: Parsing user-entered content to remove rude words <Juha.Laiho@iki.fi>
Re: PDF and Word to screen rob_1029384756@hotmail.co.uk
Re: regex help ioneabu@yahoo.com
socket change from 5.8.4 to 5.8.6? <bit@bucket.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Apr 2005 07:56:57 -0700
From: "Imdabaum" <bdabaum@gmail.com>
Subject: BASIC XML help
Message-Id: <1113663416.973680.87820@g14g2000cwa.googlegroups.com>
I have am trying to learn XML, and need help understanding how to
write my own methods with XSLT. The program I am working on just
accepts PCDATA into a textfield. I want to check the entries from the
textfield with definitions stored in the XML document. Can anyone help?
------------------------------
Date: Sat, 16 Apr 2005 12:10:22 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: BASIC XML help
Message-Id: <slrnd62hnu.h2e.tadmc@magna.augustmail.com>
Imdabaum <bdabaum@gmail.com> wrote:
> I have am trying to learn XML, and need help understanding how to
> write my own methods with XSLT. The program I am working on just
> accepts PCDATA into a textfield. I want to check the entries from the
> textfield with definitions stored in the XML document. Can anyone help?
Someone in the XML newsgroup can probably help XML problems.
clp.misc could probably help if you should ever have a Perl problem...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 16 Apr 2005 19:33:40 +0200
From: "Seansan" <sheukels=cuthere=@yahooo.co.uk>
Subject: Creating m3u list from opendir listing
Message-Id: <42614d9f$0$82850$e4fe514c@news.xs4all.nl>
Hi there,
Does anyone know why the following code doenst force a download of a m3u
list (winamp playlist) when called directly? Am I forgetting something?
regards, Seansan
my $mp3_dir = '/var/www/html/dl';
my $url_root = 'http://www.site.com/dl/';
my $body;
opendir(D, $mp3_dir);
my @f = readdir(D);
closedir(D);
foreach my $file (@f) {
next if ($file eq '.' || $file eq '..');
next if (-d $file);
if ($file =~ /mp3$/) {
$body .= $url_root . $file . "\n";
}
}
print "Content-type: application/octet-stream\n";
print "Content-Disposition: attachment; filename=mymusic.m3u\n";
print "Content-Length: ", length $body, "\n\n",
print $body;
------------------------------
Date: Sat, 16 Apr 2005 16:31:55 +0100
From: "Bigus" <youdontknowme@stranger.com>
Subject: Re: DBI update
Message-Id: <DtGdnQ6GKuzVrfzfRVnyuw@giganews.com>
"Richard Gration" <richard@zync.co.uk> wrote in message
news:pan.2005.04.14.23.25.50.632314@zync.co.uk...
> > my $sth = $db->prepare("UPDATE items SET $set WHERE id =
> > '$form{selitem}'");
> > $sth->execute($quoted);
>
> What happens if $form{selitem} contains the string
>
> q('; delete from items; select * from items where id = ') ?
$form{selitem} always contains an integer
[..]
> That would become
>
> eval ("HASH(0x813c1c8)->execute($form{type},$form{size})");
>
> Not quite what you wanted. You're in a bit of an interpolation pickle
> here. A more correct way to do what you want is something along
> these lines (untested):
>
> my (@fields,@values);
> foreach my $field (keys %form) {
> next if ($field =~ /^selitem$/) # strip out others if you wish
> push @fields, $field;
> push @values, $form{$field};
> }
> my $set = join (' = ?,',@fields) . ' = ?';
> push @values, $form{selitem};
>
> my $sth = $db->prepare("UPDATE items SET $set WHERE id = ?");
> $sth->execute(@values);
Yes, that's roughly how I did it, now that I've changed $quoted to an array.
It's working nicely.
Bigus
------------------------------
Date: Sat, 16 Apr 2005 16:35:24 +0100
From: "Bigus" <youdontknowme@stranger.com>
Subject: Re: DBI update
Message-Id: <NeSdnaDZHNhhrPzfRVnygQ@giganews.com>
<axel@white-eagle.invalid.uk> wrote in message
news:z6CdnWK05cDaZ8PfRVn-jw@adelphia.com...
> > eval("$sth->execute(".$quoted.")");
> >
> > That doesn't return any error in the Apache log but doesn't update the
DB
> > either, which suggests it's simply not executing.. what's the correct
way to
> > go about this?
>
> Did you check the status of $@ after the eval?
No, I didn't know about that variable.
> I suggest you use something like this:
>
> eval '$sth->execute('. $quoted. ')';
I had actually tried single quotes but another error was throwing it out..
useful to know eval works like it does in javascript though :)
Bigus
------------------------------
Date: Sat, 16 Apr 2005 16:39:12 +0100
From: "Bigus" <youdontknowme@stranger.com>
Subject: Re: DBI update
Message-Id: <NeSdnaLZHNhgrPzfRVnygQ@giganews.com>
"Tad McClellan" <tadmc@augustmail.com> wrote in message
news:slrnd5tunb.9aa.tadmc@magna.augustmail.com...
> > my $sth = $db->prepare("UPDATE items SET $set WHERE id =
> > '$form{selitem}'");
>
>
> You should use a placeholder for $form{selitem} too, or otherwise
> arrange for proper quoting of its value.
$form{selitem} is always an integer, so don't need to do I?
[..]
> Call the function with the proper arguments. :-)
>
> my @quoted = ($form{type}, $form{size});
> ...
> $sth->execute(@quoted);
that's the nail on the head.. there was no reason, other than my ignorance,
for me using a scalar!
Bigus
------------------------------
Date: Sat, 16 Apr 2005 16:36:46 +0100
From: "Bigus" <youdontknowme@stranger.com>
Subject: Re: DBI update
Message-Id: <NeSdnaPZHNhgrPzfRVnygQ@giganews.com>
"Fabian Pilkowski" <pilkowsk@informatik.uni-marburg.de> wrote in message
news:3c8aduF6lbm8bU1@individual.net...
[..]
> Perhaps you could pay attention on this when building the var $quoted
> and save your values in an array rather than a skalar.
Yes, I see.. that works nicely now.. thanks
Bigus
------------------------------
Date: Sat, 16 Apr 2005 12:08:45 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: DBI update
Message-Id: <slrnd62hkt.h2e.tadmc@magna.augustmail.com>
Bigus <youdontknowme@stranger.com> wrote:
>
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrnd5tunb.9aa.tadmc@magna.augustmail.com...
>> > my $sth = $db->prepare("UPDATE items SET $set WHERE id =
>> > '$form{selitem}'");
>>
>>
>> You should use a placeholder for $form{selitem} too, or otherwise
>> arrange for proper quoting of its value.
>
> $form{selitem} is always an integer, so don't need to do I?
I assume from the hash name that the value comes from a <form> ?
If you are properly untainting it, then you wouldn't need other quoting.
Are you properly untainting it?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 16 Apr 2005 07:15:48 -0700
From: RonGrossi382594@yahoo.com
Subject: Do You Want To Know For Sure That You Are Going To Heaven? The reason some people don't know for sure if they are going to Heaven when they die is because they just don't know. The good news is that you can know for sure that you are going to Heaven which is described in the Holy Bible as a beautiful place with no death, sorrow, sickness or pain. (newsgroup-post 140)
Message-Id: <1113660948.571612.127430@o13g2000cwo.googlegroups.com>
The reason some people don't know for sure
if they are going to Heaven when they die
is because they just don't know.
The good news is that you can know for
sure that you are going to Heaven which is
described in the Holy Bible as a beautiful
place with no death, sorrow, sickness or
pain.
God tells us in the Holy Bible how simple
it is to be saved so that we can live
forever with Him in Heaven.
"For if you confess with your mouth Jesus
is Lord and believe in your heart that God
raised Him from the dead, you
WILL BE SAVED." (Romans 10:9)
Over 2000 years ago God came from Heaven
to earth in the person of Jesus Christ to
shed His blood and die on a cross to pay
our sin debt in full.
Jesus Christ was born in Israel
supernaturally to a virgin Jewish woman
named Mary and lived a sinless life for
thirty-three years.
At the age of thirty-three Jesus was
scourged and had a crown of thorns pressed
onto His head then Jesus was crucified.
Three days after Jesus died on a cross and
was placed in a grave Jesus rose from the
dead as Jesus said would happen before
Jesus died.
If someone tells you that they are going
to die and in three days come back to life
again and it happens then this person must
be the real deal.
Jesus Christ is the only person that ever
lived a perfect sinless life.
This is why Jesus is able to cover our
sins(misdeeds) with His own blood because
Jesus is sinless.
The Holy Bible says, "In Him(Jesus) we
have redemption through His blood, the
forgiveness of sins..." (Ephesians 1:7)
If you would like God to forgive you of
your past, present and future sins just
ask Jesus Christ to be your Lord and
Saviour.
It doesn't matter how old you are or how
many bad things that you have done in
your life including lying and stealing
all the way up to murder.
Just pray the prayer below with your
mouth and mean it from your heart and
God will hear you and save you.
Dear Jesus Christ, I want to be saved so
that I can have a home in Heaven with You
when I die. I agree with You that I am a
sinner. I believe that You love me and want
to save me. I believe that You bled and
died on the cross to pay the penalty for my
sins and that You rose from the dead.
Please forgive my sins and come into my
heart and be my Lord and Saviour. Thanks
Lord Jesus Christ for forgiving me and
saving me through Your merciful grace.
Amen.
Welcome to the family of God if you just
allowed God to save you. Now you are a real
Christian and you can know for sure that
you will live in Heaven forever when this
life comes to an end.
As a child of God we are to avoid
sin(wrongdoing), but if you do sin the
Holy Bible says, "My dear children, I
write this to you so that you will not sin.
But if anybody does sin, we have one who
speaks to the Father in our defense Jesus
Christ, the Righteous One."
Those of you that have not yet decided to
place your trust in the Lord Jesus Christ
may never get another chance to do so
because you do not know when you will die.
This means that if you die without
trusting in Jesus Christ as your Lord and
Saviour you will be forever separated from
the love of God in a place called Hell.
The Holy Bible descibes Hell as a place of
eternal torment, suffering, pain and agony
for all those who have rejected Jesus Christ.
The good news is that you can avoid Hell by
allowing Jesus Christ to save you today.
Only then will you have true peace in your
life knowing that no matter what happens you
are on your way to Heaven.
Praise the Lord!
Servant of the Lord Jesus Christ
Ronald L. Grossi
*Show this to your family and friends so
they can know that they have a choice
where they will spend eternity. Thanks!
____________________________________________________
Got Questions?
http://www.gotquestions.org/archive.html
Other Languages
http://www.godssimpleplan.org/gsps.html
Free Movie: To Hell and Back
http://www.tbn.org/index.php/8/1.html
Animation
http://www.browser.to/jesus-animation
The Passion Of The Christ
http://www.thepassionofthechrist.com
Beware Of Cults
http://www.carm.org/cults/cultlist.htm
About Hell
http://www.equip.org/free/DH198.htm
Is Jesus God?
http://www.powertochange.com/questions/qna2.html
Free Online Bible
http://www.bibledatabase.net
____________________________________________________
The Death of John Paul II
John Paul II gained the whole world but
forfeited his soul. Year after year he
was the most loved and admired man in
the world. The idolatrous veneration
and adoration of this man was
unprecedented. His devotees, who are now
singing his praises, are probably
ignorant of the strong rebuke of Jesus
who said, "Woe to you when all men speak
well of you" (Luke 6:26). Had the pope
been devoted to Jesus Christ and His
Gospel of grace, he would have been
hated and persecuted by the world.
No one can judge John Paul's heart but
we are all called to judge the fruit of
our spiritual leaders. Clearly this man
was blinded by the prince of this world
and never saw the light of the gospel or
the glory of Christ. I mourn the death
of this man, not for the reason the
world mourns, but because he rejected
Jesus as God's only provision for his
sins. I also have a solemn compassion
for those who blindly followed this pope
and his man-centered religion. My heart
is painfully burdened to see so many
"professing" Christians unable to
discern truth from error and genuine
Christianity from its counterfeit.
The rest of this article that was
written by Mike Gendron can be found
at >> http://www.pro-gospel.org/main/Topics/topic-027.php
____________________________________________________
------------------------------
Date: Sat, 16 Apr 2005 12:37:31 -0500
From: brian d foy <comdog@panix.com>
Subject: Re: Is Perl open source?
Message-Id: <160420051237316620%comdog@panix.com>
In article <ctednT0c5q66nsLfRVn-3w@comcast.com>, Chris Mattern
<matternc@comcast.net> wrote:
> Abigail wrote:
>
> > Chris Mattern (matternc@comcast.net) wrote on MMMMCCXLIV September
> > MCMXCIII in <URL:news:E6GdnWFtg8bnxMPfRVn-jA@comcast.com>:
> > )) Yet it is good to remember that often, that second of programmer's
> > time
> > )) is more expensive than the many seconds of machine time that is saved.
> > Keep remembering that when your airbag takes a few seconds to inflate.
> > Generalizing is seldomly correct.
> I did say *often*, not *always*. Of course, anybody doing tasks
> with hard real-time requirements in Perl is certifiable.
Certifiably what? I do things with hard real-time requirements
in Perl. Didn't Abigail just say that you shouldn't generalize? :)
--
brian d foy, comdog@panix.com
Subscribe to The Perl Review: http://www.theperlreview.com
------------------------------
Date: Sat, 16 Apr 2005 17:04:10 GMT
From: jbl <jbl02NO@SPAMhotmail.com>
Subject: Re: Matching strings in a binary file thanks a lot Tad
Message-Id: <85h261lrjpqckhnri87rl7s69shnri3pi1@4ax.com>
On Sat, 16 Apr 2005 10:05:02 -0500, Tad McClellan
<tadmc@augustmail.com> wrote:
>
>> Is this so far off it needs to be scrapped or can it be saved?
>
>
>Save it, you just need to tell the diamond operator what files
>to process:
>
> # untested
> local @ARGV = map { "$directory/$_" } sort grep /\.pdf$/, readdir DIR;
> while (<>) {
> ...
Thanks a lot.
I still need to clean up the output but it is now working.
use strict;
use open IO => ":raw";
$/ = "\0";
my $directory = 'C:\captured_web_sites'; # code in a specific
directory
opendir(DIR,$directory) or die "Couldn't open directory, $!";
local @ARGV = map { "$directory/$_" } sort grep /\.pdf$/, readdir DIR;
while (<>) {
while (/(\x2F\x43\x6F\x6E\x74\x65\x6E\x74\x73\x20\x28[^\x29]*\x29)/g)
{
print "$ARGV ", $1, "\n";
}
}
closedir DIR;
------------------------------
Date: Sat, 16 Apr 2005 14:18:41 GMT
From: jbl <jbl02NO@SPAMhotmail.com>
Subject: Matching strings in a binary file
Message-Id: <q17261hsc1na3k2bg32n69dop4hlto756a@4ax.com>
The following is an example from Perl Cookbook, to match strings in a
binary file.
Example 8-6. strings
#!/usr/bin/perl -w
# strings - pull strings out of a binary file
$/ = "\0";
use open IO => ":raw";
while (<>) {
while (/([\040-\176\s]{4,})/g) {
print $1, "\n";
}
}
my objective is to search all pdf files in a given directory for the
string "/Contents ("
PDF's are binary files, so I am attempting to match the bytes,
\x2F\x43\x6F\x6E\x74\x65\x6E\x74\x73\x20\x28.
In the following script, I don't get any error messages, it just
doesn't do anything but seem to hang up
.
For simplicity, for now, I only have one pdf file in the folder, and I
know that it has the target string in it. ( a comment on a pdf page )
use strict;
use open IO => ":raw";
my $directory = 'C:\pdf_folder'; # code in a specific directory
opendir(DIR,$directory) or die "Couldn't open directory, $!";
foreach (sort grep(/^.*\.pdf$/,readdir(DIR)))
{
while (<>) {
while (/(\x2F\x43\x6F\x6E\x74\x65\x6E\x74\x73\x20\x28)/g) {
print $1, "\n";
}
}
}
closedir DIR;
Is this so far off it needs to be scrapped or can it be saved?
Thanks
jbl
------------------------------
Date: Sat, 16 Apr 2005 10:05:02 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Matching strings in a binary file
Message-Id: <slrnd62acu.gpc.tadmc@magna.augustmail.com>
jbl <jbl02NO@SPAMhotmail.com> wrote:
> In the following script, I don't get any error messages, it just
> doesn't do anything but seem to hang up
The diamond operator is probably waiting for some input to process...
> opendir(DIR,$directory) or die "Couldn't open directory, $!";
> foreach (sort grep(/^.*\.pdf$/,readdir(DIR)))
^^^
^^^
All that including that in your pattern does is to disallow
filenames that contain newlines.
> {
So here $_ contains the name of a file that you want to search in.
> while (<>) {
Here that filename will get *stomped on* by the 1st line of input.
You never make use of the info that grep() gave you.
> Is this so far off it needs to be scrapped or can it be saved?
Save it, you just need to tell the diamond operator what files
to process:
# untested
local @ARGV = map { "$directory/$_" } sort grep /\.pdf$/, readdir DIR;
while (<>) {
...
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 16 Apr 2005 17:17:28 +0100
From: Greg <gmills@nilELEPHANTdram.com>
Subject: Parsing user-entered content to remove rude words
Message-Id: <Te-dnQ8IxsMNp_zfRVnysw@pipex.net>
Hi,
I would like to make life easier for myself my automating (as best as
possible) the removal of messages supplied by users.
If my incoming string is $input, I originally thought of searching as
follows:
<Pseudocode>
foreach my $rudeword in @RudeWordList {
if ($input =~ s/$rudeword/i) {
REJECT;
}
}
</Pseudocode>
However, this seems a rather unoptimised method of searching. Is there a
more optimised way of doing this?
Cheers,
Greg
------------------------------
Date: Sat, 16 Apr 2005 12:15:05 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Parsing user-entered content to remove rude words
Message-Id: <slrnd62i0p.h2e.tadmc@magna.augustmail.com>
Greg <gmills@nilELEPHANTdram.com> wrote:
> if ($input =~ s/$rudeword/i) {
The s/// operator has *two* parts.
You realize that automating this accurately is nearly impossible?
You should probably have word boundaries in your pattern.
Does the word list contain all of the ways that folks will
use to circumvent censorship?
Will it generate "false hits" and delete messages that don't
really contain the "bad words"?
> Is there a
> more optimised way of doing this?
Your Question is Asked Frequently:
perldoc -q match
How do I efficiently match many regular expressions at once?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 16 Apr 2005 19:41:02 +0200
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: Parsing user-entered content to remove rude words
Message-Id: <42614e2a$0$819$8fcfb975@news.wanadoo.fr>
Greg wrote:
> Hi,
>
> I would like to make life easier for myself my automating (as best as
> possible) the removal of messages supplied by users.
>
> If my incoming string is $input, I originally thought of searching as
> follows:
>
> <Pseudocode>
> foreach my $rudeword in @RudeWordList {
> if ($input =~ s/$rudeword/i) {
> REJECT;
> }
> }
> </Pseudocode>
You could check out Regexp::Common, specifically Regexp::Common::profanity.
Mark
------------------------------
Date: Sat, 16 Apr 2005 17:38:12 +0000 (UTC)
From: Juha Laiho <Juha.Laiho@iki.fi>
Subject: Re: Parsing user-entered content to remove rude words
Message-Id: <d3rii4$iaa$1@ichaos.ichaos-int>
Greg <gmills@nilELEPHANTdram.com> said:
>I would like to make life easier for myself my automating (as best as
>possible) the removal of messages supplied by users.
>
>If my incoming string is $input, I originally thought of searching as
>follows:
>
><Pseudocode>
>foreach my $rudeword in @RudeWordList {
> if ($input =~ s/$rudeword/i) {
> REJECT;
> }
>}
></Pseudocode>
>
>However, this seems a rather unoptimised method of searching. Is there a
>more optimised way of doing this?
Not quite -- some points, though:
- s// is substituting, whereas you only need matching (m//, or just //)
- you realize you're playing 'catch' -- the rude words can be altered
enough to make your filter fail, yet have the result be readable for
users - then, of course, you can add these alterations to your word
list after you see them in use -- but, read on..
- if you still want to do this, use word boundaries around your regular
expressions -- otherwise (remembering the above), you'll trigger
a false positive with just 'AMD Sempron'
You might consider using a soundex algorithm, but that's also prone
to false positives - it's somewhat just an automated way to match
a set of alterations at a single go.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
------------------------------
Date: 16 Apr 2005 08:36:57 -0700
From: rob_1029384756@hotmail.co.uk
Subject: Re: PDF and Word to screen
Message-Id: <1113665817.366716.106180@f14g2000cwb.googlegroups.com>
Hi,
Thanks for the reply. It looks like I do need something like. Thanks.
Rob.
axel@white-eagle.invalid.uk wrote:
> rob_1029384756@hotmail.co.uk wrote:
> > I'm having a few difficulties with perl. I have a database (mysql)
> > full of files, in particular medium blobs all of which are word
> > documents (for 1 type) and pdf's (for another type). I can download
> > these quite happily (all works / no corruption).
>
> > However, what I would really like to do is load a page with some
text,
> > the infomation on the word document, and the info on the pdf.
>
> > Is this possible? I have been searching, but am finding nothing
except
> > a little about creating pdf/docs. If so, it would be a great help
if
> > someone could point me in the right direction or link me to any
> > documentation.
>
> You might find the following of use:
>
> xpdf http://www.foolabs.com/xpdf/
> pdftohtml http://pdftohtml.sourceforge.net/
>
> Axel
------------------------------
Date: 16 Apr 2005 06:32:54 -0700
From: ioneabu@yahoo.com
Subject: Re: regex help
Message-Id: <1113658374.671152.207650@o13g2000cwo.googlegroups.com>
John W. Krahn wrote:
> Scott Bryce wrote:
> >
> > my %hash = split / */, $string;
>
> ioneabu@yahoo.com wrote:
> >
> > my %hash = split / /, $str;
>
> Is someone actually teaching people to use split() like this?
> There must be a lot of bad examples out there on the web. :-)
>
yes, the documentation that comes with Perl. From perlfunc:
split /PATTERN/,EXPR,LIMIT
split /PATTERN/,EXPR
split /PATTERN/
Both examples above fit the format. What is your problem with them?
wana
------------------------------
Date: Sat, 16 Apr 2005 08:41:18 -0700
From: "news" <bit@bucket.com>
Subject: socket change from 5.8.4 to 5.8.6?
Message-Id: <Tna8e.5656$qO6.2059@okepread03>
I am on Windows 2000:
When I upgraded from 5.8.4 to 5.8.6, I can no longer create an ICMP
socket...
(io/socket/inet.pm is the same between versions 8.4 and 8.6)
I also tried using Net::Ping, which works in 5.8.4, but not 5.8.6
Works: perl 5.8.4 (source) and ActiveState perl 5.8.3
Doesn't work: 5.9.2 (source), 5.8.6 (source), ActiveState 5.8.6
(I just compiled all these 3 source versions, so I know I can compile 5.8.4
correctly!)
Anyone have any ideas? Can someone on 5.8.6+ run on windows and post back?
(I am on windows 2000 server, sp4)
use IO::Socket::INET;
for ('tcp','udp','icmp')
{
my $sock = IO::Socket::INET->new(Proto=>$_);
print "$_ sock=$sock\n";
close($sock);
}
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 7982
***************************************