[25476] in Perl-Users-Digest
Perl-Users Digest, Issue: 7721 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 1 14:05:47 2005
Date: Tue, 1 Feb 2005 11:05:17 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 1 Feb 2005 Volume: 10 Number: 7721
Today's topics:
=?iso-8859-1?q?Re:_XML_Datei_auslesen,_bearbeiten_zur=F ioneabu@yahoo.com
[OT] Perl Code which draws camel <bernhard.walle@gmx.de>
Re: [OT] Perl Code which draws camel <hendrik_maryns@despammed.com>
Re: [OT] Perl Code which draws camel <richard@zync.co.uk>
Re: [OT] Perl Code which draws camel <comdog@panix.com>
Boolean ? <jds@atavailcheck.com>
Re: Boolean ? <do-not-use@invalid.net>
Re: Boolean ? <1usa@llenroc.ude.invalid>
Re: Boolean ? <jds@atavailcheck.com>
Re: Boolean ? <mritty@gmail.com>
Re: Boolean ? (Anno Siegel)
Re: Boolean ? ioneabu@yahoo.com
Re: Boolean ? <1usa@llenroc.ude.invalid>
Re: cgi and cgi-bin (Anno Siegel)
Re: compacting '..' path segments using File::Spec ofer@netapt.com
Re: compacting '..' path segments using File::Spec <1usa@llenroc.ude.invalid>
Compile perl code/files via STDIN (mseele)
Re: Compile perl code/files via STDIN <mritty@gmail.com>
Re: FAQ 3.15 How can I generate simple menus without us (Anno Siegel)
Re: file locking module ofer@netapt.com
Re: Invisible cache for LWP / Mechanize? <comdog@panix.com>
Re: Just wondering - variables in html templates <lawrence.tierney@bipcontracts.com>
Re: Just wondering - variables in html templates <phaylon@dunkelheit.at>
Re: Newbie Hash question. <jl_post@hotmail.com>
Re: Newbie Hash question. <news@chaos-net.de>
Re: Newbie Hash question. <jgibson@mail.arc.nasa.gov>
Re: Newbie Hash question. (Anno Siegel)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 1 Feb 2005 10:00:19 -0800
From: ioneabu@yahoo.com
Subject: =?iso-8859-1?q?Re:_XML_Datei_auslesen,_bearbeiten_zur=FCck_speiche_rn?=
Message-Id: <1107280819.016458.111790@c13g2000cwb.googlegroups.com>
Ich denke, dass Sie der falschen Newsgroup Ihre Nachricht aufgestellt
haben k=F6nnen.=20
Viel Gl=FCck!=20
wana
------------------------------
Date: Tue, 01 Feb 2005 16:38:18 +0100
From: Bernhard Walle <bernhard.walle@gmx.de>
Subject: [OT] Perl Code which draws camel
Message-Id: <cto7pa$vgl$1@online.de>
Hello,
somewhere I've seen Perl code which is very small (i. e. can be put in a
signature of a mail) which draws a camel on the screen. Does anybody
have the source?
Thanks!
Regards,
Bernhard
------------------------------
Date: Tue, 01 Feb 2005 16:44:47 +0100
From: Hendrik Maryns <hendrik_maryns@despammed.com>
Subject: Re: [OT] Perl Code which draws camel
Message-Id: <tNydnRcI9YZzPmLcRVnygA@scarlet.biz>
Bernhard Walle schreef:
> Hello,
>
> somewhere I've seen Perl code which is very small (i. e. can be put in a
> signature of a mail) which draws a camel on the screen. Does anybody
> have the source?
Is http://www.cpan.org/misc/japh what you're after?
HTH, H.
------------------------------
Date: Tue, 01 Feb 2005 15:58:36 +0000
From: Richard Gration <richard@zync.co.uk>
Subject: Re: [OT] Perl Code which draws camel
Message-Id: <pan.2005.02.01.15.58.35.700048@zync.co.uk>
On Tue, 01 Feb 2005 16:44:47 +0100, Hendrik Maryns wrote:
> Bernhard Walle schreef:
>> Hello,
>>
>> somewhere I've seen Perl code which is very small (i. e. can be put in a
>> signature of a mail) which draws a camel on the screen. Does anybody
>> have the source?
>
> Is http://www.cpan.org/misc/japh what you're after?
>
> HTH, H.
I went to that page and ran the first japh (the 2001 one) and it printed
this:
Just AnoineasPerl Hacker
Does it do this for anyone else?
R
------------------------------
Date: Tue, 01 Feb 2005 10:19:35 -0600
From: brian d foy <comdog@panix.com>
Subject: Re: [OT] Perl Code which draws camel
Message-Id: <010220051019354011%comdog@panix.com>
In article <cto7pa$vgl$1@online.de>, Bernhard Walle
<bernhard.walle@gmx.de> wrote:
> somewhere I've seen Perl code which is very small (i. e. can be put in a
> signature of a mail) which draws a camel on the screen. Does anybody
> have the source?
I think you want Acme::EyeDrops
http://search.cpan.org/dist/Acme-EyeDrops
--
brian d foy, comdog@panix.com
Subscribe to The Perl Review: http://www.theperlreview.com
------------------------------
Date: Tue, 01 Feb 2005 14:16:07 GMT
From: "Julia De Silva" <jds@atavailcheck.com>
Subject: Boolean ?
Message-Id: <HaMLd.42235$v8.15842@fe2.news.blueyonder.co.uk>
Hi there all
I can do this in other languages. Have I got the syntax wrong or is this not
possible in Perl ?
my $testtime = 1107267063;
my $isbeforenow = ($testtime > time);
print"isbeforenow - $isbeforenow\n";
Output is >> isbeforenow -
TIA
J
------------------------------
Date: 01 Feb 2005 15:36:29 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: Boolean ?
Message-Id: <yzdoef45ouq.fsf@invalid.net>
"Julia De Silva" <jds@atavailcheck.com> writes:
> I can do this in other languages. Have I got the syntax wrong or is this not
> possible in Perl ?
>
> my $testtime = 1107267063;
> my $isbeforenow = ($testtime > time);
> print"isbeforenow - $isbeforenow\n";
>
> Output is >> isbeforenow -
You are assigning the result of a test to a variable, and printing it
out. Yes, you can - the value produced by logical operations to mean
"false" by Perl is the empty string, which is precisely what you're
getting.
Additional values are treated as "false" when being used in
tests. From "perldoc perlsyn":
The number 0, the strings C<'0'> and C<''>, the empty list C<()>, and
C<undef> are all false in a boolean context. All other values are true.
------------------------------
Date: Tue, 01 Feb 2005 14:42:53 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Boolean ?
Message-Id: <Xns95F062DDBF8CAasu1cornelledu@127.0.0.1>
"Julia De Silva" <jds@atavailcheck.com> wrote in
news:HaMLd.42235$v8.15842@fe2.news.blueyonder.co.uk:
> Hi there all
> I can do this in other languages. Have I got the syntax wrong or is
> this not possible in Perl ?
>
> my $testtime = 1107267063;
> my $isbeforenow = ($testtime > time);
> print"isbeforenow - $isbeforenow\n";
>
> Output is >> isbeforenow -
$isbeforenow is set to the empty string which is a false value in Perl.
You can do this:
my $isbeforenow = 0 + ($testtime > time);
if you really want to force the result to be numeric.
Sinan.
------------------------------
Date: Tue, 01 Feb 2005 14:57:01 GMT
From: "Julia De Silva" <jds@atavailcheck.com>
Subject: Re: Boolean ?
Message-Id: <1NMLd.42242$v8.39292@fe2.news.blueyonder.co.uk>
> my $isbeforenow = 0 + ($testtime > time);
Excellent, just what I was after, thanks.
J
------------------------------
Date: Tue, 01 Feb 2005 16:37:27 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Boolean ?
Message-Id: <bfOLd.8610$QS5.2021@trndny06>
"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
news:Xns95F062DDBF8CAasu1cornelledu@127.0.0.1...
> "Julia De Silva" <jds@atavailcheck.com> wrote in
> news:HaMLd.42235$v8.15842@fe2.news.blueyonder.co.uk:
>
> > my $testtime = 1107267063;
> > my $isbeforenow = ($testtime > time);
> > print"isbeforenow - $isbeforenow\n";
>
> You can do this:
>
> my $isbeforenow = 0 + ($testtime > time);
>
> if you really want to force the result to be numeric.
An alternative suggestion would be to explicitly provide the two values
you want to have in your 'boolean' variable:
my $isbeforenow = $testtime > time ? 1 : 0;
Paul Lalli
------------------------------
Date: 1 Feb 2005 17:01:57 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Boolean ?
Message-Id: <ctocm5$m6o$2@mamenchi.zrz.TU-Berlin.DE>
A. Sinan Unur <1usa@llenroc.ude.invalid> wrote in comp.lang.perl.misc:
> "Julia De Silva" <jds@atavailcheck.com> wrote in
> news:HaMLd.42235$v8.15842@fe2.news.blueyonder.co.uk:
>
> > Hi there all
> > I can do this in other languages. Have I got the syntax wrong or is
> > this not possible in Perl ?
> >
> > my $testtime = 1107267063;
> > my $isbeforenow = ($testtime > time);
> > print"isbeforenow - $isbeforenow\n";
> >
> > Output is >> isbeforenow -
>
> $isbeforenow is set to the empty string which is a false value in Perl.
More precisely, comparisons return a scalar whose string value is empty
*and* whose numeric value is 0.
> You can do this:
>
> my $isbeforenow = 0 + ($testtime > time);
>
> if you really want to force the result to be numeric.
If ($testtime > time) were just an empty string, you couldn't do this
under warnings.
Anno
------------------------------
Date: 1 Feb 2005 09:08:49 -0800
From: ioneabu@yahoo.com
Subject: Re: Boolean ?
Message-Id: <1107277729.018837.305720@z14g2000cwz.googlegroups.com>
Hey, your right. This produces an error:
#!/usr/bin/perl
use strict;
use warnings;
my $a = 0 + '';
------------------------------
Date: Tue, 01 Feb 2005 18:25:59 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Boolean ?
Message-Id: <Xns95F088B0BB70Casu1cornelledu@127.0.0.1>
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in news:ctocm5$m6o$2
@mamenchi.zrz.TU-Berlin.DE:
> A. Sinan Unur <1usa@llenroc.ude.invalid> wrote in comp.lang.perl.misc:
>> > my $isbeforenow = ($testtime > time);
..
>> $isbeforenow is set to the empty string which is a false value in Perl.
..
> More precisely, comparisons return a scalar whose string value is
> empty *and* whose numeric value is 0.
Thanks for catching that.
Sinan
------------------------------
Date: 1 Feb 2005 17:58:31 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: cgi and cgi-bin
Message-Id: <ctog07$obf$3@mamenchi.zrz.TU-Berlin.DE>
Gregory Toomey <nospam@bigpond.com> wrote in comp.lang.perl.misc:
> zippy wrote:
> Make a symbolic link from cgi-bin to scgi-bin, or move cgi-bin to scgi-bin.
> Any system admin with 1/4 of a brain could work this out.
Patching a configuration error with a symlink is *not* what good
sysadmins do.
Anno
------------------------------
Date: 1 Feb 2005 10:36:59 -0800
From: ofer@netapt.com
Subject: Re: compacting '..' path segments using File::Spec
Message-Id: <1107283019.666326.273640@c13g2000cwb.googlegroups.com>
I'll ignore the two morons and reply to the one who seems to have
understood what I'm trying to accomplish.
By the description of canonpath ('a logical cleanup of a path'), and
your example, it would seem to be what I'm looking for. I threw it in
to my test script... and it didn't change the path at all. It still
returns /foo/bar/../somefile instead of /foo/somefile.
Of course, I'm running on Linux, and I see you're running on DOS or
Windows. So I copied my test script over to my windows desktop,
tweaked it a bit, and tried it. It works!
So it appears canonpath does what I want on DOS/Windows, but not on
Linux.
How bizarre.
Anyways, thanks for the tip. It was valid, even if it doesn't work for
me.
------------------------------
Date: Tue, 01 Feb 2005 18:44:22 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: compacting '..' path segments using File::Spec
Message-Id: <Xns95F08BCF1E9C2asu1cornelledu@127.0.0.1>
ofer@netapt.com wrote in news:1107283019.666326.273640
@c13g2000cwb.googlegroups.com:
[ Please provide some context when you are posting. ]
> I'll ignore the two morons
OK, you got me curious, let me look up who those are ... Hmmmm ... It's
Brian McCauley and Josef Moellers who have provided insight and help to
countless people. In fact, I just learned something from reading Brian's
post. Thank you Brian.
Oh, getting back to the topic at hand ...
* PLONK *
I hope you'll enjou Xahzilla's company.
Sinan.
------------------------------
Date: 1 Feb 2005 07:07:34 -0800
From: mseele@gmail.com (mseele)
Subject: Compile perl code/files via STDIN
Message-Id: <554147f0.0502010707.6f1d149c@posting.google.com>
hi,
i want to open a perl process and enter the code/files to compile via
STDIN. i know it is possible. but how?
does somebody know a tutorial or something like this which explains
how i can compile perl code via STDIN?
thx mseele
------------------------------
Date: Tue, 01 Feb 2005 16:31:00 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Compile perl code/files via STDIN
Message-Id: <89OLd.1693$g16.1199@trndny08>
"mseele" <mseele@gmail.com> wrote in message
news:554147f0.0502010707.6f1d149c@posting.google.com...
> hi,
> i want to open a perl process and enter the code/files to compile via
> STDIN. i know it is possible. but how?
> does somebody know a tutorial or something like this which explains
> how i can compile perl code via STDIN?
> thx mseele
If I understand you correctly, you want to provide your code by typing
directly from the command line, rather than executing a pre-existing
file containing perl code. Is this correct? If so, at your shell,
simply type
perl
and press enter. Perl will now patiently wait for you to enter the code
you wish to execute. When you've entered all the code, send the
end-of-file code (CTRL-D on most systems). Perl will execute what
you've typed.
If you want a more interactive environment, perhaps you want the perl
debugger. The easiest way to launch the debugger is:
perl -d -e1
Read about the debugger in
perldoc perldebug
Hope that helps,
Paul Lalli
------------------------------
Date: 1 Feb 2005 18:24:15 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: FAQ 3.15 How can I generate simple menus without using CGI or Tk?
Message-Id: <ctohgf$q4i$1@mamenchi.zrz.TU-Berlin.DE>
PerlFAQ Server <comdog@panix.com> wrote in comp.lang.perl.misc:
> 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 Perl.
>
> --------------------------------------------------------------------
>
> 3.15: How can I generate simple menus without using CGI or Tk?
>
> The http://www.cpan.org/authors/id/SKUNZ/perlmenu.v4.0.tar.gz module,
> which is curses-based, can help with this.
Is this really a FAQ?
If it is, is the answer up to date, in view of Curses::UI?
The advertised module "perlmenu" has been ported from a Perl 4 library
to work under Perl 5 (but no inch farther than that). It has last been
updated in 1997 and is not up to today's standards.
I think this one could go without replacement.
Anno
------------------------------
Date: 1 Feb 2005 10:10:37 -0800
From: ofer@netapt.com
Subject: Re: file locking module
Message-Id: <1107281437.177238.232060@f14g2000cwb.googlegroups.com>
I do have the Perl Cookbook (absolutely invaluable), and I'm familiar
with the flock function and fcntl constants, but like all good perl
programmers, I am lazy, so I'm now looking for a module that will
handle the dirty details for me and present me with an elegant syntax.
:)
------------------------------
Date: Tue, 01 Feb 2005 10:16:18 -0600
From: brian d foy <comdog@panix.com>
Subject: Re: Invisible cache for LWP / Mechanize?
Message-Id: <010220051016182211%comdog@panix.com>
In article <1107249521.436612.265290@c13g2000cwb.googlegroups.com>,
jfix <jakob.fix@gmail.com> wrote:
> Thanks for your response, brian.
>
> Problem is I am not sure HTML::SimpleLinkExtor works for ftp sites. I
> am using LWP because it's the only module I found to be able to access
> the ftp site from behind our authenticated HTTP firewall.
SimpleLinkExtor doesn't do anything with the network. It just
extracts links from the HTML you give it. You can use LWP like
you are, but dump WWW::Mechanize if you only need it to extract links.
You won't have to worry about all of its baggage.
--
brian d foy, comdog@panix.com
Subscribe to The Perl Review: http://www.theperlreview.com
------------------------------
Date: Tue, 01 Feb 2005 14:39:07 GMT
From: "Lord0" <lawrence.tierney@bipcontracts.com>
Subject: Re: Just wondering - variables in html templates
Message-Id: <fwMLd.145$0o6.116@newsfe3-win.ntli.net>
HTML::Template
"phaylon" <phaylon@dunkelheit.at> wrote in message
news:pan.2005.01.31.13.10.32.598693@dunkelheit.at...
> Seansan wrote:
>
>> Sherm start a hobby
>
> I see, you have to be the new "I don't need the regulars"-guy.
> Good luck. Score adjusted.
>
>
> p
>
> --
> http://www.dunkelheit.at/
>
> The eternal mistake of mankind is to set up an attainable ideal.
> -- Aleister Crowley
>
------------------------------
Date: Tue, 01 Feb 2005 16:12:26 +0100
From: phaylon <phaylon@dunkelheit.at>
Subject: Re: Just wondering - variables in html templates
Message-Id: <pan.2005.02.01.15.12.26.238657@dunkelheit.at>
Lord0 wrote:
> HTML::Template
Could you please tell my what reason there was to top-post that as an
answer to my post?
curious,
p
--
http://www.dunkelheit.at/
bellum omnium pater.
------------------------------
Date: 1 Feb 2005 08:44:36 -0800
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Re: Newbie Hash question.
Message-Id: <1107276276.124659.93530@c13g2000cwb.googlegroups.com>
Wondering wrote:
>
> Now I have a larger lookup table, and rather than write
> it into the program, I'd prefer to store the lookup table
> in a text file, and load it at runtime.
You might consider giving the Data::Dumper module a shot. It's a
standard Perl module, so you should already have it. Here's an example
of how to use it:
File "hashOut.pl" outputs a hash to STDOUT:
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
my %hash = (cat => 'mammal', dog => 'mammal', sparrow => 'bird');
my $output = Dumper \%hash;
$output =~ s/^\$VAR1 = //; # remove "$VAR1 = "
print $output;
__END__
File "hashIn.pl" reads text from STDIN and forms a hash from it:
#!/usr/bin/perl
use strict;
use warnings;
# Read the input data into $text:
my $text = join('', <>);
# Reconstruct the %hash:
my %hash = %{ eval($text) };
# Print out %hash contents:
print " $_ => $hash{$_}\n" foreach sort keys %hash;
__END__
When you have these two files, you can run them like this:
perl hashOut.pl | perl hashIn.pl
or with an intermediate text file, like this:
perl hashOut.pl > data.txt
perl hashIn.pl < data.txt
Then you will see hashIn.pl print out the hash it got from STDIN.
According to "perldoc Data::Dumper", the string returned from the
Dumper() function is suitable for eval()ing. Therefore, I print out
the Dumper() value of a hash reference in hashOut.pl, then read it back
into a string and eval() that string to get a hash in hashIn.pl .
What's nice about the Data::Dumper module is that it should also be
able to handle nested hashes, arrays, and even Perl objects (blessed
references).
I hope this helps.
-- Jean-Luc
------------------------------
Date: Tue, 1 Feb 2005 17:49:28 +0100
From: Martin Kissner <news@chaos-net.de>
Subject: Re: Newbie Hash question.
Message-Id: <slrncvvcoo.53i.news@maki.homeunix.net>
Tad McClellan wrote :
> Martin Kissner <news@chaos-net.de> wrote:
>
>> use HTML::Template;
>
> Your code does not make use of that module, so why include it?
I have shortened the script; I should have deleted this line, too.
>> my (%row, $row, $name, $url);
>
> You should declare your variables in the *smallest possible* scope.
I wouldn't be able to use %row, $name and $url outside the while loop if I
would not declare them here, would I?
> You never use the $row variable, so why declare it?
I use it in the deleted part; should have deleted it here, too.
>
>> open LINKS, "<", $file or die "Can not open $file: $!";
>> while ($line = <LINKS>)
>
> while ( my $line = <LINKS> )
>
>> {
>> my @line = split (":", $line);
>> $name = $line[0];
>> $url = $line[1];
>
> You can use a "list assignment" and do away with the temporary variable.
>
> A pattern match should *look like* a pattern match.
>
> my($name, $url) = split (/:/, $line);
Good hint.
Thank you for your feedback
It makes me think about the general design of my script, because I
guess I could process the hash within the while loop.
Then again it would be sufficient to declare the variables within the
loop.
Best regards
Martin
--
perl -e 'print 7.74.117.115.116.11.32.13.97.110.111.116.104.101.114.11
.32.13.112.101.114.108.11.32.13.104.97.99.107.101.114.10.7'
------------------------------
Date: Tue, 01 Feb 2005 09:46:18 -0800
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Newbie Hash question.
Message-Id: <010220050946186823%jgibson@mail.arc.nasa.gov>
In article <1107235158.046510.158720@f14g2000cwb.googlegroups.com>,
Wondering <dbent@comcast.net> wrote:
> I'm teaching myslf Perl using the Camel book. I'm trying to load some
> data, and I think a hash is a good solution for mapping values. I did
> one simple hash in the program, and it worked as expected. Now I have a
> larger lookup table, and rather than write it into the program, I'd
> prefer to store the lookup table in a text file, and load it at
> runtime. I've tried a couple of different methods, and I thought I had
> it working at one point. Then, a couple of days went by, and now I
> can't get what I want at all. I separated the code for that hash into a
> separate Perl script so I could test it, and nothing I've tried (book
> in hand) has given the result I would like. I expect it's something
> simple a newbie like me would miss.
>
> Here's an abbreviated version of the table from the text file (filename
> is "sufhash"):
>
> '149' => ' x'
> '150' => ' y'
> '151' => ' z'
> '152' => 'AA'
>
> I've also written this file with commas at the end of each line, but
> this is the current iteration.
>
> Here's the Perl script I'm using to test:
> #!/usr/contrib/bin/perl
>
> %sufmap = (`cat /"full path"/sufhash`) ;
`cat ...` returns a list consisting of the lines from the file,
including the newlines at the end of each line. Assigning this list to
a hash takes the odd-numbered elements as keys and the even-numbered
elements as values. At this point, you have a hash that looks like:
%sufmap = (
"'149' => ' x'\n" => "'150' => ' y'\n",
"'151' => ' z'\n" => "'152' => 'AA'\n"
);
and this is what you are seeing when you print this hash.
If you had 'use strict' and 'use warnings' in your program and had an
odd number of lines in the file, you would have gotten a warning
message, and the last element added to the hash would have undef as a
value.
As others have pointed out, there are ways to accomplish your end. I
just wanted to explain why what you tried doesn't work.
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
------------------------------
Date: 1 Feb 2005 17:49:22 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Newbie Hash question.
Message-Id: <ctoff2$obf$2@mamenchi.zrz.TU-Berlin.DE>
Martin Kissner <news@chaos-net.de> wrote in comp.lang.perl.misc:
> Tad McClellan wrote :
> > Martin Kissner <news@chaos-net.de> wrote:
> >
> >> use HTML::Template;
> >
> > Your code does not make use of that module, so why include it?
>
> I have shortened the script; I should have deleted this line, too.
>
> >> my (%row, $row, $name, $url);
> >
> > You should declare your variables in the *smallest possible* scope.
>
> I wouldn't be able to use %row, $name and $url outside the while loop if I
> would not declare them here, would I?
You only want to use %row outside the loop. $name and $url can (and
should) be local to the loop body. That's what *smallest possible* means.
Oh, and the lines should be chomped before splitting them.
Anno
------------------------------
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 7721
***************************************