[17059] in Perl-Users-Digest
Perl-Users Digest, Issue: 4471 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 29 18:05:41 2000
Date: Fri, 29 Sep 2000 15:05:21 -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: <970265121-v9-i4471@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 29 Sep 2000 Volume: 9 Number: 4471
Today's topics:
Re: "use Foo qw(bar)" vs. "use Foo qw(&bar)" -- What's nobull@mail.com
Re: "use Foo qw(bar)" vs. "use Foo qw(&bar)" -- What's <jeffp@crusoe.net>
Re: [Q] Perldoc on UNIX?? (Garry Williams)
AppConfig fsconzo@my-deja.com
Appeler un fichier Perl gbigot@free.fr
Re: Appeler un fichier Perl <jeff@vpservices.com>
Re: benefits of perl (Mark-Jason Dominus)
Re: benefits of perl <sariq@texas.net>
Re: benefits of perl <celliot@tartarus.uwa.edu.au>
Re: can't create file or mkdir on some servers <bkennedy@hmsonline.com>
Re: Candidate for the top ten perl mistakes list <bart.lateur@skynet.be>
Re: Converting Text? nobull@mail.com
Re: Converting Text? <godzilla@stomp.stomp.tokyo>
Re: Converting Text? <jeffp@crusoe.net>
Re: Converting Text? <flavell@mail.cern.ch>
database accessing <jtjohnston@courrier.usherb.ca>
Re: database accessing <lr@hpl.hp.com>
Re: dereferencing an array from within a hash value <bart.lateur@skynet.be>
Re: E-commerce - getting started <hosting@NOme.icobb.SPAMcom>
Re: Fehlermeldung beim =?ISO-8859-1?Q?Ausf=FChren?= ein ebohlman@omsdev.com
Re: Fehlermeldung beim Ausführen eines Scripts! <lr@hpl.hp.com>
Re: function reference <tim@ipac.caltech.edu>
Re: getting hidden values with param function (Richard J. Rauenzahn)
Re: getting hidden values with param function (Abigail)
Re: getting hidden values with param function (Craig Berry)
Re: getting hidden values with param function <jeff@vpservices.com>
Re: getting hidden values with param function <bmb@ginger.libs.uga.edu>
Re: help renaming a file <tlos@UNSOLICITEDtlos.org>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 29 Sep 2000 19:10:38 +0100
From: nobull@mail.com
Subject: Re: "use Foo qw(bar)" vs. "use Foo qw(&bar)" -- What's the difference?
Message-Id: <u9snqj6pcx.fsf@wcl-l.bham.ac.uk>
Francis Litterio <franl-removethis@world.omitthis.std.com> writes:
> use POSIX qw(tmpnam); # No '&' before "tmpname".
> use POSIX qw(&tmpnam); # Use '&' before "tmpname".
> But I can't find any documentation of the semantic difference between the
> two syntaxes (if there is any difference -- perhaps they mean the same
> thing but the '&' is allowed for clarity?).
>
> Can anyone explain?
How about looking at the source of Exporter.pm? It clearly strips
leading '&' from things in the list. Since this is undocumented and
all the examples in the documentation don't have a leading '&' I think
it would be better to leave it off.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 29 Sep 2000 15:43:38 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: "use Foo qw(bar)" vs. "use Foo qw(&bar)" -- What's the difference?
Message-Id: <Pine.GSO.4.21.0009291541550.5957-100000@crusoe.crusoe.net>
[posted & mailed]
On Sep 29, nobull@mail.com said:
>> use POSIX qw(tmpnam); # No '&' before "tmpname".
>> use POSIX qw(&tmpnam); # Use '&' before "tmpname".
>
>How about looking at the source of Exporter.pm? It clearly strips
>leading '&' from things in the list. Since this is undocumented and
>all the examples in the documentation don't have a leading '&' I think
>it would be better to leave it off.
I don't think YOU looked at the source of Exporter.pm. ;)
The only place it strips the &'s is in the module USING Exporter:
[line 39]
if (!%exports) {
grep(s/^&//, @exports);
@exports{@exports} = (1) x @exports;
my $ok = \@{"${pkg}::EXPORT_OK"};
if (@$ok) {
grep(s/^&//, @$ok);
@exports{@$ok} = (1) x @$ok;
}
}
[line 156]
# shortcut for the common case of no type character
(*{"${callpkg}::$sym"} = \&{"${pkg}::$sym"}, next)
unless $sym =~ s/^(\W)//;
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: Fri, 29 Sep 2000 19:33:35 GMT
From: garry@ifr.zvolve.net (Garry Williams)
Subject: Re: [Q] Perldoc on UNIX??
Message-Id: <j86B5.274$UA3.15323@eagle.america.net>
On Fri, 29 Sep 2000 11:39:28 -0400, TAREK SELEEM
<s021tas@mail.wright.edu> wrote:
>
>Try this
>
>prompt> which perldoc
>
>will return the directory has it (if it's exist),
>then make sure that you have that in your path.
Here's from the manual page for which on Solaris:
DESCRIPTION
which takes a list of names and looks for the files which
would be executed had these names been given as commands.
Each argument is expanded if it is aliased, and searched for
along the user's path. Both aliases and path are taken from
the user's .cshrc file.
It's hard to see how the which command will find a command that is
*not* in the current PATH.
--
Garry Williams
------------------------------
Date: Fri, 29 Sep 2000 21:29:54 GMT
From: fsconzo@my-deja.com
Subject: AppConfig
Message-Id: <8r31k7$iv0$1@nnrp1.deja.com>
Greetings!
There are values in my config file I want stored into a hash.
I searched the web for different Configuration/Ini file readers.
I found AppConfig.
It explicitly states in the perldoc:
Variables may also be defined as hash lists. Each subsequent definition
creates a new key and value in the hash array.
So, I tried it. But it does not work. I scoured the newsgroups and the
web for people having reported a problem like this - but no one seems
to have done so.
Does anyone know what I am doing wrong?
Here's my config file (myfile.conf)
which should translate to a single variable testid
with value 9 and a hash groupcode with three
key/value pairs:
########################################
testid = 9
groupcode AC="DE"
groupcode AL="BG"
groupcode AX="EG"
And here's my code:
#####################################
#!/usr/local/bin/perl
use AppConfig;
$filename = "myfile.conf";
my $config = AppConfig->new();
$config->define("testid");
$config->define("groupcode",
{DEFAULT => "<undef>",
ARGCOUNT => ARGCOUNT_HASH
});
$config->file($filename);
# test a single value from the config file
print $config->testid(),"\n";
# try to get the hash from the config file
my $groupcodes = $config->groupcode();
foreach my $code (keys %$groupcodes) {
print "$code => $groupcodes->{$code}\n";
}
Finally... the only output I get is for the single
value. The hash is not recognized and value is wrong.
#########################################
1
I also tried using App::Reader which seems to be
a newer version, but it doesn't work on the hash either... plus it
no longer contains the documentation about the hash. It does however
locate testid and print out 9.
##### Using App::Config.
#!/usr/local/bin/perl
use App::Config;
$filename = "myfile.conf";
my $config = App::Config->new();
$config->define("testid");
$config->define("groupcode",
{DEFAULT => "<undef>",
ARGCOUNT => ARGCOUNT_HASH
});
$config->cfg_file($filename);
# test a single value from the config file
print $config->testid(),"\n";
# try to get the hash from the config file
my $groupcodes = $config->groupcode();
foreach my $code (keys %$groupcodes) {
print "$code => $groupcodes->{$code}\n";
}
Output this time is 9, but still no hash values.
#########################################
9
Anyone have any ideas?
Thanks for any suggestions.
Best Regards,
Frank Sconzo
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 29 Sep 2000 21:21:09 +0200
From: gbigot@free.fr
Subject: Appeler un fichier Perl
Message-Id: <39D4EBA4.C946A2B9@free.fr>
Bonjour,
J'essaie en vain d'appeler un fichier perl sur mon cgi-bin
J'ai vérifier les CHMOD, l'emplacement #!usr/bin/perl.
Comment faire ?
------------------------------
Date: Fri, 29 Sep 2000 12:28:52 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Appeler un fichier Perl
Message-Id: <39D4ED74.64EDCC2F@vpservices.com>
gbigot@free.fr wrote:
>
> Bonjour,
> J'essaie en vain d'appeler un fichier perl sur mon cgi-bin
> J'ai vérifier les CHMOD, l'emplacement #!usr/bin/perl.
> Comment faire ?
Tu as peut etre oublier '/' dans ton shebang: #!/usr/bin/perl -w.
Est-ce-que c'est vraiment ou perl ce trouve (dans /usr/bin)? Est-ce
qu'il y a des ^M dans ton fichier?
--
Jeff
------------------------------
Date: Fri, 29 Sep 2000 18:07:46 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: benefits of perl
Message-Id: <39d4da72.7011$2eb@news.op.net>
In article <39D4C824.854364E0@vpservices.com>,
Jeff Zucker <jeff@vpservices.com> wrote:
>Well, I suggest you use this reference:
>
>> Mark-Jason Dominus <mjd@plover.com> wrote in message
>> news:39d4bb7a.6b42$3d@news.op.net
The material I quoted there was taken from the perl man page.
So that is what he should cite.
I should have included the attribution myself.
------------------------------
Date: Fri, 29 Sep 2000 18:19:38 GMT
From: Tom Briles <sariq@texas.net>
Subject: Re: benefits of perl
Message-Id: <39D4DD39.A64C2C8F@texas.net>
[ YA Jeopardectomy performed. In the future, type your reply *after*
the quoted text. And only quote the text that is relevant to your post.
]
Cameron Elliott wrote:
>
> Mark-Jason Dominus <mjd@plover.com> wrote in message
> news:39d4bb7a.6b42$3d@news.op.net...
> > In article <39d4b2ca$0$7897@echo-01.iinet.net.au>,
> > Cameron Elliott <celliot@tartarus.uwa.edu.au> wrote:
> > >Can someone point me to any articles or documents outlining the benefits
> of
> > >using Perl over other languages?
> > >ie performance benefits, ease of use etc....
<snipped perl manpage (with no attribution, but perhaps mjd wrote that
portion)>
>
> thankyou,
>
> that was very helpful.
> I am actually looking for references as well.
> I am writing a paper and a little section is on perl so I need to reference
> these kinds of benefits.
> Any idea where I can find actual articles
<snipped perl manpage>
perldoc perl
Or, you can go to (drumroll, please) http://www.perl.com .
- Tom
------------------------------
Date: Sat, 30 Sep 2000 02:27:09 +0800
From: "Cameron Elliott" <celliot@tartarus.uwa.edu.au>
Subject: Re: benefits of perl
Message-Id: <39d4df37$0$7893@echo-01.iinet.net.au>
ok.. that sounds good. will do..
I looked up the site you gave me before and found some useful information
but am looking for a bit more.
If anyone knows any other sites or articles about perl (esp. perl vs Emacs)
please let me know..
thankyou
------------------------------
Date: Fri, 29 Sep 2000 20:56:30 GMT
From: "Ben Kennedy" <bkennedy@hmsonline.com>
Subject: Re: can't create file or mkdir on some servers
Message-Id: <2m7B5.13948$td5.2417806@news1.rdc2.pa.home.com>
"Jonah" <jjk@onlink.net> wrote in message
news:8r2bnh$8m2$1@onlink3.onlink.net...
> So I'm checking into umask and I'm totally confused. I have no idea what
umask
> is for. It seems like it's some kind of protective layer over the default
> permissions or something...
the umask allows you to specify what file permission are excluded when you
create a file. The benefit of this is that you don't accidentally create
executable, writable files. For example, a umask of 0022 (which is pretty
standard) will make it so you can't create a world writable or group
writable file. A umask of 0777 would make it impossible to create a file
with any modes
> I read the docs on mkdir, umask, chmod, open and it's just not clicking
for me.
> I'm confused. How can I create directories and files on this server? They
seem
> overly paranoid about their permissions...
Directories have the same permissions as files, except that the executable
bit means you can enter the directory. See
http://docuspace.uchicago.edu/dpc/unix/tutorial/basic04.html for basic info
> Actually, I just thought of another question... I know it's owner group
other
> so what category is my script in? What about the surfer?
This depends on the setup - anyone can own the script, but the web server
will run the script as non-privileged user, often just 'nobody'. Should
someone manage to exploit your script, this helps limit the damage that can
be done. This may be why you are experiencing file creation problems, check
google.com for some CGI tutorials.
--Ben Kennedy
------------------------------
Date: Fri, 29 Sep 2000 19:10:52 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Candidate for the top ten perl mistakes list
Message-Id: <6aq9ts8khj6jifsiabfc7hi52or05rhvaf@4ax.com>
Adrian Pepper [MFCF] wrote:
>My candidate for the top ten perl mistakes list
Thinking of a string as if it was an array.
--
Bart.
------------------------------
Date: 29 Sep 2000 19:00:27 +0100
From: nobull@mail.com
Subject: Re: Converting Text?
Message-Id: <u9u2az6ptw.fsf@wcl-l.bham.ac.uk>
Gary Mayor <gary@prosport.uk.com> writes:
Subject lines are important! Not everyone is too lazy to do a search
before they post and when people do a Usenet search what they see is a
list of subject lines.
> Subject: Converting Text?
There's a very simple rule to getting your subject lines right -
before you hit "Send" ask youself this question: "If I had seen a post
with my subject line before I posted would I have realised it was
probably the same question?". If the answer is "no" then DO NOT HIT
SEND until you are absoultely convinced that it is beyond your
intelegence to come up with a more suitable subject line.
Subject: Replacing characters by hexadecimal ASCII codes
> I'm using perl
Gee, you don't say! :-) (Or at least you shouldn't need to say, we do
get people here who are asking non-Perl questions but we still assume
that people who post here are using Perl unless they state otherwise
(in which case we tell then to go away)).
> and need to know how to convert the string,
> $a = "hello out there";
>
> to
>
> $a = "hello%20out%20there";
use CGI;
$a = CGI->escape($a);
The guts of CGI->escape() are actually very simple:
s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg;
However I still think it is better to use the standard library rather
than paste the above code into your scripts. (Unless you are having
you work graded by Godzilla).
For some reason the escape() method is not documented in perldoc CGI.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 29 Sep 2000 11:33:37 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Converting Text?
Message-Id: <39D4E081.30D6739E@stomp.stomp.tokyo>
nobull@mail.com wrote:
> Gary Mayor wrote:
(snip)
> > and need to know how to convert the string,
> > $a = "hello out there";
> > to
> > $a = "hello%20out%20there";
> use CGI;
> $a = CGI->escape($a);
> The guts of CGI->escape() are actually very simple:
> s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg;
> However I still think it is better to use the standard library rather
> than paste the above code into your scripts. (Unless you are having
> you work graded by Godzilla).
#!/usr/local/bin/perl
print "Content-type: text/plain\n\n";
$graded = "Hello Out There!";
$graded =~ s/ /%20/g;
print $graded;
exit;
PRINTED RESULTS:
________________
Hello%20Out%20There!
Godzilla!
------------------------------
Date: Fri, 29 Sep 2000 15:39:19 -0400
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Converting Text?
Message-Id: <Pine.GSO.4.21.0009291537510.5957-100000@crusoe.crusoe.net>
[posted & mailed]
On Sep 29, nobull@mail.com said:
>For some reason the escape() method is not documented in perldoc CGI.
Because it's an internal function, and not exported.
--
Jeff "japhy" Pinyan japhy@pobox.com http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
CPAN - #1 Perl Resource (my id: PINYAN) http://search.cpan.org/
------------------------------
Date: Fri, 29 Sep 2000 22:11:02 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Converting Text?
Message-Id: <Pine.GHP.4.21.0009292154400.6975-100000@hpplus01.cern.ch>
On Fri, 29 Sep 2000, Jeff Pinyan wrote:
> On Sep 29, nobull@mail.com said:
>
> >For some reason the escape() method is not documented in perldoc CGI.
There is a fine documentation for CGI.pm, maintained in HTML format by
the author. The POD unfortunately isn't it. (And even more
misleadingly, there are HTML-ified versions of the POD floating
around too).
How to recognise the documentation from quite a long way off:
- The HTML documentation (GOOD) begins like this
[logo] CGI.pm - a Perl5 CGI Library
Version 2.74, 9/13/2000, L. Stein
Abstract
This perl 5 library uses objects to create Web fill-out forms on the
fly and to parse their contents.
and then after the Abstract comes a bulleted list of hotlinks to the
various topic headings in the documentation which follows.
- The HTML-ified POD (LESS GOOD!), on the other hand, begins with this
heading:
CGI - Simple Common Gateway Interface Class
followed immediately by a table of contents which begins
* NAME
* SYNOPSIS
* ABSTRACT
* DESCRIPTION
(and does not appear to mention which version it's applicable to).
I strongly recommend the HTML documentation:
http://stein.cshl.org/WWW/software/CGI/
(if you don't use the latest stable release from the author's
site, then you presumably need the version appropriate to the
version of CGI.pm that you use).
> Because it's an internal function, and not exported.
Well, it's "not exported as standard". But the author's documentation
does (now) document it:
In addition to the standard imported functions, there are a few
optional functions that you must request by name if you want them.
They were originally intended for internal use only, but are now made
available by popular request.
escape(), unescape()
use CGI qw/escape unescape/;
$q = escape('This $string contains ~wonderful~ characters');
$u = unescape($q);
These functions escape and unescape strings according to the URL hex
escape rules. For example, the space character will be converted into
the string "%20".
all the best
------------------------------
Date: Fri, 29 Sep 2000 16:55:53 -0400
From: jtjohnston <jtjohnston@courrier.usherb.ca>
Subject: database accessing
Message-Id: <39D501D8.64B7@courrier.usherb.ca>
I was reading my last post and realised it wasn't very clear. I've been
losing threads lately anyways. Maybe my news server?
I have a database file that looks like:
--- Snip -----
John:5:
Gail:3:
Dave:3:
--- Snip -----
Question 1:
How can I increase the value of one person?
Gail:4:
And be able to read all the data back into the file?
Question 2:
How can I add a new line, if a person didn't exist in the file:
-----------------------------------------------------------------
I've tried this but failed:
sub RegisterVote
{
open (VOTINGDATAFILE, "$votes_database") or die "can't open
$votes_database: $!\n";
@VoteData = <VOTINGDATAFILE>;
close VOTINGDATAFILE;
foreach $Message (@Data)
{
@VoteData = split (/:/, $Message);
if ($VoteData[0] eq $in{'Vote1'}
{
$VoteData[1]++;
}
}
open(VOTES,">$votes_database") or die "can't open
$votes_database:
$!\n";
print VOTES @VOTES;
close VOTES;
}
------------------------------
Date: Fri, 29 Sep 2000 14:49:11 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: database accessing
Message-Id: <MPG.143eae36e2ebf96698ade1@nntp.hpl.hp.com>
In article <39D501D8.64B7@courrier.usherb.ca> on Fri, 29 Sep 2000
16:55:53 -0400, jtjohnston <jtjohnston@courrier.usherb.ca> says...
...
> I have a database file that looks like:
>
> --- Snip -----
> John:5:
> Gail:3:
> Dave:3:
> --- Snip -----
>
> Question 1:
> How can I increase the value of one person?
>
> Gail:4:
>
> And be able to read all the data back into the file?
> Question 2:
> How can I add a new line, if a person didn't exist in the file:
>
> -----------------------------------------------------------------
> I've tried this but failed:
>
> sub RegisterVote
> {
> open (VOTINGDATAFILE, "$votes_database") or die "can't open
> $votes_database: $!\n";
Good, except for the supfluous quotes.
> @VoteData = <VOTINGDATAFILE>;
Poor. An array is not the write data structure for a search. Use a
hash!
> close VOTINGDATAFILE;
>
> foreach $Message (@Data)
Where did @Data suddenly appear from?
Please don't ever post code here that won't pass 'use strict;' and run
without warnings.
> {
> @VoteData = split (/:/, $Message);
> if ($VoteData[0] eq $in{'Vote1'}
> {
> $VoteData[1]++;
> }
> }
> open(VOTES,">$votes_database") or die "can't open
> $votes_database:
> $!\n";
Just hope your system doesn't crash during the subsequent write, or bye-
bye, data! The proper way to update a file is described in perlfaq5.
In a high-volume environment, you would also need to worry about file
locking to prevent simultaneous-access disasters.
> print VOTES @VOTES;
Where did @VOTES suddenly appear from?
Please don't ever post code here that won't pass 'use strict;' and run
without warnings.
> close VOTES;
> }
Untested sketch of the complete solution, less the proper file handling:
# Create the data structure from the file:
my %votes;
/([^:]+):(\d+)/ and $votes{$1} = $2 while <VOTES>;
# Update the data structure from the input data (this adds an entry if
there is none):
$votes{$in{Vote1}}++;
# Write the updated file.
print OUTFILE map "$_:$votes{$_}:\n" => sort keys %votes;
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 29 Sep 2000 19:05:41 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: dereferencing an array from within a hash value
Message-Id: <30q9tssie6lqhftels89urohp9v4c0euel@4ax.com>
Dave wrote:
>%FIELDS = ('personal information' => ['Name', 'Address', 'Tele', 'Fax']);
>How do I dereference $FIELDS{$_} so that
>Name, Address, Tele, Fax prints out?
print $FIELDS{$_}{Name};
--
Bart.
------------------------------
Date: Fri, 29 Sep 2000 14:56:12 -0400
From: "Free Hosting" <hosting@NOme.icobb.SPAMcom>
Subject: Re: E-commerce - getting started
Message-Id: <8r2oc9$sf1$1@slb7.atl.mindspring.net>
Nebulus wrote in message ...
<snip>
>Sorry if these are ignorant questions, but I'm VERY new to perl. I'd do it
>all in servlets and JSP (definately easier using those APIs!), but my host
>is dragging their feet on installing a JAva Web Server as well. Thanks for
>any help!
First, get a new friendly host.
Second - check perlarchive.com - I'm almost positive the answer is there
--
Ecommerce power? Secure? Fast? Online? We bet our business on it.
http://domains.icobb.com - Pure Power Hosting
3 megs free with domain registration only $50 - 2 years
------------------------------
Date: 29 Sep 2000 18:51:10 GMT
From: ebohlman@omsdev.com
Subject: Re: Fehlermeldung beim =?ISO-8859-1?Q?Ausf=FChren?= eines Scripts!
Message-Id: <8r2oau$1n8$3@news.enteract.com>
Ralf Siedow <replynews@bigfoot.com> wrote:
> Sorry guys for posting in german. I was too stupid to realize that this is
> an english newsgroup!
[primarily for others' benefit]
While the predominant language of comp.lang.perl.misc is in fact English,
there's a fairly widespread sentiment among the regulars that it's better
to post in one's native language in the hopes that someone who speaks that
language will come along and either answer or translate than it is to post
in seriously broken English which is likely to be either misunderstood or
not understood at all. Of course, the more code and the less prose
included in a post, the less effect language barriers have; therefore it's
almost always a good idea to post actual code (just be sure to trim it
down appropriately) rather than descriptions of code.
------------------------------
Date: Fri, 29 Sep 2000 12:04:41 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Fehlermeldung beim Ausführen eines Scripts!
Message-Id: <MPG.143e87a1eff2ed5e98addd@nntp.hpl.hp.com>
In article <8r2l4p$gt0kb$1@ID-23826.news.cis.dfn.de> on Fri, 29 Sep 2000
19:57:23 +0200, Ralf Siedow <replynews@bigfoot.com> says...
> Sorry guys for posting in german. I was too stupid to realize that this is
> an english newsgroup!
It isn't an English newsgroup. People are encouraged to post in
whatever language they feel best to express their situation, recognizing
that this may restrict the number of people able to respond.
> Thx for solving my problem!
But I'm glad you got what you needed.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 29 Sep 2000 12:17:29 -0700
From: Tim Conrow <tim@ipac.caltech.edu>
Subject: Re: function reference
Message-Id: <39D4EAC9.DB279233@ipac.caltech.edu>
Philip Garrett wrote:
>
> chalesx <chalesx@yahoo.com> wrote in message
> news:st7e2ti40qn57b@corp.supernews.com...
> > Hi,
> >
> > Do anyone know how to pass a function like 'sort'?
> >
> > Currently, I can only pass a function using reference:
> > foo_caller(\&foo)
> >
> > or
> >
> > pass the string value of the function and use 'eval' the run the function.
> >
> > I would like to create something similar to 'sort' where you
> > can pass the function 'naked'. (e.g. sort numerically (5, 6, 1, ...))
>
> I'm not sure if it's possible to exactly mimic the sort syntax, though I am
> positive that if it is possible, someone on this list will explain. That
> being said, I have come up with this partial solution. It almost does what
> you ask, but you must separate the subroutine from the following
> arguments with a comma, as opposed to whitespace only.
>
> use strict;
> sub foo_caller (*;@) {
> my $subref = shift;
> no strict 'refs';
> &$subref(@_);
> }
>
> sub foo { print "@_\n" }
>
> foo_caller foo,1,2,3,4;
>
> Check out perldoc perlsub for an explanation of function prototypes.
I don't klow how to just pass a bareword sub name, but we can get a little
closer to sort syntax. Checkout this line in perlsub:
> sub mygrep (&@) mygrep { /foo/ } $a, $b, $c
... and these:
> An & requires an anonymous subroutine,
> which, if passed as the first argument, does not require
> the sub keyword or a subsequent comma.
So we can do
sub a { print " - go!\n"; }
sub b (&@) { my $x=shift; print "@_"; &$x; }
b {a} 1,2,3;
Read the limitations in perlsub carefully. Sub 'a' can only be passed args
through global var.s (such as $_). @_ doesn't work.
Why?
--
-- Tim Conrow tim@ipac.caltech.edu |
------------------------------
Date: 29 Sep 2000 18:33:14 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: getting hidden values with param function
Message-Id: <970252393.181364@hpvablab.cup.hp.com>
abigail@foad.org writes:
>
>You have a bug in line 17.
>
>
I think your Abigail::Prognosticate module is suffering from a bad
random seed.
http://www.deja.com/dnquery.xp?ST=QS&QRY=%7Ea+abigail+You+have+a+bug+in+line+17&svcclass=dnserver&DBS=2
Rich (But just to be safe, from now on my programs are going to have a
blank line 17.)
--
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: 29 Sep 2000 18:56:06 GMT
From: abigail@foad.org (Abigail)
Subject: Re: getting hidden values with param function
Message-Id: <slrn8t9pbm.k0e.abigail@alexandra.foad.org>
Richard J. Rauenzahn (nospam@hairball.cup.hp.com) wrote on MMDLXXXVI
September MCMXCIII in <URL:news:970252393.181364@hpvablab.cup.hp.com>:
.. abigail@foad.org writes:
.. >
.. >You have a bug in line 17.
.. >
.. >
..
.. I think your Abigail::Prognosticate module is suffering from a bad
.. random seed.
..
.. http://www.deja.com/dnquery.xp?ST=QS&QRY=%7Ea+abigail+You+have+a+bug+in+line+17&svcclass=dnserver&DBS=2
..
.. Rich (But just to be safe, from now on my programs are going to have a
.. blank line 17.)
Blank lines aren't counted anyway.
Abigail
--
:;$:=~s:
-:;another Perl Hacker
:;chop
$:;$:=~y
:;::d;print+Just.
$:;
------------------------------
Date: Fri, 29 Sep 2000 19:05:00 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: getting hidden values with param function
Message-Id: <st9puslm0qa104@corp.supernews.com>
Erik Pedersen (erikpede@online.no) wrote:
: I wonder if its not possible to get hidden form-values parsed with the param
: function. If its possible how do you do that?
By the time they reach your script, hidden form fields are
indistinguishable from ordinary text fields. And this isn't really a Perl
question, of course.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "Quidquid latine dictum sit, altum viditur."
|
------------------------------
Date: Fri, 29 Sep 2000 12:08:56 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: getting hidden values with param function
Message-Id: <39D4E8C8.DA6CA98C@vpservices.com>
"Richard J. Rauenzahn" wrote:
>
> abigail@foad.org writes:
> >
> >You have a bug in line 17.
> >
>
> I think your Abigail::Prognosticate module is suffering from a bad
> random seed.
Sheesh, who said 17 was random? You probably also don't know, as every
good poker player does, that Jack of Clubs is the most common card in
the deck.
--
Jeff
------------------------------
Date: Fri, 29 Sep 2000 15:29:52 -0400
From: Brad Baxter <bmb@ginger.libs.uga.edu>
Subject: Re: getting hidden values with param function
Message-Id: <Pine.A41.4.21.0009291528000.10690-100000@ginger.libs.uga.edu>
On Fri, 29 Sep 2000, Jeff Zucker wrote:
> "Richard J. Rauenzahn" wrote:
> >
> > abigail@foad.org writes:
> > >
> > >You have a bug in line 17.
> > >
> >
> > I think your Abigail::Prognosticate module is suffering from a bad
> > random seed.
>
> Sheesh, who said 17 was random? You probably also don't know, as every
> good poker player does, that Jack of Clubs is the most common card in
> the deck.
>
> --
> Jeff
No, no! The Two of Hearts is the most common.
Brad
--
Two's are wild, you know.
------------------------------
Date: Fri, 29 Sep 2000 14:42:51 -0400
From: "TLOS" <tlos@UNSOLICITEDtlos.org>
Subject: Re: help renaming a file
Message-Id: <8r2ni1$ru2$1@slb6.atl.mindspring.net>
I am using Carp, as always, and no errors are returned ... thanks guys. I
handled it.
Michael Budash wrote in message ...
>In article <slrn8t9e6n.miu.rgarciasuarez@rafael.kazibao.net>,
>rgarciasuarez@free.fr (Rafael Garcia-Suarez) wrote:
>
>> TLOS wrote in comp.lang.perl.misc:
>> >
>> >Rafael Garcia-Suarez wrote in message ...
>> >>> rename("$datafile", $newfile) || die("Cannot rename file");
>> >>
>> >>Is the working directory of your script correct? Have you made a chdir
>> >>to the directory where $datafile lives? You should print the $!
>> >>variable
>> >>in your error message; it contains the system error string and is
>> >>useful
>> >>to debug.
>> >
>> >There is no system error. All I want to do is rename the file. Nothing
>> >more,
>> >nothing less.
>>
>> Yes, but if the rename function gets called, and if the file is not
>> renamed, then a system-level error occured (file not found, permission
>> denied...) So I suggest that you change the die statement by:
>> rename($datafile, $newfile)
>> || die("Cannot rename $datafile to $newfile : $!\n");
>> and then, by checking the logs, you should find the cause of the error.
>
>
>good suggestion. and he wouldn't even have to 'check the logs' if he
>added this to the top of the script:
>
>use CGI::Carp 'fatalsToBrowser';
>
>hth-
>--
>Michael Budash ~~~~~~~~~~ mbudash@sonic.net
------------------------------
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 4471
**************************************