[10843] in Perl-Users-Digest
Perl-Users Digest, Issue: 4444 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 17 00:07:26 1998
Date: Wed, 16 Dec 98 21:00:18 -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 Wed, 16 Dec 1998 Volume: 8 Number: 4444
Today's topics:
Re: ($e_mail !~ /\w+[-\w]*\@\w+[-\w]*\.\w+/) (Ronald J Kimball)
Re: @INC and perl (Ronald J Kimball)
Re: array initialisation (Ronald J Kimball)
arrays, multi-dimensional arrays, pointers and such <cswfrank@rica.net>
Re: arrays, multi-dimensional arrays, pointers and such <rick.delaney@home.com>
asterisk in subroutine parameter list <mikane@shell3.ba.best.com>
Re: binmode <jamesht@idt.net>
Re: Can this be done <jamesht@idt.net>
Re: Can this be done <rick.delaney@home.com>
Re: counterintuitive behavior of "shift" (Larry Rosler)
Re: delete files <newsposter@cthulhu.demon.nl>
Re: Execute multi commands in one line <rick.delaney@home.com>
hashes <cswfrank@rica.net>
Re: hashes <rick.delaney@home.com>
Re: Help with Win32 to Unix Porting (Ronald J Kimball)
including other files <cswfrank@rica.net>
Re: including other files <rick.delaney@home.com>
Making the name of a var the contents of another johngalt25@excite.com
Re: perl cgi script call from an applet <jamesht@idt.net>
Re: Perl's in the dictionary (Ronald J Kimball)
Re: Perl's in the dictionary <kprice@cardinal.co.nz>
Re: Preventing 'Repost Form Data' <jamesht@idt.net>
Re: sort it ? (Ronald J Kimball)
Re: Writing Perl with Notepad <shameluss plug> (JT)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 16 Dec 1998 22:56:03 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: ($e_mail !~ /\w+[-\w]*\@\w+[-\w]*\.\w+/)
Message-Id: <1dk5hfi.48abag1nz6cxgN@bay2-206.quincy.ziplink.net>
Emmett McLean <emclean@slip.net> wrote:
> I think some of the people in this thread should concentrate
> on Perl and lighten up a bit.
Yes, please do.
P.S. Read the FAQ! ;-)
--
_ / ' _ / - 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: Wed, 16 Dec 1998 22:56:04 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: @INC and perl
Message-Id: <1dk5hjh.16h4xk813ezgn4N@bay2-206.quincy.ziplink.net>
Joe <tasburfoot@yahoo.com> wrote:
> Is there a way that i can add to the path long enough for my script to work.
> Maybe ->
>
> push (@INC, "/location");
Close.
use lib '/location';
This is an FAQ, by the way.
perlfaq8: How do I keep my own module/library directory?
--
_ / ' _ / - 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: Wed, 16 Dec 1998 22:56:04 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: array initialisation
Message-Id: <1dk5hmc.1fa868et3n19kN@bay2-206.quincy.ziplink.net>
Ala Qumsieh <aqumsieh@matrox.com> wrote:
> I was checking the entries into the 3rd Confuscated Perl Contest
> [...]
Help! Someone's stolen the Perl Contest!!
:-)
--
_ / ' _ / - 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: Wed, 16 Dec 1998 13:59:05 -0500
From: tabo <cswfrank@rica.net>
Subject: arrays, multi-dimensional arrays, pointers and such
Message-Id: <367802F9.850F00CA@rica.net>
it there something that kinda resembles a pointer in perl? if there
are, does anyone know how its used?
anyway, back to the jest of this post. i am trying to write a cgi
script file that is to automatically generate a table based on the
directories present and the files located in that directory. is there
anyway to implement that? what i had in mind was to create a files
list, an array and a couple of lists. the array would be used to hold
the names of the lists that are available. the lists would kinda
contain the equivilent of java applet params, which just tells my script
file where the info will go in the table. the main jest is to have the
web admin and any user that uploads files, to only modify the files list
and thats it. so it kinda looks like this
%doc1 = (
"title", "docuements table"
"wp5", "word perfect 5 document"
);
%doc2 = (
"title", "documents table"
"wp6", "word perfect 5 documents"
);
@docTypes(??????????????);
this is where i am stuck at. i want to have a generic variable that
will hold a reference to one of the lists.
@docTypes(ref_to_doc1, ref_to_doc2)
$temp = @docType[0];
print "$temp{title}\n";
that hopefull will print out "documents table". i know that i could do
it with the individual names of the lists, but i the problem is that if
i do that, when i add in new documentation i would have to manaully
modify the codes again. the whole jest is not to do that. so is there
any way that could be accomplished? i know i could do it in c or
c++(pointers, and multi-dimensional arrays), but programming in c or c++
for a cgi script is kinda long and tedious and just a plain pain in the
ass.
please reply to cswfrank@rica.net or tabo@cstone.net
any help would be greatly appreciated. thanx
--
Ezekiel 25:17
"The path of the righteous man is beset on all sides by the inequities
of the selfish and the tyranny of evil men. Blessed is he, who in the
name of charity and good will, shepherds the weak through the valley of
darkness, for he is truly his brother's keeper and the finder of lost
children. And I will strike down upon thee with great vengence and
furious anger those who attempt to poison and destroy my brothers. And
you will know my name is the Lord when I lay my vengence upon thee."
-Jules, Pulp Fiction
------------------------------
Date: Thu, 17 Dec 1998 04:49:10 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: arrays, multi-dimensional arrays, pointers and such
Message-Id: <36788F01.1D743D19@home.com>
[posted & mailed]
tabo wrote:
>
> it there something that kinda resembles a pointer in perl?
Yes, references. They are documented in perlref. Other related
documents are perldsc and perllol.
> if there are, does anyone know how its used?
They wouldn't be very useful if no one knew how to use them. :-)
> anyway, back to the jest of this post. i am trying to write a cgi
^^^^
I thought the last question was it.
> script file that is to automatically generate a table based on the
> directories present and the files located in that directory. is there
> anyway to implement that? what i had in mind was to create a files
> list, an array and a couple of lists. the array would be used to hold
> the names of the lists that are available. the lists would kinda
> contain the equivilent of java applet params, which just tells my
> script file
> where the info will go in the table. the main jest is to have the
> web admin and any user that uploads files, to only modify the files
>
> list and thats it. so it kinda looks like this
>
> %doc1 = (
> "title", "docuements table"
> "wp5", "word perfect 5 document"
> );
>
> %doc2 = (
> "title", "documents table"
> "wp6", "word perfect 5 documents"
> );
>
> @docTypes(??????????????);
> this is where i am stuck at. i want to have a generic variable that
> will hold a reference to one of the lists.
> @docTypes(ref_to_doc1, ref_to_doc2)
> $temp = @docType[0];
> print "$temp{title}\n";
@docTypes = (\%doc1, \%doc2);# read as (ref_to_doc1, ref_to_doc2)
$temp = $docType[0];
print "$temp->{title}\n";
perldsc will definately be of use to you. Check out the section, 'LISTS
OF HASHES'.
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: 17 Dec 1998 04:23:54 GMT
From: <mikane@shell3.ba.best.com>
Subject: asterisk in subroutine parameter list
Message-Id: <3678875a$0$198@nntp1.ba.best.com>
What is the significance of "*" in the statement:
&widgets(*foo);
Mikane
------------------------------
Date: Wed, 16 Dec 1998 22:12:07 -0500
From: jamesht <jamesht@idt.net>
To: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: binmode
Message-Id: <36787687.9439B6C3@idt.net>
Here here!
------------------------------
Date: Wed, 16 Dec 1998 22:35:23 -0500
From: jamesht <jamesht@idt.net>
To: Henry Lifton <henlif@elsfl.com>
Subject: Re: Can this be done
Message-Id: <36787BFB.1A8D426F@idt.net>
Here you go:
my %land;
open(LAND, "land.file") || die "$!";
while(<LAND>) {
($id, @rest) = split('\|', $_);
$land{$id} = \@rest;
}
close LAND;
#
# now, %land holds keyed array references.
#
#
# get the data at will.
#
($add, $city, $etc) = @{$land{$id}};
that should do it.
James
------------------------------
Date: Thu, 17 Dec 1998 04:29:39 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Can this be done
Message-Id: <36788A6C.796C8844@home.com>
[posted & mailed]
jamesht wrote:
>
> Here you go:
>
> my %land;
> open(LAND, "land.file") || die "$!";
> while(<LAND>) {
> ($id, @rest) = split('\|', $_);
> $land{$id} = \@rest;
Oops, @rest is being given new values on each iteration of the loop but
$land{$id} contains the same reference to @rest for all values of $id.
Outside the loop, @{$land{$id}} will return the fields of the last line in
the file, regardless of what $id is.
You could declare @rest local to the while loop:
my ($id, @rest) = split /\|/;
$land{$id} = \@rest;
or use an anonymous copy:
$land{$id} = [@rest];
> }
> close LAND;
The former is probably faster since there is no copying. Also, since you're
going to have to declare all your variables anyway when you put 'use strict'
at the top of your program -- you will do this, right? -- you might as well
declare them in the while loop.
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Wed, 16 Dec 1998 18:58:32 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: counterintuitive behavior of "shift"
Message-Id: <MPG.10e2132ea7a7400298995f@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <759o7n$2f5@disco.cs.columbia.edu> on 16 Dec 1998 20:53:59 -
0500, Dragomir R. Radev <radev@news.cs.columbia.edu> says...
> $par1 = shift || 1;
> $par2 = shift || 2;
>
> print "$par1 $par2\n";
> ----------------------------------------------------------------------------
>
> % bla.pl 5 6
> % 5 6
> % bla.pl 0 6
> % 1 6 instead of "0 6"
>
> I find this logical from Perl's point of view, yet very
> counterintuitive and confusing.
Despite your title, this has nothing to do with the behavior of 'shift'
specifically. It has to do with the fact that 0, '0', "", and
*undefined* are all FALSE, so the second operand of the || is the value
of the expression.
The purpose of the code seems to be to supply a default value if there
is no argument. That could be written explicitly as, for example:
$par1 = 1 unless defined($par1 = shift);
$par2 = 2 unless defined($par2 = shift);
In any case, Perl's behavior isn't going to change, so "Love it or leave
it!" :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 16 Dec 1998 15:39:50 -0500
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: delete files
Message-Id: <36781A95.561187A2@cthulhu.demon.nl>
John Corbin wrote:
>
> I have a script i am working on that changes to a directory, iterates thru
> the files in that directory, reads the file and converts the data from all
> lowercase to all uppercase and writes the data to a new file, then I need to
> delete the file (with the all lowercase). Well I got everything to work
> except for the delete part. I tried;
>
> unlink("H:\\$dirname\\$FileName");
>
> and it doesn't do anything....I have a feeling that there is a file lock on
> that file for some time til it gets closed all the way, maybe?? I am on
> Windows NT 4, SP4 using perl 5
The unlink doesn't seem to work, so you add some code to generate a message
with an error message if unlink fails. eg:
unlink("H:\\$dirname\\$FileName") or
die "Could not delete H:\\$dirname\\$FileName: $!";
As far as I know Windows does implicit file locking.
Erik
------------------------------
Date: Thu, 17 Dec 1998 03:15:17 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Execute multi commands in one line
Message-Id: <36787900.61C8C6DB@home.com>
[posted & mailed]
mbrich@my-dejanews.com wrote:
>
> I sure my subject wasn't clear but here is goes: I have the following
> command that I wish to execute in a perl script.
>
> cvs status | $ grep 'Status:' | grep -v 'Up-to-date' | awk '{print $2}'
^
^
What's that doing there?
> Do I have to break this up into indivdual actions, or is there a way to
> do this using exec() or system().
You should be able to wrap either system or exec around that command. If
you insist on doing it that way, be sure to read the entries on system and
exec in perlfunc to make sure you use the right one for your purposes.
> I have tried with my limited knowledge but perls seems to stop after the
> first executable statement(i.e. cvs status).
What exactly did you try? Perhaps someone could help you out if you posted
the code that results in this behaviour.
Anyway, if you're going to use Perl then make your program more Perlish:
#!/usr/local/bin/perl -w
# This code is untested.
open(CMD, 'cvs status|') || die "Can't fork: $!\n";
while(<CMD>) {
next unless /Status:/;
next if /Up-to-date/;
chomp;
print (split)[1], "\n";
}
HTH.
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Wed, 16 Dec 1998 15:53:06 -0500
From: tabo <cswfrank@rica.net>
Subject: hashes
Message-Id: <36781DB2.26708A46@rica.net>
is there a way to get the number of items in a hash table?
--
Ezekiel 25:17
"The path of the righteous man is beset on all sides by the inequities
of the selfish and the tyranny of evil men. Blessed is he, who in the
name of charity and good will, shepherds the weak through the valley of
darkness, for he is truly his brother's keeper and the finder of lost
children. And I will strike down upon thee with great vengence and
furious anger those who attempt to poison and destroy my brothers. And
you will know my name is the Lord when I lay my vengence upon thee."
-Jules, Pulp Fiction
------------------------------
Date: Thu, 17 Dec 1998 04:51:31 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: hashes
Message-Id: <36788F96.5C100DE4@home.com>
[posted & mailed]
tabo wrote:
>
> is there a way to get the number of items in a hash table?
perldoc -f keys
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Wed, 16 Dec 1998 22:56:05 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Help with Win32 to Unix Porting
Message-Id: <1dk5hxy.loj5kve9msrbN@bay2-206.quincy.ziplink.net>
<expoinfo@globalexpos.co.nz> wrote:
> I have the following part of a script...
>
> I have Ported before, and find it usually a piece of cake, but this current
> script boggles me... Have a look
>
> print qq!
>
> <html>
>
> <title>Search Results for $search</title>
>
> <body bgcolor="#FFFFFF">
>
> <table border="0" cellpadding="0" cellspacing="0" width="550">
> <tr>
> <td valign="top" width="450">
> !;
>
>
>
>
> and i have ported it to this..
Why? That code would work fine on Unix as is. I don't understand what
you're trying to accomplish in this porting.
> print ("<html>\n<body>\n<table border=\"0\" cellpadding=\"0\"
> cellspacing=\"0\" width=\"550\"><tr><td valign=\"top\" width=\"450\">");
>
> Please Tell me What is wrong with the porting.. ans it seems to just block out
> after body.. and not do anything...
Well, you left out the bgcolor attribute in the body tag. Could that be
the problem?
You also took out all the whitespace used to format the output. It
should still work, but why would you bother removing the nice
formatting??
--
_ / ' _ / - 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: Wed, 16 Dec 1998 14:06:15 -0500
From: tabo <cswfrank@rica.net>
Subject: including other files
Message-Id: <367804A7.9668DE03@rica.net>
how do you include another file or a module? for instance, i have a
parsing subroutine written, and i want to have it included into all the
other script files and not have to copy and paste. i have tried to
include a version of cgi-lib.pl, and the script works fine at the
command line, but when i test it out on a server, it chokes. i run perl
5.004_02, on a win95b system. i run a test server of ZBSPro.
--
Ezekiel 25:17
"The path of the righteous man is beset on all sides by the inequities
of the selfish and the tyranny of evil men. Blessed is he, who in the
name of charity and good will, shepherds the weak through the valley of
darkness, for he is truly his brother's keeper and the finder of lost
children. And I will strike down upon thee with great vengence and
furious anger those who attempt to poison and destroy my brothers. And
you will know my name is the Lord when I lay my vengence upon thee."
-Jules, Pulp Fiction
------------------------------
Date: Thu, 17 Dec 1998 04:50:41 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: including other files
Message-Id: <36788F64.492985CC@home.com>
[posted & mailed]
tabo wrote:
>
> how do you include another file or a module?
perldoc -f use
perldoc -f require
perldoc perlmod
--
Rick Delaney
rick.delaney@shaw.wave.ca
------------------------------
Date: Thu, 17 Dec 1998 04:23:18 GMT
From: johngalt25@excite.com
Subject: Making the name of a var the contents of another
Message-Id: <75a0vk$q6c$1@nnrp1.dejanews.com>
Is it possible to make the name of a new variable out of the contents (a
string) of another?
This is what I have so far, which does not work, but should give the idea:
$oldstrvar = 'newname';
$"$oldstrvar" = 3;
print $newname;
Which would hopefully give the output of: 3
I am trying to have it select the var name dynamically, based on what it has
in the file.
Thanks!
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 16 Dec 1998 23:03:48 -0500
From: jamesht <jamesht@idt.net>
To: Erwann Chandon <echandon@yahoo.com>
Subject: Re: perl cgi script call from an applet
Message-Id: <367882A4.8C0A465A@idt.net>
Hi,
Are you sure that Java will allow an applet to connect to a server on the same
machine?
Otherwise, I can't imagine that perl's the problem. It wouldn't know who's
making the request, as long as it's being made properly.
James
------------------------------
Date: Wed, 16 Dec 1998 22:56:07 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Perl's in the dictionary
Message-Id: <1dk5ic5.1a77ky91rxc88wN@bay2-206.quincy.ziplink.net>
[posted and mailed]
Stewart C. Russell <stewart@ref.collins.co.uk> wrote:
> I'd just like to say that fourth edition of the Collins English
> Dictionary (ISBN 0-00-470453-3) has an entry for Perl. A competitor's
> title (which claims to include every word in standard current English)
> doesn't.
That's great, but I am somewhat skeptical that Perl is "standard
English".
Or does your dictionary also include entries on C++, COBOL, and Tcl?
--
_ / ' _ / - 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: Thu, 17 Dec 1998 17:15:53 +1300
From: Kelvin Price <kprice@cardinal.co.nz>
Subject: Re: Perl's in the dictionary
Message-Id: <36788579.FE27368E@cardinal.co.nz>
Stewart C. Russell wrote:
>
<snip>
> A completely transparent plug for our book? Maybe so, but we use Perl
> for many of our text management needs, so it deserved a mention.
So it's in because it's useful huh !? Does that mean Microsoft and
Windows are not in there ?!
( Light blue touch paper and stand well back 8-D )
------------------------------
Date: Wed, 16 Dec 1998 22:27:35 -0500
From: jamesht <jamesht@idt.net>
To: "Charles R. Thompson" <design@spam_raincloud-studios.com>
Subject: Re: Preventing 'Repost Form Data'
Message-Id: <36787A27.774DF4BE@idt.net>
Hello,
I believe that if you simply output the following from your script, the problem
will be solved:
"Location: a_place_which_when_refreshed_does_nothing_bad.html\n\n"
Then, make that location target provide the response page.
James
------------------------------
Date: Wed, 16 Dec 1998 22:56:08 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: sort it ?
Message-Id: <1dk5io1.1rnxvnb1e5tkn5N@bay2-206.quincy.ziplink.net>
Jim Fitzsimmons <jimbo@cgocable.net> wrote:
> text file looks like this, in the format of vendor, price 1, price2, price
> 3, price4....etc. :
>
> vendor1 99.00 98.00 299.00 300.00
> vendor2 89.00 94.00 299.00 300.00
> vendor3 99.00 14.00 299.00 300.00
This is just crying out for a Schwartzian Transform. This is documented
in perlfaq4, under "How do I sort an array by (anything)?" Since you
said you'd read the FAQ, I must assume that this entry was not clear to
you. Could you explain why you had trouble with it, so that we can
improve it?
Here is how you would sort your data using a Schwartzian Transform:
@vendors = <FH>; # or however you load the file into the array
$field = 1; # if you want to sort on the first price field
# (remember, the first index in an array is 0)
@vendors = map { [ (split " ", $_)[$field], $_ ] } @vendors;
# step 1: convert the data to a sortable form
# in this case, that means splitting the line, and getting
# a specific field
# use [] to create an anonymous array
# @vendors now contains a list of array refs
# each array ref points to a two-element array
# the first element is the field to sort on,
# and the second element is the original string
@vendors = sort { $a->[0] <=> $b->[0] } @vendors;
# step 2: sort the data
# remember, @vendors contains array refs
# so dereference $a and $b with ->
# and use [0] to get the first element; the field to sort on
# @vendors still contains a list of array refs
# but now they're sorted
@vendors = map { $_->[1] } @vendors;
# step 3: convert the data back to the original form
# remember, @vendors contains array refs
# so dereference $_ with ->
# and use [1] to get the second element; the original string
# the sort fields are numeric, so use <=> instead of cmp
# @vendors now contains the original strings, in sorted order!
And you can put all three steps together:
@vendors = map { $_->[1] }
sort { $a->[0] <=> $b->[0] }
map { [ (split " ", $_)[$field], $_ ] } @vendors;
Hope that helps!
--
_ / ' _ / - 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: Thu, 17 Dec 1998 04:35:29 GMT
From: jett1not@homedot.com (JT)
Subject: Re: Writing Perl with Notepad <shameluss plug>
Message-Id: <367a79ce.12488500@news>
On 16 Dec 1998 18:58:32 PST, BMan@concentric.net (B. Mann) wrote:
>If you use MS write, and save as a text file, it usually comes out
>fine. Occassionally, not. Just do a tr from linux to be sure. It
>works fine for me. Vi is fine as far as I'm concerned, but, working
>in windows can be mighty convenient.
>
>dragons@scescape.net (Matthew Bafford) wrote:
>
>->In article <36730C4B.D0A1B217@technologist.com>, evanp@technologist.com
>->says...
>->=> This is a multi-part message in MIME format.
>->=> --------------31C935D452E45C802F4A6D88
>->=> Content-Type: text/plain; charset=us-ascii
>->=> Content-Transfer-Encoding: 7bit
>
>->Please don't do that.
>
>->=> I have no problems writing Perl scripts with vi. Yesterday though, I
>->=> tried to write a script with Notepad but after I saved it on Linux and
>->=> tried to execute it gave me an error complaining about linefeeds or
>->=> something like that. Can I use Notepad or different windows editor
>
>->Something like that?
>
>->=> for script writing? I have a class of high school students and using
>->=> vi is like pulling teeth.
>
>->Sure. You have to watch for (at least) two things when using a windows
>->editor:
>
>->1) Make sure the line endings are 'fixed'.
>->2) Make sure the last line, if the last line of a format or of a here-
>-> doc, has a blank line after it.
>
>->To get the proper line endings, either transfer as ASCII (when FTPing the
>->file).
>
>->Or:
>
>->Do a
>
>->perl -i -pe 'tr/\r//d;' files
>
>->from the Linux prompt.
>
>->=> --------------31C935D452E45C802F4A6D88
>->[snip VCARD]
>
>->Please don't do that, either.
>
>->=> Thanks,
>
>->HTH!
>
>->--Matthew
>
<Shameles Plug>
Try Textpad. It is the ultimate windows text editor, everything else
is junk.
http://www.textpad.com/
It's so good that it's scary, I won't even try to explain. Just go to
the website and grab a trial version - Unless you're bankrupt, you
will purchase it!
I have no affilliation with Helios Software Solutions, I just think
this is the best "no bullsh*t" package I've ever purchased for
Windows. It's paid for itself on almost a daily basis <literally> it
is very good - you'll never use Notepad again.
</Shameless Plug>
pardon the intrusion, talk amongst yourselves.
-JT
Remove the "not" and delete the "dot" to reply
jett1not@homedot.com
------------------------------
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 4444
**************************************