[18136] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 304 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 16 21:05:40 2001

Date: Fri, 16 Feb 2001 18:05:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <982375510-v10-i304@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 16 Feb 2001     Volume: 10 Number: 304

Today's topics:
    Re: [OT] What other languages do you know? (Kevin Reid)
        Big Numerical Computations in Perl ve C++/Fortran <david@habanero.chem.usu.edu>
    Re: Big Numerical Computations in Perl ve C++/Fortran <elijah@workspot.net>
    Re: Big Numerical Computations in Perl ve C++/Fortran (Martien Verbruggen)
        broken pipe error running ufsdump | ufsrestore from per <rscott@directlink.net>
        copying directories w/ ActiveState ver5.6 <bmccann@naisp.net>
    Re: Email Attachments - Help (Peter L. Berghold)
    Re: FAQ 4.34:   How can I expand variables in text stri <rick.delaney@home.com>
    Re: FAQ 4.36:   Why don't my <<HERE documents work? <gtoomey@usa.net>
    Re: free cgi's ? (Rob - Rock13.com)
    Re: Perl 5 and graphics <c_clarkson@hotmail.com>
    Re: Perl 5 and graphics <perldomo@hotmail.com>
        perlcc <geoff@brainstorm.net.au>
        Perlscript on Win2000 (how to run) <aurko@saudia.com>
    Re: remote IP Address (Richard J. Rauenzahn)
    Re: Stop writing CGIs (SPAM)  23 Questions <bigrich318@yahoo.com>
    Re: striping HTML <gerard@NOSPAMlanois.com>
    Re: striping HTML (David K. Wall)
    Re: striping HTML (David K. Wall)
    Re: three-part form submission using CGI.pm <dontspamthewebmaster@webdragon.net>
    Re: three-part form submission using CGI.pm <dontspamthewebmaster@webdragon.net>
    Re: three-part form submission using CGI.pm <joe+usenet@sunstarsys.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sat, 10 Feb 2001 09:05:05 -0500
From: kpreid@attglobal.net (Kevin Reid)
Subject: Re: [OT] What other languages do you know?
Message-Id: <1eoku5p.h1gepp1xvekeqN%kpreid@attglobal.net>

Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> wrote:

> Pity MacPerl isn't AppleScriptable--it would be handy, sometimes, to use
> a quick line or two of Perl in an AppleScript script. Or if it is 
> scriptable, I haven't been able to figure out how to drive it from 
> AppleScript...

I've never done this before, but I knew it's possible, so I just wrote
this, as an example of passing data both ways:

property myScript : ¬
    "my $t = $ENV{foo}; MacPerl::Reply($ENV{key}.$t.' or not?')"

tell application "MacPerl 5.2.1a1"
    set myRes to Do Script myScript environment {"foo", "less", ¬
        "key", "value"} with warnings
end tell
display dialog myRes

-- 
 Kevin Reid: |    Macintosh:      
  "I'm me."  | Think different.


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

Date: Fri, 16 Feb 2001 17:57:01 -0700
From: david farrelly <david@habanero.chem.usu.edu>
Subject: Big Numerical Computations in Perl ve C++/Fortran
Message-Id: <3A8DCC5D.16674EE5@habanero.chem.usu.edu>

Hello,

I recently programmed up a Numerical Recipes algorithm in PERL. The
subroutine is called VEGAS and it does multidimensional Monte Carlo
integration. On an identical
task the FORTRAN version took 0.5 cpu seconds while the PERL version
took 66
seconds on a DEC alpha. I made no special attempts to optimize the PERL
code and essentially just translated the FORTRAN into PERL. However,
this is a
huge difference in execution time. Is this normal? I'm relatively new to
PERL --- I want to solve a problem in quantum physics which requires
combining some PERL-ish stuff with some C++/FORTRAN-ish stuff. It could
be that I have goofed somewhere. Does anyone have experience with doing
large floating point computations in PERL?

I used the Math::Random module's random number generator but the results
don't change much if I use rand (58 sec vs 66).

Comments?

Thanks,

David



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

Date: 17 Feb 2001 01:13:14 GMT
From: Eli the Bearded <elijah@workspot.net>
Subject: Re: Big Numerical Computations in Perl ve C++/Fortran
Message-Id: <eli$0102162008@qz.little-neck.ny.us>

In comp.lang.perl.misc, david farrelly  <david@habanero.chem.usu.edu> wrote:
> I recently programmed up a Numerical Recipes algorithm in PERL. The
> subroutine is called VEGAS and it does multidimensional Monte Carlo
> integration. On an identical task the FORTRAN version took 0.5 cpu
> seconds while the PERL version took 66 seconds on a DEC alpha.

Perl (not PERL) is not the best language for complex math problems.
That said, we can't really tell if your code can be speeded up unless
we see it. You might want to use the perl profiler to see where all
the processing time is going.

	perldoc Devel::DProf

Inline::C might help you, if you can easily get the math complex bits
done by C functions.

Elijah
------
but you probably would want Inline::FORTRAN, if it existed


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

Date: Sat, 17 Feb 2001 12:19:03 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Big Numerical Computations in Perl ve C++/Fortran
Message-Id: <slrn98rkc7.2q4.mgjv@martien.heliotrope.home>

On Fri, 16 Feb 2001 17:57:01 -0700,
	david farrelly <david@habanero.chem.usu.edu> wrote:

> task the FORTRAN version took 0.5 cpu seconds while the PERL version
> took 66
> seconds on a DEC alpha. I made no special attempts to optimize the PERL
> code and essentially just translated the FORTRAN into PERL. However,
> integration. On an identical

You have just discovered that Perl is slow. It is also a memory hog.
perl is not the language to program CPU-intensive algorithms in. For
that you fall back on C or, in your case, Fortran.

> this is a
> huge difference in execution time. Is this normal? I'm relatively new to
> PERL --- I want to solve a problem in quantum physics which requires
> combining some PERL-ish stuff with some C++/FORTRAN-ish stuff. It could
> be that I have goofed somewhere. Does anyone have experience with doing
> large floating point computations in PERL?

Have a look at Inline::C. This will let you put C code in a Perl
program, without having to worry about all the code that needs to be
written to link the two. 

> I used the Math::Random module's random number generator but the results
> don't change much if I use rand (58 sec vs 66).

I suspect that the slowness isn't in the random number generation, but
in the loops that you have in your code.

If you have really tight loops that need to be executed many, many
times, Perl is not the place to do it. At least, not if you need
performance.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | I'm just very selective about what I
Commercial Dynamics Pty. Ltd.   | accept as reality - Calvin
NSW, Australia                  | 


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

Date: Fri, 16 Feb 2001 18:29:22 -0600
From: Raymond Scott <rscott@directlink.net>
Subject: broken pipe error running ufsdump | ufsrestore from perl
Message-Id: <3A8DC5E2.9984784@directlink.net>

I'm building a script to do backups of a Solaris boot disk to another
disk on the same system.
I'm using ufsdump and piping to ufsrestore.
I build up a string like:
$rundump = "ufsdump 0f - /dev/vx/rdsk/rootvol | (cd /mnt/root;
ufsrestore xf -)";

and then run it with system:

system($rundump);

But, ufsdump aborts with a "Broken Pipe" error.
I've tried setting up a parent/child pipe, but it gets a 'can't change
TTY' error.

Is there a way to get this to work?

--
Raymond Scott
rscott@directlink.net




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

Date: Fri, 16 Feb 2001 19:35:08 -0800
From: "Brian McCann" <bmccann@naisp.net>
Subject: copying directories w/ ActiveState ver5.6
Message-Id: <t8rid4ojcfih97@corp.supernews.com>

ok,

I'm at a loss this statement works with files but if you try to copy the
whole
directory it's a no go any one know why, I read File::Copy doc and it
states if the arguments are directories copydir will get called
copy('C:\Applications\InternalProduct\JSPRoot\admin\adminLogin.jsp','c:\comp
ilearea');
copy('C:\Applications\InternalProduct\JSPRoot\admin','c:\compilearea');

tia,
Brian






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

Date: Sat, 17 Feb 2001 01:40:06 GMT
From: peter@uboat.berghold.net (Peter L. Berghold)
Subject: Re: Email Attachments - Help
Message-Id: <slrn98rljm.7j6.peter@uboat.berghold.net>

On Wed, 14 Feb 2001 20:46:40 -0500, TeamZulu HQ <teamzulu@teamzulu.com> wrote:
>I am looking for an email attachment type script - Anybody ?

Mime::Entity;


>Please email me direct.
>

Much prefer to answer here. That way my response benefits more than 
just you. 


-- 
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Peter L. Berghold                        Peter@Berghold.Net
"Linux renders ships                     http://www.berghold.net
 NT renders ships useless...."           


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

Date: Sat, 17 Feb 2001 01:00:25 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: FAQ 4.34:   How can I expand variables in text strings?
Message-Id: <3A8DD06B.9B128D4F@home.com>

Jerome Abela wrote:
> 
> However, I failed to understand why s/(\\[ntb])/\"$1\"/ee leads to an
> unmnatched quote error message.

Forgetting about the extra e, the right-hand expression is

    \ "$1\"

That is, a reference to a string that just happens to not have a closing
".  With the extra e, it is just

eval \ "$1\"

which obviously has the same syntax problems.

-- 
Rick Delaney
rick.delaney@home.com


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

Date: Sat, 17 Feb 2001 10:34:47 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Re: FAQ 4.36:   Why don't my <<HERE documents work?
Message-Id: <dtjj6.27911$65.130588@newsfeeds.bigpond.com>

Agreed. I occasionally make postings to this newsgroup to ask tricky
questions and help answer others.

Imagine, asking questions to a FAQ server ...

gtoomey

"Uri Guttman" <uri@sysarch.com> wrote in message
news:x7ofw2jqyw.fsf@home.sysarch.com...
> >>>>> "G" == Godzilla!  <godzilla@stomp.stomp.tokyo> writes:
>
>   G> PerlFAQ Server wrote:
>   >> Why don't my <<HERE documents work?
>
>   G> (snipped lots and lots of code to correct here doc problems)
>
>   G> There is an easier solution to avoid these myriad
>   G> problems with here document style.
>
>   G> Never use here document style. That's stupid!
>
> and that advice is typical moronzilla stupidity. but i don't need to
> tell everyone that. oh, here docs were in perl4 and have nothing to do
> with modules.
>
> uri
>
> --
> Uri Guttman  ---------  uri@sysarch.com  ----------
http://www.sysarch.com
> SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX
Consulting
> The Perl Books Page  -----------
http://www.sysarch.com/cgi-bin/perl_books
> The Best Search Engine on the Net  ----------
http://www.northernlight.com




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

Date: 17 Feb 2001 00:38:35 GMT
From: rob_13@excite.com (Rob - Rock13.com)
Subject: Re: free cgi's ?
Message-Id: <904AC3478rock13com@207.91.5.10>

nowayandnohow <nowayandnohow@hotmail.com>:

>Hi ya'll, i was wondering if one of you could give me a link or
>two to a free cgi script page...

http://www.google.com/search?q=free+CGI+scripts
http://perlarchive.com/
See the sig for some other suggestions.

-- 

Rob - http://rock13.com/
Web Stuff: http://rock13.com/webhelp/


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

Date: Fri, 16 Feb 2001 17:22:52 -0600
From: "Charles K. Clarkson" <c_clarkson@hotmail.com>
Subject: Re: Perl 5 and graphics
Message-Id: <43F55E9D45B65873.1EE92B2951AE3133.EDD732B9A5B33DD3@lp.airnews.net>

"Montego" <perldomo@hotmail.com> wrote:
: I have no idea how to do this, but I want to make a subroutine that will
: check the dimensions of a GIF or JPG image on a remote server. This way,
: someone can use a form to enter the URL of an image on their site, and my
: script will check it and assign the width and height to variables. Then I
: can check those values and return an error if it's too large.
:
: The only part I'm stumped on is how to actually get the dimensions into
the
: variables.
Check out Image::Size:
    http://search.cpan.org/search?module=Image::Size

If that doesn't help try:
    http://search.cpan.org/Catalog/Graphics/

HTH,
Charles K. Clarkson





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

Date: Fri, 16 Feb 2001 16:58:50 -0800
From: "Montego" <perldomo@hotmail.com>
Subject: Re: Perl 5 and graphics
Message-Id: <t8rjjh81tst461@corp.supernews.com>

Thank you Charles!!! Image::Size module works perfectly, exactly what I
needed.


"Charles K. Clarkson" <c_clarkson@hotmail.com> wrote in message > Check out
Image::Size:
>     http://search.cpan.org/search?module=Image::Size
>
> If that doesn't help try:
>     http://search.cpan.org/Catalog/Graphics/
>
> HTH,
> Charles K. Clarkson
>
>
>




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

Date: Sat, 17 Feb 2001 01:59:51 GMT
From: Geoff Toogood <geoff@brainstorm.net.au>
Subject: perlcc
Message-Id: <B6B4180C.2114%geoff@brainstorm.net.au>

Hi all,

I have asked this question before and have been given 1 hard to follow
answer. I am sure what I am trying to do is possible but I can't get it to
work :(

I am trying to compile a script from the command prompt with perlcc.  It
tells me that there is a missing library which as I have been told is
libgdbm.so.xx.

I have successfully located 3 matches to this library.

/usr/lib/libgdbm.so.1
/usr/lib/libgdbm.so.1.7.3
/usr/lib/libgdbm.so.2

How do I let perlcc know about these?  HELP???!! I am using debian linux's
standard patato release and an i386 box. My attempted compilation output is
below....

----------------------------------------------------------------------------
Compiling test.pl:
----------------------------------------------------------------------------
Making C(test.pl.c) for test.pl!
perl-5.005 -I/usr/lib/perl5/5.005/i386-linux -I/usr/lib/perl5/5.005
-I/usr/local/lib/site_perl/i386-linux -I/usr/local/lib/site_perl
-I/usr/lib/perl5 -I. -MO=CC
,-otest.pl.c test.pl
test.pl syntax OK
Compiling C(test) for test.pl!
perl-5.005 -I/usr/lib/perl5/5.005/i386-linux -I/usr/lib/perl5/5.005
-I/usr/local/lib/site_perl/i386-linux -I/usr/local/lib/site_perl
-I/usr/lib/perl5 -I. /tmp/t
est.pl.tst
cc -Dbool=char -DHAS_BOOL -D_REENTRANT -DDEBIAN -I/usr/local/include -O2
-I/usr/lib/perl5/5.005/i386-linux/CORE -I/usr/local/lib/
/usr/lib/perl5/5.005/i386-lin
ux/auto/Fcntl/Fcntl.so -o test test.pl.c  -L/usr/local/lib
-L/usr/lib/perl5/5.005/i386-linux/CORE -L/usr/local/lib/ -lperl -lnsl -lndbm
-lgdbm -ldbm -ldb -ldl -
lm -lc -lposix -lcrypt
/usr/bin/ld: cannot find -lgdbm
collect2: ld returned 1 exit status
ERROR: In compiling code for test.pl.c !




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

Date: Fri, 16 Feb 2001 18:00:28 -0800
From: Perly_Boy <aurko@saudia.com>
Subject: Perlscript on Win2000 (how to run)
Message-Id: <3A8DDB3C.3A0F9B4E@saudia.com>

Hi Folks,

I had a question :

I was trying to run Perl script in the server ( w/ Win 2k server ins.. )

machine; I know how to run Perl script from the command line in a MS DOS

(using the DOS prompt); however, I couldn't find any way of getting the
DOS prompt in the server ( w/ Win 2k installed)..

My question is -
Is there anyway I can bring up a command line in such M/cs (w/ Win 2k)
so that I can run the script.. or there has to be an altogether
different approach?

I shall appreciate very much a feedback from you in this regard (if
possible)

Thanks

Perly Boy



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

Date: 16 Feb 2001 21:44:19 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: remote IP Address
Message-Id: <982359857.938213@hpvablab.cup.hp.com>

lejeuned@starband.net (David W LeJeune) writes:
>I log into a computer (HP) via telnet from my PC.  On the HP I need a 
>Perl subroutine to determine the ip of the computer from whence I'm telnetting. 
> That computer (my PC) does not have a static IP address. Any ideas?
>
>Regards
>Dave

Use a combination of '/usr/bin/who -R' and '/usr/bin/tty'.  Use the
'/usr/bin/tty' results to parse your login out of the 'who -R' listing
(in case you have multiple logins.)

If that gives you a hostname instead of an IP, use /usr/bin/nslookup or
gethostbyname() to get the IP.

Rich
-- 
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave. 
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014


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

Date: Fri, 16 Feb 2001 19:32:32 -0600
From: "Rich" <bigrich318@yahoo.com>
Subject: Re: Stop writing CGIs (SPAM)  23 Questions
Message-Id: <t8rkt0gntm58cf@corp.supernews.com>

"nowayandnohow" <nowayandnohow@hotmail.com> wrote in message
news:8Ndj6.476$lx.477066@typhoon2.ba-dsg.net...
> Rich: I am laughing my ass of :-) I haven't seen such an exelent
burn in a
> long while :-)

What can I say, I was bored and, since I program CGI scripts using
Perl, I took it kind of personal when they stated that CGIs were
"junk" and insinuated that Perl "puked" out HTML pages when that is
exactly what their bloated crap does.

Its obvious that they are targeting the clueless but I hate #!&*ing
hypocrites.

Rich




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

Date: 16 Feb 2001 16:37:57 -0800
From: Gerard Lanois <gerard@NOSPAMlanois.com>
Subject: Re: striping HTML
Message-Id: <u66iaw3dm.fsf@NOSPAMlanois.com>


Joe Schaefer <joe+usenet@sunstarsys.com> writes:
> maheshasolkar@yahoo.com (Mahesh A) writes:
> > Could use the following regexp:
> > 
> > perl -ne '{s/<[^<|^>]*>//g;s/ +/ /g;print if (/\S/)}' JS_exp.html
> 
> #!/usr/bin/perl -w
> undef $/; $_=<DATA>;
> s/<[^<|^>]*>//g;s/ +/ /g;
> print if (/\S/);
> 
> __DATA__
> <html<>><head<>><title<>>bzzt</title<>></head<>>
> [...nefarious maliciousness...]
> </body<>></html<>>

Funny, I was just writing a stripper earlier today.

Here is what I came up with.  A great deal of your __DATA__
gets through, though much of it doesn't end up as valid HTML.

Comments and criticisms are welcome.

I'd be especially interested to see if anyone has any code
which handles _all_ the perlfaq9 "tricky cases".  Tom Christiansen's
"striphtml" doesn't.


-Gerard
http://www.lanois.com/perl/


-----------snip--------------
#!/usr/bin/perl -w

use strict;

package Stripper;

use HTML::Parser;
use HTML::Entities;

use vars qw ( @ISA );

@ISA = qw ( HTML::Parser );

sub new
{
    my ($class, %args) = @_;
    my $self = $class->SUPER::new(%args);
    return $self;
}

sub text
{
    my $self = shift;
    my $text = shift;
    
    my $dtext = HTML::Entities::decode($text);

    # Accumulate pieces of text.
    if (defined($self->{_stringref}) && length($dtext)) {
        ${$self->{_stringref}} .= $dtext;
    }
}

sub set_stringref($) 
{
    my $self = shift;
    $self->{_stringref} = shift;
}

1;


package main;

undef $/; 
my $file = <>;

my $stripper = Stripper->new();
my $result = "";
$stripper->set_stringref(\$result);

$stripper->parse($file);

print $result;



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

Date: 16 Feb 2001 20:49:05 -0500
From: darkon@one.net (David K. Wall)
Subject: Re: striping HTML
Message-Id: <904ADBBC3darkononenet@206.112.192.118>

no@email.com (Frank Miller) wrote:

>I have a website where users can post text replies to questions.   I don't
>want them to be able to enter HTML in the messages, because that messes up
>my pages when I print the replies.
>
>Is there a good perl sub that will strip any HTML tags they put in the
>message?  It would be nice if they could do simple ones like <br>, <b> and
>other text formatting.  I don't want pictures, tables and font changes.

Here's a simplistic idea:  give them a list of tags they CAN use, like <b>, 
<br>... but have them use [b], [br].. instead.  Change < 
and > to &lt; and &gt;, and then explicitly change [b] to <b>, [/b] to 
</b>, etc.  It's a bit crude, but it does avoid the problem of stripping 
"bad" HTML and leaving the "good" HTML.  Caveat programmer....

-- 
David Wall
darkon@one.net


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

Date: 16 Feb 2001 20:57:39 -0500
From: darkon@one.net (David K. Wall)
Subject: Re: striping HTML
Message-Id: <904AD582Cdarkononenet@206.112.192.118>

I wrote:
>
>Here's a simplistic idea:  give them a list of tags they CAN use, like
><b>, 
><br>... but have them use [b], [br].. instead.  Change < 
>and > to &lt; and &gt;, and then explicitly change [b] to <b>, [/b] to 
></b>, etc.  It's a bit crude, but it does avoid the problem of stripping
>"bad" HTML and leaving the "good" HTML.  Caveat programmer....

I should add that this is not an original idea with me, and that I've not 
actually used it.  Even though I've written a (very) crude web board, I 
don't do alot of CGI programming, and most of my Perl programs have been 
short little "duct-tape" programs designed to relieve me of otherwise 
tedious work.

-- 
David Wall - darkon@one.net
http://w3.one.net/~darkon/


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

Date: 16 Feb 2001 23:07:50 GMT
From: "Scott R. Godin" <dontspamthewebmaster@webdragon.net>
Subject: Re: three-part form submission using CGI.pm
Message-Id: <96kbs6$ei6$1@216.155.32.211>

In article <3A8D6C81.19F9116A@stomp.stomp.tokyo>, "Godzilla!" 
<godzilla@stomp.stomp.tokyo> wrote:

 | 
 | Yes, a suggestion. Stop using CGI.pm and write your own
 | custom read and parse routine. All of your problems
 | associated with CGI.pm will instantly vanish.

if I hadn't had CGI.pm, this would have taken me MUCH longer to complete 
as far as it's gotten.

this one function alone saved me gobs of time:

      import_names('UT');

there's over 30 form params. the HELL I want to grok (i.e. import into 
UT:: namespace) all of them myself when I can do it with one line of 
code that works that simply. 

the stumbling block has more to do with my understanding of how HTML is 
parsed by the subroutines than anything inherently wrong with CGI.pm.

-- 
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw"; 
# ( damn spammers. *shakes fist* take a hint. =:P )


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

Date: 16 Feb 2001 23:10:35 GMT
From: "Scott R. Godin" <dontspamthewebmaster@webdragon.net>
Subject: Re: three-part form submission using CGI.pm
Message-Id: <96kc1b$ei6$2@216.155.32.211>

In article <3A8D9724.AA8FBB5F@nortelnetworks.com>, Clayton Scott 
<claytons@nortelnetworks.com> wrote:

 | "Godzilla!" wrote:
 | > Your comments well reflect why you
 | > suffer so many problems attempting
 | > to write Perl programs.
 | 
 | You're entitled to believe what you want about my Perl prowess.
 | And here's what I believe about yours:
 | 
 | More of your answers and opinionated ramblings on this newsgroup 
 | do more of a disservice to the people asking the questions than no 
 | answer at all.
 
so, is anyone going to actually attempt to help me with my problem or 
are we all going to follow up to Godzilla instead?

let's get back on track here. :P 

6 posts and not one attempt to talk to me about what ails my perl. 
enough already. :j

-- 
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw"; 
# ( damn spammers. *shakes fist* take a hint. =:P )


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

Date: 16 Feb 2001 18:39:53 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: three-part form submission using CGI.pm
Message-Id: <m31ysygpti.fsf@mumonkan.sunstarsys.com>

"Scott R. Godin" <dontspamthewebmaster@webdragon.net> writes:

> print header, start_html, start_form,
>     ( map { 
>           hidden({-name=>$_, -Values=>unescapeHTML(param($_))}) 
>           } (param)
>      ), 
>     submit(), end_form, end_html;
> 
> I tried this in my code itself, and played with it a bit, and it 
> otherwise seems to work fine, but it introduces another problem.. 
> 
> I have some textarea fields that I want the users to be able to input 
> in paragraph format and preserve the line breaks (for which I was using 
> a fix_paragraphs() sub that replaces all the \n's with <br>'s instead)
> 
> However, when I view the 'intermediate preview' now, all the \n's are 
> HTML-escaped by CGI.pm to be &#13;&#10; pairs (and I'm not even sure 
> whether this is localized to being on a Mac, or if that's normal.) 
> which is why I added the unescapeHTML business to the map function to 
> see if that would take care of it (nope).


I think that hidden() is escaping the HTML.  If so, it's arguably
a good feature designed to prevent special characters from screwing 
up your form.

I'm not quite sure what you want to do, but I'd recommend either
doing a s/&#13;&#10;/<br>/ etc on the returned hidden form values (after
they'd been resubmitted), or else place the returned data within a
<pre>...</pre> block as is.

HTH
-- 
Joe Schaefer       Then the King smiled.  "A hard day," he'd say, "full of
                nizzardly worries.  A long day," he'd say. "Now it's time for
                                          some fun!"
                                               -- Dr. Seuss


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

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 V10 Issue 304
**************************************


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