[23918] in Perl-Users-Digest
Perl-Users Digest, Issue: 6120 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 11 21:05:37 2004
Date: Wed, 11 Feb 2004 18:05:06 -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 Wed, 11 Feb 2004 Volume: 10 Number: 6120
Today's topics:
Re: A Newbie Array Problem <iamdownloading@yahoo.com>
Re: Broken Pipe <No_4@dsl.pipex.com>
Re: Broken Pipe <No_4@dsl.pipex.com>
Re: compile Perl as a STATIC library <usenet@morrow.me.uk>
Re: Encrypt and Decrypt for text ... <matthew.garrish@sympatico.ca>
Re: Encrypt and Decrypt for text ... <spamhole@klaas.ca>
Re: Encrypt and Decrypt for text ... <spamhole@klaas.ca>
Re: Encrypt and Decrypt for text ... <usenet@morrow.me.uk>
Re: encrypt.pm <usenet@morrow.me.uk>
Re: encrypt.pm <invalid-email@rochester.rr.com>
Re: formating pipe delimited file <glex_nospam@qwest.invalid>
Re: formating pipe delimited file <invalid-email@rochester.rr.com>
Re: formating pipe delimited file <usenet@morrow.me.uk>
Re: PERL : Cant find string terminator .. <invalid-email@rochester.rr.com>
Re: Perl : Cant Find String Terminator <1usa@llenroc.ude>
Re: Perl usage these days? <pkent77tea@yahoo.com.tea>
Re: perl/korn scirpt for appending first variable to en <beardy@beardy.net>
Re: RFC: utils.pm <tassilo.parseval@rwth-aachen.de>
Re: trying to create a network script: <invalid-email@rochester.rr.com>
Re: trying to create a network script: <usenet@morrow.me.uk>
Re: Using Tie::IxHash order a hash reference <kevin@vaildc.net>
Re: Why is Perl losing ground? <tassilo.parseval@rwth-aachen.de>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Feb 2004 18:19:10 -0600
From: Down Loader <iamdownloading@yahoo.com>
Subject: Re: A Newbie Array Problem
Message-Id: <402ac67e$1_1@127.0.0.1>
Tad McClellan <tadmc@augustmail.com> wrote in
news:slrnc2j8q8.64f.tadmc@magna.augustmail.com:
> Once you discover a good data structure, the coding it up is
easy(ish).
>
I'll take your word for it, but I am a newbie and the thing is,
while I appreciate your actually providing the whole code
structure, I just don't understand what it is and how it works.
I see that you're splitting the array elements and making a hash
of hashes and know what both of those are, but... this part just
sails over my head at warp speed.
> my %acct_totals;
> foreach my $domain ( sort keys %domains ) {
> my($total, @accts);
> foreach my $acct ( sort keys %{$domains{$domain}} ) {
> $acct_totals{$acct} += $domains{$domain}{$acct};
> $total += $domains{$domain}{$acct};
> push @accts, " $acct=
$domains{$domain}{$acct}\n";
> }
> print "domain $domain = $total entries\n";
> print for @accts;
> print "\n";
> }
What exactly is happening here?
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
------------------------------
Date: Thu, 12 Feb 2004 01:08:29 +0000
From: Big and Blue <No_4@dsl.pipex.com>
Subject: Re: Broken Pipe
Message-Id: <402ad1d2$0$10334$cc9e4d1f@news-text.dial.pipex.com>
Jon Landenburer wrote:
>
> In perl I been gettuing broken pipes. I get all of the data but I get
> a message (stderr)
> dog: Broken pipe
>
> to isolate the probelm I wrote
> @temp = `zcat $filename | head -n50|`;
So, after it has read 50 lines the head command exits.
If $filename is large the zcat command may still be pushing the contents
into the now deceased head, in which case it will be writing to a closed
pipe. Hence a SIGPIPE is sent.
Just put:
$SIG{PIPE} = _IGNORE_;
in your code (ideally scoped to the extent of the `` command).
--
-*- Just because I've written it here doesn't -*-
-*- mean that you should, or I do, believe it. -*-
------------------------------
Date: Thu, 12 Feb 2004 01:18:52 +0000
From: Big and Blue <No_4@dsl.pipex.com>
Subject: Re: Broken Pipe
Message-Id: <402ad441$0$10344$cc9e4d1f@news-text.dial.pipex.com>
Big and Blue wrote:
>
> If $filename is large the zcat command may still be pushing the
> contents into the now deceased head, in which case it will be writing to
> a closed pipe. Hence a SIGPIPE is sent.
>
> Just put:
>
> $SIG{PIPE} = _IGNORE_;
>
> in your code (ideally scoped to the extent of the `` command).
Err...could be wrong there. The "Broken Pipe" message is from the
shell running the `` command, so a perl SIG handler isn't going to help.
So, you'll need to trap the signal in the shell....
@temp = `trap "" 13; zcat $filename | head -n50`;
(although the comment made about the trailing | is also true - it shouldn't
be there: I'm assuming it isn't).
Anyway, try all of the suggestions in turn until the problem is gone.
(Another suggestion would be to install Compress::Zlib and just read
the first 50 lines entirely in Perl).
--
-*- Just because I've written it here doesn't -*-
-*- mean that you should, or I do, believe it. -*-
------------------------------
Date: Wed, 11 Feb 2004 23:08:40 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: compile Perl as a STATIC library
Message-Id: <c0eclo$ckl$1@wisteria.csv.warwick.ac.uk>
Torsten Mohr <tmohr@s.netic.de> wrote:
> But if i want to distribute this code to some other PCs, i need
> to install Perl there completely, not just the perl58.dll, but
> also the modules.
>
> Is there some way to compile Perl as a STATIC library that already
> includes all modules that come with a normal Perl installation?
>
> I looked into the Makefile, the Readme's, but didn't yet find
> any hint for this.
>
> I hope it is clear what i want, i want to compile a static Perl
> library and link it with my own programs so i can distribute them
> as standalone programs and i can execute Perl scripts in these
> programs.
If the 'programs' you are talking about are Perl programs, then you
want PAR. If they are C programs that use embedded Perl interpreters,
then you will want to build perl statically by passing -Uusedl to
Configure, and then you must make sure you create an perlxsi.c with
ExtUtils::Embed::xs_init and link it into your executable.
Ben
--
Musica Dei donum optimi, trahit homines, trahit deos. |
Musica truces molit animos, tristesque mentes erigit. | ben@morrow.me.uk
Musica vel ipsas arbores et horridas movet feras. |
------------------------------
Date: Wed, 11 Feb 2004 18:54:35 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Encrypt and Decrypt for text ...
Message-Id: <ZgzWb.7149$sO4.917093@news20.bellglobal.com>
"Klaas" <spamhole@klaas.ca> wrote in message
news:Xns948BE9C5BE28Fnothing@209.98.50.131...
> After careful consideration, Gregory Toomey muttered:
>
> > The best known algorithm is DES
> > http://www.itl.nist.gov/fipspubs/fip46-2.htm
>
> Surely you jest? DES can be broken in a matter of hours. AES is the
> current standard.
>
In all fairness, I think he meant best known in the sense of widely known,
not best available.
Matt
------------------------------
Date: 12 Feb 2004 01:39:32 GMT
From: Klaas <spamhole@klaas.ca>
Subject: Re: Encrypt and Decrypt for text ...
Message-Id: <Xns948CB3F50FC88nothing@209.98.50.131>
After careful consideration, Matt Garrish muttered:
>
> "Klaas" <spamhole@klaas.ca> wrote in message
> news:Xns948BE9C5BE28Fnothing@209.98.50.131...
>> After careful consideration, Gregory Toomey muttered:
>>
>> > The best known algorithm is DES
>> > http://www.itl.nist.gov/fipspubs/fip46-2.htm
>>
>> Surely you jest? DES can be broken in a matter of hours. AES is the
>> current standard.
>
> In all fairness, I think he meant best known in the sense of widely
> known, not best available.
Ah, right. All that trouble caused by a missing hyphen...
-Mike
------------------------------
Date: 12 Feb 2004 01:41:19 GMT
From: Klaas <spamhole@klaas.ca>
Subject: Re: Encrypt and Decrypt for text ...
Message-Id: <Xns948CB4424A381nothing@209.98.50.131>
After careful consideration, Walter Roberson muttered:
> In article <Xns948BE9C5BE28Fnothing@209.98.50.131>,
> Klaas <spamhole@klaas.ca> wrote:
>:Surely you jest? DES can be broken in a matter of hours.
>
> Yes, it can be broken in a matter of hours -- if you devote several
> thousand computers to the task. I would tend to doubt anyone would
> bother for whatever the original poster intended to use the
> encryption for.
>
> Encryption doesn't have to be perfect: it just has to be good
> enough to not be worth the bother of breaking.
I agree. I was essentially objecting to the poster's characterizing DES
as the best known algorithm (I should have realized he meant best-known).
Still, there is no sense using DES when it isn't difficult to find
libraries for much more robust algorithms.
-MIke
------------------------------
Date: Thu, 12 Feb 2004 01:51:37 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Encrypt and Decrypt for text ...
Message-Id: <c0em79$ish$1@wisteria.csv.warwick.ac.uk>
Klaas <spamhole@klaas.ca> wrote:
> I agree. I was essentially objecting to the poster's characterizing DES
> as the best known algorithm (I should have realized he meant best-known).
Yay! Punctuation Pedants of the World Unite!
Ben
--
And if you wanna make sense / Whatcha looking at me for? (Fiona Apple)
* ben@morrow.me.uk *
------------------------------
Date: Wed, 11 Feb 2004 23:14:43 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: encrypt.pm
Message-Id: <c0ed13$ckl$3@wisteria.csv.warwick.ac.uk>
Todd Anderson <todd@asgweb.net> wrote:
> I once saw a pm that un encrypted a script before compiling to keep
> hackers from stealing your code. Anybody know what it is and advice on
> how to use it is appreciated.
Acme::Bleach
Ben
--
don't get my sympathy hanging out the 15th floor. you've changed the locks 3
times, he still comes reeling though the door, and soon he'll get to you, teach
you how to get to purest hell. you do it to yourself and that's what really
hurts is you do it to yourself just you, you and noone else * ben@morrow.me.uk
------------------------------
Date: Wed, 11 Feb 2004 23:18:41 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: encrypt.pm
Message-Id: <402AB837.4070908@rochester.rr.com>
Todd Anderson wrote:
> I once saw a pm that un encrypted a script before compiling to keep
> hackers from stealing your code. Anybody know what it is and advice on
> how to use it is appreciated.
> Thanks in advance.
>
>
You can check out the Acme::Bleach and other Acme:: modules. But they
won't stop any hacker worthy of the name.
For more information (a FAQ, by the way) on why you really can't protect
your Perl source code, see:
perldoc -q hide
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Wed, 11 Feb 2004 17:16:36 -0600
From: "J. Gleixner" <glex_nospam@qwest.invalid>
Subject: Re: formating pipe delimited file
Message-Id: <pJyWb.204$C%.74588@news.uswest.net>
J wrote:
> I have a file with 40000 lines. Each line is a row of data, and the fields
> are seperated by pipes ( | ). I would like to align all pipes so that the
> fields will line up.
>
> example:
>
> field1 | 100 | 1 | | |
> field2islong| | example | | 3 |
>
> would become
>
> field1 | 100 | 1 | | |
> field2islong| | example | | 3 |
>
>
> anyone have any ideas.
>
> J
>
split each line, find the maximun length for each column, then use
printf with the max length of each column.
------------------------------
Date: Wed, 11 Feb 2004 23:24:12 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: formating pipe delimited file
Message-Id: <402AB983.5010207@rochester.rr.com>
J wrote:
> I have a file with 40000 lines. Each line is a row of data, and the fields
> are seperated by pipes ( | ). I would like to align all pipes so that the
> fields will line up.
...
> J
Do you know any information on field lengths up front? If not, you'll
have to pass through your data once to determine the maximum length of
each field, then pass through it again to output it. The actual program
to do that is trivial. The "x" operator would be useful in it.
You will have to decide if you want to read the entire file to memory
the first time through (I don't know what 40000 lines translates to in
bytes, or what that number of bytes means to your computer system), or
whether the file should be read twice.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Wed, 11 Feb 2004 23:28:09 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: formating pipe delimited file
Message-Id: <c0edq9$des$1@wisteria.csv.warwick.ac.uk>
J <webstuff@fluidic.com> wrote:
> I have a file with 40000 lines. Each line is a row of data, and the fields
> are seperated by pipes ( | ). I would like to align all pipes so that the
> fields will line up.
>
> example:
>
> field1 | 100 | 1 | | |
> field2islong| | example | | 3 |
>
> would become
>
> field1 | 100 | 1 | | |
> field2islong| | example | | 3 |
>
>
> anyone have any ideas.
(untested)
use Fcntl qw/:seek/;
{
open my $FILE, '<', $file or die "can't open $file: $!";
my @lengths;
while (<$FILE>) {
my @f = split /\|/;
for (0..$#f) {
$lengths[$_] < length $f[$_]
and $lengths[$_] = length $f[$_];
}
}
my $fmt = join '|', map "%-$_s", @lengths;
seek $FILE, 0, SEEK_SET;
{
open my $OUT, '>', "$file.new"
or die "can't create $file.new: $!";
local $\ = "\n";
# or maybe "|\n", if the last field is really null
while (<$FILE>) {
print $OUT sprintf $fmt => split /\|/;
}
}
}
rename "$file.new", $file or die "can't overwrite $file: $!";
--
Although few may originate a policy, we are all able to judge it.
- Pericles of Athens, c.430 B.C.
ben@morrow.me.uk
------------------------------
Date: Wed, 11 Feb 2004 23:10:04 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: PERL : Cant find string terminator ..
Message-Id: <402AB632.1070309@rochester.rr.com>
TP wrote:
...
> i get the message Cand find String Terminator "HTML_RESPONSE" anywhere
> before line .... everytime i try to compile the script
>
> can anyone tell me what is wrong with it ?
Yes. You spelled the string two different ways.
...
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: 12 Feb 2004 01:22:49 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude>
Subject: Re: Perl : Cant Find String Terminator
Message-Id: <Xns948CCF526992Fasu1cornelledu@132.236.56.8>
Darren Dunham <ddunham@redwood.taos.com> wrote in news:DjyWb.23897
$nv7.21446@newssvr25.news.prodigy.com:
> TP <pin@purdue.edu> wrote:
>> i get the message Cant Find String Terminator anywhere before EOF
>> everytime i try to compile my script..
>
> [snip]
>
>> print<<HTML_RESPOSE
>> HTML_RESPONSE
>
Don't forget the terminating semi-colon:
print <<HTML_RESPONSE;
<html>
<body>
<ul>
<li>I will learn to spell right</li>
<li>I will learn to spell right</li>
<li>I will learn to spell right</li>
<li>I will learn to spell right</li>
<li>I will learn to spell right</li>
<li>I will learn to spell right</li>
...
</ul>
</body>
</html>
HTML_RESPONSE
--
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)
------------------------------
Date: Wed, 11 Feb 2004 23:36:32 +0000
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: Perl usage these days?
Message-Id: <pkent77tea-59302F.23363211022004@pth-usenet-02.plus.net>
In article <awgWb.277936$na.440399@attbi_s04>, thumb_42@yahoo.com
wrote:
> pkent <pkent77tea@yahoo.com.tea> wrote:
> > It could be that the sites you happen to use are ones that seem to use
> > PHP or Java, and you don't visit sites that seem to use perl.
>
> True, I suppose people could be using the .php extension for anything, but I
> can't see why one would do that. (also, .html's are in many cases perl I
> know, because I've done that myself. :-)
And also (more what I was getting at) if you have a url like
http://example.com/foo/bar/baz ... well, you don't reall yknow whethe
rfoo, bar or baz are actual directories under $DOCROOT or RewriteRules
or Aliases or ScriptAliases or... :-)
<snip: we do lots in perl>
> Have you ever regretted using perl? Ever get any flack from others about
> using it, and are there maintenance issues that say, wouldn't be there with
> other languages?
Yes on all points, but with a good explanation:
1) There are some things that are best expressed in C, some are best
expressd in perl, or bash, and so on and on. A lot of things of course
can be done in most languages, one way or another. I regret that a very
small number of things that we use were done in perl rather than
something _more appropriate to the problem_ - but sometimes it's not my
choice :-)
That said, there is one enormous project written in C++ that I regret[1]
was not written in perl, so it works both ways
2) Plenty of people prefer python, C, java, whatever. At our place, cos
we use so much perl, there is less flak - but still there is some.
Sometime it's justified, e.g. an old version of perl that we use.
Sometime's it not, and results from people's misunderstandings.
That said, we also use oracle and mysql, and both of those get
criticized for all sorts of reasons, so it's not limited to perl.
3) I've had reasonably trivial but annoying issues maintaining a suite
of OO classes recently. In java I would know what my member variables
were called and they could be 'private' or 'protected'. Not the same
thing in perl, which meant I had do do a little bit more grepping and
testing.
Now, that was annoying, but like I say pretty minor in the grand scheme
of things. I'm sure that there would be maintenance headaches in _any_
language - just different ones :-)
> Have you considered going with PHP/JSP/etc.. on the web side, but having
> those languages talk to a perl daemon? (I didn't ask would you consider, I
> wonder if you had already or perhaps the manager types tried to push it.)
We use PHP for some things on a few of our internal development
machines, because some developers have PHP skills and it's an
appropriate solution to particular problems. On the live site there is
currently no PHP and won't be for a good long time. I don't know the
exact reasons.
I have a feeling that we do use some JSP somewhere, but that would be on
an application we bought in from somewhere else, and is running on its
own boxes.
> I've used perl on large projects before, I liked parts of it. seemed to work
> pretty good overall, except for the web interface stuff. (was an N-tier
> design)
We've got a good number of large projects and I think that careful
planning and design makes such things work, in any language. Perl can be
used for enormous projects but you need the appropriate planning,
architecture and design first - just as for any language.
P
[1] yeah, no worries, we'll just upgrade glibc on these critical servers
and recompile the world shall we?
--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply
------------------------------
Date: Wed, 11 Feb 2004 23:07:36 +0000
From: Beardy <beardy@beardy.net>
Subject: Re: perl/korn scirpt for appending first variable to end of line.
Message-Id: <fDyWb.3021$Y%6.419490@wards.force9.net>
Ben Morrow wrote:
> Beardy <beardy@beardy.net> wrote:
>
>>LISP - Lots of Irritating Single Parentheses
>
>
> Lots of Irrelevant Silly Parentheses
>
> Ben
>
Tread carefully on the contents of your .signature! Copyright rules
could prevail.
Check out the .signature of Barbie LeVile for ideas ;-)
BTW: You can't have mine:
"I'd rather have a full bottle in front of me, than a full frontal lobotomy"
Apparently it is also a plaigiarism, but I'm *sure* I was the original
author ;-)
------------------------------
Date: 12 Feb 2004 00:27:43 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: RFC: utils.pm
Message-Id: <c0eh9v$hsq$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Ben Morrow:
> Tore Aursand <tore@aursand.no> wrote:
>> Yeah. Does anyone have related documents for me (apart from perlxs and
>> perlxstut)?
>
> perlguts and perlapi. And the perl source.
You are so mean. :-)
Yet it's true. The perl source is often an indispensable source of
information since perlapi.pod is incomplete. The headers will do most of
the time.
Makes me think of how I learnt XS. I think perlxstut was my primary
weapon. It only scratches on the surface, though, but it could just be
enough to get one started. The whole XS business requires a bit of
patience and stamina. Sooner or later there might be the point of
enlightment (to a certain extent). For me that was when I understood
typemaps and how to store pointers to C structures in Perl types. That
turnt the affair from painful to quite enjoyable for me.
As for documentation, I found perlclib.pod and perlcall.pod quite
helpful. And of course perl-xs@perl.org where a small but fine selection
of XS gurus is willing to offer help.
> I found http://gisle.aas.no/perl/illguts/ helpful.
Yes, this one helped me in the past, too. Ever since I started
descriptions for the various stacks have been added. XSUBs do not use @_
for argument handling. Instead they access the argument stack directly
so it's really important to have a rough understanding of them.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
Date: Wed, 11 Feb 2004 23:06:13 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: trying to create a network script:
Message-Id: <402AB54C.5020503@rochester.rr.com>
Nex6 wrote:
...
> if i mage the $var a static like:
> my $file = '+<\\\\computername\\c$\\reset.reg'
>
> it works
>
>
> if I :
> open my $fh1, '+<', '\\\\$file\\C$\\reset.reg' or die "can't open $file:
> $^E";
>
> it does not with $file being a text file with the computer name
>
>
> a detailed error is:
>
>
> H:\scripts\admin-scripts\perl>cclinchgpassv2.pl
> can't open computername: The network path was not found at
> H:\scripts\admin-scripts\perl\cclinchgpassv2.pl line 28, <lc1> lin
> e 1.
>
> -Nex6
>
I recommend you carefully check $file for the presence of non-printing
characters, the most likely being a newline at the end. You can use the
length() function to verify the length, or the ord() function to print
out the character code for each character like [untested]:
for(split //,$file){print ord,"\n"}
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
------------------------------
Date: Wed, 11 Feb 2004 23:14:17 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: trying to create a network script:
Message-Id: <c0ed09$ckl$2@wisteria.csv.warwick.ac.uk>
Nex6 <Nex6@nospam.com> wrote:
> Nex6 wrote:
>
> > It does exist,
> >
> > if i mage the $var a static like:
> > my $file = '+<\\\\computername\\c$\\reset.reg'
Use forward slashes.
> >
> > it works
> >
> >
> > if I :
> > open my $fh1, '+<', '\\\\$file\\C$\\reset.reg'
This is single-quoted. Single quotes do not interpolate variables.
> > or die "can't open $file: $^E";
>
> problem sloved:
['Twas brillig... :)]
> is removed c$ and chged it to $a
>
> and made $a = 'c$';
>
> and it worked
You must have also changed your single to double quotes; in which case
you would need to change the 'c$' to "c\$", as double quotes
interpolate variables (in this instance, $\).
Ben
--
Heracles: Vulture! Here's a titbit for you / A few dried molecules of the gall
From the liver of a friend of yours. / Excuse the arrow but I have no spoon.
(Ted Hughes, [ Heracles shoots Vulture with arrow. Vulture bursts into ]
/Alcestis/) [ flame, and falls out of sight. ] ben@morrow.me.uk
------------------------------
Date: Wed, 11 Feb 2004 20:34:33 -0500
From: Kevin Michael Vail <kevin@vaildc.net>
Subject: Re: Using Tie::IxHash order a hash reference
Message-Id: <kevin-3A9D19.20343311022004@news101.his.com>
In article <c0dpq8$15fve4$2@ID-184292.news.uni-berlin.de>,
Gunnar Hjalmarsson <noreply@gunnar.cc> wrote:
> Jeff 'japhy' Pinyan wrote:
> > On 11 Feb 2004, Darius wrote:
> >> How can I order the entries in a hash if I use a reference to a
> >> hash instead of a hash. For e.g.
> >
> > Tie a hash, using the hash reference.
> >
> > use Tie::IxHash;
> >
> > my $ref = {};
> > tie %$ref, 'Tie::IxHash';
>
> Did you try that, Jeff?
>
> I did, and found that the original order is not preserved that way.
I've been using this idiom for a couple of years now (under
ActiveState's 5.6.1) and never had any problems with it.
--
Found Poetry (_Science News_, 14-Jun-2003): oldest _homo sapiens_ find
+-----------------------------------------+ ocean eddies' far-flung effects;
| Kevin Michael Vail <kevin@vaildc.net> | superior threads spun
+-----------------------------------------+ the pox from prairie dogs.
------------------------------
Date: 12 Feb 2004 00:42:34 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de>
Subject: Re: Why is Perl losing ground?
Message-Id: <c0ei5q$ib2$1@nets3.rz.RWTH-Aachen.DE>
Also sprach Martien Verbruggen:
> On Wed, 11 Feb 2004 09:15:23 GMT,
> Bart Lateur <bart.lateur@pandora.be> wrote:
>> Matija Papec wrote:
>>
>>>Are you aware that C isn't replaceable when it comes to platform
>>>portability?
>>
>> C isn't portable, that's just an illusion.
>>
>> <http://www.kuro5hin.org/story/2004/2/7/144019/8872>
>>
>> There's a header "Portability?!", but no anchor.
>
> That article is severely biased, and wrong in many places. Well
> written C is very portable.
Also, at several points the author expresses his dislike for the
preprocessor. Of course, if he ignores an important part of the language
I am not surprised that he complains about lack of portability. The
preprocessor is the most important means to circumvent
portability-issues. If he doesn't like it, he shouldn't complain.
Tassilo
--
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval
------------------------------
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 6120
***************************************