[8130] in Perl-Users-Digest
Perl-Users Digest, Issue: 1748 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 28 02:09:09 1998
Date: Tue, 27 Jan 98 23:00:21 -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 Tue, 27 Jan 1998 Volume: 8 Number: 1748
Today's topics:
Re: "Teach Yourself Perl in 21 days" (Was: Re: substitu <dlecky@uvic.ca>
Re: "Teach Yourself Perl in 21 days" (Was: Re: substitu (Dave O.)
Re: "Teach Yourself Perl in 21 days" (Was: Re: substitu (Jeeves)
Re: Bad Word - Swear Word Checking - I Surrender! <rjk@coos.dartmouth.edu>
Re: check URL <rootbeer@teleport.com>
Re: Conversion to an array <rootbeer@teleport.com>
Re: crypt function ... help. <rootbeer@teleport.com>
Re: diff that operates on Perl variables? <joseph@5sigma.com>
Error(?) messages from perldoc <allank@techone.com.au>
Re: Freidl's book mystery <joseph@5sigma.com>
Re: is "reverse <>" of a list type? (Craig Berry)
Re: loading page after cgi call causes path problems. <rjk@coos.dartmouth.edu>
localtime hour format <feng@haas.berkeley.edu>
Re: localtime hour format <feng@haas.berkeley.edu>
Re: localtime hour format <rjk@coos.dartmouth.edu>
Looking for a really basic mailto/form script <chamber@gsat.edu.au>
My function call doesn't seem to work sometimes <bps8527@usl.edu>
Re: Perl script reading in HTML POST Form info <rootbeer@teleport.com>
Re: print<< into variable? <rootbeer@teleport.com>
Re: print<< into variable? <rootbeer@teleport.com>
Re: printing an image <rootbeer@teleport.com>
Re: Problem with Socket.sockaddr_in <rootbeer@teleport.com>
regexes: fun with /x <rjk@coos.dartmouth.edu>
Re: system command and using variable in list <rootbeer@teleport.com>
Re: system command and using variable in list <rjk@coos.dartmouth.edu>
Re: unix command pipes <rootbeer@teleport.com>
Re: Win32 Perl & Internet Information Server 4.0 (NT) <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 28 Jan 1998 04:43:28 GMT
From: Duane Lecky <dlecky@uvic.ca>
Subject: Re: "Teach Yourself Perl in 21 days" (Was: Re: substitute...)
Message-Id: <6amd1g$1hei@uvaix7e1.comp.UVic.CA>
Tom Phoenix <rootbeer@teleport.com> wrote:
>On 27 Jan 1998, Duane Lecky wrote:
>
>> My reference book for Perl was initially "Teach Yourself
>> Perl in 21 days" by David Till. It was excellent.
>
>My experience with that book is somewhat less positive.
>
>I had heard Randal claim that he could start at any random page in that
>book and find a serious error of fact within four pages.
Thanks Tom, for pointing this out. I too found many errors in the book,
but it was still more valuable to me as a beginner than the Camel books.
I should not have been so enthusiastic.
Duan Lecky
------------------------------
Date: Wed, 28 Jan 1998 05:50:52 GMT
From: sloop@mailcity.com (Dave O.)
Subject: Re: "Teach Yourself Perl in 21 days" (Was: Re: substitute...)
Message-Id: <34cec252.167472568@news.xmission.com>
On 28 Jan 1998 04:43:28 GMT, Duane Lecky <dlecky@uvic.ca> wrote:
>Tom Phoenix <rootbeer@teleport.com> wrote:
>>On 27 Jan 1998, Duane Lecky wrote:
>>
>>> My reference book for Perl was initially "Teach Yourself
>>> Perl in 21 days" by David Till.
>>My experience with that book is somewhat less positive.
>>I had heard Randal claim that he could start at any random page in that
>>book and find a serious error of fact within four pages.
>
>Thanks Tom, for pointing this out. I too found many errors in the book,
>but it was still more valuable to me as a beginner than the Camel books.
>I should not have been so enthusiastic.
I'm not sure what classifies one a beginner, but with no prior
experience in Perl, but a good background in other programming
languages (ranging from C and Pascal to Assembly and BASIC) I found
the Camel book to be not the least bit intimidating.
I suppose that with no other background in programming such a book
would be difficult to comprehend. But for someone who understands
programming concepts, someone who understands flow control, logic
operations, the concepts of variables, structures and arrays, and so
forth, learning Perl at least in principal from the Camel book is a
good approach.
A student learning a foriegn language of communication for the first
time does so painfully. However, subsequent languages may be acquired
with more ease as the acquisition of the first foriegn language
introduced and familiarized the student with the building blocks of
language, the processes involved in learning, ... in essence, the
basics of the field of Linguistics. Though programming languages are
more structured, more precise, and less exhaustive than communication
languages, the process of knowlege acquisition is not entirely
dissimilar. Once the common building blocks are understood the
specific lexicon, syntax and grammar may be considered simply an
implementation of the underlying thought and logic.
That previous statement is my wordy attempt at saying that I'm glad
for books such as Camel that assume I'm *not* learning about computers
for the first time.
Dave
------------------------------
Date: 28 Jan 1998 06:10:25 GMT
From: darlenem@PAS.DE.SPAM.flash.net (Jeeves)
Subject: Re: "Teach Yourself Perl in 21 days" (Was: Re: substitute...)
Message-Id: <slrn6ctk1t.h1i.darlenem@jeeves.flash.net>
On Wed, 28 Jan 1998 05:50:52 GMT, Dave O. <sloop@mailcity.com> wrote:
>On 28 Jan 1998 04:43:28 GMT, Duane Lecky <dlecky@uvic.ca> wrote:
>
>>>My experience with that book is somewhat less positive.
>>>I had heard Randal claim that he could start at any random page in that
>>>book and find a serious error of fact within four pages.
>>
>>Thanks Tom, for pointing this out. I too found many errors in the book,
>>but it was still more valuable to me as a beginner than the Camel books.
>>I should not have been so enthusiastic.
>
>I'm not sure what classifies one a beginner, but with no prior
>experience in Perl, but a good background in other programming
>languages (ranging from C and Pascal to Assembly and BASIC) I found
>the Camel book to be not the least bit intimidating.
When I was first playing around with Java, I got a book called "Learn Java in
21 Days." After realizing how shallow and single-minded its coverage of the
language was, I promptly returned it, and was on my way out when "Core Java"
caught my eye; it claimed to be written with the C/C++ programmer in mind.
Perfect. But, actually, since I discovered perl, I don't program in Java much
anymore =) When I got the Camel book, I struggled to understand what all that
wierd stuff was (if ($a = $b) { ... }) really threw me for awhile because
that's a standard typo in C). Then I decided reading chapter 1 (which I had
skipped, assuming it discussed fundamentals of programming in general) might
help. My Camel book is so worn out that I might have to go buy a second copy!
It's definitely a good reference. If it's intimidating to novices or
inexperienced programmers, I've heard great things about the Llama Book, and
I've seen both books sold as a package deal at some bookstores. Probably a good
thing. Speaking of errors in computer books, I was flipping through a mammoth
book about Linux Slackware ('unleashed!' or whatever), and on the first page I
stopped on, there was a false statement!
Regards,
Jeeves (darlenem@spamless.flash.net)
--
---------------------------------------------------------------------
J | Copyright (c) 1997 Jeeves Industries Limited.
J | All rights reserved. Void where prohibited.
J | Some restrictions may apply. Limit 1 per customer.
J J | Offer not valid in conjunction with any other offer.
JJJ | Some sold separately. Not intended for children under 3.
---------------------------------------------------------------------
>From .cshrc:
alias rm 'rm -rf \!*'
alias hose kill -9 '`ps -augxww | grep \!* | awk \'{print $2}\'`'
alias kill 'kill -9 \!* ; kill -9 \!* ; kill -9 \!*'
alias renice 'echo Renice\? You must mean kill -9.; kill -9 \!*'
=====================================================================
------------------------------
Date: Tue, 27 Jan 1998 23:26:36 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: Re: Bad Word - Swear Word Checking - I Surrender!
Message-Id: <34CEB37B.5608515E@coos.dartmouth.edu>
Dave Power wrote:
>
> I agree, the origin of this thread was not a question about the Perl
> programming language.
>
> It was a question to a community which I thought would be best
> qualified to answer it.
Why? Because perl programmers tend to use foul language? :-P
This is comp.lang.perl.misc. Note the comp.lang.perl part before the misc.
Chipmunk
------------------------------
Date: Tue, 27 Jan 1998 21:49:08 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Wei Weng <wweng@attila.stevens-tech.edu>
Subject: Re: check URL
Message-Id: <Pine.GSO.3.96.980127214536.13242O-100000@user1.teleport.com>
On 27 Jan 1998, Wei Weng wrote:
> Is there anyway to use perl to test a URL is valid or not?
Use the LWP module. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 27 Jan 1998 21:45:04 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Kevin Tonkin <kjt111@hotmail.com>
Subject: Re: Conversion to an array
Message-Id: <Pine.GSO.3.96.980127214221.13242N-100000@user1.teleport.com>
On 27 Jan 1998, Kevin Tonkin wrote:
> Can someone tell me if it is possible to convert the variables from a
> database file to an array?
It's certainly possible, for some definitions of "convert". :-)
> Example: Database stored in a text file like so...
>
> Bob|24|blue|single
> Fred|32|green|married
>
> If I wanted to put blue and green into an array, how would I achieve
> this?
I don't know how you would, but I know how I would. :-) I'd read the
lines, parse them (probably with split, unless I needed something
fancier), extract the elements I wanted (probably with subscripts) and
store them into an array (probably with push).
Does that give you a better idea of how you could do it? Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 27 Jan 1998 21:13:47 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Gabor <gabor@vmunix.com>
Subject: Re: crypt function ... help.
Message-Id: <Pine.GSO.3.96.980127210817.13242J-100000@user1.teleport.com>
On 27 Jan 1998, Gabor wrote:
> In comp.lang.perl.misc, chad <chad> wrote :
> # How do I de-crypt a crypt'd string? I cryp'd it using the perl
> # crypt function.
> use crypt twice on the string while chanting some secret voodoo
> rhymes. :-)
I tried this, but on the second verse, I get a core dump. But only when
using IE4.0; it runs fine under Netscape. BTW, do you know if the voodoo
rhymes have been certified Y2K compliant? My boss wants me to find out
before we upgrade to Mojo 3.0.
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 27 Jan 1998 23:42:07 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: diff that operates on Perl variables?
Message-Id: <34CED309.7FA01016@5sigma.com>
Let's stick to writing specifications. I'd be willing to
write the module but only if it's got a reasonable spec.
Writing a diff-like program isn't a trivial undertaking.
Built-in hashing should make it easier in Perl, though.
Time to move the followups to comp.lang.perl.modules I think,
unless the larger audience in clpm wants to comment.
-joseph
John Porter wrote:
>
> Steve Goldstein wrote:
> >
> > I don't know how a "diff" module might behave in general, I think it
> > should be consistent with UNIX diff (or gnudiff) in the following two
> > senses (which may not be consistent with each other):
> >
> > 1. The "perl diff" of two scalars should contain the same information
> > that you'd get from creating two text files from the scalars and then
> > doing a diff on the files. [...]
>
> I think there's too many degrees of freedom in your requirement
> (if we are to make it a useful general-purpose solution).
> . How is difference/sameness determined
> . How is it indicated
> . What action is taken for pairs that are different/same
>
> Seems to me, a general approach is to iterate over two (or more?)
> arrays in parallel. Like this:
>
> sub iterate { [...]
--
Joseph N. Hall, prop., 5 Sigma Productions mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training . . . . . . . . . . . . . . . http://www.perltraining.com
------------------------------
Date: Wed, 28 Jan 1998 15:13:20 +1100
From: "Allan Krause" <allank@techone.com.au>
Subject: Error(?) messages from perldoc
Message-Id: <6amf1m$4s21@sol.connect.usq.edu.au>
I have just downloaded and build perl5.004_04 on WindowsNT 4.0.
In the hope of not having to bothering everybody else on this newgroup with
trivial questions, I thought I'd try out the perldoc utility so often
referred to in responses to postings. perldoc appears to be having a bit of
a problem seeing some files (see below) before it actually displays the good
stuff??? Is there any way to avoid these error/warning/informative
messages?
perldoc -f open
Ignored c:\perl\lib\site/perlfunc.pod: unreadable
Ignored c:\perl\lib\site/perlfunc.pm: unreadable
Ignored c:\perl\lib\site/perlfunc: unreadable
Ignored c:\perl\lib\site/perlfunc.bat: unreadable
Ignored c:\perl\lib\site/pod/perlfunc.pod: unreadable
Ignored c:\perl\lib\site/pod/perlfunc: unreadable
Ignored c:\perl\lib/perlfunc.pod: unreadable
Ignored c:\perl\lib/perlfunc.pm: unreadable
Ignored c:\perl\lib/perlfunc: unreadable
Ignored c:\perl\lib/perlfunc.bat: unreadable
open FILEHANDLE,EXPR
open FILEHANDLE
Opens the file whose filename is given by EXPR, and
associates it with FILEHANDLE. If FILEHANDLE is an
expression, its value is used as the name of the real
filehandle wanted. If EXPR is omitted, the scalar.............
Thanks,
Allan Krause
allank@techone.com.au
------------------------------
Date: Tue, 27 Jan 1998 23:38:30 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: Freidl's book mystery
Message-Id: <34CED230.36D2C868@5sigma.com>
I am very happy to see a discussion proceeding on this now ...
especially considering scalar m//gc is the method I recommend in
EPP and the one Jeffrey recommended in his TPJ article (if I
remember correctly).
-joseph
Chip Salzenberg wrote:
>
> According to ilya@math.ohio-state.edu (Ilya Zakharevich):
> >Correct. Around 5.003_07 a patch made it into RE processor which made
> >scalar m//g to copy the string *on each iteration*.
>
> Copy what string where? Maybe I can fix it if I have more info.
--
Joseph N. Hall, prop., 5 Sigma Productions mailto:joseph@5sigma.com
Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
Perl Training . . . . . . . . . . . . . . . http://www.perltraining.com
------------------------------
Date: 28 Jan 1998 04:59:20 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: is "reverse <>" of a list type?
Message-Id: <6amdv8$r9q$1@marina.cinenet.net>
brian d foy (comdog@computerdog.com) wrote:
: In article <6alsat$j1k$1@news.ml.com>, mwang@alhena.ibk.ml.com (Michael Wang) posted:
:
: >The reason I ask this: I am think of writing "tail -n" with perl by
: >reversing the lines in a file - reverse is a speedier operations
: >which just swap the pointers - and then get first n lines, and then
: >reverse them and print it out.
:
: rather than all that reversing, why not:
:
: create the array of lines
: find the index of the last element of that array
: print out lines $#array - N to $array
You needn't even 'find out the index of the last element; use negative
indices as in my earlier post on this thread, essentially
@lines = <>;
print @lines[-N .. -1];
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: Wed, 28 Jan 1998 00:16:26 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: mpryor@shareone.com
Subject: Re: loading page after cgi call causes path problems.
Message-Id: <34CEBF29.FC96278F@coos.dartmouth.edu>
Mark Pryor wrote:
>
> I have a perl cgi that get some form input, and upon completion,
> loads a canned html page - thanking the user for submitting. However,
> if I place links along with the thank you text, it wants to look
> in the cgi-bin directory (where the cgi was called) for the files.
Sounds like you want to use the HTML <BASE> tag.
> Is there a way to just call the cgi, wherever it may be, and return
> back to the top to continue normal browsing?
Huh?
Chipmunk
------------------------------
Date: Tue, 27 Jan 1998 22:16:50 -0800
From: Patience <feng@haas.berkeley.edu>
Subject: localtime hour format
Message-Id: <34CECD52.F441BDC6@haas.berkeley.edu>
Hi guys,
I looked but could not find the answer: Does the hour element of
localtime go from 0 to 23 or 1 to 24? (My guest is 0 to 23 but not
certain)
Thanks a bunch for helping out! : )
-- Patience
------------------------------
Date: Tue, 27 Jan 1998 22:30:08 -0800
From: Patience <feng@haas.berkeley.edu>
Subject: Re: localtime hour format
Message-Id: <34CED070.78431B0D@haas.berkeley.edu>
After a few trials and errors, I figured it out. : )
The hour element does go from 0 to 23.
Thank you for caring. : )
-- Patience
Patience wrote:
> Hi guys,
>
> I looked but could not find the answer: Does the hour element of
> localtime go from 0 to 23 or 1 to 24? (My guest is 0 to 23 but not
> certain)
>
> Thanks a bunch for helping out! : )
>
> -- Patience
------------------------------
Date: Wed, 28 Jan 1998 01:22:16 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: feng@haas.berkeley.edu
Subject: Re: localtime hour format
Message-Id: <34CECE98.C8919940@coos.dartmouth.edu>
[posted and mailed]
Patience wrote:
>
> I looked but could not find the answer: Does the hour element of
> localtime go from 0 to 23 or 1 to 24? (My guest is 0 to 23 but not
> certain)
It follows the standard 24 hour clock: 0 is midnight, 23 is 11pm.
So your guess is correct.
Chipmunk
------------------------------
Date: Wed, 28 Jan 1998 16:34:46 +1100
From: "Robert Tobin" <chamber@gsat.edu.au>
Subject: Looking for a really basic mailto/form script
Message-Id: <6amjb7$2e5@lincoln.gsat.edu.au>
I am looking for a basic form/mailto script
can anyone help?
Robert Tobin
------------------------------
Date: Wed, 28 Jan 1998 00:06:42 -0600
From: Suravarapu Bhanu P <bps8527@usl.edu>
Subject: My function call doesn't seem to work sometimes
Message-Id: <34CECAF2.41C67EA6@usl.edu>
Hi,
I am using perl5.003. I have a function call in a certain script.
My problem is that this function is executed only sometimes. I realized
this by placing some debug statements. The details are below.
I have the following code (which gives me the problem)
Below assume that @TravNodes contains the numbers 2,6,7,8,9,10 and 11
while ($node)
{
open(FILE1,">>file1.txt");
print FILE1 "\n".$node." - before travlink".$url;
$response = &travlink($node);
print FILE1 "\n".$node." - ".$response." - after travlink".$url;
}
continue
{
$node = shift(@TravNodes);
}
sub travlink
{
$indexurl = <file1.txt>;
open(FILE1,">>$indexurl");
print FILE1 $_[0]." - dollar var\n";
$response = &www'request('GET', $url, *headers, *content, $Timeout);
return $response;
}
RESULT: file1.txt
-----------------
The entries from the print statement in the travlink function for
$node values - 6,8 and 10 are missing
i.e., the function was never executed
the output file file1.txt is given below:
from travlink() - 2 - dollar var
2 - before travlinkfile://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/index.html
2 - 200 - after travlinkfile://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/index.html
6 - file://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/intro.html
6 - before travlinkfile://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/intro.html
6 - 200 - after travlinkfile://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/intro.html
7 - file://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/architec.html
from travlink() - 7 - dollar var
7 - before travlinkfile://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/architec.html
7 - 200 - after travlinkfile://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/architec.html
8 - file://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/start.html
8 - before travlinkfile://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/start.html
8 - 200 - after travlinkfile://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/start.html
9 - file://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/query.html
from travlink() - 9 - dollar var
9 - before travlinkfile://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/query.html
9 - 200 - after travlinkfile://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/query.html
10 - file://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/advanced.html
10 - before travlinkfile://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/advanced.html
10 - 200 - after travlinkfile://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/advanced.html
11 - file://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/extend.html
from travlink() - 11 - dollar var
11 - before travlinkfile://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/extend.html
11 - 200 - after travlinkfile://localhost/home/swamp1/raghavan/bps8527/public_html/postgres/extend.html
Thank you,
bhanu.
bhanu@usl.edu
--
BHANU P. SURAVARAPU (bhanu@usl.edu)
901 Lamar St., Apt. C, 151 CALDERON AVE.,# 314,
LAFAYETTE, LA-70501. MOUNTAIN VIEW, CA-94041.
ph.# (318)-233-5329 ph# (415)-967-3124
------------------------------
Date: Tue, 27 Jan 1998 20:55:48 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: mgeorgeadis@fallschurch.esys.com
Subject: Re: Perl script reading in HTML POST Form info
Message-Id: <Pine.GSO.3.96.980127205420.13242G-100000@user1.teleport.com>
On Tue, 27 Jan 1998 mgeorgeadis@fallschurch.esys.com wrote:
> I'm not sure how to access the
> info passed to the next perl script.
Sounds as if you want CGI.pm. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 27 Jan 1998 20:37:49 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Tony L. Svanstrom" <tony@svanstrom.com>
Subject: Re: print<< into variable?
Message-Id: <Pine.GSO.3.96.980127201857.13242C-100000@user1.teleport.com>
On Tue, 27 Jan 1998, Tony L. Svanstrom wrote:
> What if I want to "print" to a variable
Perl has no function to '"print" to a variable'. But, of course, you can
store information into a scalar variable in a variety of ways. Some of
those ways may even remind you of what happens in output.
> a couple of times and I don't
> want to replace the information already in it?
Use a different variable, then. Perl has no shortage! :-) Or you could do
something like this.
$foo = "original foo";
{
my $foo;
for (1..5) {
$foo .= sprintf "This is line %.1f to print\n", $_;
}
$foo = reverse $foo;
print "$foo\n";
}
print "$foo\n";
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 27 Jan 1998 22:25:20 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Joshua J. Kugler" <jkugler@inreach.com>
Subject: Re: print<< into variable?
Message-Id: <Pine.GSO.3.96.980127222356.13242R-100000@user1.teleport.com>
On Tue, 27 Jan 1998, Joshua J. Kugler wrote:
> $text = join("", $text, $newtext);
Is that somehow better than using the append operator?
$text .= $newtext;
This is certainly easier to type. :-) Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 27 Jan 1998 20:42:34 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Stephen Miano <stevem@ny.ubs.com>
Subject: Re: printing an image
Message-Id: <Pine.GSO.3.96.980127204157.13242D-100000@user1.teleport.com>
On Tue, 27 Jan 1998, Stephen Miano wrote:
> open(GIF,"sm.gif");
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
Thanks.
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 27 Jan 1998 22:27:08 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Worik Macky Stanton <w.stanton@auckland.ac.nz>
Subject: Re: Problem with Socket.sockaddr_in
Message-Id: <Pine.GSO.3.96.980127222636.13242S-100000@user1.teleport.com>
On 28 Jan 1998, Worik Macky Stanton wrote:
> I get a usage error.
Perhaps the usage error is trying to tell you to use the module as the
author intended. Have you tried that? :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 28 Jan 1998 01:18:21 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
Subject: regexes: fun with /x
Message-Id: <34CECDAD.7714FC60@coos.dartmouth.edu>
Can you find a useful regex that will only work with the /x modifier?
Chipmunk
------------------------------
Date: Tue, 27 Jan 1998 21:04:39 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "Craig A. Keefner" <keefner@kinetic.com>
Subject: Re: system command and using variable in list
Message-Id: <Pine.GSO.3.96.980127205719.13242I-100000@user1.teleport.com>
On Tue, 27 Jan 1998, Craig A. Keefner wrote:
> open(JUSTDO, "|theexcefile.exe /m CAMARO >tmp/$$.file");
> sleep(3);
> close(JUSTDO);
Why are you opening a pipe you never use? Why are you wasting three
seconds sleeping? I think you want to use qx//, instead of those three
statements and the ones which follow them.
> open(RECONVERT, "tmp/$$.file");
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
> Problem is that when I ask the use which model car and store it in
> $model, I'd like to use $model in the statement above.
If you want to do this, I'd like to help. What kind of help do you need?
(I can't see any difficulty in doing what you say you want to do. Is
something stopping you from using $model in your statements?)
Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 28 Jan 1998 00:03:06 -0500
From: Chipmunk <rjk@coos.dartmouth.edu>
To: "Craig A. Keefner" <keefner@kinetic.com>
Subject: Re: system command and using variable in list
Message-Id: <34CEBC09.3BBD1A16@coos.dartmouth.edu>
[posted and mailed]
Craig A. Keefner wrote:
>
> hard coded example using camaro:
>
> open(JUSTDO, "|theexcefile.exe /m CAMARO >tmp/$$.file");
>
> [...]
>
> Problem is that when I ask the use which model car and store it in $model, I'd like
> to use $model in the statement above.
Well, you don't need our permission. ;-)
Seriously, why is that a problem? Have you tried using $model in the
statement above?
Chipmunk
------------------------------
Date: Tue, 27 Jan 1998 20:49:42 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Sonya Allin <sja3@columbia.edu>
Subject: Re: unix command pipes
Message-Id: <Pine.GSO.3.96.980127204408.13242E-100000@user1.teleport.com>
On Tue, 27 Jan 1998, Sonya Allin wrote:
> right now i am trying to write a line of code in perl which will pipe
> the output of a 'find' into a filehandle.
I'm not sure what you mean. But maybe you want one of the forms of open
from the perlfunc manpage.
> print "What is the name of the directory you want to search?";
> $directory=<STDIN>;
> print "What is the word you want to search for?";
> $word=<STDIN>;
> print "What word do you want to replace this word with?";
> $replacement=<STDIN>;
>
> open (FIND, "find $directory -print |") || die "Couldn't find $directory!
> \n";
Do you see that, since $directory was never chomp()ed, your find command
is perhaps not what you thought it would be? (Were you perhaps wondering
why the diagnostic message had an exclamation mark on a line by itself?
:-) In any case, you should almost certainly use File::Find and have an
easier time of everything.
> when i try to run my program at the command line, I write:
>
> ./myprogram.pl
>
> every time i try this, however, i get the error message
>
> 'permission denied'.
That's your shell telling you that. You should scold its authors for not
making that message clearer.
> i have chmod-ed my program so that it should be executable by anyone and
> everyone. what, then could be wrong?
Probably the first line of your script isn't a proper #! line. Are the #!
the very first characters in the file? Does the proper path to perl
immediately follow them? Is the path to perl 32 characters or fewer?
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 27 Jan 1998 21:41:36 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: cristi@obs-us.com
Subject: Re: Win32 Perl & Internet Information Server 4.0 (NT)
Message-Id: <Pine.GSO.3.96.980127214017.13242M-100000@user1.teleport.com>
On Tue, 27 Jan 1998 cristi@obs-us.com wrote:
> Please explain me how can I set up IIS 4.0 to handle Perl scripts!
If you're having troubles setting up your server, and if your vendor
and documents aren't helpful, you should ask in a newsgroup about servers.
The people there should be able to give you more and better information
than we can here. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 1748
**************************************