[11176] in Perl-Users-Digest
Perl-Users Digest, Issue: 4775 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 29 01:07:20 1999
Date: Thu, 28 Jan 99 22:00:23 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 28 Jan 1999 Volume: 8 Number: 4775
Today's topics:
Re: adding to LoL with a ref confusion. (Mike Stok)
Re: adding to LoL with a ref confusion. (Sam Holden)
Re: adding to LoL with a ref confusion. (Larry Rosler)
beginner question <nospam-seallama@mailcity.com>
Re: beginner question (Sam Holden)
Re: Blank Line in Format: how do I get one? <aqumsieh@matrox.com>
Can you launch a background process from web page? <Robbin.Brahms@trw.com>
Can you launch a background process from web page? <Robbin.Brahms@trw.com>
Can you launch a background process from web page? <Robbin.Brahms@trw.com>
Re: Deleting dupes with Perl <aqumsieh@matrox.com>
Re: Diamond Operator and $ARGV[0] <aqumsieh@matrox.com>
Re: Floating point math errors scraig@my-dejanews.com
Re: Floating point math errors (Larry Rosler)
Re: Floating point math errors <uri@home.sysarch.com>
Re: HELP - with redirect of STDERR and STDOUT <glmeow@home.com>
Re: how to return multiple values in perl? <aqumsieh@matrox.com>
Re: how to return multiple values in perl? <tchrist@mox.perl.com>
Re: Learning perl <eugene@snailgem.org>
Re: More cannot evaluate $query->param('thing') (Ronald J Kimball)
Re: Perl Criticism [summary] topmind@technologist.com
Re: Perl Criticism [summary] topmind@technologist.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 28 Jan 1999 21:24:48 -0600
From: mike@stok.co.uk (Mike Stok)
Subject: Re: adding to LoL with a ref confusion.
Message-Id: <eZuAubzS#GA.225@news1.texas.rr.com>
In article <36b11f37.11191152@news.lconn.com>,
Rob Hill <rhill@thisbox.com> wrote:
>I am writing a perl program using Lists of Lists using a reference.
>
>After I define the List, I am trying add another list to the list of
>lists (sounds technical enough!) but I am not getting the desired
>results.
>
>Here is the code:
>
>#!/usr/bin/perl
>
>$ref1 = [
> ["word0", "word1", ],
> ["word2", "word3", ],
> ];
>
>print "$ref1->[1][1]\n";
># This returns 'word3'.
>
>$ref1 += [["david", "graff", ],];
>
>print $ref1->[2][1];
># This returns nothing.
>
>Obviously I am doing this all wrong, but I cannot seem to locate the
>correct method in any of my documentation. Any help would be greatly
>appreciated.
You wouldn't use + to add elements to a normal array, and references
aren't much more difficult to handle:
push @$ref1, ["david", "graff"];
should do it - in the debugger:
DB<1> $ref1 = [["word0", "word1", ],["word2", "word3", ],];
DB<2> X ref1
$ref1 = ARRAY(0x81b07f4)
0 ARRAY(0x81a281c)
0 'word0'
1 'word1'
1 ARRAY(0x81b06c8)
0 'word2'
1 'word3'
DB<3> push @$ref1, ["david", "graff"];
DB<4> X ref1
$ref1 = ARRAY(0x81b07f4)
0 ARRAY(0x81a281c)
0 'word0'
1 'word1'
1 ARRAY(0x81b06c8)
0 'word2'
1 'word3'
2 ARRAY(0x8229fd4)
0 'david'
1 'graff'
Perl doesn't automatically dereference, so you have to use the @ to get
you to the array referenced by $ref1. Once you're there you can treat it
like as usual.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
| 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: 29 Jan 1999 03:39:04 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: adding to LoL with a ref confusion.
Message-Id: <slrn7b2bao.3fo.sholden@pgrad.cs.usyd.edu.au>
On Fri, 29 Jan 1999 02:43:52 GMT, Rob Hill <rhill@thisbox.com> wrote:
>I am writing a perl program using Lists of Lists using a reference.
>
>After I define the List, I am trying add another list to the list of
>lists (sounds technical enough!) but I am not getting the desired
>results.
>
>Here is the code:
>
>#!/usr/bin/perl
>
>$ref1 = [
> ["word0", "word1", ],
> ["word2", "word3", ],
> ];
>
>print "$ref1->[1][1]\n";
># This returns 'word3'.
>
>$ref1 += [["david", "graff", ],];
+= will convert everything to a number which is probably not what you want...
push() is one way to do it and how to is explained in the documentation.
You could try reading the documentation :
perldoc perllol
perldoc perlref
--
Sam
Of course, in Perl culture, almost nothing is prohibited. My feeling is
that the rest of the world already has plenty of perfectly good
prohibitions, so why invent more? --Larry Wall
------------------------------
Date: Thu, 28 Jan 1999 20:00:51 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: adding to LoL with a ref confusion.
Message-Id: <MPG.111ad24e37c5b57f9899e1@nntp.hpl.hp.com>
In article <36b11f37.11191152@news.lconn.com> on Fri, 29 Jan 1999
02:43:52 GMT, Rob Hill <rhill@thisbox.com> says...
> I am writing a perl program using Lists of Lists using a reference.
>
> After I define the List, I am trying add another list to the list of
> lists (sounds technical enough!) but I am not getting the desired
> results.
>
> Here is the code:
>
> #!/usr/bin/perl
>
> $ref1 = [
> ["word0", "word1", ],
> ["word2", "word3", ],
> ];
>
> print "$ref1->[1][1]\n";
> # This returns 'word3'.
>
> $ref1 += [["david", "graff", ],];
This says to add the value of the ref to a new anon-array to the value
of $ref1. Yipes!!! The sum of two refs has no semantics in any
language.
> print $ref1->[2][1];
> # This returns nothing.
No wonder.
You say that you want to add another anon-array element to the array
referred to by $ref1. Easy enough:
push @$ref1, ["david", "graff", ];
Incidentally, it is better style to use single-quotes when no
interpolation is required in a string; double-quotes otherwise.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 28 Jan 1999 20:24:43 -0800
From: dan <nospam-seallama@mailcity.com>
Subject: beginner question
Message-Id: <36B1380A.22211986@mailcity.com>
lets say a user inputs number in a form. how do i get the cgi script to
make the length of the image the number the user put in? thanks
dan
------------------------------
Date: 29 Jan 1999 04:46:46 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: beginner question
Message-Id: <slrn7b2f9m.4ki.sholden@pgrad.cs.usyd.edu.au>
On Thu, 28 Jan 1999 20:24:43 -0800, dan <nospam-seallama@mailcity.com> wrote:
>lets say a user inputs number in a form. how do i get the cgi script to
>make the length of the image the number the user put in? thanks
The same way you would in any other language.
A perl question would help?
Some code that doesn't quote work would help?
Actually learning some perl would be good too...
--
Sam
Simple rule: include files should never include include files.
--Rob Pike
------------------------------
Date: Fri, 29 Jan 1999 04:13:54 GMT
From: @l@ <aqumsieh@matrox.com>
Subject: Re: Blank Line in Format: how do I get one?
Message-Id: <78rchr$jig$1@nnrp1.dejanews.com>
In article <36ADF844.C3414ADC@drew.edu>,
Jessica Sockel <jsockel@drew.edu> wrote:
> I just want a blank line at the end of my format. The closest thing I
> can find is the $\ variable, which is the output_record_separator, but
> it's for the print function. This is what my format code looks like:
>
> format UN_UIC_EX_FL =
> @<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~
> $uname, $uic
> Flags: ~@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Exp:
> @<<<<<<<<<<<<<<<<<<<<<<<<
> $flag, $expire
> .
Well, the FAQs say that formats are terminated by a lone period on a line, so
why not have a blank line just before that period? Formats preserve white
space.
--Ala
$monger->{montreal}->[0]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 28 Jan 1999 23:04:06 -0500
From: Robbin <Robbin.Brahms@trw.com>
Subject: Can you launch a background process from web page?
Message-Id: <36B13336.6C44997D@trw.com>
This is a multi-part message in MIME format.
--------------C5C6748D6F4EBA5719DB3FED
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I'm somewhat new to Perl and was wonder if someone has a sample script and
willing to share that will start a client application from a web page, so
that the client
app will run in the background and bring up it's own gui.
like if wanted to start emacs off a web page, or the clock or calendar on
Solaris desktop.
--------------C5C6748D6F4EBA5719DB3FED
Content-Type: text/x-vcard; charset=us-ascii;
name="Robbin.Brahms.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Robbin
Content-Disposition: attachment;
filename="Robbin.Brahms.vcf"
begin:vcard
n:Brahms;Robbin
x-mozilla-html:TRUE
org:TRW;SI&TG
adr:;;12900 Federal Systems Park Drive;Fairfax;Virginia;22033;US
version:2.1
email;internet:robbin.brahms@trw.com
fn:Robbin Brahms
end:vcard
--------------C5C6748D6F4EBA5719DB3FED--
------------------------------
Date: Thu, 28 Jan 1999 23:08:15 -0500
From: Robbin <Robbin.Brahms@trw.com>
Subject: Can you launch a background process from web page?
Message-Id: <36B1342F.4843C558@trw.com>
This is a multi-part message in MIME format.
--------------EEEFBD2FF53C5E5D258E67F9
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I'm somewhat new to Perl and was wonder if I could get a sample script
to start a
client application from a web page, so that the client app will run in
the background and bring up it's own gui.
Like the clock or calendar on Solaris desktop.
Please excuse the double post, I accidentally replied, versus new
message
--------------EEEFBD2FF53C5E5D258E67F9
Content-Type: text/x-vcard; charset=us-ascii;
name="Robbin.Brahms.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Robbin
Content-Disposition: attachment;
filename="Robbin.Brahms.vcf"
begin:vcard
n:Brahms;Robbin
x-mozilla-html:TRUE
org:TRW;SI&TG
adr:;;12900 Federal Systems Park Drive;Fairfax;Virginia;22033;US
version:2.1
email;internet:robbin.brahms@trw.com
fn:Robbin Brahms
end:vcard
--------------EEEFBD2FF53C5E5D258E67F9--
------------------------------
Date: Fri, 29 Jan 1999 00:18:50 -0500
From: Robbin <Robbin.Brahms@trw.com>
Subject: Can you launch a background process from web page?
Message-Id: <36B144BA.E4FE0608@trw.com>
This is a multi-part message in MIME format.
--------------3E176E7117337C4B5D567A57
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I'm somewhat new to Perl and was wonder if I could get a sample script
to start a client application from a web page, so that the client app
will run in
the background and bring up it's own gui.
Like the launching emacs, the clock or calendar on Solaris desktop from
a web page link.
--------------3E176E7117337C4B5D567A57
Content-Type: text/x-vcard; charset=us-ascii;
name="Robbin.Brahms.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Robbin
Content-Disposition: attachment;
filename="Robbin.Brahms.vcf"
begin:vcard
n:Brahms;Robbin
x-mozilla-html:TRUE
org:TRW;SI&TG
adr:;;12900 Federal Systems Park Drive;Fairfax;Virginia;22033;US
version:2.1
email;internet:robbin.brahms@trw.com
fn:Robbin Brahms
end:vcard
--------------3E176E7117337C4B5D567A57--
------------------------------
Date: Fri, 29 Jan 1999 03:11:42 GMT
From: @l@ <aqumsieh@matrox.com>
Subject: Re: Deleting dupes with Perl
Message-Id: <78r8t9$gc4$1@nnrp1.dejanews.com>
In article <78km8q$ss6$1@nnrp1.dejanews.com>,
jxdub@my-dejanews.com wrote:
> I've written enough
> to send a report out with all the users names, but now I need to delete the
> duplicates... Could anyone tell me a good way to do this? The file would
> look like this:
>
> jonesfw
> smithjd
> jonesfw
> doejf
> smithjd
>
> And I need to send a report with only:
>
> jonesfw
> smithjd
> doejf
Well, my first suggestion would be to read the file, line by line, and store
each name in a hash. Of course, the names would be the keys of the hash.
while (<>) {
chomp;
$hash{$_} = 1;
}
Then you can retrieve the unique names simply by:
@names = keys %hash;
My second suggestion would be to read the FAQs (actually that should've been
my first one .. )
>From perlfaq4:
How can I extract just the unique elements of an array?
Several nice methods are outlined there.
Hope this helps,
Ala
$monger->{montreal}->[0]
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 29 Jan 1999 04:21:51 GMT
From: @l@ <aqumsieh@matrox.com>
Subject: Re: Diamond Operator and $ARGV[0]
Message-Id: <78rd0n$jql$1@nnrp1.dejanews.com>
In article <Ymnr2.3388$QU6.48349458@c01read10.service.talkway.com>,
"DaveH" <DaveH@nnoossppaamm.acinom.com> wrote:
> Hi all,
>
> I'm having trouble explaining to myself why the value of $ARGV[0] seems
> to get clobbered upon entering a "while(<>)" loop. The code snippet
> below simply counts the number of lines in the file specified in
> $ARGV[0].
Perhaps reading the FAQs would help? Let's see .. from perldoc perlop ..
searching for '<>' I get the following:
Input from <> comes either
from standard input, or from each file listed on the command
line. Here's how it works: the first time <> is evaluated,
the @ARGV array is checked, and if it is null, $ARGV[0] is
set to "-", which when opened gives you standard input. The
@ARGV array is then processed as a list of filenames. The
loop
while (<>) {
... # code for each line
}
is equivalent to the following Perl-like pseudo code:
unshift(@ARGV, '-') unless @ARGV;
while ($ARGV = shift) {
open(ARGV, $ARGV);
while (<ARGV>) {
... # code for each line
}
}
except that it isn't so cumbersome to say, and will actually
work. It really does shift array @ARGV and put the current
filename into variable $ARGV.
Ok .. I reiterate what already is in the FAQs: <> really does shift array
@ARGV.
Please checkout the documentation at least once.
--Ala
$monger->{montreal}->[0];
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 29 Jan 1999 02:48:20 GMT
From: scraig@my-dejanews.com
Subject: Re: Floating point math errors
Message-Id: <78r7hi$f99$1@nnrp1.dejanews.com>
In article <78qfs9$qf7$1@nnrp1.dejanews.com>,
eharrington@paymentech.com wrote:
> I get a section of output that looks like this:
>
> amt=2.23 totl=198.25
> amt=2.24 totl=200.49
> amt=2.25 totl=202.74
> amt=2.26 totl=205
> amt=2.27 totl=207.27
> amt=2.27999999999999 totl=209.55
> amt=2.28999999999999 totl=211.84
> amt=2.29999999999999 totl=214.14
>
> Can anything be done in Perl to prevent losing molecules from these pennies?
>
Yes. Work in pennies. ( i.e., in integers )
There is no other way.
This applies to any language using floating point arithmetic, not just Perl.
${amt} = 101;
while ( ${totl} < 99999900 )
{
${amt} += 1;
${totl} += ${amt};
print "amt=", ${amt}/100, " totl=", ${totl}/100, "\n";
}
Also useful is printf()
printf "amt=%.2f totl= %.2f\n", ${amt}/100, ${totl}/100;
One might get the impression from reading the FAQ no.4 that the following
might be just as good. It isn't.
> ${amt} = 1.01;
>
> while ( ${totl} < 999999 )
> {
> ${amt} += 0.01;
> ${totl} += ${amt};
printf "amt=%.2f totl= %.2f\n", ${amt}, ${totl};
> }
It may (or may not) work in this case. I haven't checked. But there is always
a danger of round off error creeping in when using floats. Integers are
stored differently so it can't happen.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 28 Jan 1999 19:50:02 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Floating point math errors
Message-Id: <MPG.111acfc8d5ed66349899e0@nntp.hpl.hp.com>
In article <LC8s2.64$LH2.5406@nsw.nnrp.telstra.net> on Fri, 29 Jan 1999
02:00:11 GMT, Martien Verbruggen <mgjv@comdyn.com.au> says...
> In article <39zp73t2xr.fsf@ibnets.com>,
> Uri Guttman <uri@ibnets.com> writes:
> >>>>>> "LR" == Larry Rosler <lr@hpl.hp.com> writes:
> > LR> better) do all your arithmetic in integers (pennies, as you say),
> > LR> then divide by 100 to display totals in dollars.
> > i always do money calculations as integral pennies and convert on
> > i/o. it is clean, accurate and works anyone who does floating point math
> > on his money is a fool and will soon be parted from it.
>
> That approach is fine if you don't need a higher resolution than
> pennies or cents. If you do, then you simply cannot use this approach.
Why not? If I need resolution in mils, I can divide by 1000 and use
printf '%.2f' to display rounded cents. The only limitation is that the
maximum number of whatever unit is chosen is 2**32 - 1, or 2**31 - 1 if
differences have to be calculated simply.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 29 Jan 1999 00:09:30 -0500
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: Floating point math errors
Message-Id: <x7hftasm0l.fsf@home.sysarch.com>
>>>>> "MV" == Martien Verbruggen <mgjv@comdyn.com.au> writes:
MV> In article <39zp73t2xr.fsf@ibnets.com>,
MV> Uri Guttman <uri@ibnets.com> writes:
>> i always do money calculations as integral pennies and convert on
>> i/o. it is clean, accurate and works anyone who does floating point math
>> on his money is a fool and will soon be parted from it.
MV> That approach is fine if you don't need a higher resolution than
MV> pennies or cents. If you do, then you simply cannot use this approach.
but i said money. i meant money. it is a common enough problem to
calculate costs at they should always be done as integers of cents (or
whatever the local lowest coin is). obviously other resolutions would
need floats. money, even to lower parts like .1 cents or other finacial
fractions like $ 1/8 use in stocks, only needs 3 decimal places.
you just do all calculations with the integral values of the lowest
decimal place you need. or use perl on a computer with decimal math like
a vax or IBM 370 (or 390 these days) :-).
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Fri, 29 Jan 1999 05:16:16 GMT
From: ZandiNi <glmeow@home.com>
Subject: Re: HELP - with redirect of STDERR and STDOUT
Message-Id: <36B144F1.98ED7F28@home.com>
You could do is:
use IPC::Open3;
....
$result = open3 ( \*WRITE, \*STDOUT, \*STDERR , "progname", @options );
...
it will execute the "progname" and give three file handles. Write, read,
read_err.
If you don't need STDERR, you could use "open2" function instead.
But be aware, you might have to do some trick using "select" to avoid
IO Blocking.
Ji Lee
Richard Nilsson wrote:
> Hi,
>
> I'm quite new to Perl, but in the current project I'm in, Perl is the
> language to be used.
> We're using Perl 5.xxx, so it's object oriented.
>
> However, the code example I'm looking for is just common perl.
>
> What I need to do is to execute a command, and redirect STDOUT to my own
> filehandle,
> and redirect SDTERR to another filehandle. As usual, I use
> open(<my_handle>, "<command>|")
> to redirect STDOUT to my filehandle. But what about STDERR for the
> command I just exe-
> cuted?
>
> The definition of the function (method) should be:
>
> (out, err, ret) = execute_mycmd($params),
>
> Where:
>
> out is the output printed on STDOUT
> err is the output from STDERR
> ret is a return code from the function
>
> I would be very greatful for an example. I'm almost there, but I only
> seems to turn off STDERR,
> rather than redirect it.
>
> Thanks in Advance,
> /Richard Nilsson
------------------------------
Date: Fri, 29 Jan 1999 03:39:15 GMT
From: @l@ <aqumsieh@matrox.com>
Subject: Re: how to return multiple values in perl?
Message-Id: <78rah2$hni$1@nnrp1.dejanews.com>
In article <78l7v7$cge$1@nnrp1.dejanews.com>,
tariq.ahmed@usa.net wrote:
[snip some irrelevant code]
> ($a,%items_hash,@eachline)=doit();
[snip some more irrelevant code]
> sub doit
> {
> local %myhash;
> $myhash{"a"}="b";
> $myhash{"b"}="c";
> @array=("one","two","three");
> return(1,%myhash,@array);
>
> }
That is not the way to return hashes and arrays from subroutines (in most
cases anyway). You should return references to those structures (go ahead and
read perlref if you are not familiar with references). Then you can
dereference, and access the data as normal. For example, your subroutine
becomes:
sub doit
{
local %myhash;
$myhash{"a"}="b";
$myhash{"b"}="c";
@array=("one","two","three");
return(1,\%myhash,\@array);
}
And you call it as such:
($a,$r_items_hash,$r_eachline)=doit();
my %items_hash = %$r_items_hash;
my @eachline = @$r_eachline;
The docs are your friend.
Ala
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 28 Jan 1999 20:59:33 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: how to return multiple values in perl?
Message-Id: <36b13225@csnews>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, @l@ <aqumsieh@matrox.com> writes:
:> local %myhash;
Why are you messing with (probably creating) a global variable there?
--tom
--
Q. Why is this so clumsy?
A. The trick is to use Perl's strengths rather than its weaknesses.
--Larry Wall in <8225@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: Thu, 28 Jan 1999 23:27:15 -0500
From: Eugene Sotirescu <eugene@snailgem.org>
Subject: Re: Learning perl
Message-Id: <36B138A3.6353CB5C@snailgem.org>
Eric Gorely wrote:
>
> I am in the process of trying to learn perl by using an on-line tutorial.
> There is an exercise that I'm trying to figure out, but since I don't yet
> know perl, I am having trouble figuring out how to do what it asks. Here's
> the problem:
Just curious, where is this tutorial?
--
Eugene
"Light is the all-exacting good,
That dry, forever virile stream
That wipes each thing to what it is,
The whole, collage and stone, cleansed
To its proper pastoral."
Alvin Feinman
------------------------------
Date: Thu, 28 Jan 1999 23:28:11 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: More cannot evaluate $query->param('thing')
Message-Id: <1dmd3n6.yrr2ae1yz4evsN@bay2-88.quincy.ziplink.net>
Charles R. Thompson <design@raincloud-studios.com> wrote:
> I'm finding it somewhat of a pain that I cannot embed
> $query->param('client_id') inside of quotes or qq~ ~; in print
> statements. Things like...
>
> print qq~<input type="hidden" name="client_id"
> value="$query->param('client_id')">~;
>
> create this...
>
> <input type="hidden" name="client_id"
> value="CGI=HASH(0x80b5670)->param('client_id')">
>
> I've tried moving it into a scalar first then using the scalar
> in the print statement, but it does the same darn thing. Scalars
> have always worked with double quotes in the past.. why does it
> handle $query a bit differently? Doing this is an easy fix for
> single lines...
It has nothing to do with Perl handling $query differently. The simple
fact is that -> is not significant when Perl interpolates a
double-quotish string; it's just two literal characters.
Try either of the following:
"${\$query->param('client_id')}"
"@{[$query->param('client_id')}"
You can interpolate arbitrary Perl expressions into double-quotish
strings this way, which is also documented in perlref and perlfaq4.
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Fri, 29 Jan 1999 05:32:47 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism [summary]
Message-Id: <78rh5v$n61$1@nnrp1.dejanews.com>
In article <78o9qe$v62$1@nnrp1.dejanews.com>,
ptimmins@netserv.unmc.edu wrote:
> In article <78nvuj$ma4$1@nnrp1.dejanews.com>,
> topmind@technologist.com wrote:
>
> > Well, at least the insults aren't ALL directed my way.
> > That was refreshing to see. You at least hinted at the
> > anti-establishment cowboy-like center-of-the-prairie
> > attitude of some of those here.
>
> So now this pointy-haired pretty-boy is slamming ranching and the
> "prarie" in addition to Perl?
>
> ... when does topmind-a-huntin season start? <- (a joke ... don't freak :)
>
> from the plains of Nebraska, where cattle and corn are king
> ... and we use Perl whenever and wherever we damn-well please
> ... and tough cobs if your manager doesn't like it
>
> Patrick Timmins
> $monger{Omaha}[0]
Thank heavens for Wallmarts!
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 29 Jan 1999 05:42:46 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism [summary]
Message-Id: <78rhol$njv$1@nnrp1.dejanews.com>
In article <39iudsv0ho.fsf@ibnets.com>,
Uri Guttman <uri@ibnets.com> wrote:
> >>>>> "t" == topmind <topmind@technologist.com> writes:
>
> t> P.S. I don't drool (unless Lara walks by)
>
> she must be on your screen's background since you seem to drool all over
> your keyboard judging by your spelling and grammar (or rather lack
> thereof). regardless of how bad a programmer you are (and you seem
> awfully bad from your illogical diatribes), you wouldn't get hired in
> most places with such a bad grasp of english (and such a strong grasp on
> a cdrom character)
>
So spelling and grammar are related to one's programming experiece.
(P.S. When I am done fixing programming languages, I am going
to replace english with a TRUE FONETIC system, so we are not
stuck with illogical rules given to us by bad history.
You probably cannot even recognize Englishes' illogical
rules because you seem to lack the ability to stand back from
what you are used to.)
Ran out of insults, eh? Resorting to attacking grammar instead
of merit and concepts that are related to the topic.
BTW, I never played a Lara game, I just like box.
> interesting how bottommind read these threads and keeps flaming but has
Exactly who is doing the flaming you flaming hypocrite!
Is this message of yours an example of unemotional
professional meritous thinking?
HYPOCRITES
> nothing to say in any other thread. maybe he could actually post some
> code or comments in a reply to a real perl question. then we can see the
> true genius of his unobsfucated code.
To test my Perl knowledge, or to see why Perl is flawed?
>
> uri
>
> --
> Uri Guttman Hacking Perl for Ironbridge Networks
> uri@sysarch.com uri@ironbridgenetworks.com
>
-tmind-
http://www.geocities.com/SiliconValley/Lab/6888/langopts.htm
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.misc (and this Digest), send your
article to perl-users@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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 4775
**************************************