[19401] in Perl-Users-Digest
Perl-Users Digest, Issue: 1596 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 23 11:05:31 2001
Date: Thu, 23 Aug 2001 08:05:07 -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: <998579107-v10-i1596@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 23 Aug 2001 Volume: 10 Number: 1596
Today's topics:
Re: Accessing $a and $b in conjunction with goto &NAME <gamma@mintaka.iern.disa.mil>
Re: bizarre! (Tad McClellan)
Can't get correct IP <peter.cch@mailexcite.com>
Command Line Arg? <john@tesserv.com>
Re: Command Line Arg? (Tad McClellan)
Re: Command Line Arg? <philippe.perrin@sxb.bsf.alcatel.fr>
email this page script <galligat@tcd.ie>
Re: Encode/Decode: how to determine format? <mjcarman@home.com>
Re: Encode/Decode: how to determine format? <gam1tci@mpinet.net>
Re: Help with Calculating fields (Helgi Briem)
Re: is perl an 'interpretative' language? <ilya@martynov.org>
join <justin.devanandan.allegakoen@intel.com>
Re: join <justin.devanandan.allegakoen@intel.com>
Re: join <tony_curtis32@yahoo.com>
Re: join <jeff@vpservices.com>
Re: join <mjcarman@home.com>
Re: join <samneric@tigerriverOMIT-THIS.com>
Re: join (Tad McClellan)
Re: Partial matching of a regular expression (JP Belanger)
Re: Perl OO needs the opposite of SUPER:: <iltzu@sci.invalid>
Re: Trailing string removal (Tad McClellan)
Re: Using %{$hashref} or %$hashref to dereference?? (Anno Siegel)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 23 Aug 2001 10:49:27 -0400
From: "W. James Showalter, Jr." <gamma@mintaka.iern.disa.mil>
To: Anno Siegel <anno4000@lublin.zrz.tu-berlin.de>
Subject: Re: Accessing $a and $b in conjunction with goto &NAME
Message-Id: <Pine.GSO.4.32.0108231043120.9674-100000@mintaka.iern.disa.mil>
On 23 Aug 2001, Anno Siegel wrote:
> According to W. James Showalter, Jr. <gamma@mintaka.iern.disa.mil>:
> > Hello,
> >
> > I am using perl 5.6.0 on Solaris 8.
> > Here is a fragment of a subroutine I use for sorting dotted values
> > (e.g. OIDs and IP addresses). It resides in a library package.
> >
> > sub ipsort {
> > my $pkg = (caller)[0];
> > my @a = split(/\./, ${"$pkg\::a"});
>
> Are you not running under strict? ${"$pkg\::a"} is a symref.
>
> Anno
>
Anno,
Thanks for the response. Regarding your comment above, I prefer to *not*
use symrefs and always 'use strict' when it does not preclude me from
doing something.
Since I need to qualify $a and $b in the module to the calling program's
namespace I used a symref. If there is a better way without using
symrefs I would gladly employ it.
Thanks,
Jim
------------------------------
Date: Thu, 23 Aug 2001 08:31:56 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: bizarre!
Message-Id: <slrn9o9tts.6ei.tadmc@tadmc26.august.net>
Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de> wrote:
>But when using strictures, $h{yes-this} would
^^^^^^^^^^
>also trigger a warning.
^^^^^^^
Strictures don't do warnings, they do fatal errors.
I get 3 warnings even without strictures.
>Perl would read the key as two barewords with a
>minus-operator in between.
It does that whether or not warnings or strictures are in effect.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 23 Aug 2001 21:17:37 +0800
From: "Peter Chan" <peter.cch@mailexcite.com>
Subject: Can't get correct IP
Message-Id: <3b850262.0@news.tm.net.my>
i try to get the user IP address with the environment variable.
But it wasn't correct.
I use this syntax:
print "IP: $ENV{'REMOTE_ADDR'}\n";
but what the IP that i get is always like this:
IP: 127.0.0.1
IP: 127.0.0.1
IP: 127.0.0.1
IP: 127.0.0.1
.
.
.
and so on(for every time a user access my srcipt}.
That 127.0.0.1 seem like is local computer's IP address.
May i know what is the problem?
Can anyone provide me the solution to get the correct IP such as this:
IP: 202.188.1.5
IP: 203.152.100.5
IP: 202.188.0.133
.
.
.
Thanks for helping.
By Peter
------------------------------
Date: Thu, 23 Aug 2001 08:59:31 -0500
From: "John Beavers" <john@tesserv.com>
Subject: Command Line Arg?
Message-Id: <h_7h7.1263$oL1.156166@nnrp3.sbc.net>
I am trying to learn perl working through some problems from a book that I
am reading. One problem in the book is to read a file searching for words
that have characters specified from the commandline. I know how to implement
the problem for a finite set of commandline arg, but I am not sure how to
implement when the commandline can have 1 to many characters. Any
suggestions would be greatly appreciated.
------------------------------
Date: Thu, 23 Aug 2001 09:43:46 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Command Line Arg?
Message-Id: <slrn9oa24i.6nb.tadmc@tadmc26.august.net>
John Beavers <john@tesserv.com> wrote:
>I am trying to learn perl working through some problems from a book that I
>am reading.
What is the title of your book?
>One problem in the book is to read a file searching for words
>that have characters specified from the commandline. I know how to implement
>the problem for a finite set of commandline arg, but I am not sure how to
>implement when the commandline can have 1 to many characters. Any
>suggestions would be greatly appreciated.
Use a loop.
perldoc perlsyn
describes the looping constructs available in Perl.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 23 Aug 2001 16:38:45 +0200
From: Philippe PERRIN <philippe.perrin@sxb.bsf.alcatel.fr>
Subject: Re: Command Line Arg?
Message-Id: <3B851575.677C45EB@sxb.bsf.alcatel.fr>
John Beavers wrote:
> I am trying to learn perl working through some problems from a book that I
> am reading. One problem in the book is to read a file searching for words
> that have characters specified from the commandline. I know how to implement
> the problem for a finite set of commandline arg, but I am not sure how to
> implement when the commandline can have 1 to many characters. Any
> suggestions would be greatly appreciated.
since @ARGV is the array containing the command line argument, you can
use a loop such as
foreach $word (@ARGV) {
# your solution for one word, using $word
}
--
PhP
($r1,$r2,$r3,$r4)=("19|20","0|1","28|29","5|24");($r5,$r6)=("9|10|15|16|$r1|$r2","9|10|$r3");%h=("1|",$r6,"1=","[1-5]|2[0-4]","1/","0|19","1\\","6|25","2|","0|6|19|25|$r6","2/","1|20","2\\",$r4,"3|","$r2|6|$r1|25|$r6","3/",$r4,"4|","$r2|$r1|$r6","4=","2|3|4|11|12|13|14|21|22|23","4/",$r4,"4\\",15,"5|","$r2|9|15|$r1|20|$r3","5/",10,"6|",$r5,"7|",$r5,"7/",$r3);for($l=1;$l<8;$l++){b:for($i=0;$i<30;$i++){c:foreach(keys
%h){next c if(!(/^$l(.*)$/));$a=$1;if($i=~/^($h{$_})$/){print $a;next
b;}}print " ";}print "\n";}
------------------------------
Date: Thu, 23 Aug 2001 14:47:19 +0100
From: Class Spokesman <galligat@tcd.ie>
Subject: email this page script
Message-Id: <3B850966.7D1FC124@tcd.ie>
Hay
I'm looking for a freeware perl script that can email a page
Does anyone where i can find one thanks
Tom
------------------------------
Date: Thu, 23 Aug 2001 08:00:56 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: Encode/Decode: how to determine format?
Message-Id: <3B84FE88.905381AD@home.com>
Gary wrote:
>
> Someone has sent me a boatload of JPG images [...] However, they
> didn't send them as JPG attachments, instead they arrived as
> "text" lines, with:
>
> begin NUMBER filename.jpg
> many lines consisting of 61 characters and a newline each
> beginning with the character M
> end
>
> I realize they're encoded, but how does one determine how they're
> encoded?
Generally speaking, I would expect the person who sent you the files to
tell you that. Did you ask them?
Otherwise, I guess you just have to recognize the format. :)
It's uuencoded.
-mjc
------------------------------
Date: Thu, 23 Aug 2001 13:40:11 GMT
From: Gary <gam1tci@mpinet.net>
Subject: Re: Encode/Decode: how to determine format?
Message-Id: <3B850764.78AC@mpinet.net>
Me too, but this guy's very illiterate, when I asked him
what format he sent the stuff in, he said "Whaddya mean?".
Followed by, "Format? I'm not sure what you're asking me".
Anyway, you and the previous poster are 100% correct. I've
since installed Convert::UU and I'm very happy this morning...
------------------------------
Date: Thu, 23 Aug 2001 14:27:53 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: Help with Calculating fields
Message-Id: <3b85115d.2699604666@news.isholf.is>
On Wed, 22 Aug 2001 22:32:41 GMT, James Salt
<james.salt@virgin.net> wrote:
>I must say before I ask my question I am new to CGI scripts. However I
>do know some C++ and I have made various alterations to the formmail
>script that I am using.
>
>What I want to do in the cgi script is to multiply a form field
>(Quantitiy) by a number that I want to hard code into the script
>(amount).
>
>I can multiply two numbers together in the script but when I try to
>multiply a variable name by a number this does not work.
Quantitiy (sic) is not a legal variable name in Perl.
All scalar variable names in Perl start with the $ sign.
> I think where I
>am going wrong is the script might think the form field that I am trying
>to multiply is text, how do I specify that the text field I am wanting
>to use is a number field and not a text field?
If it is a number, perl will recoqnize it as such.
>This is a little piece of the script I am using, any help to put me on
>the right track would be gratefully appreciated:
>
>$amount=20*Quantity;
Well, Quantity in this case is not a variable, just
the text string "Quantity". Turning on warnings
in the shebang line (#!/usr/bin/perl -w ) would
have warned you about this.
Where newbies are concerned, it is dangerous to
assume, but I will assume you are using CGI.pm.
In this case:
my $quantity = $query->param('Quantity');
my $amount = 20*$quantity;
Regards,
Helgi Briem
------------------------------
Date: 23 Aug 2001 17:06:28 +0400
From: Ilya Martynov <ilya@martynov.org>
Subject: Re: is perl an 'interpretative' language?
Message-Id: <87vgjfc4dn.fsf@abra.ru>
>>>>> On 23 Aug 2001 05:54:34 -0700, ziegler@algorilla.de (Joachim Ziegler) said:
JZ> hi,
JZ> i've recently heard the term 'interpretative language' for the special
JZ> combination of a compiler and an interpeter Perl uses to execute
JZ> a script.
JZ> it is neither a pure compiled language, nor an interpreted, nor is it
JZ> the same kind of bytecode-interpetation like Java.
JZ> what do you think about calling Perl an 'interpretative language'?
JZ> is this the right expression ? i'd like to use it in the future when
JZ> talking about Perl.
I'm not Perl internals guru but AFAIK Perl is simular to
bytecode-interpetation like Java.
When Perl executes your script first of all it builds internal
bytecode representation of your script (compilation stage) and than
executes it. It is like Java with exception that in Java exist
separation between compiler and bytecode-interpreter (these are
separate programs).
--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| Ilya Martynov (http://martynov.org/) |
| GnuPG 1024D/323BDEE6 D7F7 561E 4C1D 8A15 8E80 E4AE BE1A 53EB 323B DEE6 |
| AGAVA Software Company (http://www.agava.com/) |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
------------------------------
Date: Thu, 23 Aug 2001 21:19:57 +0800
From: "Just in" <justin.devanandan.allegakoen@intel.com>
Subject: join
Message-Id: <9m2vu0$16u@news.or.intel.com>
All,
Sorry if it seems trivial. But I've looked and tried, and looked again.
I'll go back to trying and reading after I post this . . .
Anyway I need to join two lines that get seperated sometimes but not always.
Some file has the following:-
This is line 1 with some burble and other stuff
A new line th
at gets seperated
Oh sod it line 3 is actually part of 2
I have been playing around with join and s/// but to no avail.
This is probably documented somewhere - but I havent found it yet.
------------------------------
Date: Thu, 23 Aug 2001 21:39:41 +0800
From: "Just in" <justin.devanandan.allegakoen@intel.com>
Subject: Re: join
Message-Id: <9m3130$1ub@news.or.intel.com>
Err . . . I said I'd try again after I posted the last one - well I did
And I got it working with:-
s/\n// if((length($_) < 100) && !(/;$/));
Sorry, its been a long day : (
"Just in" <justin.devanandan.allegakoen@intel.com> wrote in message
news:9m2vu0$16u@news.or.intel.com...
> All,
>
> Sorry if it seems trivial. But I've looked and tried, and looked again.
> I'll go back to trying and reading after I post this . . .
>
> Anyway I need to join two lines that get seperated sometimes but not
always.
>
> Some file has the following:-
>
> This is line 1 with some burble and other stuff
> A new line th
> at gets seperated
> Oh sod it line 3 is actually part of 2
>
> I have been playing around with join and s/// but to no avail.
>
> This is probably documented somewhere - but I havent found it yet.
>
>
------------------------------
Date: 23 Aug 2001 08:51:38 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: join
Message-Id: <87y9oaevf9.fsf@limey.hpcc.uh.edu>
>> On Thu, 23 Aug 2001 21:19:57 +0800,
>> "Just in" <justin.devanandan.allegakoen@intel.com> said:
> Anyway I need to join two lines that get seperated
> sometimes but not always.
> Some file has the following:-
> This is line 1 with some burble and other stuff
> A new line th
> at gets seperated
> Oh sod it line 3 is actually part of 2
What are the criteria for determining which lines should
be joined? As it stands, the result of rand() could be a
suitable criterion.
What is it about lines 2 and 3 above that makes it clear
they are erroneously split?
hth
t
--
Yes way! Mmmmkay.
------------------------------
Date: Thu, 23 Aug 2001 06:54:58 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: join
Message-Id: <3B850B32.BC79A0E9@vpservices.com>
Just in wrote:
>
> All,
>
> Sorry if it seems trivial. But I've looked and tried, and looked again.
> I'll go back to trying and reading after I post this . . .
>
> Anyway I need to join two lines that get seperated sometimes but not always.
>
> Some file has the following:-
>
> This is line 1 with some burble and other stuff
> A new line th
> at gets seperated
> Oh sod it line 3 is actually part of 2
The thing you haven't told us and that we absolutely need to know in
order to answer your question is: how do you know which lines have been
improperly separated? Is it by line number (e.g. line 2 always gets
separated)? or by text pattern (e.g. the word "that" is always
improperly split after the "th")? or by character count (e.g. a carriage
return is improperly inserted every 63 characters)? In each of those
cases it's possible to construct a script that will fix it. But we have
to know which case it is first.
Or is there no way to know which lines have been split, in which case,
sorry, no, can't be fixed by a script until Damian finishes DWIM.pm.
--
Jeff
------------------------------
Date: Thu, 23 Aug 2001 08:51:28 -0500
From: Michael Carman <mjcarman@home.com>
Subject: Re: join
Message-Id: <3B850A60.E09064D7@home.com>
Just in wrote:
>
> I need to join two lines that get seperated sometimes but
> not always.
>
> Some file has the following:-
>
> This is line 1 with some burble and other stuff
> A new line th
> at gets seperated
> Oh sod it line 3 is actually part of 2
Does the file have some convention that tells you when lines have been
wrapped? (e.g. a trailing '\' is used in shell scripts) Without that, I
see no way (for Perl) to tell that lines 2 and 3 should be joined by 1
and 2 should not.
> I have been playing around with join and s/// but to no avail.
>
> This is probably documented somewhere - but I havent found it yet.
'.' is the concatenation operator. e.g.
my $long_string = $string1 . $string2;
Or, use '.=' to append to an existing string:
$string1 .= $string2;
-mjc
------------------------------
Date: Thu, 23 Aug 2001 10:10:47 -0400
From: Samneric <samneric@tigerriverOMIT-THIS.com>
Subject: Re: join
Message-Id: <MPG.15eed8f294f536b0989693@news.onemain.com>
Just in wrote:
> Anyway I need to join two lines that get seperated sometimes but not always.
>
> Some file has the following:-
>
> This is line 1 with some burble and other stuff
> A new line th
> at gets seperated
> Oh sod it line 3 is actually part of 2
$line2 .= $line3; ??
[grin]
Seriously, >YOU< recognise that lines 2 & 3 are actually the same line, but how
would perl recognise that? Beyond lines 2 and/or 3 being gibberish to someone
who can read english, is there any particular line-formatting rules that can be
checked by a script to determine that a separation occurred? (minimum legal
length, etc)
Lacking any rules beyond english grammer, you're either going to have to hand-
edit the file (as an english-speaking "parser") or else rebuild the file after
finding the generating error that caused the line to become broken in the first
place.
Or else determine some recurring error-pattern in the file beyond "sometimes
but not always" :)
------------------------------
Date: Thu, 23 Aug 2001 09:41:59 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: join
Message-Id: <slrn9oa217.6nb.tadmc@tadmc26.august.net>
Tony Curtis <tony_curtis32@yahoo.com> wrote:
>>> On Thu, 23 Aug 2001 21:19:57 +0800,
>>> "Just in" <justin.devanandan.allegakoen@intel.com> said:
>
>> Anyway I need to join two lines that get seperated
>> sometimes but not always.
>
>> A new line th
>> at gets seperated
^
^
>What are the criteria for determining which lines should
>be joined?
>What is it about lines 2 and 3 above that makes it clear
>they are erroneously split?
Maybe "lines with misspelled words should be joined with the
previous line"?
:-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 23 Aug 2001 06:12:11 -0700
From: jpbelang@hotmail.com (JP Belanger)
Subject: Re: Partial matching of a regular expression
Message-Id: <b399d6ce.0108230512.5e8cdbb2@posting.google.com>
yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones) wrote in message news:<3b842901@news.victoria.tc.ca>...
> This may not be what you need, but sometimes you want to turn the test
> around.
>
> $input = <>;
>
> print "partial match" if 'hello' =~ m/^${input}$/;
This works for plain strings, but you can't use metacharacters.
What I actually want to do is match an expression by adding one
character at a time (not a whole string) and poll the matcher to see
if the string still could match.
I don't think you can do this in Perl (TNWTDI :) ) short of writing
a matcher. Or maybe fooling around with the regular expression.
------------------------------
Date: 23 Aug 2001 13:18:16 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Perl OO needs the opposite of SUPER::
Message-Id: <998572325.3726@itz.pp.sci.fi>
In article <a73bcad1.0108211831.5f079f17@posting.google.com>, John Lin wrote:
>
>sub gen {
> print "Now we are generating report:\n";
> $self->report;
> print "Done, hope you like it.\n";
>}
>sub save_as_html {
> print HTML "<html><pre>\n";
> $self->report;
> print HTML "</pre></html>\n";
>}
>
>The pre-report and post-report are all different codes for each caller.
>Thus, only pre_report and post_report are not enough. You need
>pre_report_in_gen, post_report_in_gen, pre_report_in_save_as_html, ...
Ah, but this is where you're missing the point. Do it this way instead:
sub gen {
print "Now we are generating report:\n";
$self->pre_report, $self->report, $self->post_report;
print "Done, hope you like it.\n";
}
sub save_as_html {
print "<html><pre>\n";
$self->pre_report, $self->report, $self->post_report;
print "</pre></html>\n";
}
There, now the "intermediate" class only needs to override pre_report
and post_report to change the behavior of all the methods.
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post something,
we discuss its implications. If the discussion happens to answer a question
you've asked, that's incidental." -- nobull in comp.lang.perl.misc
------------------------------
Date: Thu, 23 Aug 2001 08:42:57 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Trailing string removal
Message-Id: <slrn9o9uih.6ei.tadmc@tadmc26.august.net>
Espen Myrland <em@online.no> wrote:
>"JJ" <jocke30_gbg@hotmail.com> writes:
>> How can I remove the string ".txt" in the string "C:\myFile.txt"
substr($thefile, -4) = '';
>> $theFile = "C:\myFile.txt";
^
^ useless use of backslash, you get the same value without it
You should enable warnings when developing Perl programs.
I'll bet that $theFile does not get the value that you think it gets.
print() it and see.
>$thefile =~ s/\.txt^//;
That would remove 5 characters if it matched. The OP wants to
remove 4 characters. tr/^/$/;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 23 Aug 2001 14:31:55 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Using %{$hashref} or %$hashref to dereference??
Message-Id: <9m344r$746$1@mamenchi.zrz.TU-Berlin.DE>
According to Tassilo von Parseval <Tassilo.Parseval@post.rwth-aachen.de>:
> Carlos C. Gonzalez wrote:
>
>
> [%$hashref versus %{$hashref} snipped]
>
> > I am trying to develop a consistent coding style and am inclined to use
> > the "{}" for clarity as to what I am doing exactly but then perhaps I
> > should just skip them. As long as I am consistent.
> >
> > Any thoughts on this?
>
> Under some circumstances it is necessary to use the curly brackets.
> Imagine you are working with a mail-module and have $msg as object. $msg
> has a header method that returns a reference to a hash. Now, if you want
> to dereference the object, you cannot write
>
> %$msg->header
>
> Perl will complain that you cannot call this method without a package or
> object reference. Instead you have to write
>
> %{$msg->header}
>
> to indicate that you explicitely want to call header on $msg and
> dereference the returned value into a hash.
>
> So, if you are heading for consistency which is not a bad habit, then
> you should always use curly brackets since they always work.
Taking it to an extreme, would you also fully parenthesize arithmetic
expressions? It always works, and it is consistent.
I think "consistency" must be carefully defined before it can be
trusted to make a program more readable. You can gain (false)
consistency if you follow the rule: If you can make two expressions
look similar, make them look similar. This may give you an optically
neat program, but obviously you run the risk of hiding distinctions
that should be visible.
A better approximation to a rule may be: Do similar things in similar
ways. This leaves you with the responsibility of deciding which
similarity is important at each point. While that may be seem
bothersome, it is actually a plus because it allows you to stress
one aspect of the program and thus guide your reader through it.
No rule that can be applied by rote can give you that freedom.
Since I'm rambling anyway, allow me an illustration: Suppose you are
looking for *.log files that are two directories deep. Avoiding LTS
you have the choice of
m!/[^/]+/! && /\.log$/
or
m!/[^/]+/! && m!\.log$!
The first follows the rule that you write a regex /.../ unless there
is reason not to, and the second emphasizes that both parts of the
conjunction are similar (namely regexes). Seen in isolation, there
is no good way to decide which is "better". In the framework of
a larger program there well may be.
So, coming back to the original question "%$hashref or %{ $hashref}",
my answer is a resolute "It depends".
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.
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 1596
***************************************