[16275] in Perl-Users-Digest
Perl-Users Digest, Issue: 3687 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jul 16 21:10:23 2000
Date: Sun, 16 Jul 2000 18:10:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <963796212-v9-i3687@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 16 Jul 2000 Volume: 9 Number: 3687
Today's topics:
Re: How can I print date on an include file <care227@attglobal.net>
Re: How can I print date on an include file <tony_curtis32@yahoo.com>
Re: How can I print date on an include file <john99@NOSPAMcanada.com>
Re: How can I print date on an include file <john99@NOSPAMcanada.com>
How to read and show 10 lines <nikitta@ica.net>
Re: Net::Smtp problems (jason)
Re: New beginner with execution problems <gwbr23144@cableinet.co.uk>
Re: parsing cronjob emails tony_barratt@my-deja.com
Re: Perl can't add ! (Logan Shaw)
Re: perl cgi that makes web pages from text file <bwalton@rochester.rr.com>
Re: Please criticise this text extraction script <rhys.tucker@dtn.ntl.com>
Search a string for < and replace it with < <raphaelp@nr1webresource.com>
Re: Search a string for < and replace it with < <ecco64@chello.nl>
Re: Search a string for < and replace it with < (jason)
Re: Search a string for < and replace it with < (Steven Smolinski)
Re: Search a string for < and replace it with < <raphaelp@nr1webresource.com>
Re: Search a string for < and replace it with < (jason)
Re: Search a string for < and replace it with < <raphaelp@nr1webresource.com>
Re: Search a string for < and replace it with < <tony_curtis32@yahoo.com>
Re: Search a string for < and replace it with < <?@?.?>
Re: Search a string for < and replace it with < <flavell@mail.cern.ch>
Re: Substitution with variables fvision@my-deja.com
Re: Substitution with variables (Keith Calvert Ivey)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 16 Jul 2000 18:11:40 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: How can I print date on an include file
Message-Id: <3972331C.97462D10@attglobal.net>
John wrote:
> I have a perl script running on my site.
> It has a feature that enables me to add headers and footers of my own.
> They look like this:
> sub Header { print qq!
> <head>
> <title>myheader</title>
> </head>
> <body>
> $date
> !;
> }1;
>
> Within the place where it says $date i would like to call my date
> program. It is also a perl script.
>
Backticks are your friend.
$date = `your_date_program`;
print $date;
------------------------------
Date: 16 Jul 2000 17:19:30 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: How can I print date on an include file
Message-Id: <87puod3eh9.fsf@limey.hpcc.uh.edu>
>> On Sun, 16 Jul 2000 21:52:39 GMT,
>> John <john99@NOSPAMcanada.com> said:
> Hello, I have a perl script running on my site. It has
> a feature that enables me to add headers and footers of
> my own. ...
> Within the place where it says $date i would like to
> call my date program. It is also a perl script.
See the entry for "qx" in "perldoc perlop".
> Does anyone one how can I implement this? SSI doesn't
> work.
I don't think SSI is relevant here.
Using POSIX::strftime and localtime might be a better way
of getting the date (without the overhead of a new shell
process).
hth
t
--
"With $10,000, we'd be millionaires!"
Homer Simpson
------------------------------
Date: Sun, 16 Jul 2000 23:48:37 GMT
From: John <john99@NOSPAMcanada.com>
Subject: Re: How can I print date on an include file
Message-Id: <397248D9.64127F68@NOSPAMcanada.com>
Thank you very much.
I had tried exactly what you've suggested before but at that time I had
quotes instead of backsticks.
It now works flawlessly.
Thanx again
Drew Simonis wrote:
>
> John wrote:
>
> > I have a perl script running on my site.
> > It has a feature that enables me to add headers and footers of my own.
> > They look like this:
> > sub Header { print qq!
> > <head>
> > <title>myheader</title>
> > </head>
> > <body>
> > $date
> > !;
> > }1;
> >
> > Within the place where it says $date i would like to call my date
> > program. It is also a perl script.
> >
>
> Backticks are your friend.
>
> $date = `your_date_program`;
> print $date;
------------------------------
Date: Sun, 16 Jul 2000 23:49:52 GMT
From: John <john99@NOSPAMcanada.com>
Subject: Re: How can I print date on an include file
Message-Id: <39724925.1BE5824E@NOSPAMcanada.com>
Thank you for your response, I've solved the problem.
I should find a good perl5 book that I can afford.
Regards
Tony Curtis wrote:
>
> >> On Sun, 16 Jul 2000 21:52:39 GMT,
> >> John <john99@NOSPAMcanada.com> said:
>
> > Hello, I have a perl script running on my site. It has
> > a feature that enables me to add headers and footers of
> > my own. ...
>
> > Within the place where it says $date i would like to
> > call my date program. It is also a perl script.
>
> See the entry for "qx" in "perldoc perlop".
>
> > Does anyone one how can I implement this? SSI doesn't
> > work.
>
> I don't think SSI is relevant here.
>
> Using POSIX::strftime and localtime might be a better way
> of getting the date (without the overhead of a new shell
> process).
>
> hth
> t
> --
> "With $10,000, we'd be millionaires!"
> Homer Simpson
------------------------------
Date: Sun, 16 Jul 2000 19:33:24 -0700
From: nikita <nikitta@ica.net>
Subject: How to read and show 10 lines
Message-Id: <39727074.927F1E41@ica.net>
Hi everybody.
I need your help
How to force the program read and show only, in my case, 10 lines of a
database
and then continue until all database are shown?
This fragment of program counts 10 lines of a database and stops.
How to continue next 10 lines until all the database will be shown?
First time $counter is at 0. How can I overwrite the value 0 of the
$counter in $start_number, in my case this is 10?
Thanks in advance,
Serguei
# a flat data is written in $filename in this way:
#
"($num,$one,$two,$line1,$line2,$line3,$three,$four,$five,$six,$seven,\n";
#=======================================================================
$display_num = 10;
&get_number;
print "<table >\n";
print "<tr><td><form action=\"$main_script\" method = \"post\">\n";
print "<input type= \"hidden\" name =\"begin\" value =
\"$start_number\">
print "<input type= \"hidden\" name =\"end\" value = \"$stop_number\">
print "<input type= \"submit\" value = \">>>>\">\n"
print "<b>Found: $start_number - $stop_number from
$num_display<\b></form>\n";
print "</td></tr></table>\n";
#========================================================================
sub get_number {
open(FDATA,"$filename") || die $!;
chomp(@datafile = <FDATA>);
close(FDATA);
my $num_display = @datafile;
my $counter = 0;
my $start_num = $counter;
my $stop_num = $counter + $display_num;
if ($stop_num > $num_display ) {
$stop_num = $num_display;
}
foreach (@datafile) {
my @data = split /\|/;
my $number = shift(@data);
if ($number != 0) {
&write data;
$counter++;
until ($counter == $stop_num);
}
return ($num_display, $start_num, $stop_num);
}
------------------------------
Date: Sun, 16 Jul 2000 22:48:35 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: Net::Smtp problems
Message-Id: <MPG.13dcd911e03686cb9896c3@news>
deno wrote ..
>See the original question which started the topic and you'll see
>the script.
read up on how usenet works and you'll realise that not everyone will
necessarily HAVE the original question which started the topic
just include the relevant parts of what you're replying to and your
posts will be read and understood
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Sun, 16 Jul 2000 22:38:18 GMT
From: Bungy Williams <gwbr23144@cableinet.co.uk>
Subject: Re: New beginner with execution problems
Message-Id: <397239DE.604F82FD@cableinet.co.uk>
Firstly, check that perl is in your path. In the dos window type:
perl -v
If perl is in your path you should get a screen of information giving the
version.
If you still get an error, you need to extend your PATH variable in you
autoexec.bat.
If you need any further help, let me know and I will send you an example of
an autoexec.bat
Bungy
Stefan Jonsson wrote:
> Hi! I am a newbeginner on Perl programming. How do I execute an
> Perlprogram - from the doswindow by writing "perl helloworld.pl" or how?
> When I do this i get a message "wrong commando or filename".
> I have installed the "Perl 5.6.0.616" - package on a Window 95 system and a
> AMD K6 200 mhz processor. I downloaded InstMsi.exe (Installer 1.1) to make
> it possible to install the "Perl 5.6.0.616" - package on to it, and the
> installation procedure runned smoth. What am I doing wrong?
------------------------------
Date: Sun, 16 Jul 2000 22:28:28 GMT
From: tony_barratt@my-deja.com
Subject: Re: parsing cronjob emails
Message-Id: <8ktctu$icf$1@nnrp1.deja.com>
Ah Yes. this will do:
From www.cpan.org
SYNOPSIS
use Mail::Audit;
my $mail = Mail::Audit->new;
$mail->pipe("listgate p5p") if ($mail->from =~ /perl5-porters/);
$mail->accept("perl) if ($mail->from =~ /perl/);
$mail->reject("We do not accept spam") if looks_like_spam($mail);
$mail->ignore if $mail->subject =~ /boring/i;
In article <8kt21q$b5o$1@nnrp1.deja.com>,
tony_barratt@my-deja.com wrote:
> I've compiled and installed procmail. It will as you suggest do the
job
> nicely. But it's a bit complex for what I want to do. It looks like
I'd
> need to use some procmail, some shellscripting some piping and some
perl
> coding. Which is OK but a bit challenging to maintain after I've moved
> on.
> Just perl would be good. A quick search of the Internet reveals that
> perl POP3 and SMTP could replace fetchmail (for simple requirements).
> I didn't find anything to replace procmail though.
> Maybe it can't be done?
>
> <wiser_now>
> thanks for the input so far..
>
> In article <nflc5.39424$fR2.361962@news1.rdc1.mi.home.com>,
> clintp@geeksalad.org (Clinton A. Pierce) wrote:
> > [Posted and mailed]
> >
> > In article <8kse6e$ts4$1@nnrp1.deja.com>,
> > tony_barratt@my-deja.com writes:
> > > Hi,
> > > I'd like to implement some perl code to react to incoming emails
to
> root
> > > and look for keywords like failed and generate an event if found.
> > > [...]
> > > But I'm not clear on how to react to emails. I expect there's a
hard
> way
> > > and a very hard way, but is there perhaps an easy way?
> >
> > A combination of Perl and a package called procmail will do this job
> > quite nicely. And easily. Search the fine web for both. :)
> >
> > --
> > Clinton A. Pierce Teach Yourself Perl in 24 Hours!
> > clintp@geeksalad.org for details see
> http://www.geeksalad.org
> > "If you rush a Miracle Man,
> > you get rotten Miracles." --Miracle Max, The Princess Bride
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 16 Jul 2000 17:11:32 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Perl can't add !
Message-Id: <8ktbuk$ksl$1@provolone.cs.utexas.edu>
In article <2O9c5.10477$tI4.832438@bgtnsc05-news.ops.worldnet.att.net>,
Kevin M. Sproule <kmsproule@worldnet.att.net> wrote:
>These results are similar to what you encountered. The errors creep in
>because computers are only capable of approximating the floating point
>values. It is necessary to use whole numbers or to round your results to
>keep things accurate.
Actually, it isn't the compiler. The folks who figured out how
computers were going to work were faced with a choice. Either (1) make
computers do all arithmetic correctly, or (2) make computers which can
do built-in arithmetic operations without literally taking forever.
They chose #1, which I think was the correct choice.
Let's imagine you want to work with the number 1/5. In decimal, this
happens to be easy. It's equal to 0.2. In binary, it's a bit tougher
because it's actually equal to
0.00110011001100110011001100110011001100110011001100110011001100110011
0011001100110011001100110011001100110011001100110011001100110011001100
1100110011001100110011001100110011001100110011001100110011001100110011
0011001100110011001100110011001100110011001100110011001100110011001100
1100110011001100110011001100110011001100110011001100110011001100110011
Except that I lied -- it's not equal to that because I haven't yet
typed "0011" enough times. I have to keep typing it forever if I want
an exact representation.
Anyway, the computer gets tired too and quits after some number of
digits. Let's assume it quits after 25 digits after the "decimal"
(actually binary) point. In that case, when you write 0.2, it actually
stores the number 0.199999988079071044921875. That's the best it can
do because the next closest number that can be represented with 25
fractional binary digits is 0.20000001788139343261718750.
So when you go adding 0.2 and 0.2 together, you get
0.0110011001100110011001100 in binary or 0.39999997615814208984375 in
decimal, which isn't exactly equal to 0.4.
But oh well, you can't write 0.4 in binary anyway so it was impossible
to get an answer back that was exactly 0.4.
So why do the numbers seem right some of the time? Well, some of the
time they are right. 1/4 and 3/16 can both be written exactly in a
finite number of binary digits. So if you add them, you'll get exactly
the right answer. Other times they seem right because you convert a
number like 0.2 into an approximation (in binary) and then when you
convert it back (to decimal), 0.2 is the closest decimal approximation
for your binary approximation. It just depends on the numbers you're
working with whether you luck out.
Another way of solving this problem is to have the computer work the
numbers as fractions. This completely eliminates the problem with
repeating decimals, but it has some of its own problems. It's slower,
you've got to have a library that supports it, and eventually if you
add enough fractions with different denominators, you'll get a least
common denominator that's bigger than the largest integer you can
store. (Try doing 1/2 + 1/3 + 1/5 + 1/7 + 1/11 + 1/13 + 1/17 + . . .;
there's no limit to how big the denominator can get.)
Binary isn't the problem either -- some numbers like (1/7) can't be
written in decimal without repeating digits. And even if you solved
the problem for fractions, somebody would complain that the square of
the square root of two doesn't come out to exactly two.
Moral: some arithmetic is always an approximation, and computers are no
exception.
- Logan
------------------------------
Date: Sun, 16 Jul 2000 22:27:13 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: perl cgi that makes web pages from text file
Message-Id: <397236FE.9DFE37DB@rochester.rr.com>
"Ðyl@ñ" wrote:
>
> Hi, I'm making a script that makes web pages from text files, what I don't
> know is how to tell to the cgi wich text file it has to use to make the web
> page.
>
> this is the link that I wanto to use to build the web page
> http://sito.com/script.cgi?fileA.txt
>
> thanks
>
> #!/usr/local/bin/perl
>
> print "Content-type: text/html\n\n" ;
>
> print <<EOF ;
> <html>
> <head><title>$title</title></head>
> <body>
>
> ||||||||| here should go the text file
>
> </body>
> </html>
> EOF
First, you are missing the line:
use CGI;
from the beginning of your script. Put that in and read the docs about
the CGI module. Your question will be answered.
--
Bob Walton
------------------------------
Date: Sun, 16 Jul 2000 23:43:33 +0000
From: rhys <rhys.tucker@dtn.ntl.com>
Subject: Re: Please criticise this text extraction script
Message-Id: <397248A5.756D0CDC@dtn.ntl.com>
Jonathan Stowe wrote:
>
> On Sat, 15 Jul 2000 18:07:45 +0000 rhys wrote:
> > I would be grateful for suggestions on how I could have done this better
> > (although I am pleased that I finally got it working at all).
> >
> > The objective is to extract email addresses from html pages - I have
> > already used it to email British members of parliament!.
> >
>
> Spam is evil, even against MPs.
>
<snip>
I'm very grateful for all responses - my Perl skills are improving.
I don't agree that emailing MPs is spam. The point about spam is that
it's unrequested. MPs accept that they will be contacted by
constituents, lobbyists and special interest groups. It's part of the
job and seems to be the foundation of that abstract concept called
representative democracy.
regards,
rhys
------------------------------
Date: Mon, 17 Jul 2000 00:26:25 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Search a string for < and replace it with <
Message-Id: <8ktd3n$u7r$17$1@news.t-online.com>
Hi guys,
Ok, I have no Idea with this but what I want to do is search the variable
$html_code for possible < codes (the string is about 10k in size) and
replace all the < with <. How do I do that in Perl?
Thanks in advance,
Raphael
------------------------------
Date: Sun, 16 Jul 2000 23:16:01 GMT
From: "Ecco" <ecco64@chello.nl>
Subject: Re: Search a string for < and replace it with <
Message-Id: <Rmrc5.397906$k22.1760581@flipper>
$html_code =~ s/</</g;
Just a wild guess, i'm a newbie... but this should do the trick I think...
--
-----------------------------------------------------
Click here for Free Video!!
http://www.gohip.com/free_video/
"Raphael Pirker" <raphaelp@nr1webresource.com> wrote in message
news:8ktd3n$u7r$17$1@news.t-online.com...
> Hi guys,
>
> Ok, I have no Idea with this but what I want to do is search the variable
> $html_code for possible < codes (the string is about 10k in size) and
> replace all the < with <. How do I do that in Perl?
>
> Thanks in advance,
>
> Raphael
>
>
------------------------------
Date: Sun, 16 Jul 2000 23:17:17 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: Search a string for < and replace it with <
Message-Id: <MPG.13dcdfc9d495b449896c5@news>
Raphael Pirker wrote ..
>Ok, I have no Idea with this but what I want to do is search the variable
>$html_code for possible < codes (the string is about 10k in size) and
>replace all the < with <. How do I do that in Perl?
from the command line run
perldoc perlop
and scroll down to "Regexp Quote-Like Operators"
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Sun, 16 Jul 2000 23:25:04 GMT
From: sjs@yorku.ca (Steven Smolinski)
Subject: Re: Search a string for < and replace it with <
Message-Id: <slrn8n4h32.bti.sjs@john.sympatico.ca>
Ecco <ecco64@chello.nl> wrote:
[...jeopardectomy...]
>"Raphael Pirker" <raphaelp@nr1webresource.com> wrote:
>> Ok, I have no Idea with this but what I want to do is search the variable
>> $html_code for possible < codes (the string is about 10k in size) and
>> replace all the < with <. How do I do that in Perl?
>
>$html_code =~ s/</</g;
^^^
This won't replace a single occurrence of '<' with anything.
>Just a wild guess, i'm a newbie... but this should do the trick I think...
Testing would have let you know for sure. It's not nice to make
people waste their time running down your wild guesses.
Steve
------------------------------
Date: Mon, 17 Jul 2000 01:25:30 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Re: Search a string for < and replace it with <
Message-Id: <8ktgjb$bnp$16$1@news.t-online.com>
> >$html_code =~ s/</</g;
> ^^^
>
> This won't replace a single occurrence of '<' with anything.
Actually it did...
Only that there was the ; missing:
$html_code =~ s/</</g;
> Testing would have let you know for sure. It's not nice to make
> people waste their time running down your wild guesses.
Well, it wasted 5 seconds... :-) Not knowing it at all would have wasted a
lot more!
------------------------------
Date: Sun, 16 Jul 2000 23:32:38 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: Search a string for < and replace it with <
Message-Id: <MPG.13dce36b303ff4ea9896c7@news>
Steven Smolinski wrote ..
>Ecco <ecco64@chello.nl> wrote:
>
>[...jeopardectomy...]
>
>>"Raphael Pirker" <raphaelp@nr1webresource.com> wrote:
>>> Ok, I have no Idea with this but what I want to do is search the variable
>>> $html_code for possible < codes (the string is about 10k in size) and
>>> replace all the < with <. How do I do that in Perl?
>>
>>$html_code =~ s/</</g;
> ^^^
>
>This won't replace a single occurrence of '<' with anything.
actually - it will replace all occurences of '<' with '<;' ..
certainly not what the originator wanted (but that's nothing new for
Ecco)
>>Just a wild guess, i'm a newbie... but this should do the trick I think...
>
>Testing would have let you know for sure. It's not nice to make
>people waste their time running down your wild guesses.
Ecco is quickly gaining the reputation for posting completely out of
place responses that have either entirely missed the point - or produce
more errors that they're worth .. or both
there's a time to teach and a time to learn
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Mon, 17 Jul 2000 01:43:07 +0200
From: "Raphael Pirker" <raphaelp@nr1webresource.com>
Subject: Re: Search a string for < and replace it with <
Message-Id: <8kthlb$v5g$17$1@news.t-online.com>
> there's a time to teach and a time to learn
I'd say it's the will that counts, too! If the code would have been 100%
wrong, I would complain as well, but since there was only that one little
mistake... (which was probably a typo?)
------------------------------
Date: 16 Jul 2000 18:53:42 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: Search a string for < and replace it with <
Message-Id: <87lmz1ws1l.fsf@limey.hpcc.uh.edu>
>> On Sun, 16 Jul 2000 23:32:38 GMT,
>> elephant@squirrelgroup.com (jason) said:
> Steven Smolinski wrote ..
>> Ecco <ecco64@chello.nl> wrote:
>>
>>> $html_code =~ s/</</g;
>>
>> This won't replace a single occurrence of '<' with
>> anything.
> actually - it will replace all occurences of '<' with
> '<;' .. certainly not what the originator wanted (but
> that's nothing new for Ecco)
Yes, but that's an incomplete description, as it will also
replace a terminal "<" with "<".
http://search.cpan.org/search?dist=HTML-Parser
might be a good thing to try (HTML::Entities)
> Ecco is quickly gaining the reputation for posting
> completely out of place responses that have either
> entirely missed the point - or produce more errors that
> they're worth .. or both
Getting to be a trend round these parts...
hth
t
--
"With $10,000, we'd be millionaires!"
Homer Simpson
------------------------------
Date: Mon, 17 Jul 2000 00:00:40 GMT
From: "NightWish" <?@?.?>
Subject: Re: Search a string for < and replace it with <
Message-Id: <I0sc5.398065$k22.1760762@flipper>
Backoff Jason, he was just trying to help, and he did a hell of a lot more
than you did, so go bother your mom!
------------------------------
Date: Mon, 17 Jul 2000 01:52:13 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Search a string for < and replace it with <
Message-Id: <Pine.GHP.4.21.0007170149050.13639-100000@hpplus03.cern.ch>
On Sun, 16 Jul 2000, Ecco wrote:
> Just a wild guess,
Please don't: there's more than enough mess around here that the
regulars feel they have to clean up (and thus waste time where they
could otherwise be helping us).
> i'm a newbie...
gosh, as if that hadn't been obvious.
Stick around, keep reading. Just reading, for the time being.
------------------------------
Date: Sun, 16 Jul 2000 22:59:36 GMT
From: fvision@my-deja.com
Subject: Re: Substitution with variables
Message-Id: <8kteoh$jpe$1@nnrp1.deja.com>
In article <39751be2.4698795@news.newsguy.com>,
kcivey@cpcug.org (Keith Calvert Ivey) wrote:
> fvision@my-deja.com wrote:
>
> >@commands = $line =~ /regularexpression/gi;
> >
> >foreach $command (@commands) {
> > $result = &getresult($command);
> > $line =~ s/$command/$result/;
> >}
>
> Why not just
>
> $line =~ s/(regularexpression)/getresult($1)/gie;
>
> ? The way you're doing it might make substitutions within the
> results of previous commands rather than where you're expecting.
I see what you mean. This would work well. I did however find the
solution to the problem that I was having and feel really stupid. I had
actually left off the "$" on "$line" so I was looking for the error in
entirely the wrong place. When I retyped the snippit for the news post I
typed it correctly but did not on my code that is on the server. Go
figure.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 17 Jul 2000 00:10:37 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: Substitution with variables
Message-Id: <397a4d67.17377951@news.newsguy.com>
fvision@my-deja.com wrote:
>I see what you mean. This would work well. I did however find the
>solution to the problem that I was having and feel really stupid. I had
>actually left off the "$" on "$line" so I was looking for the error in
>entirely the wrong place. When I retyped the snippit for the news post I
>typed it correctly but did not on my code that is on the server. Go
>figure.
If your program had "-w" and "use strict;" (as often recommended
on this group and elsewhere), then Perl would have told you
about the missing $. It was interpreting the bareword "line" as
a string constant, which can't be modified. Let Perl help you
catch errors.
Also, if you'd copied and pasted from your program into your
message, then we wouldn't have spent time looking at a program
that didn't contain the critical error. It's very easy to type
what you think is there rather than what's really there. Please
copy and paste in the future.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 V9 Issue 3687
**************************************