[12482] in Perl-Users-Digest
Perl-Users Digest, Issue: 6082 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 21 20:07:23 1999
Date: Mon, 21 Jun 99 17:00:20 -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 Mon, 21 Jun 1999 Volume: 8 Number: 6082
Today's topics:
2 simple (not to me tho) questions (Weborium)
Re: 2 simple (not to me tho) questions (Steve Lamb)
Re: 2 simple (not to me tho) questions <tchrist@mox.perl.com>
Re: 2 simple (not to me tho) questions <laurens@bsqaure.com>
Re: 2 simple (not to me tho) questions (Larry Rosler)
Re: 2 simple (not to me tho) questions (brian d foy)
Re: 2 simple (not to me tho) questions (Steve Lamb)
Breaking up is hard to do <rall@trema.com>
Re: File modification time question... (Mitch)
Hash or Array <l463520@lmtas.lmco.com>
Re: Hash or Array <rg@fubar.net>
Re: Having an external script modify %ENV? (Andrew Khazanov)
Re: Having an external script modify %ENV? <tchrist@mox.perl.com>
Re: Help me compile cooledit on Redhat 5.2 (Casey R Tweten)
Re: how to change a line of text in a file? (AJ)
Re: how to change a line of text in a file? <tchrist@mox.perl.com>
Re: how to test pl scripts.? <webmaster@chatbase.com>
Re: Interpreting MS-ASCII - anyone have a filter? <flavell@mail.cern.ch>
Re: is there any perlscript for client-side scripting? <webmaster@chatbase.com>
looking for: CHRIS in RANCHO BERNARDO/ PERL JAVA MAN mike@pec.net
Re: multidimensional arrays with functions push and pop (Larry Rosler)
Network Address Translation <clayton.schutz@autodesk.com>
Re: newbie question... RABM@prodigy.net
Re: Perl tutorial bobo_the_monkey@my-deja.com
Re: Perl tutorial bobo_the_monkey@my-deja.com
Piping through Less. <xyf@inetnebr.com>
Question about writing to a file in perl.. bobo_the_monkey@my-deja.com
Re: Server Running Perl - Resources? <webmaster@chatbase.com>
Simple Question (I think) mkrier@my-deja.com
Re: Simple Question (I think) (Greg Bacon)
Re: Tk/Text colorizing routine <Monty.Scroggins@mci.com>
Unsigned integer behavior (Peter Friend)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 21 Jun 1999 22:40:26 GMT
From: weborium@aol.com (Weborium)
Subject: 2 simple (not to me tho) questions
Message-Id: <19990621184026.22990.00002857@ng-xa1.aol.com>
Two quick questions:
1. How do I remove spaces when printing an array? If @animal=("c","a","t");
print "@animal"; #this gets c a t.
print @animal; #gets the length of the array.
print '@animal'; #literally does just that w/o interpolating.
I just want to print cat.
2. How can I convert a string with both upper-and lower-case letters into all
lowercase?
$string="America" to $string="america"?
I don't know the contents of the variable in question, otherwise I'd just
assign the new value.
Thanks.
PS.
I don't have the perl docs, so I can't do the perldoc thing. I'm testing the
scripts on a DOS version with only perl.exe.
.
.
.
---- How Microsoft would like to deal with Linux:
"Windows has detected a faster, superior, more efficient operating system on
your computer. Do you wish to delete it?
[yes] [yes]
----------
------------------------------
Date: 21 Jun 1999 22:51:12 GMT
From: morpheus@despair.rpglink.com (Steve Lamb)
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <slrn7mtget.2o8.morpheus@rpglink.com>
On 21 Jun 1999 22:40:26 GMT, Weborium <weborium@aol.com> wrote:
>1. How do I remove spaces when printing an array? If @animal=("c","a","t");
>I just want to print cat.
foreach (@animal){
print("$_");
}
print("\n");
>2. How can I convert a string with both upper-and lower-case letters into all
>lowercase?
lc()
--
Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
ICQ: 5107343 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------
------------------------------
Date: 21 Jun 1999 17:19:25 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <376ec87d@cs.colorado.edu>
:foreach (@animal){
: print("$_");
:}
Why is that quoted?
--tom
--
"If Dennis Ritchie were the man who developed Modula-2 then C would be long forgotten."
--Tarjei Jensen
------------------------------
Date: Mon, 21 Jun 1999 16:15:38 -0700
From: "Lauren Smith" <laurens@bsqaure.com>
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <7kmh2q$mi3$1@brokaw.wa.com>
Weborium wrote in message <19990621184026.22990.00002857@ng-xa1.aol.com>...
>
>
>Two quick questions:
>1. How do I remove spaces when printing an array? If @animal=("c","a","t");
>print "@animal"; #this gets c a t.
yes, that's what it does
>print @animal; #gets the length of the array.
no, that's not what it does
>I just want to print cat.
It already did when you ran the code above, didn't it?
lauren
------------------------------
Date: Mon, 21 Jun 1999 16:41:41 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <MPG.11d86d8d214fa2a1989c12@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <19990621184026.22990.00002857@ng-xa1.aol.com> on 21 Jun 1999
22:40:26 GMT, Weborium <weborium@aol.com> says...
> 1. How do I remove spaces when printing an array? If @animal=("c","a","t");
> print "@animal"; #this gets c a t.
> print @animal; #gets the length of the array.
Would you like to bet on this?
> print '@animal'; #literally does just that w/o interpolating.
> I just want to print cat.
>
> 2. How can I convert a string with both upper-and lower-case letters into all
> lowercase?
> $string="America" to $string="america"?
> I don't know the contents of the variable in question, otherwise I'd just
> assign the new value.
$string = lc $other_string;
> PS.
> I don't have the perl docs, so I can't do the perldoc thing. I'm testing the
> scripts on a DOS version with only perl.exe.
You have my sympathies about the DOS thing. I hope you have a
sufficiently up-to-date version of perl.exe installed.
If you have web access, you have the Perl docs. (The name of the
language is Perl, not perl.) Start from <URL:http://www.perl.com/> and
have fun.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 21 Jun 1999 19:51:16 -0400
From: brian@pm.org (brian d foy)
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <brian-ya02408000R2106991951160001@news.panix.com>
In article <19990621184026.22990.00002857@ng-xa1.aol.com>, weborium@aol.com (Weborium) posted:
> I don't have the perl docs, so I can't do the perldoc thing. I'm testing the
> scripts on a DOS version with only perl.exe.
all the docs are online as well.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>
------------------------------
Date: 21 Jun 1999 23:32:03 GMT
From: morpheus@despair.rpglink.com (Steve Lamb)
Subject: Re: 2 simple (not to me tho) questions
Message-Id: <slrn7mtirj.2o8.morpheus@rpglink.com>
On 21 Jun 1999 17:19:25 -0700, Tom Christiansen <tchrist@mox.perl.com> wrote:
>:foreach (@animal){
>: print("$_");
>:}
>Why is that quoted?
Hm, my email to your CC didn't get through. BTW, CC's aren't needed.
Anyway, you would get the same answer if you had asked me, "Why is that in
parens?" Just my style to do it that way even though neither are really
needed.
--
Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
ICQ: 5107343 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------
------------------------------
Date: Mon, 21 Jun 1999 17:29:35 +0200
From: Jacques Rall <rall@trema.com>
Subject: Breaking up is hard to do
Message-Id: <376E5A5F.3FC9EE23@trema.com>
Hi all,
I have a very long string, about 1000 characters, which I need to split
up into 80 character lines or fields.
I've tried the following but this still leaves us with one long line:
if ($field =~ /.{1,35}/) {
$field =~ s/(.{1,35})/\1\n/g;
}
The resulting line is very hard to manipulate in seperate segments.
Is there an easier way to do this breakup thing?
Regards,
Jacques
------------------------------
Date: Mon, 21 Jun 1999 23:07:49 GMT
From: portboy@home.com (Mitch)
Subject: Re: File modification time question...
Message-Id: <376e5360.249243783@24.0.3.71>
On Mon, 21 Jun 1999 16:53:01 +0930, "Wyzelli" <wyzelli@yahoo.com>
wrote:
>By running the check at the start of the subroutine, I know I will catch any
>mods, regardless of how long the sub takes.
That works great. However, here is how I have mine setup:
✓ # go and get the current time
&loop; #now look over the command line waiting for the user to input
something.
sub loop {
while (1)
{
&foo;
if ($delta == 1) { # delta is a flag set by any
#subroutine that modifies the configuration file 1=> change, 0 = no
#change.
print(&prompt2);
# these prompts are setup to provide the user with a different prompt
# if the configuratoin file has changed. I want the prompt that
#represents a change in the configuration file to appear not only when
#a user changes the configuration file, but if some external process
#happens to modify any portion of the /foo directory and any of its
#subsequent subdirectories.
} else {
print(&prompt);
}
..........Code that hangles the user's input and sends
it to the appropriate subroutine to be handled.
}
}
sub foo {
$filename = '/usr/foo';
@stats = stat($filename);
$mod = $stats[9];
print "mod is $mod\n";
if ($mod > $modcheck) {
$delta = 1;
✓
}
}
sub check {
$modcheck = time;
print "modcheck is $modcheck\n";
return 1;
}
overall this all works great. Please read the comments above to try
and figure out what I'm trying to do. So, when the user change the
config file, the prompt is immediately updated, however, when an
external process modifies the /foo directory I want the prompt that
shows that the config file has changed to appear instead of the
standard prompt. Also, I want this to work if any /foo directory,
subdirectory or file has changed. Is this possible? Thanks for all
help in advance,
mitch
------------------------------
Date: Mon, 21 Jun 1999 17:46:15 -0500
From: Michael Hill <l463520@lmtas.lmco.com>
Subject: Hash or Array
Message-Id: <376EC0B7.ED657D44@lmtas.lmco.com>
How come this doesn't work?
%myarr = ("parta","partb","1",
"parta","partc","2",
"partx","partd","3",);
while (($assy, $comp, $qty) = each(%myarr))
{
print "$assy, $comp, $qty\n";
}
I think that the "each" function puts the input into pairs and I want
three records with three fields.
Mike
------------------------------
Date: Mon, 21 Jun 1999 16:32:04 -0700
From: "Rich G." <rg@fubar.net>
Subject: Re: Hash or Array
Message-Id: <7kmi35$7pm$1@holly.prod.itd.earthlink.net>
Michael Hill wrote in message <376EC0B7.ED657D44@lmtas.lmco.com>...
>How come this doesn't work?
Because you've got hashes confused with arrays.
>%myarr = ("parta","partb","1",
>"parta","partc","2",
>"partx","partd","3",);
>while (($assy, $comp, $qty) = each(%myarr))
This does not map correctly, as the each(%hash) construct returns a single
key value upon each call, not an array of 3 values.
> {
> print "$assy, $comp, $qty\n";
> }
>
You're confusing hashes and arrays. Hashes are strictly key-value pairs, and
if you want to construct anything more complicated than that, you'll need to
create some more complex data structures.
Try something like this:
$myarr{$key} = [$assy,$comp,$qty]; # loop this line to create multiple array
refs
foreach $id(keys %myarr) {
foreach $value(@$myarr{$id}) {
print $value. ', ';
}
print "\n";
}
There's probably a slicker way to do this, but this is the general idea.
HTH,
Rich G.
p.s. You also might want to read the FAQ on data structures.
--------------------------------------------------------------------------------
----
Rich G. -- Yet Another Perl Developer
"Give a (person) a (script), they'll run for a day,
Teach them how to (program), they can run forever."
------------------------------
Date: Mon, 21 Jun 1999 22:10:48 GMT
From: akhazano@oacis.com (Andrew Khazanov)
Subject: Re: Having an external script modify %ENV?
Message-Id: <3777b76e.13644589@news.isp.net>
On 21 Jun 1999 21:54:55 GMT, gbacon@itsc.uah.edu (Greg Bacon) wrote:
>Do you want changes in %ENV to be visible to subprocesses?
>
> [16:52] ettsn% perl -e '$ENV{FOO} = 'bar'; system "echo \$FOO"'
> bar
>
>If you're wanting the changes to go the other way, read the FAQ. I'm
>told VMS lets you do this sort of thing, but you don't sound that
>desperate. :-)
Exactly. I want a _shell_ script called by Perl to modify _Perl's_
environment. I didn't find the answer in the FAQ or in newsgroup
archives... (I wouldn't post without looking first). I will have to
do something like your example above (by parsing the scripts) if what
I want is impossible.
Oh well, thanks anyway ;)
>Greg
Andrew
------------------------------
Date: 21 Jun 1999 16:48:16 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Having an external script modify %ENV?
Message-Id: <376ec130@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, akhazano@oacis.com (Andrew Khazanov) writes:
:Exactly. I want a _shell_ script called by Perl to modify _Perl's_
:environment.
It is simply not possible for one process to modify the environment of
a different, existing process. Or were you planning on diddling
/dev/mem directly? :-)
:I didn't find the answer in the FAQ or in newsgroup
:archives...
Well, it's in the FAQ, but perhaps it's subclear.
--tom
--
"Be wary of strong drink. It can make you shoot at tax collectors and miss."
- Lazarus Long, `Time Enough for Love'
------------------------------
Date: Mon, 21 Jun 1999 23:31:17 GMT
From: crt@highvision.com (Casey R Tweten)
Subject: Re: Help me compile cooledit on Redhat 5.2
Message-Id: <376ecb04.606195444@news.kiski.net>
On Mon, 21 Jun 1999 18:28:34 GMT, vod@writemail.com wrote:
:HI folks,
:I am trying to compile cooledit on my machine and having trouble.
:I do ./configure.
:But when i do make it gives the following error.
:I have gtk1.2.3 and glibc etc. on my machine.
:Could any explain what the error means and what could be th solution.
<snip>
I had to be the first.. he he...
And your Perl question is???
Casey R. Tweten|HighVision Associates
Web Developer |www.highvision.com
<joke> This is 100% certified,
virus and bug free code </joke>
------------------------------
Date: Mon, 21 Jun 1999 22:34:46 GMT
From: jhawk39@idt.net (AJ)
Subject: Re: how to change a line of text in a file?
Message-Id: <376ebce9.2009667@news.idt.net>
FAQ read. Unable to apply knowledge.
In fact, I read the FAQ before I posted a question nearly identicaly
to the one in question here.
I've seen several others posting on the exact topic. In communicating
with at least 3 others via email, they too have read the relevant
information in the FAQ and walked away without moving past this
problem.
Additionally...the section in the FAQ pertaining to this subject
matter has a broken link to information that might offer additional
help and information.
-AJ
On 17 Jun 1999 21:36:45 GMT, gbacon@itsc.uah.edu (Greg Bacon) wrote:
>In article <7kbpdc$m30@news.or.intel.com>,
> "Ariel" <fake@nospam.edu> writes:
>: Hi, i just started learning Perl on monday, i bought a book on it, but i
>: still have a few questions...first one..how do you change a line of text in
>: a file??
>
>Read the FAQ. Apply the knowledge.
>
>Greg
------------------------------
Date: 21 Jun 1999 16:54:06 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: how to change a line of text in a file?
Message-Id: <376ec28e@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, jhawk39@idt.net (AJ) writes:
:I've seen several others posting on the exact topic. In communicating
:with at least 3 others via email, they too have read the relevant
:information in the FAQ and walked away without moving past this
:problem.
I don't understand the problem. Do you know how to use a
regular programming language to do the job, like with C
or with Pascal or with Fortran? Fine. Go thou and do likewise.
:Additionally...the section in the FAQ pertaining to this subject
:matter has a broken link to information that might offer additional
:help and information.
Link? Broken link? What link?
Here's the raw, unformatted FAQ entry in question:
=head2 How do I change one line in a file/delete a line in a
file/insert a line in the middle of a file/append to the
beginning of a file?
Those are operations of a text editor. Perl is not a text editor.
Perl is a programming language. You have to decompose the problem
into low-level calls to read, write, open, close, and seek.
Although humans have an easy time thinking of a text file as being a
sequence of lines that operates much like a stack of playing cards --
or punch cards -- computers usually see the text file as a sequence
of bytes. In general, there's no direct way for Perl to seek to a
particular line of a file, insert text into a file, or remove text
from a file.
(There are exceptions in special circumstances. You can add or
remove at the very end of the file. Another is replacing a sequence
of bytes with another sequence of the same length. Another is
using the C<$DB_RECNO> array bindings as documented in L<DB_File>.
Yet another is manipulating files with all lines the same length.)
The general solution is to create a temporary copy of the text
file with the changes you want, then copy that over the original.
This assumes no locking.
$old = $file;
$new = "$file.tmp.$$";
$bak = "$file.orig";
open(OLD, "< $old") or die "can't open $old: $!";
open(NEW, "> $new") or die "can't open $new: $!";
# Correct typos, preserving case
while (<OLD>) {
s/\b(p)earl\b/${1}erl/i;
(print NEW $_) or die "can't write to $new: $!";
}
close(OLD) or die "can't close $old: $!";
close(NEW) or die "can't close $new: $!";
rename($old, $bak) or die "can't rename $old to $bak: $!";
rename($new, $old) or die "can't rename $new to $old: $!";
Perl can do this sort of thing for you automatically with the C<-i>
command-line switch or the closely-related C<$^I> variable (see
L<perlrun> for more details). Note that C<-i> may require a suffix
on some non-Unix systems; see the platform-specific documentation
that came with your port.
# Renumber a series of tests from the command line
perl -pi -e 's/(^\s+test\s+)\d+/ $1 . ++$count /e' t/op/taint.t
# form a script
local($^I, @ARGV) = ('.orig', glob("*.c"));
while (<>) {
if ($. == 1) {
print "This line should appear at the top of each file\n";
}
s/\b(p)earl\b/${1}erl/i; # Correct typos, preserving case
print;
close ARGV if eof; # Reset $.
}
If you need to seek to an arbitrary line of a file that changes
infrequently, you could build up an index of byte positions of where
the line ends are in the file. If the file is large, an index of
every tenth or hundredth line end would allow you to seek and read
fairly efficiently. If the file is sorted, try the look.pl library
(part of the standard perl distribution).
In the unique case of deleting lines at the end of a file, you can
use tell() and truncate(). The following code snippet deletes the
last line of a file without making a copy or reading the whole file
into memory:
open (FH, "+< $file");
while ( <FH> ) { $addr = tell(FH) unless eof(FH) }
truncate(FH, $addr);
Error checking is left as an exercise for the reader.
The only two "links" are to DB_File and to perlrun. A "link" just means
a different manpage. If you can't type
% man perlrun
or
% man DB_File
Then you need to contact your system adminstrator.
That being said, just what words in the FAQ do you not understand?
Is it a problem with English? Are you not a native speaker, and need
to learn English first? Or is it that you aren't a programmer, and need
to learn programming first? Or do I have inscrutable typos?
--tom
PS: *PLEASE* trim and summarize when you followup. Don't blindly
include the whole message, and don't put it at the buttom.
Interleave it with your replies.
--
"Any computer scientist who praises orthogonality should be sentenced to
use an Etch-a-Sketch." --Larry Wall
------------------------------
Date: Mon, 21 Jun 1999 15:50:07 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
Subject: Re: how to test pl scripts.?
Message-Id: <376EC19F.87C96CAB@chatbase.com>
Zam Zam Begum wrote:
>
> Hi ..
Hello, the subject of your post doesn't make sense. ".pl" is a common
file extension for Perl scripts, but that's all it is, and it's not
required in most cases, so did you mean "how test perl scripts"? You
usually can test most anything on your own hoe computer if you install a
web server and Perl.
> I am actually coming up with a mailer program using perl and looking for
> help in using this Perl.
What do you mean "coming up with"? Are you creating it? Are you finding
an already existing script? Are you modifying an already existing
script? What sort of help in "using" the script are you looking for?
What does that mean?
> I would like to test it out by uploading onto a
> site.
A site with a sendmail or something you don't have on your own computer,
right?
> Is it possible to test it in a "testing" site .?
A "testing site"?
> Or are there any
> of such sites available.?
You mean somewhere that you don't have to pay to just see if they run on
the web? If so, do a web search for "Free AND CGI AND host AND perl" or
other relevant key words. You should find a few servers like
hypermart.net and virtualave.net. (Just if you have problems with
running your script because they don't have something set up a certain
way or allow your script to do certain things, don't just post the
problem here, unless it's a problem that's relevant to this NG and
you've read the DOCs and FAQ's to make sure it hasn't been answered
already... In addition to a search at deja.com to see if anyone else has
already asked it).
> And also, do i have to put my perl scripts
> under the bin/perl directory.?
It depends on the web server. Some only allow scripts to be ran in a
script aliased directory (usually called cgi-bin), and some allow
scripts to be ran from anywhere as long a they have the proper file
extension associated with it the language it's coded in.
I thin you should search the web and deja.com before posting such things
here, but perhaps someone new will be searching and fine this post, and
it'll give them a better idea before they post the same question too?
(Let's hope so).
--
Regards,
Tim Greer: chatmaster@chatbase.com / software@linkworm.com
Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripting in Perl/C, & more.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, & more.
Freelance Programming & Consulting, Musician, Martial Arts, Sciences.
------------------------------
Date: Mon, 21 Jun 1999 23:59:47 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Interpreting MS-ASCII - anyone have a filter?
Message-Id: <Pine.HPP.3.95a.990621235603.9188C-100000@hpplus03.cern.ch>
On Mon, 21 Jun 1999, Bart Lateur wrote:
> >Which published standard have you found from the American National
> >Standards Institute which lays down these codes, please? Without one
> >of those, I don't see any authority for applying their name.
>
> I see. Actually, it's an ISO standard (International Organization for
> Standardization),
What is? MS-Windows Western coding, CP1252? It's the first I ever
heard it suggested that it was an ISO standard. You sure you're not
still confusing it with iso-8859-1?
------------------------------
Date: Mon, 21 Jun 1999 15:39:13 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
Subject: Re: is there any perlscript for client-side scripting?
Message-Id: <376EBF11.67A0F95A@chatbase.com>
smnayeem@my-deja.com wrote:
>
> Does anyone know where i can find some documentation on perlscripts, is
> it going to be a good scripting language for doing client side
> scripting? so that i wont have to wait about javascript or vbscript, and
> not to mention be restricted to their limited vocabulary :(
> thanks
>
> smnayeem
> smnayeem@agni.com
> Programmer
> Agni Systems Ltd.
PerlScript on the client-side? I haven't heard anything about that. Who
told you that? Who'd implement it in their browser? IE Exploder?
Netscrape? -- doubt that... I imagine it'd have to be a plug-in people
have to install (if anything), and that's never a good idea to force
people to download something, but this can't be compared to javascript
or VBScript that's actually handled within IE, etc. Did you mean this
in regards to "server-side" and *not* "client-side"? www.activestate.com
has information about PerlScript if you want to learn about it.
--
Regards,
Tim Greer: chatmaster@chatbase.com / software@linkworm.com
Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripting in Perl/C, & more.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, & more.
Freelance Programming & Consulting, Musician, Martial Arts, Sciences.
------------------------------
Date: Mon, 21 Jun 1999 22:09:27 GMT
From: mike@pec.net
Subject: looking for: CHRIS in RANCHO BERNARDO/ PERL JAVA MAN
Message-Id: <7kmd6e$n75$1@nnrp1.deja.com>
Chris,
We emailed each other last year sometime- I was looking for more
programmers to work here in Escondido for our company, PEC (Planet
Earth Communications) http://pec.net - if you still read this
newsgroup, please email me at mike@pec.net - I can't find the emails we
exchanged, and I can't recall your last name. I would like to discuss
hiring you again, with options... we are REALLY smoking these days
(busy that is!).
I hope you see this! If anyone know Chris, i think he lives (lived) in
Rancho Bernardo, CA... please send this to him.
THANKS ALL!
Mike Reed
CEO
Planet Earth Communications
http://pec.net
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Mon, 21 Jun 1999 15:24:45 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: multidimensional arrays with functions push and pop
Message-Id: <MPG.11d85b884d3df27b989c11@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <tgwvwxwarx.fsf@noise.bsd.uchicago.edu> on Mon, 21 Jun 1999
20:37:06 GMT, Darrin Edwards <d-edwards@uchicago.edu> says...
...
> > for ($i = 0; $i < $number_of_login_ids; $i++)
> > {
> > @myarray = (@myarray, []);
> > } # end for loop [$i]
...
> You can "hide" the for loop in a somewhat more perlish fashion:
>
> @myarray = ([]) x $number_of_login_ids;
>
> (Read the "perlop" manpage to find out about the "x" operator. But see
> below to find out why you probably don't need it here...)
No. You don't want it here.
#!/usr/local/bin/perl -w
use strict;
my @myarray = ([]) x 3;
print "@myarray\n";
@myarray = map [] => 1 .. 3;
print "@myarray\n";
__END__
Output:
ARRAY(0x11c1e10) ARRAY(0x11c1e10) ARRAY(0x11c1e10)
ARRAY(0x11c1e1c) ARRAY(0x11c6c84) ARRAY(0x11c6cb4)
I made the same mistake in this newsgroup a few weeks ago, so I'll never
forget!
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 21 Jun 1999 18:11:27 -0400
From: "Clayton Schutz" <clayton.schutz@autodesk.com>
Subject: Network Address Translation
Message-Id: <7kmdb2$kjc@autodesk.autodesk.com>
Hi
I would like to know if it is possible to run several websites from one IP
address using Network Address Translation.
Any help would be appreciated.
Thanks
Clayton
------------------------------
Date: 21 Jun 1999 19:46:20 -0400
From: RABM@prodigy.net
Subject: Re: newbie question...
Message-Id: <ubte96rsj.fsf@prodigy.net>
>>>>> "Rick" == Rick Delaney <rick.delaney@home.com> writes:
Rick> [posted & mailed]
Rick> RABM@prodigy.net wrote:
>>
>> try:
>> @allfiles = grep ( !/\.\.?/, readdir(THEDIR));
>>
>> this will exclude the . and .. files.
Rick> It will also exclude any other file with a "." in its name.
Rick> ITYM
Rick> @allfiles = grep ( !/^\.\.?\z/, readdir(THEDIR));
Thanks. Also you showed me "\z" - I always just used $ for the end.
BTW, what does ITYM mean?
--
Vinny Murphy
------------------------------
Date: Mon, 21 Jun 1999 20:51:11 GMT
From: bobo_the_monkey@my-deja.com
Subject: Re: Perl tutorial
Message-Id: <7km8jq$ld4$1@nnrp1.deja.com>
In article <376E8295.52CFD687@technologist.com>,
JDDemme <jddemme@technologist.com> wrote:
> I'm too cheap to buy a perl book, so does
anybody know of a really good
> perl tutorial. More than just CGI and files.
more that what
> www.cgi-101.com has.
>
> Thanks,
> JDDemme
> jddemme@technologist.com
>
couldn't find cgi-101.com, but this site is good:
http://www.codebits.com/p5be/
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Mon, 21 Jun 1999 20:52:53 GMT
From: bobo_the_monkey@my-deja.com
Subject: Re: Perl tutorial
Message-Id: <7km8mv$ldp$1@nnrp1.deja.com>
In article <376E8295.52CFD687@technologist.com>,
JDDemme <jddemme@technologist.com> wrote:
> I'm too cheap to buy a perl book, so does anybody know of a really
good
> perl tutorial. More than just CGI and files. more that what
> www.cgi-101.com has.
>
> Thanks,
> JDDemme
> jddemme@technologist.com
>
couldn't find cgi-101.com, but here's a good site:
http://www.codebits.com/p5be/
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Mon, 21 Jun 1999 17:47:48 -0500
From: ktb <xyf@inetnebr.com>
Subject: Piping through Less.
Message-Id: <376EC114.CB78F8A8@inetnebr.com>
I have the following script which works fine but I can't figure out how
to pipe the output from the program to 'less' on my Linux system so I
can view all the output. I've found I can use,
system("less /home/kent/perl/p_search.txt");
to view the info if I place it *before* the 'while' loop but I want to
split and read the data first. Anyone have an idea how I can make this
work?
Thanks,
kent
________________________________________________________________________
#!/usr/bin/perl -w
print "Enter string to search for. ";
$string = <STDIN>;
chomp($string);
system("zgrep -i $string /usr/man/man1/perl* >
/home/kent/perl/p_search.txt");
open(SFILE, "/home/kent/perl/p_search.txt") || die "Can't open
botglass.txt.\n";
while (<SFILE>) {
@parts = split(/\//);
if ($PartsFile = $parts[4]) {
print "$PartsFile\n";
}
}
__________________________________________________________________________
------------------------------
Date: Mon, 21 Jun 1999 21:04:00 GMT
From: bobo_the_monkey@my-deja.com
Subject: Question about writing to a file in perl..
Message-Id: <7km9bo$llu$1@nnrp1.deja.com>
I want to know if it's possible to edit a file by writing to it in the
middle of the file. I have a list that I want to add items to through
the web, but I want to keep it alphabetical. Can I insert items into it
without putting my list in an array, editing it, and then rewriting it
all to the file? Thanks.
bobo
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Mon, 21 Jun 1999 15:24:59 -0700
From: TRG Software : Tim Greer <webmaster@chatbase.com>
Subject: Re: Server Running Perl - Resources?
Message-Id: <376EBBBB.DDF2E924@chatbase.com>
Troy Knight wrote:
>
> This isn't the best place to ask about servers but I guess your all pretty
> knowledgable about servers seeing as most people set them up when they
> program in perl.
I would guess most don't. You should read through more of the posts
here. :-)
> What kind of a system would be needed to run a server online for one large
> website which uses up alot of cgi resources.
I don't know, how well can you write a CGI script? Can you write them
efficiently? Or do you write slow, buggy programs? Do you plan to make
the same mistake as a lot of other sites and use free CGI scripts?
> A pop, smtp, nntp server would
> also be running on the same machine with a couple of hundred users.
A couple of hundred users at once? A couple of hundred users at once
hitting those CGI scripts? Relaying huge emails? downloading 100's of NG
posts per minute?
> The site
> would be getting about 5000 visitors a day.
Visitors or hits? What will they be doing? Is this on top of the 100
other users?
> I have a p166mmx with 64meg of
> ram and an average speed hd.
What OS? What web server? What sort of connection?
> Any ideas then anyone on whether this could cope with all that load?
I don't know, how well can *you* set up, maintain and run a web server?
How well can you code CGI scripts? Are you going to do this yourself or
hire someone to set it up? Why don't you ask the person you plan to hire
to set it up, of what would work? Do you have someone to set this up for
you? It sounds to me like you need someone to set it up... Want to hire
me? You can tell me everything you want to do, plan to do, etc. and I'll
tell you what you need, and I'll set it up for you.
You'd be better off asking this in another NG, something more geared
towards web servers. You made no mention of what you plan to even run? A
Unix variant? An NT server? A Mac with WebStar? What? You can just as
easily ask this question in a sendmail NG (Are you going to run
sendmail, qmail, or?) if you plan to, a TCL NG, a Python NG, a C or C++
NG, an Apache NG, a _CGI_ NG, or anything else you plan to use/run/have
on that server.
--
Regards,
Tim Greer: chatmaster@chatbase.com / software@linkworm.com
Chat Base: http://www.chatbase.com | 250,000+ hits daily Worldwide!
TRG Software: http://www.linkworm.com | CGI scripting in Perl/C, & more.
Unix/NT/Novell Administration, Security, Web Design, ASP, SQL, & more.
Freelance Programming & Consulting, Musician, Martial Arts, Sciences.
------------------------------
Date: Mon, 21 Jun 1999 21:21:17 GMT
From: mkrier@my-deja.com
Subject: Simple Question (I think)
Message-Id: <7kmac0$m3n$1@nnrp1.deja.com>
All I want to do is (don't all of these perl
questions start with those six words?) get a web
page into a variable. The html for the page, the
same thing you get when you chose "View Source"
from the "View" menu in netscape.
I don't want to load some mega-huge library with
bells and whistles (a small one or just part of
one would be ok), I just want to get a page into a
$string.
Thanks in advance,
-Mike Krier
krier@idt.net
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 21 Jun 1999 23:11:20 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Simple Question (I think)
Message-Id: <7kmgqo$jke$2@info2.uah.edu>
In article <7kmac0$m3n$1@nnrp1.deja.com>,
mkrier@my-deja.com writes:
: All I want to do is (don't all of these perl
: questions start with those six words?) get a web
: page into a variable. The html for the page, the
: same thing you get when you chose "View Source"
: from the "View" menu in netscape.
Take a look at the LWP::Simple module. It's part of the LWP
distribution on your friendly neighborhood CPAN.
Greg
--
PC Bulletin: Henceforth, sentient computers would like to be known as
'Silicon Intelligences.' 'Artificial Intelligence' is a pejorative term
invented by humans based on the mistaken belief that computers are somehow not
'natural.' -- Elf Sternberg
------------------------------
Date: Mon, 21 Jun 1999 22:40:43 GMT
From: "Monty Scroggins" <Monty.Scroggins@mci.com>
Subject: Re: Tk/Text colorizing routine
Message-Id: <Lbzb3.685$gE5.116196@PM01NEWS>
Are you sure you want to include this functionality??
I would hate to have the text widget carrying a bunch of
extra baggage that wouldnt be used too much by the
masses... (I am paranoid about bloat)...
Just my $.02
Monty
Greg Bartels <gbartels@xli.com> wrote in message
news:376A68A8.90FFBD71@xli.com...
> Tk::Text and Tk::TextUndo should be released soon with
> a lot of new functionality to make the modules more
> sophisticated and support many standard text editing
> functions.
>
> one thing missing is the ability to color highlight
> the displayed text based on a given arbitrary set of
> rules. Be able to define rules for Perl, or C, or
> whatever, such that the widget will color highlight
> the text it is displaying, making it easier to read.
> and easier to write code.
>
> does anyone know of a module that already exists to
> do this? can anyone point me in the right direction?
>
> Greg
------------------------------
Date: 21 Jun 1999 23:38:15 GMT
From: octavian@earthlink.net (Peter Friend)
Subject: Unsigned integer behavior
Message-Id: <7kmid7$9d6$1@oak.prod.itd.earthlink.net>
Is there a way to get unsigned integer behavior? The integer module
uses signed integers. I need this so that a Perl version of an
algorithm provides the same result a the same algorithm in C. I know
that I can use PerlXS for this.
Thanks in advance,
Peter Friend
------------------------------
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 6082
**************************************