[17057] in Perl-Users-Digest
Perl-Users Digest, Issue: 4469 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 29 14:05:32 2000
Date: Fri, 29 Sep 2000 11:05:14 -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: <970250714-v9-i4469@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 29 Sep 2000 Volume: 9 Number: 4469
Today's topics:
"use Foo qw(bar)" vs. "use Foo qw(&bar)" -- What's the <franl-removethis@world.omitthis.std.com>
Re: "use Foo qw(bar)" vs. "use Foo qw(&bar)" -- What's <jeffp@crusoe.net>
Re: [Q] Perldoc on UNIX?? <s021tas@mail.wright.edu>
Re: Assigning to this scalar ${num}{'hex'} ? <uri@sysarch.com>
benefits of perl <celliot@tartarus.uwa.edu.au>
Re: benefits of perl (Mark-Jason Dominus)
Re: benefits of perl <celliot@tartarus.uwa.edu.au>
Re: benefits of perl <jeff@vpservices.com>
Can't call method "sockport" <happy-no-spam-@nietzsche.net>
Re: Can't call method "sockport" <happy-no-spam-@nietzsche.net>
can't create file or mkdir on some servers <jjk@onlink.net>
Re: Converting Text? <gary@prosport.uk.com>
E-commerce - getting started <news@nebulus.org>
Re: Enviroment Interaction For A Newbie <bkennedy@hmsonline.com>
Re: Fehlermeldung beim Ausführen eines Scripts! <replynews@bigfoot.com>
getting hidden values with param function <erikpede@online.no>
Re: getting hidden values with param function <tony_curtis32@yahoo.com>
Re: getting hidden values with param function (Abigail)
Re: help renaming a file <tlos@UNSOLICITEDtlos.org>
Re: help renaming a file (Rafael Garcia-Suarez)
Re: help renaming a file <mbudash@sonic.net>
Re: how do i use localhost <bkennedy@hmsonline.com>
How to deal with unicode char in perl? i0519@my-deja.com
How to deal with unicode char in perl? i0519@my-deja.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 29 Sep 2000 16:57:48 GMT
From: Francis Litterio <franl-removethis@world.omitthis.std.com>
Subject: "use Foo qw(bar)" vs. "use Foo qw(&bar)" -- What's the difference?
Message-Id: <m3snqji19v.fsf@franl.andover.net>
I've found that both of the following scripts work:
#!/usr/bin/perl -w
use strict;
use POSIX qw(tmpnam); # No '&' before "tmpname".
print tmpnam(), "\n";
and
#!/usr/bin/perl -w
use strict;
use POSIX qw(&tmpnam); # Use '&' before "tmpname".
print tmpnam(), "\n";
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?
--
Francis Litterio
franl-removethis@world.std.omit-this.com
PGP public keys available on keyservers.
------------------------------
Date: Fri, 29 Sep 2000 13:37:54 -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.0009291333420.5957-100000@crusoe.crusoe.net>
[posted & mailed]
On Sep 29, Francis Litterio said:
> 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?).
Did you look in the Exporter.pm documentation (most modules, including
POSIX.pm, use Exporter.pm for their symbol exporting)? Well, I did, and
it didn't mention it as far as I could see. So I checked the code itself
(you should do this too):
# shortcut for the common case of no type character
(*{"${callpkg}::$sym"} = \&{"${pkg}::$sym"}, next)
unless $sym =~ s/^(\W)//;
Basically, that's in a for-loop that's cycling over the symbols you're
asking to export from the specific module. If the symbol doesn't start
with a sigil (the $, @, %, *, or & character), it's assumed to be a
function.
--
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 11:39:28 -0400
From: TAREK SELEEM <s021tas@mail.wright.edu>
To: Joe Edgar <jedgar@mail.arc.nasa.gov>
Subject: Re: [Q] Perldoc on UNIX??
Message-Id: <Pine.GSO.4.10.10009291129550.8705-100000@paladin.wright.edu>
On Wed, 27 Sep 2000, Joe Edgar wrote:
> Date: Wed, 27 Sep 2000 12:55:20 -0700
> From: Joe Edgar <jedgar@mail.arc.nasa.gov>
> Newsgroups: comp.lang.perl.misc
> Subject: Re: [Q] Perldoc on UNIX??
>
>
> "amonotod" <amonotod@netscape.net> wrote in message
> news:8qth18$e99$1@nnrp1.deja.com...
> > In article <8qtee5$7c1$1@sun500.nas.nasa.gov>,
> > "Joe Edgar" <jedgar@mail.arc.nasa.gov> wrote:
> > > This is pretty bad I know, but here's the question. How do I use the
> > > perldoc command on a UNIX (solaris) system. I know in windows you
> > > just go to the perl directory and type perldoc *, but for UNIX do I
> > > have to set the "PATH=" variable to something? I'm a Newbie, so be
> > > gentle ;-)
> > >
> >
> > Did you try it? If so, what response did you get?
> >
> > amonotod
>
> Amonotd,
> Here's what happens:
>
> prompt> cd /
> prompt> perldoc
> perldoc: Command not found
> prompt> cd usr/local/bin
> prompt> ls -l perl*
> lrwxrwxrwx 1 root other 17 Sep 23 1997 perl ->
> /usr/ccf/bin/perl
> lrwxrwxrwx 1 root other 43 Sep 23 1997 perl5 ->
> ../../../share/sun4_sos5/ccf/perl5/bin/perl
> prompt> cd /usr/ccf/bin/
> prompt> perldoc
> perldoc: Command not found
>
> I know the perldoc command will always look in the path variable, but where
> would that perldoc 'library' be?
> Thanks for your response..
>
>
>
>
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.
Tarek
------------------------------
Date: Fri, 29 Sep 2000 17:58:50 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Assigning to this scalar ${num}{'hex'} ?
Message-Id: <x7ya0b5bc5.fsf@home.sysarch.com>
>>>>> "KCI" == Keith Calvert Ivey <kcivey@cpcug.org> writes:
KCI> Uri Guttman <uri@sysarch.com> wrote:
>> it is very simple but you have it all backwards. it is not a scalar you
>> want and you can't create or assign to $1, $2, etc. they are special to
>> regexes
KCI> But he wasn't trying to use $1, $2, etc. He was trying to use
KCI> %1, %2, etc., which are perfectly assignable. Of course it's
KCI> still a very bad idea, and he should be using an array of hash
KCI> refs, as you recommended.
yep, good points. at 3am $1 and $num = 1 ; ${num}{'foo'} look alike. :)
it was just so ugly to see al if that in one line of code that i was
blinded to the details. :)
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: Fri, 29 Sep 2000 23:17:33 +0800
From: "Cameron Elliott" <celliot@tartarus.uwa.edu.au>
Subject: benefits of perl
Message-Id: <39d4b2ca$0$7897@echo-01.iinet.net.au>
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....
thankyou
------------------------------
Date: Fri, 29 Sep 2000 13:16:38 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: benefits of perl
Message-Id: <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....
Perl is a language optimized for scanning arbitrary text files,
extracting information from those text files, and printing
reports based on that information. It's also a good language
for many system management tasks. The language is intended to
be practical (easy to use, efficient, complete) rather than
beautiful (tiny, elegant, minimal).
Perl combines (in the author's opinion, anyway) some of the
best features of C, sed, awk, and sh, so people familiar with
those languages should have little difficulty with it.
(Language historians will also note some vestiges of csh,
Pascal, and even BASIC-PLUS.) Expression syntax corresponds
closely to C expression syntax. Unlike most Unix utilities,
Perl does not arbitrarily limit the size of your data--if
you've got the memory, Perl can slurp in your whole file as a
single string. Recursion is of unlimited depth. And the
tables used by hashes (sometimes called "associative arrays")
grow as necessary to prevent degraded performance. Perl can
use sophisticated pattern matching techniques to scan large
amounts of data quickly. Although optimized for scanning text,
Perl can also deal with binary data, and can make dbm files
look like hashes. Setuid Perl scripts are safer than C
programs through a dataflow tracing mechanism that prevents
many stupid security holes.
If you have a problem that would ordinarily use sed or awk
or sh, but it exceeds their capabilities or must run a
little faster, and you don't want to write the silly thing
in C, then Perl may be for you. There are also transla-
tors to turn your sed and awk scripts into Perl scripts.
But wait, there's more...
Begun in 1993 (see the perlhist manpage), Perl version 5
is nearly a complete rewrite that provides the following
additional benefits:
o modularity and reusability using innumerable modules
Described in the perlmod manpage, the perlmodlib manpage,
and the perlmodinstall manpage.
o embeddable and extensible
Described in the perlembed manpage, the perlxstut manpage,
the perlxs manpage, the perlcall manpage, the perlguts
manpage, and the xsubpp manpage.
o roll-your-own magic variables (including multiple
simultaneous DBM implementations)
Described in the perltie manpage and the AnyDBM_File
manpage.
o subroutines can now be overridden, autoloaded, and prototyped
Described in the perlsub manpage.
o arbitrarily nested data structures and anonymous functions
Described in the perlreftut manpage, the perlref manpage,
the perldsc manpage, and the perllol manpage.
o object-oriented programming
Described in the perlobj manpage, the perltoot manpage, and
the perlbot manpage.
o compilability into C code or Perl bytecode
Described in the B manpage and the B::Bytecode manpage.
o support for light-weight processes (threads)
Described in the perlthrtut manpage and the Thread
manpage.
o support for internationalization, localization, and Unicode
Described in the perllocale manpage and the utf8 manpage.
o lexical scoping
Described in the perlsub manpage.
o regular expression enhancements
Described in the perlre manpage, with additional examples
in the perlop manpage.
o enhanced debugger and interactive Perl environment, with
integrated editor support
Described in the perldebug manpage.
o POSIX 1003.1 compliant library
Described in the POSIX manpage.
Okay, that's definitely enough hype.
------------------------------
Date: Sat, 30 Sep 2000 00:40:34 +0800
From: "Cameron Elliott" <celliot@tartarus.uwa.edu.au>
Subject: Re: benefits of perl
Message-Id: <39d4c63b$0$7878@echo-01.iinet.net.au>
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
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....
>
> Perl is a language optimized for scanning arbitrary text files,
> extracting information from those text files, and printing
> reports based on that information. It's also a good language
> for many system management tasks. The language is intended to
> be practical (easy to use, efficient, complete) rather than
> beautiful (tiny, elegant, minimal).
>
> Perl combines (in the author's opinion, anyway) some of the
> best features of C, sed, awk, and sh, so people familiar with
> those languages should have little difficulty with it.
> (Language historians will also note some vestiges of csh,
> Pascal, and even BASIC-PLUS.) Expression syntax corresponds
> closely to C expression syntax. Unlike most Unix utilities,
> Perl does not arbitrarily limit the size of your data--if
> you've got the memory, Perl can slurp in your whole file as a
> single string. Recursion is of unlimited depth. And the
> tables used by hashes (sometimes called "associative arrays")
> grow as necessary to prevent degraded performance. Perl can
> use sophisticated pattern matching techniques to scan large
> amounts of data quickly. Although optimized for scanning text,
> Perl can also deal with binary data, and can make dbm files
> look like hashes. Setuid Perl scripts are safer than C
> programs through a dataflow tracing mechanism that prevents
> many stupid security holes.
>
> If you have a problem that would ordinarily use sed or awk
> or sh, but it exceeds their capabilities or must run a
> little faster, and you don't want to write the silly thing
> in C, then Perl may be for you. There are also transla-
> tors to turn your sed and awk scripts into Perl scripts.
>
> But wait, there's more...
>
> Begun in 1993 (see the perlhist manpage), Perl version 5
> is nearly a complete rewrite that provides the following
> additional benefits:
>
> o modularity and reusability using innumerable modules
> Described in the perlmod manpage, the perlmodlib manpage,
> and the perlmodinstall manpage.
>
> o embeddable and extensible
> Described in the perlembed manpage, the perlxstut manpage,
> the perlxs manpage, the perlcall manpage, the perlguts
> manpage, and the xsubpp manpage.
>
> o roll-your-own magic variables (including multiple
> simultaneous DBM implementations)
> Described in the perltie manpage and the AnyDBM_File
> manpage.
>
> o subroutines can now be overridden, autoloaded, and prototyped
> Described in the perlsub manpage.
>
> o arbitrarily nested data structures and anonymous functions
> Described in the perlreftut manpage, the perlref manpage,
> the perldsc manpage, and the perllol manpage.
>
> o object-oriented programming
> Described in the perlobj manpage, the perltoot manpage, and
> the perlbot manpage.
>
> o compilability into C code or Perl bytecode
> Described in the B manpage and the B::Bytecode manpage.
>
> o support for light-weight processes (threads)
> Described in the perlthrtut manpage and the Thread
> manpage.
>
> o support for internationalization, localization, and Unicode
> Described in the perllocale manpage and the utf8 manpage.
>
> o lexical scoping
> Described in the perlsub manpage.
>
> o regular expression enhancements
> Described in the perlre manpage, with additional examples
> in the perlop manpage.
>
>
> o enhanced debugger and interactive Perl environment, with
> integrated editor support
> Described in the perldebug manpage.
>
> o POSIX 1003.1 compliant library
> Described in the POSIX manpage.
>
> Okay, that's definitely enough hype.
>
------------------------------
Date: Fri, 29 Sep 2000 09:49:40 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: benefits of perl
Message-Id: <39D4C824.854364E0@vpservices.com>
Cameron Elliott wrote:
>
> 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
Well, I suggest you use this reference:
> Mark-Jason Dominus <mjd@plover.com> wrote in message
> news:39d4bb7a.6b42$3d@news.op.net
Since 1) Mark-Jason Dominus is a well respected authority on Perl and 2)
that citation uniquely identifies his message and 3) citations to Usenet
articles should be as valid as citations to any other article,
especially in the computer field.
:-)
--
Jeff
------------------------------
Date: Fri, 29 Sep 2000 10:17:01 -0500
From: "Robert Miller" <happy-no-spam-@nietzsche.net>
Subject: Can't call method "sockport"
Message-Id: <st9cqc5a577l9d@news.supernews.com>
I wrote a script that I need to send email from (included at the bottom is
the subroutine that I am using). Usually it works fine, but occationally,
when I run it I get the error message:
Can't call method "sockport" on an undefined value at
C:/Perl/site/lib/Net/FTP.pm line 591.
And I always get the message: "The system cannot find the path specified."
even though it works fine.
I have to admit that I am new to perl. I cobbled together this program
mostly by looking up every other command while I wrote it. I am running a
default installation of ActivePerl 5.6 Build 618 on NT 4 sp6a. Can anyone
tell me how to fix the error? Or at least point me in the right direction to
look for the answer myself?
Thanks,
Robert Miller
--
sub email {
my ($server,$host,$from,$to,$subject,$body) = @_;
use Net::SMTP;
$smtp = Net::SMTP->new($server);
$smtp->hello($host);
$smtp->mail($from);
$smtp->recipient($to);
$smtp->data();
$smtp->datasend("To: $to\n");
$smtp->datasend("Subject: $subject");
$smtp->datasend("\n");
$smtp->datasend($body);
$smtp->dataend();
$smtp->quit;
}
------------------------------
Date: Fri, 29 Sep 2000 11:39:53 -0500
From: "Robert Miller" <happy-no-spam-@nietzsche.net>
Subject: Re: Can't call method "sockport"
Message-Id: <st9hlmduuorh69@news.supernews.com>
Ok. that is what I get for posting early in the morning. The sockport error
message is generated by my ftp subroutine, not the email sub. The path error
is generated by the email sub and not the ftp. My ftp sub uses NET::FTP.
"Robert Miller" <happy-no-spam-@nietzsche.net> wrote in message
news:st9cqc5a577l9d@news.supernews.com...
> I wrote a script that I need to send email from (included at the bottom is
> the subroutine that I am using). Usually it works fine, but occationally,
> when I run it I get the error message:
> Can't call method "sockport" on an undefined value at
> C:/Perl/site/lib/Net/FTP.pm line 591.
>
> And I always get the message: "The system cannot find the path specified."
> even though it works fine.
>
> I have to admit that I am new to perl. I cobbled together this program
> mostly by looking up every other command while I wrote it. I am running a
> default installation of ActivePerl 5.6 Build 618 on NT 4 sp6a. Can anyone
> tell me how to fix the error? Or at least point me in the right direction
to
> look for the answer myself?
>
> Thanks,
> Robert Miller
>
> --
>
> sub email {
> my ($server,$host,$from,$to,$subject,$body) = @_;
> use Net::SMTP;
> $smtp = Net::SMTP->new($server);
> $smtp->hello($host);
> $smtp->mail($from);
> $smtp->recipient($to);
> $smtp->data();
> $smtp->datasend("To: $to\n");
> $smtp->datasend("Subject: $subject");
> $smtp->datasend("\n");
> $smtp->datasend($body);
> $smtp->dataend();
> $smtp->quit;
> }
>
>
>
>
>
------------------------------
Date: Fri, 29 Sep 2000 09:20:39 -0400
From: "Jonah" <jjk@onlink.net>
Subject: can't create file or mkdir on some servers
Message-Id: <8r2bnh$8m2$1@onlink3.onlink.net>
Hello
On some servers, the following gives me a permission denied error:
mkdir ($dir, 0777) || &error("can't create directory $dir: $!",__LINE__,2)
if !(-e $dir);
#some code here
open (FILE, ">$dir$file$ext") || &error("can't open file $dir$file$ext:
$!",__LINE__,2);
#flock and check
#print stuff to file
#close
#etc..
I'm trying to create a directory and some html files
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...
So here's my bright idea to fix this:
I ftp'ed in with cuteftp and checked the file permissions of normal html
files and directories on
the server that gave me an error...
files: -rw-rw-r-
directories: drwxrwxr-x
On my server, (and many others) where the above code works it's:
files: rwxr-xr-x
directories: drwxr-xr-x
So I tried this:
mkdir ($dir, 0775) || &error("can't create directory $dir: $!",__LINE__,2)
if !(-e $dir);
got the same error...
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...
If this is too much of a non-specific question to ask, then please point me
to some more information on file permissions or something.
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?
thanks so much for your time
------------------------------
Date: Fri, 29 Sep 2000 17:36:11 +0100
From: Gary Mayor <gary@prosport.uk.com>
Subject: Re: Converting Text?
Message-Id: <39D4C4FA.291D367@prosport.uk.com>
Jeff Pinyan wrote:
> On Sep 29, Gary Mayor said:
>
> >I'm using perl and need to know how to convert the string,
> >$a = "hello out there";
> >to
> >$a = "hello%20out%20there";
>
> That's called URL encoding. Use either the CGI module or the URI::Escape
> module.
>
> use CGI;
> $safe = CGI::escape("what's up?!");
>
> use URI::Escape;
> $safe = uri_escape("oh, nuttin' much.");
>
> They treat the strings slightly differently.
>
> --
> 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/
Hey Jeff,
Thanks a lot man that works great now
------------------------------
Date: Fri, 29 Sep 2000 15:45:21 GMT
From: "Nebulus" <news@nebulus.org>
Subject: E-commerce - getting started
Message-Id: <lO2B5.1389$mB3.75010@newsread2.prod.itd.earthlink.net>
Hey all. I have a question, and I'm sure somebody out there can answer it.
How does one get started developing the CGI that uses all the various
payment validation packages out there (CyberCash, Verisign's PayFlo Pro,
Authorize.net, etc)? I've got forms and CGI built that handles
Authorize.net's WebLink Relay system, but I'm interested in using the SDK's
provideed by the other companies.
I downloaded the make files for PayFlo and CyberCash, but can't do anything
with that since I don't have the rights to put the files where they need to
be on the account.
I've contacted my web host about any SDKs that they might have installed,
but I think they're playing dumn with me, and I don't know where they hide
'em.
Also, if you're designing say, a shopping cart (I know, ANOTHER ONE?), then
how do you design it that so that it'll connect and use whatever payment
service the client may want to use?
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!
------------------------------
Date: Fri, 29 Sep 2000 16:42:13 GMT
From: "Ben Kennedy" <bkennedy@hmsonline.com>
Subject: Re: Enviroment Interaction For A Newbie
Message-Id: <FD3B5.13365$td5.2366674@news1.rdc2.pa.home.com>
"Jonathan Klaff" <jon.klaff@rdel.co.uk> wrote in message
news:01c0279d$54bdd690$30b815ac@ntwc0585...
> Hi,
>
> I am trying to use an alias I have set up in my .cshrc file from a perl
> script. Unfortunatly I have no idea how to do this!
I do not believe this is possible, since aliases are handled completely
within your shell, and are not part of the environment. One way around it
is to create a small wrapper shell script, and place it in your path,
something like
#!/bin/sh
exec yourprogram
In fact, you could take it to the next level and create a perl script that
automatically generates the wrapper files:
alias | perl make_aliases.pl
or something to that effect, and execute it when you log in or change
aliases.
--Ben Kennedy
------------------------------
Date: Fri, 29 Sep 2000 19:57:23 +0200
From: "Ralf Siedow" <replynews@bigfoot.com>
Subject: Re: Fehlermeldung beim Ausführen eines Scripts!
Message-Id: <8r2l4p$gt0kb$1@ID-23826.news.cis.dfn.de>
Sorry guys for posting in german. I was too stupid to realize that this is
an english newsgroup!
Thx for solving my problem!
cu Ralf
------------------------------
Date: Thu, 28 Sep 2000 18:16:51 +0200
From: "Erik Pedersen" <erikpede@online.no>
Subject: getting hidden values with param function
Message-Id: <3h3B5.431$Q43.5513@news1.online.no>
Hi,
I wonder if its not possible to get hidden form-values parsed with the param
function. If its possible how do you do that?
It dosn't work on my script.
regards
Erik Pedersen
------------------------------
Date: 29 Sep 2000 11:22:03 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: getting hidden values with param function
Message-Id: <873dijyxqs.fsf@limey.hpcc.uh.edu>
>> On Thu, 28 Sep 2000 18:16:51 +0200,
>> "Erik Pedersen" <erikpede@online.no> said:
> Hi, I wonder if its not possible to get hidden
> form-values parsed with the param function. If its
> possible how do you do that?
"hidden" just refers to what the user-agent is supposed to
do when it renders that option -- or in this case, not :-)
All the data is still passed to the server, so you'd just
use the param() method in CGI.pm as you would for any
other data.
> It dosn't work on my script.
Well, that doesn't exactly help anyone does it? If you
want help with code you've written, you have to post it.
If noone can see the code, noone can tell you what's
wrong.
hth
t
--
Namaste!
And an "oogabooga" to you too!
-- Homer Simpson
------------------------------
Date: 29 Sep 2000 16:27:20 GMT
From: abigail@foad.org (Abigail)
Subject: Re: getting hidden values with param function
Message-Id: <slrn8t9gkp.k0e.abigail@alexandra.foad.org>
Erik Pedersen (erikpede@online.no) wrote on MMDLXXXV September MCMXCIII
in <URL:news:3h3B5.431$Q43.5513@news1.online.no>:
// Hi,
//
// I wonder if its not possible to get hidden form-values parsed with the param
// function. If its possible how do you do that?
//
// It dosn't work on my script.
You have a bug in line 17.
Abigail
--
perl -wle 'print "Prime" if (0 x shift) !~ m 0^\0?$|^(\0\0+?)\1+$0'
# Two kitties crouch. The
# Bear Hunter sighs. A pair of
# nesting ravens. Ten thrushes.
------------------------------
Date: Fri, 29 Sep 2000 11:13:52 -0400
From: "TLOS" <tlos@UNSOLICITEDtlos.org>
Subject: Re: help renaming a file
Message-Id: <8r2bbs$qmm$1@slb0.atl.mindspring.net>
Rafael Garcia-Suarez wrote in message ...
<snip>
>[style note] You should really read about the print <<"EOF" shell-like
>construct instead of mutiplying the print statements and mangling them
I do use "here" - print<<HTML; statements but this is a very short script.
>> $newfile = $input{'newfile'};
>
>You're not using the CGI module, are you? You should use it, for many
>reasons; it has less bugs that most homegrown form parsers, and leads
>to smaller and more maintainable code.
This entire script is only 32 lines long. I do use the CGI module for some
things but I'm not completely familiar with it yet. I have chdir in the
beginning of the script - I am in the working directory when I read the data
file in. The script reads the current string value of $filename into the
text box to show the current name of ths data file but what I seem to be
missing is how to change the current name of the file. I also wrote the
script to explicitely call the path and called the path using scalars.
>> 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.
------------------------------
Date: Fri, 29 Sep 2000 15:37:41 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: help renaming a file
Message-Id: <slrn8t9e6n.miu.rgarciasuarez@rafael.kazibao.net>
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.
--
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Fri, 29 Sep 2000 08:55:17 -0700
From: Michael Budash <mbudash@sonic.net>
Subject: Re: help renaming a file
Message-Id: <mbudash-D4AAB6.08551729092000@news.pacbell.net>
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: Fri, 29 Sep 2000 16:50:13 GMT
From: "Ben Kennedy" <bkennedy@hmsonline.com>
Subject: Re: how do i use localhost
Message-Id: <9L3B5.13369$td5.2367913@news1.rdc2.pa.home.com>
"Chris" <abatec@seattleu.edu> wrote in message
news:m6Bz5.1419$LH5.387700@news.uswest.net...
> Someone told me to use 'localhost' as a way to connect to a database
because
> the server i'm on does not have the DBI module installed. They also
> suggested that I could install the DBI module myself. How would I do this
> and where would i get it from. I have the DBI module for windows but the
> server is unix, will it work still?
>
> Any help is very much appreciated.
If you don't have DBI installed, you can't access a database no matter what
you call it. If you don't have DBI installed, you (or your admin if you
don't have root privileges) can install it via CPAN.pm with
perl -MCPAN -e 'install DBI'
or with an Activestate build of perl:
ppm
install DBI
Or you can find it at www.cpan.org and follow the instructions
Whether or not you can connect to a remote database depends on the database
you are connecting to.
--Ben Kennedy
------------------------------
Date: Fri, 29 Sep 2000 16:22:51 GMT
From: i0519@my-deja.com
Subject: How to deal with unicode char in perl?
Message-Id: <8r2fkr$1os$1@nnrp1.deja.com>
I use
$text =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack("C",($1))/eg
to extract the text input by a multiline text.
But, it can't
1. Handle some symbol char,like "=", "|"
2. Handle unicode char, like Japanese or Chinese.
Could anybody give me some advice please?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 29 Sep 2000 16:23:06 GMT
From: i0519@my-deja.com
Subject: How to deal with unicode char in perl?
Message-Id: <8r2fla$1p3$1@nnrp1.deja.com>
I use
$text =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack("C",($1))/eg
to extract the text input by a multiline text.
But, it can't
1. Handle some symbol char,like "=", "|"
2. Handle unicode char, like Japanese or Chinese.
Could anybody give me some advice please?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 4469
**************************************