[10328] in Perl-Users-Digest
Perl-Users Digest, Issue: 3920 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 7 17:07:26 1998
Date: Wed, 7 Oct 98 14:00:31 -0700
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, 7 Oct 1998 Volume: 8 Number: 3920
Today's topics:
Re: "Many Jars" Mystery (Joe McMahon)
Re: "Many Jars" Mystery <jdporter@min.net>
Re: *quick q:* how to escape a query string? (Matthew Bafford)
Re: Are there any "perl.newbie" group or forum? <jdporter@min.net>
Re: Are there any "perl.newbie" group or forum? (Patrick Timmins)
Re: Back button in Perl? <featheredfrog@geocites.com>
Re: Back button in Perl? (Abigail)
Re: Back button in Perl? (Marc Bissonnette)
Re: cat reese > /dev/null (was Re: Perl & Java - differ (Walter Tice USG)
cgi-lib.pl vs CGI.pm? (Marc Bissonnette)
comp.lang.perl.win32 <jbharvey@auspex.net>
Re: Data Search Question (Larry Rosler)
Re: Data Search Question <jdporter@min.net>
Re: Expecting <ayoung@sigg.com>
Re: Extracting muliple values from a hash (Larry Rosler)
Re: Extracting muliple values from a hash <rootbeer@teleport.com>
Getting PERL to work with personal web server bluecanary@my-dejanews.com
Getting PERL to work with personal web server bluecanary@my-dejanews.com
Re: Help with Here Document <aqumsieh@tigre.matrox.com>
Re: How do I combine scripts (Steve Linberg)
Re: How do I format a system date? (Brand Hilton)
Re: Metasearch engine and Compare <rootbeer@teleport.com>
Re: missing value after unpack from socket <rootbeer@teleport.com>
multi-line comments <a14203@cig.mot.com>
Re: multi-line comments <jbharvey@auspex.net>
Re: multi-line comments <rootbeer@teleport.com>
open's return value (was: Re: eq on if statement causin <rootbeer@teleport.com>
Re: Opening Perl documentation <jdporter@min.net>
Re: Perl 5.005_02 Compiling ERRORS (Ilya Zakharevich)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 07 Oct 1998 16:25:39 -0400
From: joe.mcmahon@gsfc.nasa.gov (Joe McMahon)
Subject: Re: "Many Jars" Mystery
Message-Id: <joe.mcmahon-0710981625390001@prtims.stx.com>
In article <361B79A3.7A5602DF@boeing.com>, John Hagen
<john.b.hagen@boeing.com> wrote:
>George C. Hetrick wrote:
>>
>> >In article <6vdm5d$a9l$1@nnrp1.dejanews.com>, ptimmins@netserv.unmc.edu
>> >(Patrick Timmins) wrote:
>> >
>> >+ Could this explain the "Many Jars" mystery?
>> >
>>
>> John Many Jars was one of the lectroids in _Buckaroo_Banzai_, yes?
>>
>> (Along with John Yaya and John Smallberries...)
>
>Yes! And John Bigbooty...
>
>Cheers,
"BigbooTAY!!"
--- Joe M.
------------------------------
Date: Wed, 07 Oct 1998 16:41:26 -0400
From: John Porter <jdporter@min.net>
Subject: Re: "Many Jars" Mystery
Message-Id: <361BD1F6.540C9AB6@min.net>
John Hagen wrote:
>
> Yes! And John Bigbooty...
Big Boo-TAY! TAY! TAY!
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Wed, 7 Oct 1998 15:46:03 -0400
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: *quick q:* how to escape a query string?
Message-Id: <MPG.10855709f5410b6e9896c9@news.south-carolina.net>
In article <361B8297.EF3C6CE4@ncsa.uiuc.edu> on Wed, 07 Oct 1998
10:02:47 -0500, Marty Blase (mblase@ncsa.uiuc.edu) pounded in the
following text:
=> I'm afraid my Perl5 literacy is still rather lacking... is this the right
=> syntax?
=>
=> use URI::Escape;
=> $refer = Escape($refer);
=>
=> - Marty
>From perldoc URI::Escape:
NAME
URI::Escape - Escape and unescape unsafe characters
SYNOPSIS
use URI::Escape;
$safe = uri_escape("10% is enough\n");
$verysafe = uri_escape("foo", "\0-\377");
$str = uri_unescape($safe);
Hope This Helps!
--Matthew
------------------------------
Date: Wed, 07 Oct 1998 16:14:44 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <361BCBB4.CD8E1060@min.net>
madame philosophe wrote:
>
> People seek the newsgroups because they need help, not because they
> are stupid.
The issue is about maximizing the value of this (or any) newsgroup,
both to the querant, and to others. Being lazy is not an excuse --
cute aphorisms not withstanding.
> If the people at this group are tired of hearing the same questions.
> why doesn't someone start a newbie perl newsgroup?
This question has already been discussed, and answered.
Many times.
But you wouldn't know that, would you?
> As the web grows there will be more newbies. GET USED TO IT.
No, it's not that simple.
"People are going to come and deposit bodily excretions in your
sandbox. Get used to it." No, I'm sorry. There are trends which
must be resisted, however futile it turns out to be.
> It doesn't take a lot of brains to take pot shots to well meaning people.
You would know...
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Wed, 07 Oct 1998 20:00:33 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <6vgh92$jp9$1@nnrp1.dejanews.com>
In article <361BA1C7.13BB0701@mkt2mkt.com>,
madame philosophe <mp@mkt2mkt.com> wrote:
> What I don't understand is this:
>
> If someone is posting a "dumb" question (If there is such a thing),
> why not just ignore it? Treat it like spam?
(Almost) no question will be totally ignored. If one of the true
experts does not respond, the Siren call of the naked question in
tens of thousands of news readers around the world will be too
seductive for one or more "up and coming" Perl types to resist.
They'll indulge their urge to help out ... they'll want to share
what they've recently learned with someone else. They'll post
wantonly, until they've sated their need to "fix" your problem.
Unfortunately, since they themselves are still learning much,
they will often leave you with a "little surprise" when they've
finished, in the form of a bug or two. The true experts will then
have to wade in to clean up, since DejaNews and other archives
are storing all of this forever. Otherwise the bugs and perverted
thinking could spread and contaminate countless other newbies
out there trying to learn Perl.
The safest way to go is to abstain. Read the newsgroup for a month
or more while you're learning Perl before you ever even think of
posting a question. Instead of turning to others, just satisfy
yourself with the Perl docs that are right there on your hard drive!
No false promises. No perverted code. No bugs to watch out for.
This is what the experts and the rest of us are trying to tell
newbies. Don't be a statistic in this epidemic of foolishness. Learn
from others that *have* been where you are, and save yourself
alot of pain and suffering on your way up the Perl ladder:
read the FAQ's and docs that came with your Perl. The best answers
to most of your questions have been with you all along! There's
no place like home. There's no place like home. There's no place
like home.
Patrick Timmins
$monger{Omaha}[0]
Omaha, NE - "The Emerald City"
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 07 Oct 1998 14:57:30 -0400
From: "Michael D. Hofer" <featheredfrog@geocites.com>
To: Brian Enderle <benderle@mindspring.com>
Subject: Re: Back button in Perl?
Message-Id: <361BB99A.7075@geocites.com>
I'm sure you'll be flamed for a "non-perl" type of question. Open a
javascript book and examine the onClick option to input type=button. Put
your javascript there, and it'll work.
mh
Brian Enderle wrote:
>
> I wish to include a 'Back' button in my webpage. The webpage is created
> 'on-the-fly' by a cgi script (perl). I would like to be able to have
> the user press the 'Back' button and be taken back one page, just as if
> he had pressed the browser's 'Back' button. I have tried using the
> javascript snippet:
>
> <A HREF="javascript:history.go(-1)"><INPUT TYPE=button
> VALUE="Back"></A>
>
> but it doesn't work. Is there a way to call a javascript routine from
> within a cgi script?
>
> Thank you in advance for any help and please dierect responses to my
> e-mail.
>
> thank you,
> Brian Enderle
> www.pcgamex.com
--
Cian ua'Lochan /mka/ Michael D. Hofer
I'm not a medievalist - I just play one on weekends!
http://www.geocities.com/SoHo/Lofts/9800/
------------------------------
Date: 7 Oct 1998 20:05:45 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Back button in Perl?
Message-Id: <6vghip$6t2$2@client3.news.psi.net>
Brian Enderle (benderle@mindspring.com) wrote on MDCCCLXIII September
MCMXCIII in <URL:news:361BAF2B.86F58428@mindspring.com>:
++ I wish to include a 'Back' button in my webpage.
No you don't really want to. There's no need to, as noone has seen a
browser that doesn't have one.
Furthermore, you can't.
http://cthulhu.mandrake.net/%7Eabigail/HTML/Misc/back_button.html
Abigail
--
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
------------------------------
Date: 7 Oct 1998 20:35:43 GMT
From: dragnet@internalysis.com (Marc Bissonnette)
Subject: Re: Back button in Perl?
Message-Id: <6vgjav$6ft$1@news.interlog.com>
In article <6vghip$6t2$2@client3.news.psi.net>, abigail@fnx.com says...
>No you don't really want to. There's no need to, as noone has seen a
>browser that doesn't have one.
>
>Furthermore, you can't.
Careful with this type of answer :) I just did a mailer for a client who wanted
a similar thing: a preview of the contents of the mail that was about to be
sent, as well as a "back" type of function in case they wanted to edit. When I
told him he could save a couple of hundred bucks by just putting in a "Click
your back button to edit" he told me he had just seen a study that shows
something disgusting like 60% of most casual web surfers haven't the foggiest
idea that there is a back button, much less what it does.
Keep in mind that many people with updated versions of netscape and MSIE also
keep the toolbars up top for maximized viewing space.
In case the original poster was wondering, I achieved the Perl-based "back"
button by including <INPUT TYPE="HIDDEN" NAME="\foo\" VALUE="\bar\"> and having
Perl generate the page, inserting the values in the backslashed slots (Using
the content from the original form). When the "back" button was clicked, Perl
generated the form with the text-fields pre-filled in from the <INPUT
TYPE="HIDDEN"> fields.
To give a more specific answer to the original poster, the only way I could
think of a Perl-based "Back" button would be to have Perl spit out *all* the
pages of the site, with each link being a submit-type of button with a value
denoting the file name of the page they were leaving. The value of the "back'
button could simply be s/\BACK\/$FORM{'Back'}/
If it's of any use at all, I could make the script I wrote available (My usual
caveat here: I'm not a Perl guru, so my code could probably be improved upon
*alot*... But it works :) :)
--
Marc Bissonnette
InternAlysis
Corporate Internet Research and Results!
http://www.internalysis.com
------------------------------
Date: 7 Oct 1998 20:32:00 GMT
From: tice@hunch.zk3.dec.com (Walter Tice USG)
Subject: Re: cat reese > /dev/null (was Re: Perl & Java - differences and uses)
Message-Id: <6vgj40$6sq@zk2nws.zko.dec.com>
In article <360C4E84.4621A333@bbnplanet.com> Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:
>Adam Turoff wrote:
>> With all due respect, John, I think George is playing the
>> 'if 6 turned out to be 9' game.
>Well, darling, men do seem to have an knack for exaggeration ;)
>*mwaahahaa*
Exaggeration? Or Hendrix tune?
'If six turned out to be nine, I don't care!'
- If six was nine; Axis Bold as Love
>/me flees
>e.
>"All of us, all of us, all of us trying to save our immortal souls, some
>ways seemingly more round-about and mysterious than others. We're having
>a good time here. But hope all will be revealed soon." R. Carver
--
"One World. One Web. One Program."
-Microsoft promotional advertisement
"Ein Volk, ein Reich, ein Fuhrer!"
-Adolf Hitler
------------------------------
Date: 7 Oct 1998 20:43:26 GMT
From: dragnet@internalysis.com (Marc Bissonnette)
Subject: cgi-lib.pl vs CGI.pm?
Message-Id: <6vgjpe$6ft$2@news.interlog.com>
Hey folks,
I've been seeing an overwhelming amount of referance to CGI.pm in CLPM lately,
and have been wondering if there would be a major shift in value added in me
switching to it (aside from the obvious benefit of understanding more of the
articles in CLPM :).
Currently, I've been using cgi-lib.pl by Steven E. Brenner, which handles a lot
of the mundane tasks of CGI quite nicely. Are there any overwhelming reasons to
switch to CGI.pm? I went as far as to print out the docs on CGI.pm (or the
source, I can't remember which), but for whatever reason put it on the back
burner and kept on trundling along with cgi-lib.pl.
Comments appreciated!
--
Marc Bissonnette
InternAlysis
Corporate Internet Research and Results!
http://www.internalysis.com
------------------------------
Date: Wed, 07 Oct 1998 20:52:30 GMT
From: Justin Harvey <jbharvey@auspex.net>
Subject: comp.lang.perl.win32
Message-Id: <361BD47B.C469B7EF@auspex.net>
I wish there was the above newsgroup, it's annoying reading the group
and wading through win32 perl stuff. Maybe we should do
comp.lang.perl.win32 as well as comp.lang.perl.unix
--
Justin B. Harvey http://www.auspex.net/jbharvey
jbharvey@auspex.net Mountain View, CA
use Perl || die "trying";
------------------------------
Date: Wed, 7 Oct 1998 12:44:20 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Data Search Question
Message-Id: <MPG.1085646c88e99fd69897f4@nntp.hpl.hp.com>
In article <lalnmsss1h.fsf@erh.ericsson.se> on 07 Oct 1998 10:19:22
+0200, Michal Rutka <erhmiru@erh.ericsson.se> says...
> just a caution to John's solution. Larry wants to search 1000000 strings 10
> characters long. That is about 10MB. John makes a local copy of this stuff
> in his subroutine. That is another 10MB...
No, it is 20MB more! In my code, the 1000000 strings are processed one-
at-a-time, instead of all being in an array in memory. Furthermore, my
code examines each string just once, whereas the entire array is searched
10 times in John's code.
My loop (strings in a data file):
while (<DATA>) {
my $xor = $_ ^ $datum;
next unless (my $n = $xor =~ tr/\0//) > $max;
$best = $_;
last if ($max = $n) == length $datum;
}
John's loop (strings in array @w):
for my $i ( 0 .. $len-1 ) {
my $pat = '.' x $len;
substr($pat,$i,1) = substr($t,$i,1);
for ( grep { /$pat/ } @w ) {
$h{$_}++;
}
}
As for the other solutions proposed so far:
'agrep' (proposed by Anton Berezin) is not in the standard Unix command
set, but is readily available and might be the best solution. I haven't
tried it.
Benjamin Franz (Snowhare) posted an interesting geometrical approach
which might be competitive with linear search (but no code,
unfortunately).
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 07 Oct 1998 15:54:36 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Data Search Question
Message-Id: <361BC6FC.BD1F1C5@min.net>
Michal Rutka wrote:
>
> just a caution to John's solution. Larry wants to search 1000000 strings 10
> characters long. That is about 10MB. John makes a local copy of this stuff
> in his subroutine. That is another 10MB...
Yes, isn't that rather obvious?
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: Wed, 07 Oct 1998 14:53:49 -0500
From: Aaron Young <ayoung@sigg.com>
Subject: Re: Expecting
Message-Id: <361BC6CD.4B6B8DAC@sigg.com>
Ah,
I realize my problem
I am passing a reference instead of an array
Aaron Young wrote:
> Hi all
>
> I am trying to use the Expect module and could use a little
> clarification
>
> I have the Pod documentation in front of me but I am having a little bit
> of trouble understanding how one of the methods is supposed to work
>
> I am calling the $obj->clear_accum() and for some reason I'm not
> understanding the behavior of the object after that call
>
> My understanding is that it should clear everything out....but it
> doesn't seem to.
>
> My code (below) takes an pgp5 encrypted file hello.pl.asc and decrypts
> it
>
> but when I do my &print_match sub I don't get what I expect....what I
> get is the first match printed again when it should be printing out the
> second.....in other words, I get the Enter pass phrase: bit everytime I
> print out what was matched.
>
> the odd thing is that everything seems to work, if I can't get the
> match, then I can't change the behavior based on the output.......
>
> TIA
>
> Aaron
>
> I have something like this
> #Set up objects
> $process = Expect->spawn("/usr/local/security/bin/pgpv",
> "hello.pl.asc");
> $process->expect(1, "Enter pass phrase:");
> &print_match;
> $process->clear_accum();
>
> $process->send_slow(1, "my key phrase\n");
> $process->clear_accum();
>
> $process->expect(1, ["type binary.","Overwrite? [y/N]"]);
> &print_match;
> $process->send_slow(1, "y\n");
>
> &print_match;
>
> exit;
>
> #Print out Expect match info
> sub print_match {
> print "\n----------------------------------\n";
> print "Object->exp_match(): ";
> print $process->exp_match();
> print "\n";
> print "Object->exp_match_number(): ";
> print $process->exp_match_number();
> print "\n----------------------------------\n";
> }
------------------------------
Date: Wed, 7 Oct 1998 12:01:06 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Extracting muliple values from a hash
Message-Id: <MPG.10855a4e500a19fa9897f3@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <6vg5gg$n7a$1@nnrp1.dejanews.com> on Wed, 07 Oct 1998 16:39:44
GMT, elund@compuserve.com <elund@compuserve.com> says...
> Is there a simple way to extract multiple named values from a hash? For
> example (and this doesn't work):
>
> @array = @hash{key0,key3}; # This could be interpolated in a string
...
> I'm just lazy and like to do things in one line if it's an alternative. My
> question is probably more of a why: Is there a reason this isn't in Perl, and
> if not, who would I beg and plead to get this added?
Hash slices such as this *are* in Perl and work just fine for everyone
else. Please post some code that makes you think they don't work for
you.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 07 Oct 1998 20:42:18 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Extracting muliple values from a hash
Message-Id: <Pine.GSO.4.02A.9810071334260.4710-100000@user2.teleport.com>
On Wed, 7 Oct 1998 elund@compuserve.com wrote:
> Is there a simple way to extract multiple named values from a hash?
Yes; with a hash slice.
> For example (and this doesn't work):
>
> @array = @hash{key0,key3}; # This could be interpolated in a string
No, you can't use barewords like that.
@array = @hash{ qw/ key0 key3 / }; # better
As a shortcut, if the item in the curly braces of a hash element reference
is just a plain bareword, quote marks may be omitted. But if it's any
fancier, it's really an expression, so you may need quotes.
$fred{barney} = "simple key here";
$fred{"bar ney"} = "gotta quote that key";
$fred{3+3} = "this is element '6'"
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 07 Oct 1998 19:28:05 GMT
From: bluecanary@my-dejanews.com
Subject: Getting PERL to work with personal web server
Message-Id: <6vgfc5$g7o$1@nnrp1.dejanews.com>
From: Dave Kettmann
Subject: PWS
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
I also had the same problem!!! I followed all the advice provided so far
but still had no luck. Then I decided to look at the Readme/troubleshootimg
and found the following:
To use PWS on a computer that is not connected to a network, you must use
the following procedure:
1. Rename the file Hosts.sam, located in the \Windows directory to Hosts
(no extension).
2. Open Hosts file in a text editor. Add an entry that maps 127.0.0.1 to
your machine name, then save your changes.
3. Click Start, point to Settings, then click Control Panel.
4. Double-click the Network icon.
5. On the Configuration property sheet, under The following network
components are installed select TCP/IP Dial Up Adapter, then click
Properties.
6. On the IP Address property sheet, select Specify an IP address.
7. In the IP Address box, enter 1.2.3.4.
8. In the Subnet Mask box, enter 255.0.0.0.
9. Click OK.
10. You may need to insert your Microsoft Windows 95 CD , and then restart
you computer for changes to take effect.
Note Before dialing up to your Internet Service Provider, on the IP
Address property sheet you will need to reset the settings in the IP
Address property sheet to Obtain an IP Address automatically.
This worked for my Home system that is not connected to a network. On my
system at work all I had to do was:
1. Run WINIPCFG.exe to get my IP address number
2. Rename Hosts.sam to host
3. Edit host to include the IP address and machine name.
Then it worked.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 07 Oct 1998 19:26:21 GMT
From: bluecanary@my-dejanews.com
Subject: Getting PERL to work with personal web server
Message-Id: <6vgf8t$fu3$1@nnrp1.dejanews.com>
From: Dave Kettmann <davek@testdrive.com>
Subject: PWS
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
I also had the same problem!!! I followed all the advice provided so far
but still had no luck. Then I decided to look at the Readme/troubleshootimg
and found the following:
To use PWS on a computer that is not connected to a network, you must use
the following procedure:
1. Rename the file Hosts.sam, located in the \Windows directory to Hosts
(no extension).
2. Open Hosts file in a text editor. Add an entry that maps 127.0.0.1 to
your machine name, then save your changes.
3. Click Start, point to Settings, then click Control Panel.
4. Double-click the Network icon.
5. On the Configuration property sheet, under The following network
components are installed select TCP/IP Dial Up Adapter, then click
Properties.
6. On the IP Address property sheet, select Specify an IP address.
7. In the IP Address box, enter 1.2.3.4.
8. In the Subnet Mask box, enter 255.0.0.0.
9. Click OK.
10. You may need to insert your Microsoft Windows 95 CD , and then restart
you computer for changes to take effect.
Note Before dialing up to your Internet Service Provider, on the IP
Address property sheet you will need to reset the settings in the IP
Address property sheet to Obtain an IP Address automatically.
This worked for my Home system that is not connected to a network. On my
system at work all I had to do was:
1. Run WINIPCFG.exe to get my IP address number
2. Rename Hosts.sam to host
3. Edit host to include the IP address and machine name.
Then it worked.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 07 Oct 1998 14:56:49 -0400
From: Ala Qumsieh <aqumsieh@tigre.matrox.com>
Subject: Re: Help with Here Document
Message-Id: <x3y90isqjyl.fsf@tigre.matrox.com>
Jim Woodgate <jdw@dev.tivoli.com> writes:
>
>
> Andrew Perrella <ap85@cornell.edu> writes:
> > Is it possible to use the "Here Document" method to print to a
> > variable?
>
> how about:
>
> $words = <<end_of_text;
> Hello this is a atest
> may as well have "multiple lines"
> end_of_text
>
> print $words;
> __END__
>
In the same thread, tadmc@flash.net (Tad McClellan) writes:
>
> Andrew Perrella (ap85@cornell.edu) wrote:
>
> : Is it possible to use the "Here Document" method to print to a
> : variable?
>
>
> No, you can't "print" to a variable.
>
> You can "assign" to a variable though ;-)
>
>
> $words =<<end_of_text;
> Hello this is a atest
> end_of_text
>
Hmmmmm..... coincidence???
--
Ala Qumsieh | No .. not Just Another
ASIC Design Engineer | Perl Hacker!!!!!
Matrox Graphics Inc. |
Montreal, Quebec | (Not yet!)
------------------------------
Date: Wed, 07 Oct 1998 15:02:43 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: How do I combine scripts
Message-Id: <linberg-0710981502430001@ltl1.literacy.upenn.edu>
In article <6vg5qr$5f6$1@newsread1-mx.centuryinter.net>, "brettr"
<brettr@centuryinter.net> wrote:
> How would I combine 2 scripts into one?
Copy and paste? m-x insert-file?
> How would the form know which script
> it was calling in the file?
What form?
> I think some use of hidden variables. I'm just
> not exactly sure of where to start.
I'm not sure what you're asking. Sounds like a CGI question, right? Try
comp.infosystems.www.authoring.cgi.
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: 7 Oct 1998 18:56:48 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: How do I format a system date?
Message-Id: <6vgdhg$7p116@mercury.adc.com>
In article <6vg98i$7ks$1@newsread1-mx.centuryinter.net>,
brettr <brettr@centuryinter.net> wrote:
>I would like to have this date "10/06/98 06:41:13 CDT" look like this one
>"Tuesday October 6, 1998." How would I do that?
The Date::Manip module on CPAN will do that. Specifically, the ParseDate and
UnixDate functions.
--
_____
|/// | Brand Hilton bhilton@adc.com
| ADC| ADC Telecommunications, ATM Transport Division
|_____| Richardson, Texas
------------------------------
Date: Wed, 07 Oct 1998 20:28:24 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Metasearch engine and Compare
Message-Id: <Pine.GSO.4.02A.9810071326380.4710-100000@user2.teleport.com>
On Wed, 7 Oct 1998, Bill wrote:
> Can anybody point me to a site that offers a perl-based Metasearch
> engine and a Comparison Price search engine that searches several book
> retailing sites such as Amazon, Barnes & Noble for the lowest price on
> a particular book/title?
There are many places which may help you to find any old web site that you
may be interested in. This newsgroup is not one of them. Try using Yahoo,
and go from there. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 07 Oct 1998 20:09:10 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: missing value after unpack from socket
Message-Id: <Pine.GSO.4.02A.9810071306200.4710-100000@user2.teleport.com>
On Wed, 7 Oct 1998, johnvun wrote:
> But the problem is value 4 (11) ($var4) didn't print out
> $infor = <S2>;
> ($var1, $var2, $var3, $var4) = unpack("nnNN", $infor);
You're reading binary data, but you used the line input operator to read
it. That's only good for text; if you get the binary pattern for end of
line, that will end that line of input. Try using read instead. Hope this
helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 07 Oct 1998 15:10:47 -0500
From: Gump Xu <a14203@cig.mot.com>
Subject: multi-line comments
Message-Id: <361BCAC7.1FBD@cig.mot.com>
Hi,all:
I am a new guy in Perl programming. Could anyone tell me
how to use a couple of characters to make multi-line comments
in Perl program?
thanks,
--
Gump Xu (Xu han)
email: a14203@cig.mot.com
------------------------------
Date: Wed, 07 Oct 1998 20:39:57 GMT
From: Justin Harvey <jbharvey@auspex.net>
Subject: Re: multi-line comments
Message-Id: <361BD18A.5300EBE7@auspex.net>
#!/usr/local/bin/perl
#
#
#
#
#
That's hard.
Gump Xu wrote:
>
> Hi,all:
> I am a new guy in Perl programming. Could anyone tell me
> how to use a couple of characters to make multi-line comments
> in Perl program?
>
> thanks,
> --
> Gump Xu (Xu han)
> email: a14203@cig.mot.com
--
Justin B. Harvey http://www.auspex.net/jbharvey
jbharvey@auspex.net Mountain View, CA
use Perl || die "trying";
------------------------------
Date: Wed, 07 Oct 1998 20:58:15 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: multi-line comments
Message-Id: <Pine.GSO.4.02A.9810071356160.4710-100000@user2.teleport.com>
On Wed, 7 Oct 1998, Gump Xu wrote:
> Could anyone tell me how to use a couple of characters to make
> multi-line comments in Perl program?
Have you seen what section seven of the FAQ says about this? Hope this
helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 07 Oct 1998 19:56:38 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: open's return value (was: Re: eq on if statement causing problems)
Message-Id: <Pine.GSO.4.02A.9810071243570.4710-100000@user2.teleport.com>
On Tue, 6 Oct 1998, Kevin Reid wrote:
> John Porter <jdporter@min.net> wrote:
>
> > 0. Always, *Always*, *ALWAYS* check the result of open().
> > There is never, NEVER a situation in which you can safely
> > neglect to check the result of open().
>
> if ($^O eq 'MacOS') {
> open CON, '> Dev:Console:Ha!';
> print CON "Never say never!\n";
How do you know that that open will succeed when the program is run under
a future version of the MacOS? Remember, the future Mac system won't be
using MacPerl; Perl will compile directly. (Maybe $^O will be set
to a different value then, too.)
I imagine that even if that would normally work, it could fail if there
are too many windows open, or if the program is a faceless background
process, or for other reasons.
Of course, you don't need to check the return value if it truly doesn't
matter that the open failed. But that's not likely, I don't think you were
trying to do that. For usual stuff, always check.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 07 Oct 1998 17:00:19 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Opening Perl documentation
Message-Id: <361BD663.6A3CFDC0@min.net>
Kevin Reid wrote:
>
> use Help;
> help 'perlsyn';
I think you should change the doco to this:
perl -MHelp -e help('perlsyn')
This kind of usage is easy to alias in most shells.
--
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer
------------------------------
Date: 7 Oct 1998 19:14:39 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl 5.005_02 Compiling ERRORS
Message-Id: <6vgeiv$3uq$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Detlef Weitz
<weitz@goya.informatik.rwth-aachen.de>],
who wrote in article <361BA2C2.B156FF87@goya.informatik.rwth-aachen.de>:
> `sh cflags libperl.a perlio.o` perlio.c
> CCCMD = gcc -DPERL_CORE -c -I/usr/local/include -I/opt/local/include
> -I/opt/gnu/include
> -I/opt/gnu/gcc-2.7.2.3/lib/gcc-lib/sparc-sun-solaris2.5/2.7.2.3/include
> -O
> rm -f libperl.a
> ar rcu libperl.a perl.o malloc.o gv.o toke.o perly.o op.o regcomp.o
> dump.o util.o mg.o byterun.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o
> pp_ctl.o pp_sys.o doop.o doio.o regexec.o taint.o deb.o universal.o
> globals.o perlio.o
> gcc -L/usr/local/lib -L/opt/local/lib -L/opt/gnu/lib -o miniperl
> miniperlmain.o libperl.a -lsocket -lnsl -ldb -ldl -lm -lc -lcrypt
> Undefined first referenced
> symbol in file
> PL_thrsv libperl.a(malloc.o)
> pthread_getspecific libperl.a(malloc.o)
> PL_malloc_mutex libperl.a(malloc.o)
> PL_thr_key libperl.a(malloc.o)
> PL_threadnum libperl.a(malloc.o)
> ld: fatal: Symbol referencing errors. No output written to miniperl
> make: *** [miniperl] Error 1
> 444.43u 103.80s 11:54.63 76.7%
How did you configure Perl? Did you reconfigure it without cleanup?
malloc.c thinks that Perl is going to be multithreaded, but this
assumption is not substantiated by other .c files.
Ilya
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3920
**************************************