[19310] in Perl-Users-Digest
Perl-Users Digest, Issue: 1505 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 13 03:05:53 2001
Date: Mon, 13 Aug 2001 00:05:16 -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: <997686315-v10-i1505@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 13 Aug 2001 Volume: 10 Number: 1505
Today's topics:
Re: A novice question about regex (Tad McClellan)
Re: A novice question about regex (Eric Bohlman)
Re: A novice question about regex <pne-news-20010813@newton.digitalspace.net>
Re: A novice question about regex <bcaligari@fireforged.com>
Any Perl version of GNU patch utility by Larry Wall? (John Lin)
Re: Any Perl version of GNU patch utility by Larry Wall (Logan Shaw)
Comma's at end of list can break program?? <miscellaneousemail@yahoo.com>
Re: Comma's at end of list can break program?? (Malcolm Dew-Jones)
Re: Comma's at end of list can break program?? (Tramm Hudson)
Re: Comma's at end of list can break program?? <bcaligari@fireforged.com>
Re: Comma's at end of list can break program?? (Logan Shaw)
Re: Comma's at end of list can break program?? <comdog@panix.com>
Re: Comma's at end of list can break program?? (Eric Bohlman)
Re: Comma's at end of list can break program?? <miscellaneousemail@yahoo.com>
Re: Comma's at end of list can break program?? <wyzelli@yahoo.com>
Re: copy anonymous hashes (Tad McClellan)
FAQ: Why do I sometimes get an "Argument list too long" <faq@denver.pm.org>
File::Find Troubles... (Bill Atkins)
Re: File::Find Troubles... <krahnj@acm.org>
Re: Get rid of some ratio ftp (Martien Verbruggen)
help with a global variable in CGI <no-reply@bong.net>
Re: help with a global variable in CGI egwong@netcom.com
Re: help with a global variable in CGI (wade)
Re: how to test $X le 'z' <pne-news-20010813@newton.digitalspace.net>
Re: how to test $X le 'z' (Anno Siegel)
Re: Learning Perl, 2nd Edition <uri@sysarch.com>
Re: Newbie (Tad McClellan)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 13 Aug 2001 00:14:35 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: A novice question about regex
Message-Id: <slrn9nel1b.2fe.tadmc@tadmc26.august.net>
Dav Lam <crud@hongkong.com> wrote:
>I'm wondering is there a way to treat a string pattern as a single
>word class with quantifier?
>
>What i mean is something : m!(?:joe){3}! matches "joejoejoe"
>
>Is it possible?
What happened when you tried it?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 13 Aug 2001 05:25:00 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: A novice question about regex
Message-Id: <9l7obc$ah0$2@bob.news.rcn.net>
Dav Lam <crud@hongkong.com> wrote:
> I'm wondering is there a way to treat a string pattern as a single
> word class with quantifier?
> What i mean is something : m!(?:joe){3}! matches "joejoejoe"
> Is it possible?
Did you try it?
------------------------------
Date: Mon, 13 Aug 2001 07:33:14 +0200
From: Philip Newton <pne-news-20010813@newton.digitalspace.net>
Subject: Re: A novice question about regex
Message-Id: <depentchqgvihji4a5ou9qej91q83i4alj@4ax.com>
On 12 Aug 2001 20:41:49 -0700, crud@hongkong.com (Dav Lam) wrote:
> I'm wondering is there a way to treat a string pattern as a single
> word class with quantifier?
>
> What i mean is something : m!(?:joe){3}! matches "joejoejoe"
>
> Is it possible?
What happened when you tried it out?
Here, I'll give you a command line that you can cut and paste. For
safety, I'll put some anchors (beginning-of-string/end-of-string)
anchors around your string.
DOS:
perl -e "print qq(It matches!\n) if 'joejoejoe' =~ m!^(?:joe){3}$!"
Unix:
perl -e 'print "It matches!\n" if "joejoejoe" =~ m!^(?:joe){3}$!'
One of the nice things about Perl is that since it's an interpreted
language, you don't need to go through lengthy compile-link-run cycles
to try out short programs.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Mon, 13 Aug 2001 07:18:29 -0000
From: "B. Caligari" <bcaligari@fireforged.com>
Subject: Re: A novice question about regex
Message-Id: <9l7nkq0lrk@enews4.newsguy.com>
"Dav Lam" <crud@hongkong.com> wrote in message
news:fc25f4f2.0108121941.7e248a0f@posting.google.com...
> I'm wondering is there a way to treat a string pattern as a single
> word class with quantifier?
>
> What i mean is something : m!(?:joe){3}! matches "joejoejoe"
>
> Is it possible?
What happened when you tried it out? It does work though. But it
hasnothing to do with [...] word classes, which by definition are meant
to match a single character.
You can extend your regex to match a said number of strings, eg
m/(?:joe|mary){3}/ would comfortably match
joejoejoe, or joemaryjoe, etc
B
------------------------------
Date: 12 Aug 2001 18:47:16 -0700
From: johnlin@chttl.com.tw (John Lin)
Subject: Any Perl version of GNU patch utility by Larry Wall?
Message-Id: <a73bcad1.0108121747.6badef7b@posting.google.com>
Dear all,
GNU patch utility is written by Larry Wall.
http://www.gnu.org/directory/patch.html
Personally I think Diff/Patch are very important and useful utilities.
Do we have such modules in Perl? It's very likely that Larry also writes
a Perl version.
Thank you.
John Lin
------------------------------
Date: 12 Aug 2001 21:01:08 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Any Perl version of GNU patch utility by Larry Wall?
Message-Id: <9l7cd4$ip9$1@charity.cs.utexas.edu>
In article <a73bcad1.0108121747.6badef7b@posting.google.com>,
John Lin <johnlin@chttl.com.tw> wrote:
>GNU patch utility is written by Larry Wall.
It has been a while, but I believe it's not quite like that. What I
remember is that first Larry Wall wrote a version of patch, then he
quit working on it, and after that, it was picked up by the GNU
project.
>Personally I think Diff/Patch are very important and useful utilities.
I agree.
>Do we have such modules in Perl? It's very likely that Larry also writes
>a Perl version.
If it exists, you should be able to find it at http://search.cpan.org/ .
In fact, there is a module there called Algorithm::Diff, which in fact
has a "function to generate diff-like output". There doesn't seem to
be a module that emulates the "patch" program, but you could write one
if you want (it shouldn't be very hard). Or, you could simply call the
"patch" program from Perl.
- Logan
--
"Our grandkids love that we get Roadrunner and digital cable."
(Advertisement for Time Warner cable TV and internet access, July 2001)
------------------------------
Date: Mon, 13 Aug 2001 03:14:43 GMT
From: Carlos C. Gonzalez <miscellaneousemail@yahoo.com>
Subject: Comma's at end of list can break program??
Message-Id: <MPG.15e0f3e1d8d3d963989735@news.edmonton.telusplanet.net>
Hi everyone,
In reading some of Tom Christiansen's material on Perl Style: Defensive
Programming he mentions the following as something to do:
"Put commas at the end of lists to so your program won't break if someone
inserts another item at the end of the list."
I was wondering if someone can explain this phrase to me? Put commas at
the end of what kind of lists and how can someone insert an item into
lists I create breaking my code??
Tom's material can be found at:
http://www.perl.com/language/style/slide4.html
Thanks.
--
Carlos
www.internetsuccess.ca
------------------------------
Date: 12 Aug 2001 22:48:53 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Comma's at end of list can break program??
Message-Id: <3b776a45@news.victoria.tc.ca>
Logan Shaw (logan@cs.utexas.edu) wrote:
: In article <3b775d2d@news.victoria.tc.ca>,
: Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> wrote:
: >Lets assume you are smart enough.
: >
: >However the maintenance programmer who will edit your files next year may
: >not be so smart.
: It's possible. But my question would then be what clever source code
: editing trick (or other trick) you're going to use to prevent him from
: making important logic errors.
I'm serious, - every single trick in the book.
And they won't always work.
but if you enumerate all the possible things you could do, and some people
more qualified than me have enumerated some of the techniques, (like
always provding positive logic but never double negative logic, etc, )
then your program will be more maintainable.
: If ill-qualified people are going to be editing the code, they're going
: to mess it up no matter what you do. If they end up getting a syntax
No, they're going to mess it up in direct proportion to how well you
shielded them from the problems that you (the supposed expert) understood
but they didn't.
------------------------------
Date: 13 Aug 2001 05:20:06 GMT
From: hudson@swcp.com (Tramm Hudson)
Subject: Re: Comma's at end of list can break program??
Message-Id: <9l7o26$ln3$1@sloth.swcp.com>
[ Posted and cc'd to cited author ]
Logan Shaw <logan@cs.utexas.edu> wrote:
> ... In other words, I've never seen the point in adding the comma.
I've found it handy for diffs since the lines with commas do not
need to be edited. As an example, if you have the hash:
my %h = (
foo => 3,
bar => 12,
);
and need to add an item, the diff would be very clear:
my %h = (
foo => 3,
bar => 12,
+ baz => 9,
);
rather than the more muddled:
my %h = (
foo => 3,
- bar => 12
+ bar => 12,
+ baz => 9
);
> ... I sometimes wonder if
> maybe someone has accidentally deleted the last item of the list.
If it is not done consistently, then it would appear that someone has
forgotten something or deleted the last item. But if it is in your
"Style Guide", then that is not a problem.
> On the other hand, I put semicolons after all statements (even those at
> the end of a block or file), so maybe I am a hypocrite. :-)
Well, you can choose from two Larry Wall quotes:
# Be consistent.
or
# Psychotics are consistently inconsistent. The essence of sanity is
# to be inconsistently inconsistent.
Tramm
--
o hudson@swcp.com hudson@XXXXXXXXX.XXX O___|
/|\ http://www.swcp.com/~hudson/ H 505.323.38.81 /\ \_
<< KC5RNF @ N5YYF.NM.AMPR.ORG W 505.986.60.75 \ \/\_\
0 U \_ |
------------------------------
Date: Mon, 13 Aug 2001 07:31:55 -0000
From: "B. Caligari" <bcaligari@fireforged.com>
Subject: Re: Comma's at end of list can break program??
Message-Id: <9l7oe00mnf@enews4.newsguy.com>
"Logan Shaw" <logan@cs.utexas.edu> wrote in message
news:9l7lgu$jgm$1@charity.cs.utexas.edu...
> In article <comdog-81D55C.00280413082001@news.panix.com>,
> brian d foy <comdog@panix.com> wrote:
> >you can write lists with trailing commas like so:
>
> But if you're goint to follow that policy, you should really
> put a comma after the "4". :-)
>
> It's just a matter of when you want to type the comma -- before you
> type the list element or afterwards. (I find before easier because
> then I'm done and I can forget about it.)
>
> - Logan
my %users = (
# start of user list
ab => 'Foo',
xy => 'Bar',
# end of user list
);
Suppose you have a hash, in a sript, which a secretary (umm, I mean one of
the executives from marketing) might need to amend from time to time to
add/remove some entry. It's much easier to coerce the user into 'always
make sure there is a comma at the end of the line', then try to explain
syntactic rules. Ok, one might argue that a script should nto be modified
by an end user....
B
------------------------------
Date: 13 Aug 2001 00:06:50 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Comma's at end of list can break program??
Message-Id: <9l7n9a$jqq$1@charity.cs.utexas.edu>
In article <3b775d2d@news.victoria.tc.ca>,
Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> wrote:
>Lets assume you are smart enough.
>
>However the maintenance programmer who will edit your files next year may
>not be so smart.
It's possible. But my question would then be what clever source code
editing trick (or other trick) you're going to use to prevent him from
making important logic errors.
If ill-qualified people are going to be editing the code, they're going
to mess it up no matter what you do. If they end up getting a syntax
error (which is all that will happen) because they haven't added the
comma, maybe they'll get discouraged and decide to give up and go do
something else instead. ;-)
- Logan
--
"Our grandkids love that we get Roadrunner and digital cable."
(Advertisement for Time Warner cable TV and internet access, July 2001)
------------------------------
Date: Mon, 13 Aug 2001 01:07:25 -0400
From: brian d foy <comdog@panix.com>
Subject: Re: Comma's at end of list can break program??
Message-Id: <comdog-4907DD.01072513082001@news.panix.com>
In article <x7k808lggi.fsf@home.sysarch.com>, Uri Guttman
<uri@sysarch.com> wrote:
> >>>>> "bdf" == brian d foy <comdog@panix.com> writes:
>
> bdf> In article <MPG.15e0f3e1d8d3d963989735@news.edmonton.telusplanet.net>,
>
> bdf> you can write lists with trailing commas like so:
>
> bdf> @array = ( 1, 2, 3, );
>
> bdf> when you add another element you don't have to worry about
> bdf> the separating comma because it is already there.
>
> bdf> @array = ( 1, 2, 3, 4 );
>
> but you didn't append a comma to the new value on the end of the list.
of course not. this is defensive programming. you're programming
for the poor shmuck you forgets commas. why would that person put
on a trailing comma if he can't remember to separate values with
them?
--
brian d foy <comdog@panix.com>
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html
------------------------------
Date: 13 Aug 2001 05:23:11 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Comma's at end of list can break program??
Message-Id: <9l7o7v$ah0$1@bob.news.rcn.net>
Logan Shaw <logan@cs.utexas.edu> wrote:
> And then you ask yourself, "Why did I become a programmer, when
> apparently I'm not smart enough to edit a text file and keep in mind a
> few simple syntactic rules?" Or at least I would, because if "you must
> make sure the thing you added at the end has a comma before it" is too
> hard a rule to remember and follow, how are you *ever* going to get
> along with the zillions of other rules that are way, way more complex
> than that (and which have worse consequences)?
May I suggest reading Chapter 9, "Intelligence, or problem-solving
ability" in Gerald Weinberg's _The Psychology of Computer Programming_?
That particular case is one that's very likely to trigger "psychological
set" (the tendency to see what we expect to see rather than what's
actually there), something that requires a great deal of conscious effort
to overcome. Really the upshot of all this is that there are certain dumb
mistakes that smart people are particularly likely to make, and it pays
off to anticipate them and set things up to make them less likely to
happen. In fact, since a large part of intelligence is the ability to
figure out "cognitive shortcuts" and to abstract away a lot of detail,
there are whole classes of dumb mistakes that smart people are *more*
likely to make than less-smart people. They're generally the sorts of
mistakes that arise when doing the sorts of things that computers do
better than people; that's why we have things like warnings, and why
syntax errors result in descriptive messages rather than just "illegal
syntax."
------------------------------
Date: Mon, 13 Aug 2001 06:28:03 GMT
From: Carlos C. Gonzalez <miscellaneousemail@yahoo.com>
Subject: Re: Comma's at end of list can break program??
Message-Id: <MPG.15e1217e30ae6f33989739@news.edmonton.telusplanet.net>
In article <x7r8uglirx.fsf@home.sysarch.com>, Uri Guttman at
uri@sysarch.com says...
> if you heeded tom's advice here (and most others concur with it), the
> last list entry would have a , after it. a comma is needed between every
> pair of items in a list but with perl it is ok to put a superfluous
> comma after the last item.in many languages, the extra comma there is
> actually illegal. so by always ending the last element with a comma, you
> don't have to worry as much about noticing if a comma is missing when
> editing the list.
Makes sense. Great explanation Uri. I had no idea that you could put a
superflous comma at the end of a list. Neat. Although I will have to
start taking advantage of such things it's a bit hard for me ever since
doing some C programming. I got used to squeezing every last little
ounce out of every little line and putting as little on a line as
possible. Speed optimizations they used to call it.
I guess doing things like Tom suggested increases speed in addition to
being good programming practice. Increases speed in the sense that it
might save me time trying to figure out where easily preventable bugs
are.
Thanks.
--
Carlos
www.internetsuccess.ca
------------------------------
Date: Mon, 13 Aug 2001 16:12:57 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Comma's at end of list can break program??
Message-Id: <HAKd7.11$1T.14126@wa.nnrp.telstra.net>
"Carlos C. Gonzalez" <miscellaneousemail@yahoo.com> wrote in message
news:MPG.15e1217e30ae6f33989739@news.edmonton.telusplanet.net...
>
> I guess doing things like Tom suggested increases speed in addition to
> being good programming practice. Increases speed in the sense that it
> might save me time trying to figure out where easily preventable bugs
> are.
An often overlooked fact is that it can take an awful lot of
micro-optimisations of run-time over the life of a program to equal several
hours (days?) of difficult debugging.
Why spend hours of coding and debugging to save seconds of performance (yes
I know there are lots of cases why, but there are lots of cases why not
too.)
Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass it
around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";
------------------------------
Date: Sun, 12 Aug 2001 19:53:53 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: copy anonymous hashes
Message-Id: <slrn9ne5oh.1vr.tadmc@tadmc26.august.net>
peter pilsl <pilsl_@goldfisch.at> wrote:
>Now I want to create a copy of this structure,
^^^^ ^^^^^^^^^
perldoc -q copy
perldoc -q structure
Perl FAQ, part 4:
"How do I print out or copy a recursive data structure?"
Please check the Perl FAQs *before* posting to the Perl newsgroup.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 13 Aug 2001 06:17:01 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: Why do I sometimes get an "Argument list too long" when I use <*>?
Message-Id: <xhKd7.73$V3.170986496@news.frii.net>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.
+
Why do I sometimes get an "Argument list too long" when I use <*>?
The "<>" operator performs a globbing operation (see above). In Perl
versions earlier than v5.6.0, the internal glob() operator forks csh(1)
to do the actual glob expansion, but csh can't handle more than 127
items and so gives the error message "Argument list too long". People
who installed tcsh as csh won't have this problem, but their users may
be surprised by it.
To get around this, either upgrade to Perl v5.6.0 or later, do the glob
yourself with readdir() and patterns, or use a module like Glob::KGlob,
one that doesn't use the shell to do globbing.
-
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to
news:news.answers
or to the many thousands of other useful Usenet news groups.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-1999 Tom Christiansen and Nathan
Torkington. All rights reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
05.13
--
This space intentionally left blank
------------------------------
Date: 12 Aug 2001 18:15:50 -0700
From: billatkins@bigfoot.com (Bill Atkins)
Subject: File::Find Troubles...
Message-Id: <60805a5e.0108121715.287fc4bf@posting.google.com>
I am trying to make a script that will print out the names of all the
subfolders and their sizes. Wghen I run the script with ActivePerl, I
get a die message that I put in as a diagnostic - but I can't figure
out why the die test fails. Any help would be appreciated.
Thanks,
Bill
#!/usr/local/bin/perl
use File::Find;
opendir BIGDIR, "C:\\" || die "Unopenable";
@entries = readdir(BIGDIR);
closedir BIGDIR;
@entries = sort @entries;
%dirs = { "1" => 1 };
foreach $entry(@entries) {
unless ( -d ("C:\\" .$entry)) {next;}
$size = 0;
#HERE is where the error occurs
find(sub {$size += -s $_; }, "C:\\$entry\\") || die "find error";
$dirs{$entry} = $size;
}
foreach $entry (sort(values(%dirs))) {
print $entry . "cheese" . $dirs{$entry};
}
------------------------------
Date: Mon, 13 Aug 2001 01:35:10 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: File::Find Troubles...
Message-Id: <3B772F72.66068077@acm.org>
Bill Atkins wrote:
>
> I am trying to make a script that will print out the names of all the
> subfolders and their sizes. Wghen I run the script with ActivePerl, I
> get a die message that I put in as a diagnostic - but I can't figure
> out why the die test fails. Any help would be appreciated.
>
>
> #!/usr/local/bin/perl
#!/usr/local/bin/perl -w
use strict;
> use File::Find;
>
> opendir BIGDIR, "C:\\" || die "Unopenable";
opendir BIGDIR, "C:\\" or die "Unopenable: $!";
> @entries = readdir(BIGDIR);
> closedir BIGDIR;
>
> @entries = sort @entries;
>
> %dirs = { "1" => 1 };
>
> foreach $entry(@entries) {
> unless ( -d ("C:\\" .$entry)) {next;}
> $size = 0;
>
> #HERE is where the error occurs
> find(sub {$size += -s $_; }, "C:\\$entry\\") || die "find error";
find() returns an empty list so this won't work.
find( sub { $dir{$entry} += -s }, "C:\\$entry" );
> $dirs{$entry} = $size;
> }
>
> foreach $entry (sort(values(%dirs))) {
^^^^^^^^^^^^
> print $entry . "cheese" . $dirs{$entry};
^^^^^^^^^^^^^
You can't use the values of %dirs for the keys.
perldoc -q "How do I sort a hash (optionally by value instead of key)"
> }
John
--
use Perl;
program
fulfillment
------------------------------
Date: Mon, 13 Aug 2001 03:09:09 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Get rid of some ratio ftp
Message-Id: <slrn9neh6l.nqs.mgjv@verbruggen.comdyn.com.au>
[Please, in the future, put your comments _after_ the suitably trimmed
text you reply to. It is the generally accepted quoting style on this
group, and usenet in general.]
On Sun, 12 Aug 2001 19:58:33 +0200,
Murat Uenalan <murat.uenalan@gmx.de> wrote:
[re-ordered, re-formatted and shortened post]
> "Martien Verbruggen" <mgjv@tradingpost.com.au> schrieb im Newsbeitrag
> news:slrn9nco26.cq.mgjv@martien.heliotrope.home...
>> On Sun, 12 Aug 2001 14:31:06 +0800,
>> Foot <crud_alex@yahoo.com> wrote:
>> > Is there any way to check how many percentage of a file is
>> > completed while retrieveing it using Net:FTP?
[snip]
>> > Then kill the process once the file's completion reach 99%?
>>
>> Why would you ever want to do this?
>
> Sounds like he wants to test the performance of ftp-servers without leaving
> a file (and a sign of intrusion) on it.
The OP said 'retrieve' a file, not put. Besides that, killing your
process partway through a put wouldn't automatically erase the file on
the remote end anyway. And not getting that last percent isn't going
to make any difference to anything I can think of. The only thing that
happens is that you end up with an incomplete file on this end.
Martien
--
Martien Verbruggen |
Interactive Media Division | "In a world without fences,
Commercial Dynamics Pty. Ltd. | who needs Gates?"
NSW, Australia |
------------------------------
Date: Mon, 13 Aug 2001 02:06:39 GMT
From: "Ryan Gralinski" <no-reply@bong.net>
Subject: help with a global variable in CGI
Message-Id: <PCGd7.4938$5d2.18652@news1.wwck1.ri.home.com>
I really need help, i need to assign a cookie to the browser and then
retrieve it from the perl cgi program..
it needs to remain global, as can be seen all throughout the website..
Please advise!
Ryan
------------------------------
Date: Mon, 13 Aug 2001 03:18:42 -0000
From: egwong@netcom.com
Subject: Re: help with a global variable in CGI
Message-Id: <tnehoi7fd5m561@corp.supernews.com>
Ryan Gralinski <no-reply@bong.net> wrote:
> I really need help, i need to assign a cookie to the browser and then
> retrieve it from the perl cgi program..
> it needs to remain global, as can be seen all throughout the website..
> Please advise!
See the section on 'HTTP COOKIES' in the CGI perldoc.
[removing bogus group comp.lang.perl from newsgroups list]
------------------------------
Date: 12 Aug 2001 23:06:04 -0700
From: jjchen@alumni.ice.ntnu.edu.tw (wade)
Subject: Re: help with a global variable in CGI
Message-Id: <4259465b.0108122206.7b4b1f45@posting.google.com>
"Ryan Gralinski" <no-reply@bong.net> wrote in message news:<PCGd7.4938$5d2.18652@news1.wwck1.ri.home.com>...
> I really need help, i need to assign a cookie to the browser and then
> retrieve it from the perl cgi program..
> it needs to remain global, as can be seen all throughout the website..
> Please advise!
>
> Ryan
# set magic cookie;
my $cookie = $query->cookie(-name => 'ACC',
-value => 2
);
print $query->header (-cookie => [$cookie]);
# retrieve cookie
%acc = $query->cookie(-name=>'ACC');
------------------------------
Date: Mon, 13 Aug 2001 07:22:17 +0200
From: Philip Newton <pne-news-20010813@newton.digitalspace.net>
Subject: Re: how to test $X le 'z'
Message-Id: <mpoent8lbfvfjoebju2sbnlvp6th1hg63m@4ax.com>
On 13 Aug 2001 01:56:47 +0200, poul@asp.infostream.no (Poul H. Sorensen)
wrote:
> $str = 'a_'00';
This line looks suspect. Does it even compile under your Perl?
> while ( -f $str ) { $str++ };
And this looks as if you like race conditions. <crstal-ball>Did you,
perhaps, want File::Temp?</crystal-ball>
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: 13 Aug 2001 07:02:59 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: how to test $X le 'z'
Message-Id: <9l7u33$1cq$1@mamenchi.zrz.TU-Berlin.DE>
According to Poul H. Sorensen <poul@asp.infostream.no>:
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:
>
> > According to Ilya Martynov <ilya@martynov.org>:
> > >
> > > jp> I seem to be having a problem testing for the value of a character
> > > jp> variable.
> > > jp> the code is as follows
> > >
> > > jp> for ( $letter = 'a' ; $letter le 'z'; $letter++)
> > > jp> {
> > > jp> print $letter."\n";
> > > jp> }
> > >
>
> Try:
>
> foreach my $letter ( 'a'..'z' ) {
> print $letter,"\n";
> }
Certainly, but that hides the loop condition in "..".
[...]
Anno
------------------------------
Date: Mon, 13 Aug 2001 03:20:29 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Learning Perl, 2nd Edition
Message-Id: <x7wv48lk78.fsf@home.sysarch.com>
>>>>> "TH" == Tim Hammerquist <tim@vegeta.ath.cx> writes:
TH> Me parece que Dat Nguyen <thucdat@hotmail.com> dijo:
>> hakonrk@fys.uio.no (Haakon Riiser) wrote in message news:<slrn9ncvjs.a9.hakonrk@s.hn.org>...
>> > [Randal L. Schwartz]
>> >
>> With the upcoming "Parrot", should I bother with "Programming Perl
>> 3rd" and "Learning Perl 3rd" at all?
TH> Well, with the upcoming "Parrot", you have the opportunity to shell out
TH> $20 bucks for one of the few books in the "Technical Fiction" genre. =)
TH> "The funny part was that setting up the whole joke was the biggest
TH> collaboration between Perl and Python we've seen for a long time!"
TH> -- Simon Cozens, re. "Parrot" April Fools prank
but you don't seem to realize that parrot is the code name chosen for
the perl6 internals and possibly for the whole project.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs -------------------------- http://jobs.perl.org
------------------------------
Date: Sun, 12 Aug 2001 20:16:21 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Newbie
Message-Id: <slrn9ne72l.1vr.tadmc@tadmc26.august.net>
Jayne Heger <jayne.heger@ntlworld.com> wrote:
>
>I am new to this newsgroup
Welcome.
I took a stab at writing down what many folks here expect,
maybe it will help you:
http://mail.augustmail.com/~tadmc/clpmisc.shtml
>and have never used the Perl language before.
Two things you should know then:
1) Perl ships with over a thousand "pages" of documentation.
If you have a properly installed Perl, this documentation
is already somewhere on you hard disk. You can look up
stuff in the docs using the 'perldoc' utility, also
part of the perl distribution. To learn how to use perldoc:
perldoc perldoc
2) CPAN (Comprehensive Perl Archive Network) has a bazillion
modules (libraries) for most every purpose. There are lots
of already-invented wheels there. Go to
http://search.cpan.org
and type "CSV" (without the quotes) into the little box.
>What I want to do is quickly and easily convert text files into CSV, (comma
>separated values), so I can then import the information into a database.
I recommend the Text::CSV_XS module.
>I have heard off the grapevine that Perl can do this.
Piece 'o cake.
>Also, are there any recommended books for Newbies, nothing too heavy.;)
That sorta depends on what you are newbie _to_.
New to programming, as well as to Perl?
"Elements of Programming with Perl" Andrew Johnson
New to Perl?
"Learning Perl" Randal Schwartz and Tom Phoenix (3rd edition)
There is a section in the Perl FAQ (also already on your hard disk)
about books. You can look up FAQs with perldoc too:
perldoc -q book
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
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.
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 1505
***************************************