[28331] in Perl-Users-Digest
Perl-Users Digest, Issue: 9695 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 6 21:05:56 2006
Date: Wed, 6 Sep 2006 18:05:06 -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 Wed, 6 Sep 2006 Volume: 10 Number: 9695
Today's topics:
Best way to remove body/html tag from HTML::Element tre <afrinspray@gmail.com>
Re: Best way to remove body/html tag from HTML::Element <tadmc@augustmail.com>
Re: Best way to remove body/html tag from HTML::Element <trwww@sbcglobal.net>
Re: Get Directiry size in windows warrenb101@hotmail.com
IIS 6.0 perl problem <ksperle@hotmail.com>
Re: IIS 6.0 perl problem <tadmc@augustmail.com>
need server side script to read file/buffer data <jainarunk@gmail.com>
Re: need server side script to read file/buffer data <tadmc@augustmail.com>
Re: Numerical sort (Schwartzian xform) <awkster@yahoo.com>
Re: Numerical sort (Schwartzian xform) <john@castleamber.com>
Re: Numerical sort (Schwartzian xform) <awkster@yahoo.com>
Re: Numerical sort (Schwartzian xform) (Randal L. Schwartz)
Re: Numerical sort (Schwartzian xform) <tadmc@augustmail.com>
Re: Problems detecting multiple clients <bryan@worldspice.net>
Re: Problems detecting multiple clients xhoster@gmail.com
Re: Problems detecting multiple clients <bryan@worldspice.net>
Re: Reg:parsing a file <mumia.w.18.spam+nospam.usenet@earthlink.net>
Re: time icrement based loop <deadpickle@gmail.com>
Re: time icrement based loop <tadmc@augustmail.com>
Re: Ultimate programmer's reference - Quickref.org laun <mgarrish@gmail.com>
Re: Using named constants in cases of a switch <hjp-usenet2@hjp.at>
Re: Using named constants in cases of a switch axel@white-eagle.invalid.uk
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 6 Sep 2006 15:38:29 -0700
From: "afrinspray" <afrinspray@gmail.com>
Subject: Best way to remove body/html tag from HTML::Element tree
Message-Id: <1157582309.534482.203110@d34g2000cwd.googlegroups.com>
What's the best way to remove the <html> and <body> tags from an html
tree? Does splice_content or detach keep the children? I can also do
it from a string if you guys can think of a safe regex (sometimes body
has onLoad, class or other tags).
Thanks!
Mike
------------------------------
Date: Wed, 6 Sep 2006 19:37:46 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Best way to remove body/html tag from HTML::Element tree
Message-Id: <slrnefuqeq.b9i.tadmc@magna.augustmail.com>
afrinspray <afrinspray@gmail.com> wrote:
> if you guys can think of a safe regex
There is no such thing as a safe regex than can handle
a context free language such as HTML.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 07 Sep 2006 01:00:36 GMT
From: "Todd W" <trwww@sbcglobal.net>
Subject: Re: Best way to remove body/html tag from HTML::Element tree
Message-Id: <UaKLg.8471$yO7.4623@newssvr14.news.prodigy.com>
"afrinspray" <afrinspray@gmail.com> wrote in message
news:1157582309.534482.203110@d34g2000cwd.googlegroups.com...
> What's the best way to remove the <html> and <body> tags from an html
> tree? Does splice_content or detach keep the children? I can also do
> it from a string if you guys can think of a safe regex (sometimes body
> has onLoad, class or other tags).
http://perlmonks.org/?node_id=554219
Todd W.
------------------------------
Date: 6 Sep 2006 15:10:33 -0700
From: warrenb101@hotmail.com
Subject: Re: Get Directiry size in windows
Message-Id: <1157580633.203359.197030@m79g2000cwm.googlegroups.com>
Thanks Dark!
Your solution works great.
I looked at Win32::DirSize but the module wasn't available through the
windows perl package manager.
I appreciate the help,
warrenb
Dark wrote:
> Win32::DirSize (search.cpan.org is your friend). If you don't or can't
> install modules try something like :
>
> $dirsize = `dir \"C:\\Program Files\\\" | findstr \"File(s)\"`;
>
> or
>
> $dirsize = `dir \"C:/Program Files/\" | findstr \"File(s)\"`;
>
------------------------------
Date: 6 Sep 2006 17:07:31 -0700
From: "Kevin_S" <ksperle@hotmail.com>
Subject: IIS 6.0 perl problem
Message-Id: <1157587651.664784.264660@h48g2000cwc.googlegroups.com>
Hello,
Have done quit a bit of searching and reading but can't find my problem
yet. I am moving our corporate intranet from an old NT4 server to a
2003 Server. Everything is working fine except for a little perl
application in/out board we run.
Application website:
http://www.uburst.com/uSignIn
I am getting a 404 page not found error, which according to their
troubleshooting is usually because of 1 of 4 things. I have tried to
go through the "4 things" and still can't find my problem.
http://www.uburst.com/uSignIn/troubleshooting.html
Unfortunately that page and their "support forum" which has turned into
a knowledge base didn't solve the problem for me. I have also tried
following the troubleshooting steps for IIS outlined on the activeperl
website here:
http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/Windows/ActivePerl-Winfaq6.html#configure_IIS_60
Again, everything seemed to check out.
I cannot run a simple test script as outlined in the troubleshooting.
If I go to the cmd prompt I can run "perl -v" and get the proper
output, that I am running activeperl v5.8.7, etc...
I have to be missing a permission or missing a setting to make scripts
allowed somewhere right?
Right now my scripts are located at d:\wwwroot\cgi-bin.
I have temporarily given IUSR...xxxxxxxx full control over the cgi-bin
and wwwroot folders.
The cgi-bin directories "Execute Permissions" are set to "Scirpts &
Executables".
Anyone got any ideas on where to start or how to further narrow down my
problem?
PS - I'm a total perl amatuer, I only installed it once before, and
that was to run this third party app.
------------------------------
Date: Wed, 6 Sep 2006 19:48:00 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: IIS 6.0 perl problem
Message-Id: <slrnefur20.b9i.tadmc@magna.augustmail.com>
Kevin_S <ksperle@hotmail.com> wrote:
> If I go to the cmd prompt I can run "perl -v" and get the proper
> output
>
> I have to be missing a permission or missing a setting to make scripts
> allowed somewhere right?
Right.
> Anyone got any ideas on where to start
comp.infosystems.www.servers.ms-windows
> or how to further narrow down my
> problem?
You can eliminate Perl as the cause of the problem.
You do not have a Perl problem, you have a web server configuration
problem.
Web server configuration is off-topic in the Perl newsgroup.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Sep 2006 16:45:42 -0700
From: "Vinay Nagrik" <jainarunk@gmail.com>
Subject: need server side script to read file/buffer data
Message-Id: <1157586341.969357.88290@i3g2000cwc.googlegroups.com>
Dear group members,
I am working on a httpstack implementation. I have two requirements
1. to post file to the server.
2. to post buffer to ther server.
Incidentally I have installed my own Apache server to run on my machine
and have full control
over it.
I need group's help to get two scripts which can get the data from the
client and save it either
to a file or echo that buffer.
"I do now want form based perl script. That will not solve my
problem."
If some one can direct to already existing scripts that will be great.
I have very little
knowledge about Perl to even attempt it.
Thanks in advance.
Nagrik
------------------------------
Date: Wed, 6 Sep 2006 19:42:33 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: need server side script to read file/buffer data
Message-Id: <slrnefuqnp.b9i.tadmc@magna.augustmail.com>
Vinay Nagrik <jainarunk@gmail.com> wrote:
> I am working on a httpstack implementation.
What is an httpstack?
> I need group's help to get two scripts
What parts do you need help with?
> I have very little
> knowledge about Perl to even attempt it.
You will need to fix that if you are going to write the programs
that you require.
We help programmers here, we do not do their work for them.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Sep 2006 15:09:24 -0700
From: "Jorge" <awkster@yahoo.com>
Subject: Re: Numerical sort (Schwartzian xform)
Message-Id: <1157580564.929295.231830@e3g2000cwe.googlegroups.com>
Addition to my previous post ...
The program also has a dependency on a library of data (vault
directory) which I built with another program and the library is simply
too large to post ... ~ 1600 files. The program will not successfully
run without the library.
------------------------------
Date: 6 Sep 2006 22:30:32 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Numerical sort (Schwartzian xform)
Message-Id: <Xns9836B21C26300castleamber@130.133.1.4>
"Jorge" <awkster@yahoo.com> wrote:
> Addition to my previous post ...
>
> The program also has a dependency on a library of data (vault
> directory) which I built with another program and the library is simply
> too large to post ... ~ 1600 files. The program will not successfully
> run without the library.
In which case it's a good idea to reduce your program to the smallest
version that shows your problem.
--
John Experienced Perl programmer: http://castleamber.com/
Perl help, tutorials, and examples: http://johnbokma.com/perl/
------------------------------
Date: 6 Sep 2006 15:58:45 -0700
From: "Jorge" <awkster@yahoo.com>
Subject: Re: Numerical sort (Schwartzian xform)
Message-Id: <1157583525.714124.304740@d34g2000cwd.googlegroups.com>
Good advice -- thank you ...
I pruned the program to this ...
#!perl -lw
use strict;
my(@array, @sorted, $line);
open(IN, "infile.txt") || die "Can't open infile for read: $!";
while(<IN>){
push(@array, $_);
}
close(IN);
@sorted = sort @array;
foreach $line(@sorted){
print "$line";
}
__END__
which reads this file ...
31.43 32 1005.89 Figs Domino 1
31.62 17 537.57 Boc's Skater 2
31.85 18 573.34 Reward Crystal 3
31.54 27 851.47 Db Miss Buxley 4
31.78 13 413.17 Ucme Lola 5
31.96 12 383.46 Bayou Jasmine 6
31.62 14 442.62 Y's Flirt 7
31.46 30 943.88 Sheriff Wade 8
to create the array and it indeed does sort properly jusing the
standard sort() function.
Obviously, when I create the array on the fly in the program, I am
somehow bringing to the surface something that precludes sorting (for
whatever reason) maybe it's a whitespace problem or a seperator problem
or ...
I'll dig around until I find it.
Thanks
John Bokma wrote:
> "Jorge" <awkster@yahoo.com> wrote:
>
> > Addition to my previous post ...
> >
> > The program also has a dependency on a library of data (vault
> > directory) which I built with another program and the library is simply
> > too large to post ... ~ 1600 files. The program will not successfully
> > run without the library.
>
> In which case it's a good idea to reduce your program to the smallest
> version that shows your problem.
>
> --
> John Experienced Perl programmer: http://castleamber.com/
>
> Perl help, tutorials, and examples: http://johnbokma.com/perl/
------------------------------
Date: 06 Sep 2006 17:27:50 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Numerical sort (Schwartzian xform)
Message-Id: <863bb4tta1.fsf@blue.stonehenge.com>
>>>>> "Jorge" == Jorge <awkster@yahoo.com> writes:
Jorge> I pass the array to my schwartzian transform sub routine using this
Jorge> call ...
Jorge> my @sorted_array = &SchwartzianTransform(' ', ['1n', -1], @array);
You don't like Sort::Fields (in the CPAN) for some reason?
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
--
Posted via a free Usenet account from http://www.teranews.com
------------------------------
Date: Wed, 6 Sep 2006 19:31:57 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Numerical sort (Schwartzian xform)
Message-Id: <slrnefuq3t.b9i.tadmc@magna.augustmail.com>
Jorge <awkster@yahoo.com> wrote:
> Good advice
What is good advice?
> while(<IN>){
> push(@array, $_);
> }
This does the same thing:
my @array = <IN>;
> @sorted = sort @array;
This does the same thing, only without the unnecessary temporary variable:
my @sorted = sort <IN>;
> foreach $line(@sorted){
> print "$line";
> }
perldoc -q vars
What's wrong with always quoting "$vars"?
This does the same thing:
print @sorted;
Do you get paid by the line or something?
[ snip TOFU. Please stop doing that! ]
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Sep 2006 15:10:54 -0700
From: "samasama" <bryan@worldspice.net>
Subject: Re: Problems detecting multiple clients
Message-Id: <1157580654.133571.212580@m73g2000cwd.googlegroups.com>
samasama wrote:
> > That only deletes connections which are denied due to chk_multi_conn. What
> > about the connections that are acceptedable and then at some point down the
> > road get closed naturally?
>
>
> *nod*, that's why I was messing with other deletes, which with what you
> already said didn't make any sense at all. Noted.
>
> >
> > You might want to pass them into the subs, instead of using them globally.
> > Yes, it can be more annoying to write initially (and no, I don't always
> > follow my own advice), but it is generally worth it in the long run.
>
>
> I'll try that, I'm not worried about annoyances, just writing better
> code.
>
> > I don't know cookbook it is from, or what it looks like originally, but
> > I'm pretty sure it didn't look like that. You must have screwed something
> > up in the conversion. One thing to note is that $CLIENT doesn't appear
> > productively anywhere in that code. How can it tell if CLIENT shows up
> > more than once when it doesn't even care about what CLIENT is?
> >
> > What you end up with is that %count holds the count of the number of times
> > each IP address is connected, and $times holds that count for one
> > (unpredictably) arbitrary IP address.
Just wanted to go over this...
"You have an aggregate data structure, such as an array or a hash. You
want to know how often each element in the array (or key or value in
the hash) occurs. For instance, if your array contains web server
transactions, you might want to find the most commonly requested file.
If your hash maps usernames to number of logins, you want to find the
most common number of logins."
and below is the solution...
> First edition, and yes I mangled it a bit...
> >From the cookbook:
>
> %count = ();
> foreach $element (@ARRAY) {
> $count{$element}++;
> }
>
in my sub i'm doing foreach my $keys ( keys %ip_conns ) { ...
You're saying this is wrong? Or can have a bad side effect?
> > after you fork, you do something like
> > $pid_list{$pid}=$CLIENT->peerhost;
> >
> > Then when "wait" gives you a pid, you look it up in the %pid_list hash to
> > see what IP needs to be deleted from %ip_conns.
> >
I did this, and it's working : )
How I did it:
I already had a hash setup to record $kidpid, and just added the ip
address on to it ($children{$kidpid} = $CLIENT->peerhost;)
So, I do this within my handle_sigchld sub...
my $pid = waitpid(-1, WNOHANG); # Wait for children to die
foreach my $keys (keys %children) {
my $value = $children{$keys};
if ($pid == $keys) {
my %temp = reverse %ip_conns;
delete $temp{$value};
%ip_conns = reverse %temp;
}
}
It's working flawlessly (I believe)...
Thanks so much, and any more feedback/corrections/whatever is vastly
appreciated.
--
samasama
------------------------------
Date: 06 Sep 2006 22:48:57 GMT
From: xhoster@gmail.com
Subject: Re: Problems detecting multiple clients
Message-Id: <20060906184919.654$RM@newsreader.com>
"samasama" <bryan@worldspice.net> wrote:
> > >
> > > What you end up with is that %count holds the count of the number of
> > > times each IP address is connected, and $times holds that count for
> > > one (unpredictably) arbitrary IP address.
>
> Just wanted to go over this...
>
> "You have an aggregate data structure, such as an array or a hash. You
> want to know how often each element in the array (or key or value in
> the hash) occurs. For instance, if your array contains web server
> transactions, you might want to find the most commonly requested file.
> If your hash maps usernames to number of logins, you want to find the
> most common number of logins."
>
> and below is the solution...
>
> > First edition, and yes I mangled it a bit...
> > >From the cookbook:
> >
> > %count = ();
> > foreach $element (@ARRAY) {
> > $count{$element}++;
> > }
> >
>
> in my sub i'm doing foreach my $keys ( keys %ip_conns ) { ...
>
> You're saying this is wrong? Or can have a bad side effect?
Nope, that part is right. Later on, you had
$times = $count{$value}++;
Once the loop ends, $times is equal to the count of the last $value seen
(actually, one minus that count, as you use postincrement rather than
preincrement.) But you don't know what the last $value seen is, because
the order in which they are seen is arbitrary.
But since you don't seem to use the keys but only the values,
you could make the IP address, rather than the socket, be the key to the
%ip_conns hash. Then you don't need to loop at all, you just look up into
the hash. (This would require you to rearrange the code. Currently you
add to %ip_conns, then test for duplicates. You would have to first test
for duplicates, then add to %ip_conns only if it is not already there.)
>
> > > after you fork, you do something like
> > > $pid_list{$pid}=$CLIENT->peerhost;
> > >
> > > Then when "wait" gives you a pid, you look it up in the %pid_list
> > > hash to see what IP needs to be deleted from %ip_conns.
> > >
>
> I did this, and it's working : )
>
> How I did it:
>
> I already had a hash setup to record $kidpid, and just added the ip
> address on to it ($children{$kidpid} = $CLIENT->peerhost;)
>
> So, I do this within my handle_sigchld sub...
>
> my $pid = waitpid(-1, WNOHANG); # Wait for children to die
> foreach my $keys (keys %children) {
> my $value = $children{$keys};
> if ($pid == $keys) {
> my %temp = reverse %ip_conns;
> delete $temp{$value};
> %ip_conns = reverse %temp;
> }
> }
It would probably make sense to have %ip_conns be permanently reversed,
i.e. have the IP be the key and socket be the value (or the value could
just be "1" or undef, since the socket part which is stored in that hash
is never used anyway (and indeed probably can't be used--hash keys
are stringifed and thus lose their magic.))
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: 6 Sep 2006 17:59:17 -0700
From: "samasama" <bryan@worldspice.net>
Subject: Re: Problems detecting multiple clients
Message-Id: <1157590757.798689.144090@i3g2000cwc.googlegroups.com>
xhoster@gmail.com wrote:
> "samasama" <bryan@worldspice.net> wrote:
> > > >
> > > > What you end up with is that %count holds the count of the number of
> > > > times each IP address is connected, and $times holds that count for
> > > > one (unpredictably) arbitrary IP address.
> >
> > Just wanted to go over this...
> >
> > "You have an aggregate data structure, such as an array or a hash. You
> > want to know how often each element in the array (or key or value in
> > the hash) occurs. For instance, if your array contains web server
> > transactions, you might want to find the most commonly requested file.
> > If your hash maps usernames to number of logins, you want to find the
> > most common number of logins."
> >
> > and below is the solution...
> >
> > > First edition, and yes I mangled it a bit...
> > > >From the cookbook:
> > >
> > > %count = ();
> > > foreach $element (@ARRAY) {
> > > $count{$element}++;
> > > }
> > >
> >
> > in my sub i'm doing foreach my $keys ( keys %ip_conns ) { ...
> >
> > You're saying this is wrong? Or can have a bad side effect?
>
> Nope, that part is right. Later on, you had
>
> $times = $count{$value}++;
>
> Once the loop ends, $times is equal to the count of the last $value seen
> (actually, one minus that count, as you use postincrement rather than
> preincrement.) But you don't know what the last $value seen is, because
> the order in which they are seen is arbitrary.
>
> But since you don't seem to use the keys but only the values,
> you could make the IP address, rather than the socket, be the key to the
> %ip_conns hash. Then you don't need to loop at all, you just look up into
> the hash. (This would require you to rearrange the code. Currently you
> add to %ip_conns, then test for duplicates. You would have to first test
> for duplicates, then add to %ip_conns only if it is not already there.)
ahhhh, I'll give it a shot!
> It would probably make sense to have %ip_conns be permanently reversed,
> i.e. have the IP be the key and socket be the value (or the value could
> just be "1" or undef, since the socket part which is stored in that hash
> is never used anyway (and indeed probably can't be used--hash keys
> are stringifed and thus lose their magic.))
>
Yes, this does make sense.
Thank you so much : )
--
samasama
------------------------------
Date: Thu, 07 Sep 2006 01:04:43 GMT
From: "Mumia W." <mumia.w.18.spam+nospam.usenet@earthlink.net>
Subject: Re: Reg:parsing a file
Message-Id: <LeKLg.4315$v%4.2146@newsread1.news.pas.earthlink.net>
On 09/06/2006 11:42 AM, sivga wrote:
> hello experts,
>
> Iam new to perl .Can you pls suggest how to do this this is wat iam
> trying to do i have a text file with following lines
>
>
> exact 5
> seasad 3
> switch text 1.2
> new data 20
> cd data 10
> phase 30
> extra 40
> same 200
> different 500
>
>
> wat i need do is i neeed to read the file and if the file has (matches)
>
>
>
> switch text i need to write switch text to a new file say k2 and the
> next four lines new data ,cd data,extra and phase to k2 .other wise no
> need to write to the file k2. ,I cannot form the string say new data cd
>
>
>
> data and write to a file coz the numbers at the end will differ .How do
>
>
>
> i do it ?
>
>
> while (<AG>) {
>
>
> if ($_ =~ /exact +([0-9]+)/ ) {
> print k1 " $_";
>
>
> } elsif ( $_ =~ /switch text /) {
> print k2 "$_";
>
>
>
>
> } elsif ($_ =~ /same/) {
> print k1 "$_";
> }
>
>
> Thanks for the help
>
It was incredibly difficult to understand you, but I think I
know what you're getting at (thanks to the code you posted).
It is probably going to be easier for you to use Tie::File to
make the file you are reading look like an array. Then reading
the next four lines should be easy:
The following is NOT an example of such because I decided to
put the data directly in my program:
use strict;
use warnings;
my (@AR, @K1, @K2);
@AR = q{
exact 5
seasad 3
switch text 1.2
new data 20
cd data 10
phase 30
extra 40
same 200
different 500
} =~ m/^ *(\w.*)$/mg;
local $\ = "\n";
for my $nx (0..$#AR) {
$_ = $AR[$nx];
if (/switch text/) {
push @K2, @AR[$nx..$nx+4];
} elsif (/exact/) {
push @K1, $_;
} elsif (/same/) {
push @K1, $_;
}
}
print join "\n", @K1;
print '----------------------------';
print join "\n", @K2;
__END__
Read 'perldoc perltie' and 'perldoc Tie::File' to see how to
use tied file arrays.
------------------------------
Date: 6 Sep 2006 15:30:25 -0700
From: "deadpickle" <deadpickle@gmail.com>
Subject: Re: time icrement based loop
Message-Id: <1157581825.399312.85340@h48g2000cwc.googlegroups.com>
xhos...@gmail.com wrote:
> "deadpickle" <deadpickle@gmail.com> wrote:
> > I need to create a loop that will run a command every 5 seconds. I
> > know I can probably do this with a series of while, for and if
> > statements but I just cant wrap my head around it. Is there an easier
> > way? If not, how is it suggested that I do this?
>
> 5 seconds from when to when? one start to the next start? one finish to
> the next start? What will happend if it is 3 seconds or 7 seconds rather
> than 5? Have you looked at "perldoc -f sleep"?
>
>
> > The command I need to run is
> > $fh->client_automated("x.x.x.x","port","get","some_file");
> > It is part of a client script that uses the Net::FileShare module. If
> > the program is run within a while loop it eventually has an error that
> > closes the port and stops connection. This is bad because I need a
> > constant connection in order to keep the data flowing between the
> > computers. Any help would be very appriciated.
>
> It isn't clear how or if this relates to your first question.
>
> Xho
I want the client script to connect to the server, get the file then
dissconnect, wait 5 seconds, then reconnect to the server. I inserted
the sleep function and after 5 seconds I get a bunch of errors:
Use of uninitilized value in string eq/ne at
C:/PXPerl/lib/Net/FileShare.pm
Error sending packet: unknown error
I have no clue as to whats going on.
------------------------------
Date: Wed, 6 Sep 2006 19:44:36 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: time icrement based loop
Message-Id: <slrnefuqrk.b9i.tadmc@magna.augustmail.com>
deadpickle <deadpickle@gmail.com> wrote:
> I get a bunch of errors:
> Use of uninitilized value in string eq/ne at
> C:/PXPerl/lib/Net/FileShare.pm
That is not an error message.
It is a warning message.
(BTW: An "error" is different from an "error message".)
> I have no clue as to whats going on.
You are using an undef value when you don't want to be.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Sep 2006 16:57:34 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: Ultimate programmer's reference - Quickref.org launches
Message-Id: <1157587054.211749.105720@m79g2000cwm.googlegroups.com>
Robby Walker wrote:
> QuickRef.org : AJAX-powered site searches for documentation on Perl,
> CSS, HTML, HTML DOM, Java, JavaScript, MySQL, PHP, Ruby, and more
> languages added all the time. Minimize docs and they show up next time
> you visit the site. Instantly access Google search for documents not in
> the QuickRef system. Never open 15 tabs or windows again!
>
You've certainly come to the wrong place to ask people to "digg" your
site. Regular readers in any newsgroup generally know the language
they're using beyond what your site can offer. I wouldn't let that
deter you, as there's always a huge beginner contingent whose audience
you should be after.
That said, in the interests of providing you some constructive
criticism: your site is absolutely hideous. I mean that with the best
of intentions, though. Not only is the layout poorly designed with that
giant google vertical, but the code colouring and screen jumping when
the documentation loads further make it a pain to look at and use. The
whole dropdown concept also needs to be revisted, because the tendency
of most users is to click on the term they want to see the
documentation for, but that only seems to work if you click on a
limited area of the line. If you don't, the options disappear and the
term remains uncompleted in the search box.
And as has been mentioned here elsewhere, you absolutely need to
download and reprocess the free content you're currently hogging credit
for and better format it to work within your site. If you want to
provide your users with a professional experience you can't just try
and hack into existing documents on the web. You'll find quickly that
people will wind up bookmarking those pages instead and whatever hits
you get early on will trickle off.
You might also want to reconsider calling Adobe and Amazon your
"sponsors". I don't think they'd care to have you making that
association on their behalf, when I suspect all you've done is joined
some reseller program.
The idea of having a quick reference to many languages in one place,
however, is certainly sound, so just work on improving the interface.
There are plenty of people who will tell you your site sucks because of
some flaws and bugs they found (you should have done more QA, or
launched as a "hobby" site until working out the kinks) or because
they're just jealous of anything they didn't develop, but don't let
that get you down.
Matt
------------------------------
Date: Thu, 7 Sep 2006 00:26:05 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Using named constants in cases of a switch
Message-Id: <slrnefuio2.in.hjp-usenet2@yoyo.hjp.at>
On 2006-09-06 21:46, Brian Greenfield <not-for-replies@zombie.org.uk> wrote:
> On Wed, 6 Sep 2006 23:11:23 +0200, "Peter J. Holzer"
><hjp-usenet2@hjp.at> wrote:
>>On 2006-09-06 12:07, Ronny <ro.naldfi.scher@gmail.com> wrote:
>>> Now I would like to write a "switch" expression, where one of the
>>> cases shoulb be executed if $var is either BAR or BAZ:
>>[...]
>>> I found one solution to this, but I don't like it: Since the argument
>>> of when is allowed to be a regexp, I could use
>>>
>>> when(/^(@{[BAR]}|@{[BAZ]}$/) { handle_ba() }
>>
>>Urgs. What are the @{[]} for? What's wrong with
>>
>> /^(BAR|BAZ)$/
[...]
>
> because of
>
> use constant { FOO => 1, BAR => 2, BAZ => 3 };
Ah, yes. So that's one of the cases where the use of symbolic constants
makes the code less instead of more readable,.
hp
--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | hjp@hjp.at | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
------------------------------
Date: Wed, 06 Sep 2006 23:44:45 GMT
From: axel@white-eagle.invalid.uk
Subject: Re: Using named constants in cases of a switch
Message-Id: <N3JLg.9294$cw.3807@fed1read03>
Brian Greenfield <not-for-replies@zombie.org.uk> wrote:
> On Wed, 6 Sep 2006 23:11:23 +0200, "Peter J. Holzer"
>>On 2006-09-06 12:07, Ronny <ro.naldfi.scher@gmail.com> wrote:
>>> Now I would like to write a "switch" expression, where one of the
>>> cases shoulb be executed if $var is either BAR or BAZ:
>>[...]
>>> I found one solution to this, but I don't like it: Since the argument
>>> of when is allowed to be a regexp, I could use
>>>
>>> when(/^(@{[BAR]}|@{[BAZ]}$/) { handle_ba() }
>>
>>Urgs. What are the @{[]} for? What's wrong with
>>
>> /^(BAR|BAZ)$/
>>
>>or even
>>
>> /^BA[RZ]$/
>
> because of
>
> use constant { FOO => 1, BAR => 2, BAZ => 3 };
Which makes Readonly a useful alternative:
#!/usr/bin/perl
use strict;
use warnings;
use Readonly;
Readonly my $FOO => 1;
print $FOO;
Axel
------------------------------
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 9695
***************************************