[11005] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4605 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 9 16:07:19 1999

Date: Sat, 9 Jan 99 13: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           Sat, 9 Jan 1999     Volume: 8 Number: 4605

Today's topics:
    Re: "Email this page to a friend" script <design@raincloud-studios.com>
    Re: "internal server error" (Mark P.)
    Re: __FILE__, __LINE__ not set <design@raincloud-studios.com>
        ActivePerl on Win95 <jboyd99@hotmail.com>
    Re: c to perl <dgris@moiraine.dimensional.com>
    Re: Execute perl scripts on remote server <gellyfish@btinternet.com>
    Re: filename from a filehandle (Andrew M. Langmead)
        How do you run long scripts from a browser without send (Tommy1452)
        how to centre an awt frame? (spherie)
        How to equalize a variable to a string containing a @ <flip@nym.alias.net>
    Re: How to equalize a variable to a string containing a <due@murray.fordham.edu>
    Re: How to equalize a variable to a string containing a <gellyfish@btinternet.com>
        internal server error <msantull@dimensione.com>
        line-length limitations <framsing@unr.edu>
        make for win-32 system <wcatlan@bccom.com>
    Re: Perl 5.005 installation question <jhi@alpha.hut.fi>
    Re: Perl Criticism topmind@technologist.com
        Perl within Perl backslashxt@yahoo.com
    Re: Remove vars from a foreach loop <eugene@snailgem.org>
    Re: replacing <BR> with a physical carriage return (Andre L.)
    Re: using strict with CGI.pm <bdeitte@blue.weeg.uiowa.edu>
    Re: Windows NT  - FrontPage server --   CGI - perl scri (Jennifer Driller)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 9 Jan 1999 20:31:55 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: "Email this page to a friend" script
Message-Id: <778ebr$ae@bgtnsc03.worldnet.att.net>

Christopher Schulte wrote in message
<369dbce8.258308513@news.schulte.org>...
>Does anyone know of a script that will allow a website user to:
>
>1) be viewing a specific html file
>2) click on a link that says "email this page to a friend"
>3) enter their address, the friend's, and possibly a message
>4) have the page be sent to the specified person, with a static
>message added to the end of the email
>news.com has this option, on their news stories.  But I was curious if
>some kind of cgi system has been written to do this too?
>I have looked at various resource pages, but to no avail.


I've never done it, but can tell you the way it I would probably do it.

Use a form mail and just print the page in the message body. Problem is
the recepient would have to have an HTML capable email reader. Would be
better to just put the link to the page in the message body instead. But
if you want to mail the whole page, I would think when the user clicks
the 'mail it' button this is what would happen....

1) You grab the Referring URL (which would be your page in question)
2) Build an email (use a form mail script) with the captured email
addresses
3) Open the html file from your script... print it to the message body
either line by line for processing, or in one big gulp.
4) Close the file
5) Send the mail

I would probably make sure you have a BASE href for the html document or
use the full url for images so the email client can retrieve the images.

You might consider a checkox or radio button on the page to just send
the link or the full page.

This seems very easy to do and with a little more investigation into
Form mail I'm sure you can do it.

CT






------------------------------

Date: Sat, 09 Jan 1999 19:23:19 GMT
From: mag@imchat.com (Mark P.)
Subject: Re: "internal server error"
Message-Id: <3697ab56.47983847@news.ionet.net>

	Your best bet since you are really new is to first get a good
webserver for Windoze, Xitami is great (imatix.com), then get the perl
package from activestate.com. Install both of these and run your
scripts. Using the -w and strict you can then open the cgierror.log
and see where the script is dying. 
	Linux is great, but you might want to hold off a bit at first.
Don't want to learn ten things at once unless you have a lot of time
on your hands. I myself like the Caldera version of Linux but the
RedHat version is also great.

On Sat, 09 Jan 1999 12:32:10 +0100, Eirik Johansen
<webpages@email.com> wrote:

>The suggestion from Eugene Sotirescu worked. Thank you so much! Also thank to
>James Ludlow who gave me a lot of advice. But I also have a simple(?) question. Is
>it possible to have to different operating systems on a PC (win95 AND Linux). And
>isn't Linux really hard to use?
>
>Regards
>Eirik !
>
>Eugene Sotirescu wrote:
>
>>   Eirik,
>>
>> change
>> $FORM{$recipient}
>> to
>> $FORM{'recipient'}
>> (you're not setting a $recipient variable after all).
>>
>> Also the  s/%40/@/ is not really necessary.
>>
>> Eirik Johansen wrote:
>>
>> > Who wants to learn Perl after feedback like this???
>> >
>> > When one gets a lot of replies one should probably thank for them, but in
>> > this case, there are few replies to thank for. It's okay to give
>> > constructive critisism, but very little of this critisism is constructive. I
>> >
>> > agree that my first posting should'be been clearer, but why don't someone
>> > just say that in a nice way instead of making such a big deal out of how
>> > stupid I am.
>> >
>> > Before I repost my question, I would like to say something to some of the
>> > people replying to my message:
>> >
>> > Abigail: What's your problem? Did you actually read my posting? The first
>> > line goes something like this: "I've just started learning Perl..." Did it
>> > ever occur to you that I either know what "-w" "use strict" or modules are
>> > nor do I know how to use them. I'm supposing that modules are some pre-made
>> > scripts since you say they are "made by people with a clue".(It's probably
>> > not!) Well, you obviously didn't read the rest of the the first sentence,
>> > cause it goes something like this: "...and I recently modified a CGI-script"
>> >
>> > And did it ever occour to you that I might want to "have a clue" myself
>> > someday? And the only way to leraning this, is by doing it myself !
>> > I'm eager to learn CGI-scripting - so what if I "don't have the appropriate
>> > environment to test my work with."? I want to learn it just the same, and I
>> > will too, you'll see. And that I didn't give you an error message. The only
>> > error message I can give is in the subject line, you see THAT'S THE PROBLEM.
>> >
>> > If I had an error msg, I would've worked out the problem myself.
>> >
>> > There - that's some constructive critisism for you. Try using it sometime,
>> > instead of telling people to crawl under a rock (are you sure that your
>> > daddy allows you to play with the computer?)
>> >
>> > Bart Lateur:
>> > Thanks for actually caring about helping a novice. The other posters have
>> > got a lot to learn from you !
>> >
>> > Okay, let's rewind this tape and start from the top.........<<............
>> >
>> > Hi!
>> >
>> > I have a problem with a CGI script which I altered. The script is a usual
>> > mil-the-form
>> > script which sends tha data of the form to someones (my) E-mail adress. I
>> > altered the script a little so that it would read the recipient and the
>> > subject-line from a two hidden-fields in the the form, and added the
>> > following line:
>> >
>> > $value =~ s/%40/@/;
>> >
>> > and I also changed the output HTML-code to suit my needs. But when I hit the
>> >
>> > submit-button I get a page in the web-browser with the following msg:
>> >
>> > Internal Server Error
>> >
>> > The server encountered an internal error or misconfiguration and was unable
>> > to complete your request.
>> >
>> > Please contact the server administrator, webmaster@bardblikk.no and inform
>> > them of the time the error occurred, and anything
>> > you might have done that may have caused the error.
>> >
>> > The form can be found at http://home.sol.no/~webpages/mailform.htm and a
>> > copy of the script in *.txt version can be located at
>> > http://home.sol.no/~webpages/mailform.txt
>> >
>> > I would appriciate any help you can give my !
>> >
>> > Regards
>> >
>> > Eirik Johansen
>> > A NEWBIE IN CGI AND PERL!!!
>> >
>> > Eirik Johansen wrote:
>> >
>> > > Hi !
>> > >
>> > > I've just started learning Perl and I recently modified a CGI-skripy,
>> > > but now it won't work and I don't know why. Would someone be as kind as
>> > > to rund it un their Unix shell (I don't have Unix) and tell me which
>> > > line makes the error.
>> > >
>> > > Thanks so very much !
>> > >
>> > > Regards
>> > >
>> > > Eirik Johansen
>> > >
>> > > #!/usr/bin/perl
>> > >
>> > > # This script will take information from a form
>> > > # and place it in a mail to the desired recipent
>> > >
>> > > print "Content-type:text/html\n\n";
>> > >
>> > > read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
>> > > @pairs = split(/&/, $buffer);
>> > > foreach $pair (@pairs) {
>> > > ($name, $value) = split(/=/, $pair);
>> > > $value =~ tr/+/ /;
>> > > $value =~ tr/%40/@/;
>> > > $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
>> > > $FORM{$name} = $value;
>> > > }
>> > >
>> > > $mailprog = '/usr/sbin/sendmail';
>> > >
>> > > # this opens an output stream and pipes it directly to the sendmail
>> > > # program. If sendmail can't be found, abort nicely by calling the
>> > > # dienice subroutine (see below)
>> > >
>> > > open (MAIL, "|$mailprog -t") or &dienice("Can't access $mailprog!\n");
>> > >
>> > > # here we're printing out the header info for the mail message. You must
>> > >
>> > > # specify who it's to, or it won't be delivered:
>> > >
>> > > print MAIL "To: $FORM{$recipient}\n";
>> > >
>> > > # In case the owner of the form has any questions, I'll set the
>> > > # reply-adress as my own
>> > >
>> > > $reply = 'webpages@email.com';
>> > >
>> > > print MAIL "Reply-to: $reply\n";
>> > >
>> > > # print out a subject line so you know it's from your form cgi.
>> > > # The two \n\n's end the header section of the message. Anything
>> > > # you print after this point will be part of the body of the mail.
>> > >
>> > > print MAIL "Subject: $FORM{$subject}\n\n";
>> > >
>> > > # here you're just printing out all the variables and values, just like
>> > > # before in the previous script, only the output is to the mail message
>> > > # rather than the followup HTML page.
>> > >
>> > > foreach $key (keys(%FORM)) {
>> > > print MAIL "$key = $FORM{$key}\n";
>> > > }
>> > >
>> > > # when you finish writing to the mail message, be sure to close the
>> > > # input stream so it actually gets mailed.
>> > >
>> > > close(MAIL);
>> > >
>> > > # now print something to the HTML page, usually thanking the person
>> > > # for filling out the form, and giving them a link back to your homepage
>> > >
>> > > print <<EndHTML;
>> > > <h2>Thank You</h2>
>> > > Thank you for writing. Your mail has been delivered.<p>
>> > > Do you want a form like this one? Then visit <a
>> > > href="http://webpages.findhere.com" target="_top">The Webpage of
>> > > Webpages</a>
>> > > </body></html>
>> > > EndHTML
>> > > ;
>> > >
>> > > sub dienice {
>> > > ($errmsg) = @_;
>> > > print "<h2>Error</h2>\n";
>> > > print "$errmsg<p>\n";
>> > > print "</body></html>\n";
>> > > exit;
>> > > }
>



------------------------------

Date: 9 Jan 1999 20:23:21 GMT
From: "Charles R. Thompson" <design@raincloud-studios.com>
Subject: Re: __FILE__, __LINE__ not set
Message-Id: <778drp$r6n@bgtnsc03.worldnet.att.net>

>What is &CgiDie - I have a horrible suspiscion which I wont voice ?


Ok.. I know. It's the Steven Brenner library. I didn't realize there was
an alternative until just recently. I'm learning!

>It is most probable that instead of using the library that you are you
>should consider using CGI.pm and CGI::Carp which will provide the
>kind of diagnostic information you need to the browser.


I'll begin to look into this as an alternative. I haven't used modules
yet, but this is probably the best place to get started.

Thanks,

CT




------------------------------

Date: Sat, 09 Jan 1999 15:23:31 -0500
From: Jason Boyd <jboyd99@hotmail.com>
Subject: ActivePerl on Win95
Message-Id: <3697BAC3.7DA17D9F@hotmail.com>

If anyone knows how I can get ActivePerl (509) to fuction properly on my
Win95 system, could you please help me? 

I can open the perl.exe in Windows, but any scripts I run shut down as
soon as they have displayed, meaning I can't see the results. When I try
to open perl from DOS, it tells me "this program doesn't run in DOS
mode." Yet the docs that come with the build claim it is for Win NT, 95
and 98 systems. 

Any help is appreciated (even the name of another version of perl that
IS built for Win95).

Jason Boyd


------------------------------

Date: 09 Jan 1999 13:19:52 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: c to perl
Message-Id: <m3yanc6vx3.fsf@moiraine.dimensional.com>

tadmc@metronet.com (Tad McClellan) writes:

>    I often find myself looking for a job that converts
>    Perl into money   ;-)

Fortunately, that doesn't require much effort. :-)

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


------------------------------

Date: 9 Jan 1999 18:40:45 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Execute perl scripts on remote server
Message-Id: <7787rd$69b$1@gellyfish.btinternet.com>

On Sat, 09 Jan 1999 16:03:12 GMT cvpereira@my-dejanews.com wrote:
> Hi all,
> 
> can I generally execute perl scripts on a remote server ?
> 
> Background: We use Novonyx Enterprise Server because of the grat I/O
> Performance and the tight Novell-NDS-LDAP integration. But: The Perl-Port is
> really bad. So I'd like to put a linux machine right next to the main
> web-server to execute perl-scripts. Can I do something like this ? mapping ?
> global variables in some perl module ?
> 

I have to say that this is more to with the configuration of the server
than anything to do with Perl - people might recommend you to use LWP or
somesuch to execute the remote script but I happen to know that is not
currently supported on  the Novell port of Perl (as a matter of interest
does anyone know - or care - how the 5.005 port is coming on ?).  I cant
remember if this server allows you to do a redirect to a remote path like
Apache does.

Novell have a private newsgroup on one of their servers that might be a
more appropriate place to ask this kind of question - I cant remember the
name of the server but if you go to http://developer.novell.com I'm sure
you will find a link to it.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Sat, 9 Jan 1999 19:05:22 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: filename from a filehandle
Message-Id: <F5B3oz.HDr@world.std.com>

Kelvin Price <kprice@cardinal.co.nz> writes:

>John Stanley wrote:
>> 
>> The file goes away when the program exits. There is no disk space to
>> worry about dissappearing.

>That certainly is a useful trick.  If your program behaves and exits
>cleanly then, yes, disappearing disk space is not a problem.  My concern
>is with programs that don't behave, don't exit and just keep growing the
>'invivsible' file(s) to the point where free disk becomes dangerously
>low or non-existent.

Thats why sysadmins should keep an eye on disk space. On Unix systems
(which are pretty much the only system that supports this.) if it
starts filling up rapidly maybe tools like fuser to find which program
have open files. If long running programs have lots of open files, or
unlinked files that they have kept open "forever", start
invenstigating.
-- 
Andrew Langmead


------------------------------

Date: 9 Jan 1999 20:57:22 GMT
From: tommy1452@aol.com (Tommy1452)
Subject: How do you run long scripts from a browser without sending tons of data?
Message-Id: <19990109155722.27678.00009717@ng29.aol.com>

I don't have a dial up account with my provider, therefore I run and test all
my scripts from a browser.  One script will time out no matter how much data I
have it spit out to the browser.  It runs fine from the Unix prompt (I can't do
this any more because my user account was terminated at my  school.)
Tom
  


------------------------------

Date: Sat, 09 Jan 1999 20:57:45 GMT
From: debugger@gmx.net (spherie)
Subject: how to centre an awt frame?
Message-Id: <3697c236.10308573@news.cityweb.de>

I wonder how to centre a single Frame on the screen - their appears to
be no method to determine current screen resolutions, or even the max
pixels int. The Frame position should always be in the very middle.
Anyone got an idea?


------------------------------

Date: Sat, 9 Jan 1999 20:14:01 +0100
From: "Flip" <flip@nym.alias.net>
Subject: How to equalize a variable to a string containing a @
Message-Id: <7789ps$gt5$1@nickel.uunet.be>

I want to equalize a variable to a string containing a @
but I have some problems

This works:
{ $Config{'variable'} = testtest.com }

This doesn't:
{ $Config{'variable'} = test@test.com }

Thanks in advance for helping me!

flip@nym.alias.net






------------------------------

Date: 9 Jan 1999 19:50:32 GMT
From: "Allan M. Due" <due@murray.fordham.edu>
Subject: Re: How to equalize a variable to a string containing a @
Message-Id: <778bu8$7tq$0@206.165.165.137>

Flip wrote in message <7789ps$gt5$1@nickel.uunet.be>...
|I want to equalize a variable to a string containing a @
|but I have some problems


What does -w tell you about your code?  You are using -w aren't you?  use
strict is often a very good idea as well.
|
|This works:
|{ $Config{'variable'} = testtest.com }


I am not sure what those outside brackets are for but why are you
concatinating two bare words?  Perhaps some quotes (double or single) are in
order.

$Config{'variable'} = "testtest.com";
$Config{'variable'} = 'testtest.com';

or do you want $Config{'variable'} to be equal to testtestcom.

|This doesn't:
|{ $Config{'variable'} = test@test.com }


Hmm, that is a bare word followed by an array called test, and then you try to
concatinate com to the array, perhaps:

 $Config{'variable'} = 'test@test.com';
 $Config{'variable'} = "test\@test.com";

might work a bit better.

See perldata and perlop.

HTH

AmD




------------------------------

Date: 9 Jan 1999 20:18:56 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: How to equalize a variable to a string containing a @
Message-Id: <778djg$8r$1@gellyfish.btinternet.com>

On Sat, 9 Jan 1999 20:14:01 +0100 Flip wrote:
> I want to equalize a variable to a string containing a @
> but I have some problems
> 
> This works:
> { $Config{'variable'} = testtest.com }
> 
> This doesn't:
> { $Config{'variable'} = test@test.com }
> 

Of course if you had run this with the '-w' switch it would have 
indicated to you that there was actually a problem with the first
as well as the second case:

Unquoted string "testtest" may clash with future reserved word at stuffit.pl line 4.
Unquoted string "com" may clash with future reserved word at stuffit.pl line 4.
Unquoted string "test" may clash with future reserved word at stuffit.pl line 7.
Array found where operator expected at stuffit.pl line 7, at end of line
        (Missing operator before ?)
syntax error at stuffit.pl line 7, near "test@test"
Unquoted string "com" may clash with future reserved word at stuffit.pl line 7.
Execution of stuffit.pl aborted due to compilation errors.

I think these errors should have been sufficient to supply an answer to
most people but even without -w you would have got :

Array found where operator expected at stuffit.pl line 7, at end of line
        (Missing operator before ?)
syntax error at stuffit.pl line 7, near "test@test"
Execution of stuffit.pl aborted due to compilation errors.

(Of course the line numbers and the filename would be different).

The answers of course are either to:

A) escape the @ 

B) place the string in single quotes as you should have done in the first
   place.

Using barewords like that is very bad form and as I say had you used the
-w switch you would have been warned about this.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


------------------------------

Date: Sat, 9 Jan 1999 21:01:05 +0100
From: "Madenet" <msantull@dimensione.com>
Subject: internal server error
Message-Id: <778cij$mfh@dante.italia.com>

Anyone can help me ?

I realized a CGI in Perl.

It works with Win 95 and Frontpage Web Server.

After it doesn't work on Apache on BSDI 3.0 Server.

May be a configuration error of server conf files ?

Thanks





------------------------------

Date: Sat, 9 Jan 1999 12:56:52 -0800
From: Fred Ramsing <framsing@unr.edu>
Subject: line-length limitations
Message-Id: <Pine.GSO.3.96.990109124218.1456A-100000@equinox>

I'm running into a line-length limit that is probably a UNIX problem
rather than with Perl.  I'd appreciate any help.

Basically, I've got a 100MB text file of space delimited real numbers with
2,547 numbers per line and 4,356 lines.  I'm trying to convert it to a BIL
(band-interleaved) format with single-precision floating point numbers.

I'm trying to "split" each line, convert each number to single-precision
floating point, and write to the new binary file.  But all I get is the
following:

^AA^

I think part of the problem is that "split" doesn't split the whole line,
but only the first few hundred numbers with the last element in the array
containing the rest of the line.

By the way, neither sed nor awk could handle the file because the lines
were too long.


TIA,

Fred



------------------------------

Date: Sat, 9 Jan 1999 15:49:08 -0500
From: "Bill Catlan" <wcatlan@bccom.com>
Subject: make for win-32 system
Message-Id: <778f50$ed8$1@news01.li.net>

Hey folks,

I need the nmake utility for Win32.  Any ideas where to get a copy?

I am using ActivePerl and it does not have the utility as part of the
distribution.

Thanks.

Bill





------------------------------

Date: 09 Jan 1999 21:15:47 +0200
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: Perl 5.005 installation question
Message-Id: <oeeiuegfeak.fsf@alpha.hut.fi>


"Christopher Adams" <cadams@teleport.com> writes:

> I was installing Perl 5.005 on a SunOS 4.13. I generated the config.sh file.
> I am upgrading from Perl 5.000 Then I ran a 'make'. The operation failed and
> gave me the following message:
> 
> hv.c:72: In function 'save-hek':
> hv.c:72:Parse error before 'HEK'
> hv.c:72:Parse error before ')'
> hv.c:188:in function 'Perl_hv_fetch_ent':
> hv.c:188: Parse error before 'HEK'
> hv.c:188: Pars error before ')'
> hv.c:1029:In function 'Perl_hv_internext':
> hv.c:1029: Parse error before 'HEK'
> hv.c:1029: Pars error before ')'
> Make: Fatal Error Command failed for target 'hv.o'

I hope you do not mean 5.005 because 5.005_02 is out, has been for a long time.

> Since I have no idea what this all means, I can't really do any
> troubleshooting. Can anyone suggest what is going on and what I need to do?
> 
> Also, is there a website that has an installation troubleshooting FAQ or

The Perl source code comes with one: INSTALL.  It e.g. tells how to 
report installation problems--and how to solve the most common ones.

> searchable knowledge base that lists some of the problems that arise in
> installation.

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen


------------------------------

Date: Sat, 09 Jan 1999 20:44:57 GMT
From: topmind@technologist.com
Subject: Re: Perl Criticism
Message-Id: <778f4a$td6$1@nnrp1.dejanews.com>

In article <776aro$6q5$1@nnrp1.dejanews.com>,
  dturley@pobox.com wrote:
> In article <775olp$m66$1@nnrp1.dejanews.com>,
>   topmind@technologist.com wrote:
>
> > I just ran this example:
> >
> > $a = 5;
> > print "before " . $a . "\n";
> > mysub();
> > print "after " . $a;
> >
> > sub mysub {
> >     $a = 2;
> >     mysub2();
> > }
> >
> > sub mysub2 {
> >   $a = 99;
> > }
> >
> > An here is the output:
> >
> > before 5
> > after 99
> >
> > Where did the 99 come from if each sub did not inherit the variable
> > scope of it's parent?
>
> I think you are confusing piss-poor programming practices with language
> shortcomings. Your posts have had one good result. Reading them makes me feel
> like a damn-good programmer!
> ____________________________________
> David Turley

Hey Mr. Turkey!

It is an example to illustrate a concept. It is not production
code! Inheriting parent's variable scope *is* an issue with
language design. I did NOT invent that issue. I am only looking
at it.

-pissedmind-
http://www.geocities.com/SiliconValley/Lab/6888/

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Sat, 09 Jan 1999 20:37:35 GMT
From: backslashxt@yahoo.com
Subject: Perl within Perl
Message-Id: <778emg$t7g$1@nnrp1.dejanews.com>

I have a script which displays a banner at the top of the page (rotating
banners) and it works fine. However, in a postcard script I'm working on, I
need to include the banner at the top of each page. But I can't seem to be
able to make the call to the banner script work when called from the postcard
script, it only displays the tag to the HTML file.

The call I'm using:
print "<!--\#exec cgi=\"/cgi-bin/topad.cgi\"-->          \n"; (Calls banner)

I've tried quite a few things here and there, and it always gets pasted as
html code. I've done it before where the topad.cgi would be loaded even when
called from another script but I don't remember how. Any help appreciated.

Pat

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Sat, 09 Jan 1999 15:06:49 -0500
From: Eugene Sotirescu <eugene@snailgem.org>
To: Eirik Johansen <webpages@email.com>
Subject: Re: Remove vars from a foreach loop
Message-Id: <3697B6D9.392B216E@snailgem.org>

 print MAIL "$key = $FORM{$key}\n" unless $key =~ /recipient|subject/;


Eirik Johansen wrote:

> Hi!
>
> I'm making a script that will take the values from the components of a
> form and send them to some E-mail adress. The recipient of the E-mail
> and the subject-line are defined in two hidden-fields of the form, which
> is a problem when I do a foreach loop to print out all the vars in the
> body of the e-mail, cause it prints out the subject-line and the
> recipient as well in the body msg.
>
> Is it possible to do a foreach loop, but to remove some vars from the
> loop that you know the names of. (I do not know the names of the rest of
> the components, cause the user is supposed to chose his/her own
> components.
>
> The test-form can be found at http://home.sol.no/~webpages/mailform.htm
> and a *.txt-version of the script can be found at
> http://home.sol.no/~webpages/mailform.txt
>
> Thanks for any advice you can give me !
>
> Regards
>
> Eirik



------------------------------

Date: Sat, 09 Jan 1999 14:59:56 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: replacing <BR> with a physical carriage return
Message-Id: <alecler-0901991459560001@dialup-546.hip.cam.org>

In article <369c9206.18429706@news.cyberway.com.sg>,
pigs_can_fly@mindless.com (Jason Q.) wrote:

> It works perfectly without the 'e'.
> 
> Thanks guys for your help. Appreciated.

In addition to removing the /e, you might want to make the substitution
case-insensitive, since HTML tags can be in lowercase or uppercase.

   s/<br>/\n/gi;

Andre


------------------------------

Date: Sat, 9 Jan 1999 12:55:50 -0600
From: Brian Deitte <bdeitte@blue.weeg.uiowa.edu>
Subject: Re: using strict with CGI.pm
Message-Id: <Pine.A41.3.95.990109125321.24088A-100000@black.weeg.uiowa.edu>

On Sat, 9 Jan 1999, Brian Deitte wrote:

> Hm, now I am confused.  I always get an "undefined subroutine call" for
> param calls when I use the functional interface.  Am I doing something
> else wrong?  -Brian

Oh, nevermind.  Seems everytime I was testing use strict with CGI I was
doing it without importing standard.  I never caught the error because I
assumed it was a problem with using strict and CGI together, not my own
lack of processing capability.  -Brian



------------------------------

Date: Sat, 09 Jan 1999 20:50:24 GMT
From: jdriller@usit.net (Jennifer Driller)
Subject: Re: Windows NT  - FrontPage server --   CGI - perl script
Message-Id: <3697bf6b.4663395@news.usit.net>

No need to be a jerk about it. Get out of the house once in awhile.
I'm a programmer, and I was interested in what this person had to say.
When people are trying to learn, they don't always know where to turn.
Don't discourage them. Geez, you acted like an animal.

Jennifer

On 6 Jan 1999 17:46:15 GMT, abigail@fnx.com (Abigail) wrote:

>Rui (rren@cs.ust.hk) wrote on MCMLIV September MCMXCIII in
><URL:news:76vhv2$qn1@ustsu10.ust.hk>:
>,, 
>,, I am running  Frontpage on my PC.
>
>Fine. This group is about Perl. Not frontpage.
>
>,, Perl scripts can be run locally , but when they are accessed via   the web,
>,, ie. when a perl script is the target of a form in a remote webpage,  the
>,, client gets a error :
>,, 
>,, 500 Server Error
>,, The server encountered an internal error or misconfiguration and was unable
>,, to complete your request
>
>Oh, goodie. Did you lookup what the perl manual has to say about it?
>Did you? No? Maybe you should.
>
>,, 
>,, FrontPage  does  have a   cgi-bin directory so I supppose CGI is already
>,, installed.
>
>One doesn't install CGI. Just like one doesn't install something in ones
>brains to stop for a traffic light that's showing red.
>
>,,             My guess is that FrontPage server is not properly configurered
>,, to run perl sctipt, ie. it has not idea how to deal with that file.
>
>That could very well be. But then, you shouldn't be asking here. Go to
>a server group.
>
>,, What can I do about this ?    One possible thing is to   define a wrapper
>,, batch file that calls the perl intepreter and the script ,  but how  ?
>
>Well, then that wrapper wouldn't be written in Perl, would it? But in
>some other language. Again, you shouldn't be asking here. Go to the
>group dealing with that language.
>
>Of course, it's also very likely that you have misconfigured things or
>make the basic mistakes many people are making. But then, as you can
>guess YOU ARE IN THE WRONG GROUP! Go to a CGI group. But, before you
>do, you might look in the error log and find out what kind of error is
>generated. If your server doesn't have an error log, get a better server.
>
>
>
>Abigail



------------------------------

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 4605
**************************************

home help back first fref pref prev next nref lref last post