[27051] in Perl-Users-Digest
Perl-Users Digest, Issue: 8959 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 15 18:06:04 2006
Date: Wed, 15 Feb 2006 15:05:08 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 15 Feb 2006 Volume: 10 Number: 8959
Today's topics:
How to stop perl from exiting when stat($_)->size fails <peter@nospam.com>
Re: How to stop perl from exiting when stat($_)->size f xhoster@gmail.com
Re: How to stop perl from exiting when stat($_)->size f <scobloke2@infotop.co.uk>
Re: How to stop perl from exiting when stat($_)->size f <1usa@llenroc.ude.invalid>
Re: Looking for script setting a pixel marker in an ima <landauf@inode.at>
Re: Merging sparse arrays <abigail@abigail.nl>
Problem reading & displaying MHTML file type <rbutcher.nospam@hotmail.com>
Re: Problem reading & displaying MHTML file type <1usa@llenroc.ude.invalid>
Re: The inverse problem: generate all instances of a re <bugbear@trim_papermule.co.uk_trim>
Re: The inverse problem: generate all instances of a re <bugbear@trim_papermule.co.uk_trim>
Re: The inverse problem: generate all instances of a re (Randal L. Schwartz)
Re: The inverse problem: generate all instances of a re <ben.usenet@bsb.me.uk>
Re: The inverse problem: generate all instances of a re (See Website For Email)
Re: The inverse problem: generate all instances of a re (See Website For Email)
Re: The inverse problem: generate all instances of a re (See Website For Email)
Re: Why can't JavaScript work when embeded in Perl CGI <null@no.spam>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 15 Feb 2006 17:50:14 +0100
From: "Peter Juuls" <peter@nospam.com>
Subject: How to stop perl from exiting when stat($_)->size fails
Message-Id: <43f35bcd$0$46979$edfadb0f@dread15.news.tele.dk>
In my script I fetch the filesize with stat($_)->size from File::stat.
Occasionally it fails although the file exists, and perl exits with this
error on STDERR: Can't call method "size" on an undefined value at
myscript.pl line 7.
I don't want the script to exit, instead I want to ignore the "bad" file and
continue with the next file. I have tried to do tests on file-existence
BEFORE the stat->size is executed, to prevent perl from exiting, but nothing
seems to work.
use File::stat
.....
if ((-e $_) && (-r $_) && ($st = stat($_)) {
$bytes = stat($_)->size ;
}
How can I prevent the script from exiting? (ActiveStatePerl587 on
Windows2000)
Thanks
Best regards
Peter Juuls
------------------------------
Date: 15 Feb 2006 17:05:47 GMT
From: xhoster@gmail.com
Subject: Re: How to stop perl from exiting when stat($_)->size fails
Message-Id: <20060215120653.970$gp@newsreader.com>
"Peter Juuls" <peter@nospam.com> wrote:
> In my script I fetch the filesize with stat($_)->size from File::stat.
> Occasionally it fails although the file exists, and perl exits with this
> error on STDERR: Can't call method "size" on an undefined value at
> myscript.pl line 7.
If you change it to:
(stat($_) or die $!)->size;
Then at least you will get the real error message.
>
> I don't want the script to exit, instead I want to ignore the "bad" file
> and continue with the next file. I have tried to do tests on
> file-existence BEFORE the stat->size is executed,
You probably have a race condition, where the file exists the first 3 times
you stat it, but not the final time.
> to prevent perl from
> exiting, but nothing seems to work.
If you don't want Perl to exit, don't call the size method on an undefined
value. The easiest way to do that is to check the definedness of the value
before calling the method.
>
> use File::stat
> .....
> if ((-e $_) && (-r $_) && ($st = stat($_)) {
> $bytes = stat($_)->size ;
> }
my $st=stat($_);
if (defined $st) {
$bytes=$st->size;
};
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Wed, 15 Feb 2006 17:29:45 +0000 (UTC)
From: Ian Wilson <scobloke2@infotop.co.uk>
Subject: Re: How to stop perl from exiting when stat($_)->size fails
Message-Id: <dsvoe6$5q8$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com>
Peter Juuls wrote:
> In my script I fetch the filesize with stat($_)->size from File::stat.
> Occasionally it fails although the file exists, and perl exits with this
> error on STDERR: Can't call method "size" on an undefined value at
> myscript.pl line 7.
>
> I don't want the script to exit, instead I want to ignore the "bad" file and
> continue with the next file. I have tried to do tests on file-existence
> BEFORE the stat->size is executed, to prevent perl from exiting, but nothing
> seems to work.
>
> use File::stat
> .....
I hope "....." means "use Strict; use Warnings;"
> if ((-e $_) && (-r $_) && ($st = stat($_)) {
perldoc File::Stat says
$st = stat($file) or die "No $file: $!";
It looks like you are discarding some useful info.
You could simplify this expression by using fewer parens with a lower
precedence operator and remembering that $_ is a default variable for
many operators. I'd write something like:
if ( -e and -r and ... ) {
Though I'm not certain that readability is a prerequisite for
determinimg the size of a file (is it?)
> $bytes = stat($_)->size ;
Huh? See perldoc File::Stat for the correct usage!
You might end up with:
$bytes = $st->size if <expression>;
> }
>
> How can I prevent the script from exiting? (ActiveStatePerl587 on
> Windows2000)
In general, see
perldoc -f eval
I'd break the expression down into separate statements so that I could
report failures more fully:
"file '$_' does not exist!\n"
"unable to eval stat->size of '$_' because $@"
etc.
I'm unfamiliar with File::Stat and haven't tested the code quoted above,
so caveat emptor. Hopefully it will point you in the right direction.
------------------------------
Date: Wed, 15 Feb 2006 21:49:18 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: How to stop perl from exiting when stat($_)->size fails
Message-Id: <Xns976BAB371B77asu1cornelledu@127.0.0.1>
Ian Wilson <scobloke2@infotop.co.uk> wrote in
news:dsvoe6$5q8$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com:
> Peter Juuls wrote:
>> In my script I fetch the filesize with stat($_)->size from
>> File::stat. Occasionally it fails although the file exists, and perl
>> exits with this error on STDERR: Can't call method "size" on an
>> undefined value at myscript.pl line 7.
>>
>> I don't want the script to exit, instead I want to ignore the "bad"
>> file and continue with the next file. I have tried to do tests on
>> file-existence BEFORE the stat->size is executed, to prevent perl
>> from exiting, but nothing seems to work.
>>
>> use File::stat
>> .....
>
> I hope "....." means "use Strict; use Warnings;"
use strict;
use warnings;
Case matters.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Wed, 15 Feb 2006 19:41:38 +0100
From: "GHL" <landauf@inode.at>
Subject: Re: Looking for script setting a pixel marker in an image
Message-Id: <dsvsl4015i3@news3.newsguy.com>
Thanks for thishint, Ruud !
I will master up all my humble Perl knowledge and give that a try !
"Dr.Ruud" <rvtol+news@isolution.nl> schrieb im Newsbeitrag
news:dstuff.14g.1@news.isolution.nl...
> GHL schreef:
>
>> I am looking for a script, which is able to set a pixel marker in an
>> image file at position x|y (whereas xmax and ymax are the maximum
>> width and height of that image in pixels).
>> The color value shall be handed over with constant col.
>>
>> For reason of simplicity the filename does not vary and should be
>> filename.ext and the path can be define hardcoded in the script.
>>
>> It would be of great help if the pointsize of the pixel marker could
>> be defined within the script using a numeric value, thus 2 would mean
>> the marker is 2x2 pixels in size.
>>
>> Seems simple but I didn't find a solution to this problem (and my Perl
>> knowledge is only very basic...).
>>
>> +++
>>
>> Does anyone of you know a script, which can do just this (or even
>> more) or can remember where he has seen any (any specific link
>> appreciated !) ?
>>
>> Thanks so much in advance !
>
> Try GD::Simple, http://search.cpan.org/~lds/GD/GD/Simple.pm
>
> --
> Affijn, Ruud
>
> "Gewoon is een tijger."
>
------------------------------
Date: 15 Feb 2006 19:19:38 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Merging sparse arrays
Message-Id: <slrndv6vma.cm.abigail@alexandra.abigail.nl>
Samwyse (samwyse@gmail.com) wrote on MMMMDLI September MCMXCIII in
<URL:news:oxFIf.30309$F_3.6888@newssvr29.news.prodigy.net>:
** I have two arrays of equal length that contain null values. I want one
** array with fewer nulls. This almost works:
**
** push @t, shift(@f).shift(@g) while scalar @f;
**
** except that every once in a while both arrays have values in the same
** slot. This won't work at all:
**
** push @t, shift(@f)||shift(@g) while scalar @f;
**
** because the || operator short-circuits. Can anyone do this in one line,
** or do I need do it the hard way:
**
** while (scalar @f) {
** ($a, $b) = (shift(@f), shift(@g));
** push @t, $a || $b;
** }
I'd avoid push, and do something like:
my @t = map {defined $f [$_] ? $f [$_] : $g [$_]} 0 .. $#f;
Or if you have the defined-or operator:
my @t = map {$f [$_] // $g [$_]} 0 .. $#f;
Note that I didn't use '$f [$_] || $g [$_]', as that will assign the
value of @g if the corresponding value of @f is 0, or the empty string
(both values are defined, but false).
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
------------------------------
Date: Wed, 15 Feb 2006 20:59:46 GMT
From: "Robert" <rbutcher.nospam@hotmail.com>
Subject: Problem reading & displaying MHTML file type
Message-Id: <6DMIf.13589$B94.5803@pd7tw3no>
Hi,
I have a small piece of code where perl reads an .HTM file and displays it
in your browser:
#!/usr/bin/perl
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
use strict;
open (FH, "<page.htm") or die &error;
my @page = <FH>;
close(FH);
print "Content-type: text/html \n\n";
print @page;
exit;
This works totally fine.
The problem is now we are working with .MHTML files. Using the code above,
when trying to open and display a MHTML file, the contents of the file's
source is displayed instead of a formatted page. MHTML files define the
Content-type within the file itself at the top and use multipart/related. I
tried modifying my code above to that content-type but that didnt work. I'm
hoping maybe someone has a suggestion on how I can make this work. Many
thanx in advance.
Robert
------------------------------
Date: Wed, 15 Feb 2006 21:39:39 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Problem reading & displaying MHTML file type
Message-Id: <Xns976BA993DE050asu1cornelledu@127.0.0.1>
"Robert" <rbutcher.nospam@hotmail.com> wrote in
news:6DMIf.13589$B94.5803@pd7tw3no:
> Hi,
>
> I have a small piece of code where perl reads an .HTM file and
> displays it in your browser:
>
> #!/usr/bin/perl
>
> use CGI qw(:standard);
> use CGI::Carp qw(fatalsToBrowser);
> use strict;
use warnings;
missing.
$| = 1;
is a good idea with CGI scripts.
> open (FH, "<page.htm") or die &error;
open my $fh, '<', 'page.htm' or die error();
Lexical filehandles and the three argument form of open is generally
preferable.
&error has specific effects (see perldoc perlsub). If you don't know
what those are, you don't need them.
> my @page = <FH>;
Why slurp the whole file only to print it out
print while <$fh>;
scales much better.
> close(FH);
>
> print "Content-type: text/html \n\n";
Why use CGI.pm if you are not going to use it.
print header('text/html');
> print @page;
> exit;
exit is completely unnecessary here.
>
> This works totally fine.
So, to wrap it up:
open my $html, '<', 'page.htm' or die error();
print header('text/html');
print while <$html>;
close $html;
> The problem is now we are working with .MHTML files. Using the code
> above, when trying to open and display a MHTML file, the contents of
> the file's source is displayed instead of a formatted page. MHTML
> files define the Content-type within the file itself at the top and
> use multipart/related. I tried modifying my code above to that
> content-type but that didnt work. I'm hoping maybe someone has a
> suggestion on how I can make this work. Many thanx in advance.
I don't know anything about mhtml files, but maybe using the correct
MIME type would work:
print header('message/rfc822');
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Wed, 15 Feb 2006 16:19:06 +0000
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: The inverse problem: generate all instances of a regexp
Message-Id: <43f3547a$0$3592$ed2e19e4@ptn-nntp-reader04.plus.net>
Andrei Alexandrescu (See Website For Email) wrote:
> I wonder how this could be done elegantly. Given a regular expression
> $re, write a function Generate($) that returns a list of all possible
> strings that could match $re. If the set is infinite, die with an error
> message.
The latter sounds like the "halting problem"
BugBear
------------------------------
Date: Wed, 15 Feb 2006 16:25:47 +0000
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: The inverse problem: generate all instances of a regexp
Message-Id: <43f3560b$0$6980$ed2619ec@ptn-nntp-reader02.plus.net>
Andrei Alexandrescu (See Website For Email) wrote:
> I wonder how this could be done elegantly. Given a regular expression
> $re, write a function Generate($) that returns a list of all possible
> strings that could match $re. If the set is infinite, die with an error
> message.
>
> For example, if $re = '(debug|release)/progname\.(c|h)', Generate($re)
> should return four strings:
>
> 'debug/progname.c'
> 'debug/progname.h'
> 'release/progname.c'
> 'release/progname.h'
>
> If, on the other hand, $re = '(debug/release)/.*\.(c|h)' then
> Generate($re) should die.
>
> Any ideas on how to do that in a clever manner? (The only way that I
> think of is to parse $re and use recursion etc.)
BTW, a related activity is to define a EBNF grammer
(with weightings) and use it to generate random
output.
http://www.stonehenge.com/merlyn/LinuxMag/col04.html
http://www-cs-faculty.stanford.edu/~zelenski/rsg/grammars/
http://www-cs-faculty.stanford.edu/~zelenski/rsg/
I have used such things to generate USEFUL
test data.
BugBear
------------------------------
Date: 15 Feb 2006 08:51:50 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
To: bugbear <bugbear@papermule.co.uk>
Subject: Re: The inverse problem: generate all instances of a regexp
Message-Id: <86slqk1s61.fsf@blue.stonehenge.com>
>>>>> "bugbear" == bugbear <bugbear@trim_papermule.co.uk_trim> writes:
bugbear> http://www.stonehenge.com/merlyn/LinuxMag/col04.html
And be sure to check out (in the CPAN) Inline::Spew, which came
from me writing <URL:http://www.stonehenge.com/merlyn/LinuxMag/col57.html>.
That way, you don't have to copy the code from LM-col04 carefully into your
program, and you can optimize the compilation from Spew to data structures.
print "Just another Perl hacker,"; # the original
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
*** Free account sponsored by SecureIX.com ***
*** Encrypt your Internet usage with a free VPN account from http://www.SecureIX.com ***
------------------------------
Date: Wed, 15 Feb 2006 18:38:56 +0000
From: Ben Bacarisse <ben.usenet@bsb.me.uk>
Subject: Re: The inverse problem: generate all instances of a regexp
Message-Id: <pan.2006.02.15.18.38.56.480232@bsb.me.uk>
On Wed, 15 Feb 2006 16:19:06 +0000, bugbear wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> I wonder how this could be done elegantly. Given a regular expression
>> $re, write a function Generate($) that returns a list of all possible
>> strings that could match $re. If the set is infinite, die with an error
>> message.
>
> The latter sounds like the "halting problem"
At first glace it looks way, way easier to me. The set of matching
strings is unbounded if the RE does not start and end with ^ and $ or if
in contains any of the forms <r>* <r>+ <r>{<n>,} such that the nested RE
<r> can actually match something (or non-zero length). In all the
examples I can think of, you can tell if an RE can't match anything.
--
Ben.
------------------------------
Date: Wed, 15 Feb 2006 11:39:24 -0800
From: "Andrei Alexandrescu (See Website For Email)" <SeeWebsiteForEmail@moderncppdesign.com>
Subject: Re: The inverse problem: generate all instances of a regexp
Message-Id: <IuquLo.pBB@beaver.cs.washington.edu>
John W. Krahn wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> I wonder how this could be done elegantly. Given a regular expression
>> $re, write a function Generate($) that returns a list of all possible
>> strings that could match $re. If the set is infinite, die with an error
>> message.
>>
>> For example, if $re = '(debug|release)/progname\.(c|h)', Generate($re)
>> should return four strings:
>>
>> 'debug/progname.c'
>> 'debug/progname.h'
>> 'release/progname.c'
>> 'release/progname.h'
>>
>> If, on the other hand, $re = '(debug/release)/.*\.(c|h)' then
>> Generate($re) should die.
>
> That is not infinite, unless you know of a file system that can use infinitely
> large file names.
Well I didn't say $re really represents a file name ;o). But, point
taken. Let me replace "infinite" with "theoretically unbounded".
Andrei
------------------------------
Date: Wed, 15 Feb 2006 11:40:16 -0800
From: "Andrei Alexandrescu (See Website For Email)" <SeeWebsiteForEmail@moderncppdesign.com>
Subject: Re: The inverse problem: generate all instances of a regexp
Message-Id: <Iuqun4.pCo@beaver.cs.washington.edu>
Josef Moellers wrote:
> Andrei Alexandrescu (See Website For Email) wrote:
>> I wonder how this could be done elegantly. Given a regular expression
>> $re, write a function Generate($) that returns a list of all possible
>> strings that could match $re. If the set is infinite, die with an
>> error message.
>>
>> For example, if $re = '(debug|release)/progname\.(c|h)', Generate($re)
>> should return four strings:
>>
>> 'debug/progname.c'
>> 'debug/progname.h'
>> 'release/progname.c'
>> 'release/progname.h'
>
> You do know, that your re would also match all strings that have
> arbitrary pre- and postfix strings, such as
> adebug/progname.c
> bdebug/progname.c
> cdebug/progname.c
> ...
> debug/progname.ca
> debug/progname.cb
> debug/progname.cc
> ...
> To name but a few ;-)
>
> If you anchor your pattern, then you'r more safe:
> $re = '^(debug|release)/progname\.(c|h)$'
Oh yes, that's what I was referring to.
Andrei
------------------------------
Date: Wed, 15 Feb 2006 12:07:00 -0800
From: "Andrei Alexandrescu (See Website For Email)" <SeeWebsiteForEmail@moderncppdesign.com>
Subject: Re: The inverse problem: generate all instances of a regexp
Message-Id: <Iuqvvo.q2y@beaver.cs.washington.edu>
A. Sinan Unur wrote:
> "Andrei Alexandrescu (See Website For Email)"
> <SeeWebsiteForEmail@moderncppdesign.com> wrote in
> news:Iupuns.1J37@beaver.cs.washington.edu:
>
>> I wonder how this could be done elegantly.
>
> Hmmm ... Please don't bury your question in the subject line.
>
> Subject: The inverse problem: generate all instances of a regexp
I think the actual subject conveys more information than "How to solve
elegantly the inverse problem: ..."
> The YAPE::Regex modules might be of some help:
Thanks, I'll look into it.
>> Any ideas on how to do that in a clever manner? (The only way that I
>> think of is to parse $re and use recursion etc.)
>
> I have to wonder, however, why you want to do this. There might be
> another, more appropriate solution to the real problem you are trying to
> solve.
Ok, here's my problem.
I am writing a "make" facility for perl. Yes, Unix "make". I find make
obtuse and limited in unexpected ways, and I'm generating many files
from within Perl itself, so I wrote a little engine that allows me to write:
use Make;
sub Compile { ... }
sub Link { ... }
Depends "aout", "main.o", \&Link;
Depends "main.o", ["main.c", "main.h"], \&Compile;
Make "aout";
Of course, the simplified example above doesn't show the power of the
engine, which shines through when it comes about automatically inferring
rules. For example, the last rule above could be inferred from:
DepPattern '(.*)\.o', ['$1.c', '$1.h'], \&Compile;
I'm quite pleased with having the power of full regexes when defining
makefile rules. Now, I wanted to do something more ambitious. I wanted
to be able to specify a pattern like:
DepPatternMulti 'debug|candidate|release',
'$multi/(.*)\.o', ['$1.c', '$1.h'], \&Compile;
The line above would be equivalent with:
DepPattern 'debug/(.*)\.o', ['$1.c', '$1.h'], \&Compile;
DepPattern 'candidate/(.*)\.o', ['$1.c', '$1.h'], \&Compile;
DepPattern 'release/(.*)\.o', ['$1.c', '$1.h'], \&Compile;
For that, I'd need to expand a possibly complex regexp into all of the
possible strings it could generate. Of course, more limited solutions
would be usable, but the "ars gratia artis" solution would involve
dealing with the full-fledged problem.
Andrei
------------------------------
Date: Wed, 15 Feb 2006 14:13:16 -0600
From: Todd <null@no.spam>
Subject: Re: Why can't JavaScript work when embeded in Perl CGI code?
Message-Id: <dt0211$91v$1@home.itg.ti.com>
Dave wrote:
> Greetings
>
> I had a working Perl CGI code which generates HTML page based on the
> paramaeters.
>
> I want to add a little JavaScript function like
Dave,
Lincoln Stein has documented CGI.pm very well. You should read it:
http://search.cpan.org/dist/CGI.pm/CGI.pm.
Look at the following for a template:
Todd
#!/my/path/to/perl/bin/perl
################################################################################
## modules
################################################################################
use strict;
use warnings;
use diagnostics;
use CGI;
################################################################################
## globals
################################################################################
my $html = new CGI;
my $style1 = '/css/content.css';
my $style2 = '/css/layout.css';
my $common_js = '/javascript/common.js';
################################################################################
## control
################################################################################
&start;
&content;
&tail;
################################################################################
## body
################################################################################
sub content
{
print $html->button(-name=>'button_name',
-id=>'button_name',
-value=>'user visible label',
-onClick=>"go_download()");
}
################################################################################
## header
################################################################################
sub start
{
print $html->header();
print $html->start_html(-title=>'CGI & JS',
-style=>{-src=>[$style1,$style2],
-code=> &local_css },
-script=>[
{ -language=> 'JavaScript',
-src=> $common_js
},
{ -language=> 'JavaScript',
-code=> &local_js
},
]
);
}
################################################################################
## End
################################################################################
sub tail
{
print $html->end_form();
print $html->end_html();
}
################################################################################
## CSS inside of Perl
################################################################################
sub local_css
{
my $this_css = '';
$this_css = qq(a{text-decoration:none;});
return $this_css;
}
################################################################################
## JS inside of Perl
################################################################################
sub local_js
{
my $this_js = '';
$this_js = <<JS_END;
function go_download()
{
if (confirm("Are you sure you want to download?"))
{
alert("it works!")
}
}
JS_END
return $this_js;
}
__END__
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 8959
***************************************