[7208] in Perl-Users-Digest
Perl-Users Digest, Issue: 833 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 8 23:27:29 1997
Date: Fri, 8 Aug 97 20:00:28 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 8 Aug 1997 Volume: 8 Number: 833
Today's topics:
Re: 'require' query <rootbeer@teleport.com>
877856400 != timelocal(localtime(877856400)) ??? <reminders@pickem.com>
Re: Blanket textual changes (Tad McClellan)
Re: Can't match numeric text in m// (Mike Stok)
Re: Can't match numeric text in m// (Eric Bohlman)
Re: Can't match numeric text in m// <rbush@euclid.acs.nmu.edu>
Changing Shipping Options vonline@bellsouth.net
Re: Counting Files <zenin@best.com>
Re: EASY PROBABLY: removing names from paths <mark@tstonramp.com>
Re: EASY PROBABLY: removing names from paths <rootbeer@teleport.com>
Embedding perl 5.004_01 into a Visual Basic program <Tilmann.Haeberle@sap-ag.de>
File::Find and maxdepth? <egodeath@geocities.com>
Re: foo bar <jhi@alpha.hut.fi>
Re: Help: perl can't find sub in module Socket <rootbeer@teleport.com>
Re: How to create more than object at once? <jpm@iti-oh.comNOSPAM>
Re: How to create more than object at once? <mark@tstonramp.com>
Re: How to get file names from a directory <mark@tstonramp.com>
Re: How-to cut the last characters of a varibles (Mike Stok)
Re: Linux Installation perl5.004_01/02 <rootbeer@teleport.com>
MacPerl and localtime(time-offset) problem (Michael Tempsch)
Re: Making a variable from a variable? (Nigel Reed)
MAX OPEN FILES under SunOS/Solaris? (Michael Borowiec)
Re: MAX OPEN FILES under SunOS/Solaris? (Mike Stok)
MIF file parsing hints? (Al)
Re: Pack / Unpack of IEEE floating point? What about XD <eike.grote@theo.phy.uni-bayreuth.de>
Re: perl with a dash of gif? (Mike Stok)
Re: perl with a dash of gif? <amit@csd.sgi.com>
Re: perl with a dash of gif? <cfrost@mail.arc.nasa.gov>
Re: perl with a dash of gif? <zenin@best.com>
Re: Reading from pipes <helmrl@aur.alcatel.com>
Re: Research <eryq@enteract.com>
Re: running perl script <seay@absyss.fr>
shmctl? (Matt E Richards)
TkWeb - continuing development? <bruceSpamReject@SpAmReJeCt.gtcs.com>
Re: Unparse form data? (Mike Stok)
Why won't this work!?! <buck@huron.net>
Re: XS and C Libs:Question <jheck@merck.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 5 Aug 1997 07:57:31 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Christopher Chan <chris@cybertech.com.sg>
Subject: Re: 'require' query
Message-Id: <Pine.GSO.3.96.970805074558.10855J-100000@kelly.teleport.com>
On Tue, 5 Aug 1997, Christopher Chan wrote:
> If I have a method by the same name in two 'require' files, what can I
> do to ensure that the method that I call will be the one that I want?
>
> eg. in a.pl, I have
> require 'b.pl';
> require 'c.pl';
>
> and I call &read_input in a.pl, but &read_input is in b.pl and c.pl. If
> I want to call the &read_input in b.pl. What must I do?
(I think you mean a subroutine, and not a method (which is a term from
object-oriented programming). If I'm wrong, you may be dealing with an
inheritance question. In that case, please ask again!)
First off, if a subroutine is in both required files, it's being redefined
in the second one loaded. If you turn on warnings with the -w invocation
option (recommended) Perl will warn you about this.
A corollary of this redefining is that only one of those two subs is
available. You get only the one which is currently defined! (That would
normally be the one in c.pl, but possibly not, depending upon other things
you have in your source.)
The solution is to use packages, and probably modules. You'll be able to
call &b::read_input or &c::read_input if you put them into packages. And
if you make them into modules, you can easily choose which routines to
import, so that's the way I'd recommend.
See the perlmod manpage and related ones for more information about doing
this. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 08 Aug 1997 17:42:26 -0700
From: Torsten Heycke <reminders@pickem.com>
Subject: 877856400 != timelocal(localtime(877856400)) ???
Message-Id: <33EBBCC1.442E@uclink.berkeley.edu>
I'm using timelocal (Time::Local) to get the UNIX time for a date.
The problem is, it doesn't seem to work correctly past 877856400
(Sunday, Oct. 26 1:00 a.m.). Something to do with DST, apparently.
The docs for timelocal do not explicitly guarantee that it will work for
times other than time(), but I need some function that will. Is there a
hack to get this to work right?
Thanks,
Chris
chrishdp@uclink.berkeley.edu
------------------------------
Date: Thu, 7 Aug 1997 19:17:18 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Blanket textual changes
Message-Id: <eiods5.ahc.ln@localhost>
Steven Chmielnicki (sc7b+@andrew.cmu.edu) wrote:
: Hey guys, got a question for ya.
Might be a gal out here that would have answered your question... ;-)
[ snip ]
: Any elegant ideas on how I can
: replace everything between <applet> and </applet> with the contents of
: another text file?
Warning! This will update the files "in place", better have
backups saved off somewhere first...
---------------------
#!/usr/bin/perl -wi
# code_inject
undef $/; # set the input record separator
open(CODE, "new.code") ||
die "could not open 'new.code' $!";
$new_code=<CODE>; # slurp the new code
close(CODE);
$_ = <>; # slurp the whole HTML file into a string
s!<applet>.*?</applet>!<applet>$new_code</applet>!gs;
print;
---------------------
invoke thusly:
prompt> code_inject *.html
: Thanks for your time.
You're welcome.
--
Tad McClellan SGML Consulting
tadmc@flash.net Perl programming
Fort Worth, Texas
------------------------------
Date: 8 Aug 1997 23:54:56 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Can't match numeric text in m//
Message-Id: <5sgbkg$9kp@news-central.tiac.net>
In article <33EB9398.B0064851@lmtas.lmco.com>,
Brett Denner <Brett.W.Denner@lmtas.lmco.com> wrote:
>I'm trying to perform a pattern match on a text string containing an
>exponential-format number like this:
>
> $text = "num = 1.0E+01";
>
>I would like to see if this text actually contains an exact exponential
>number, like "1.0E+01". Here's my code:
>
> $text = "num = 1.0E+01";
>
> $num = "1.0E+01";
>
> print $text =~ /$num/ ? "match\n" : "no match\n";
The match is looking for the sequence:
1 <1>
. <any character except \n>
0 <0>
E+ <one or more E characters>
0 <0>
1 <1>
so you see the + is getting used as a regex metacharacter. You might want
to use
/\Q$num/
as the match as the \Q starts escaping (quoting) metacharacters...
The perlop man page includes this:
For constructs that do interpolation, variables beginning
with "$" or "@" are interpolated, as are the following
sequences:
\t tab (HT, TAB)
\n newline (LF, NL)
\r return (CR)
\f form feed (FF)
\b backspace (BS)
\a alarm (bell) (BEL)
\e escape (ESC)
\033 octal char
\x1b hex char
\c[ control char
\l lowercase next char
\u uppercase next char
\L lowercase till \E
\U uppercase till \E
\E end case modification
\Q quote regexp metacharacters till \E
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Sat, 9 Aug 1997 00:17:03 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Can't match numeric text in m//
Message-Id: <ebohlmanEEME4F.6GE@netcom.com>
Brett Denner (Brett.W.Denner@lmtas.lmco.com) wrote:
: $text = "num = 1.0E+01";
: $num = "1.0E+01";
: print $text =~ /$num/ ? "match\n" : "no match\n";
: When I run this code, it prints out "no match"; I suspect that the $num
: variable is being converted to its double-precision representation in the
: pattern match before the pattern match is attempted, but I'm not sure. Or,
: the "." and "+" in the $num variable may be causing problems.
It's the latter. The easiest way around it is to replace "$num" with
"\Q$num" in your match.
------------------------------
Date: 9 Aug 1997 01:55:02 GMT
From: "rbush" <rbush@euclid.acs.nmu.edu>
Subject: Re: Can't match numeric text in m//
Message-Id: <01bca469$5b838ac0$2738f2cd@ray.up.net>
Brett Denner <Brett.W.Denner@lmtas.lmco.com> wrote in article
<33EB9398.B0064851@lmtas.lmco.com>...
> I'm trying to perform a pattern match on a text string containing an
> exponential-format number like this:
>
> $text = "num = 1.0E+01";
>
> I would like to see if this text actually contains an exact exponential
> number, like "1.0E+01". Here's my code:
>
> $text = "num = 1.0E+01";
>
> $num = "1.0E+01";
>
> print $text =~ /$num/ ? "match\n" : "no match\n";
Yep same here apparently the regex is assuming the + as part of itself do
this instead (prerun your with something like $num = s/\+/\/\/\+/ ;)
$text = "num = 1.0E+01";
$num = "1.0E+01";
print "$text \n";
print "$num \n";
$num=s/\+/\/\/\+/ ; #gives no match without this
if ( $text =~ /$num/ ) { #or substitute appropriate logical expression
print "match\n";
}else{
print "no match\n";
}
------------------------------
Date: Tue, 05 Aug 1997 13:35:11 -0600
From: vonline@bellsouth.net
Subject: Changing Shipping Options
Message-Id: <870804993.26426@dejanews.com>
Now that I have Perl Shop running, I need to change the Shipping
options
and rates.
In the customization fields, I deleted all but the first shipping
option,
leaving the UPS ground option there.
When I ran the script, I thought it was going to work. When I looked
at
the shipping rates page, UPS ground was the only one listed. When I
clicked the pull down menu for shipping options on the checkout page,
I
was give only the UPS ground option. Sounds good so far...
When I submited the check out page, the script comes back with - 'This
page contains no data' -ERROR. Not an html error message, but a system
error message.
If anyone knows what I should do, please email me at:
vonline@bellsouth.net
Thanks in advance,
Bill
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 9 Aug 1997 00:31:01 GMT
From: Zenin <zenin@best.com>
Subject: Re: Counting Files
Message-Id: <5sgdo5$17a$1@nntp2.ba.best.com>
Mark J. Schaal <mark@tstonramp.com> wrote:
> If it doesn't have to be a perl program...
> ls *.dat | wc -l
Or, if you only want to fork one process...
echo *.dat | wc -w
<grin>
--
-Zenin
zenin@best.com
------------------------------
Date: Fri, 08 Aug 1997 06:10:34 -0700
From: "Mark J. Schaal" <mark@tstonramp.com>
Subject: Re: EASY PROBABLY: removing names from paths
Message-Id: <33EB1ACA.5819@tstonramp.com>
rindex() should be faster in any case, but a better regex is
$filename =~ m#/([^/]*)$#;
which will avoid all that matching and grouping on the
first part of the expression which is ignored anyways. But
use rindex() since that's what the job calls for.
mark
Ross Williamson wrote:
>
> Or instead of rindex you can use something like
> $filename =~ m/(.*)\/(.*)$/;
> Then take $2
>
> Ross
>
>
> Tom Phoenix wrote:
> >
> > On Tue, 5 Aug 1997, Shaun O'Shea wrote:
> >
> > > I have an array of file paths and I want to remove everything
> > > except the file name and extension.
> >
> > You can find the location of the last '/' character by using
> > rindex(), documented in perlfunc(1). Hope this helps!
------------------------------
Date: Tue, 5 Aug 1997 07:20:59 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Shaun O'Shea <lmisosa@eei.ericsson.se>
Subject: Re: EASY PROBABLY: removing names from paths
Message-Id: <Pine.GSO.3.96.970805071921.10855E-100000@kelly.teleport.com>
On Tue, 5 Aug 1997, Shaun O'Shea wrote:
> I have an array of file paths and I want to remove everything except the
> file name and extension.
Maybe you want the File::Basename module.
> i.e how do I remove everything BEFORE the LAST "/"
You can find the location of the last '/' character by using rindex(),
documented in perlfunc(1). Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 5 Aug 1997 18:36:54 GMT
From: "Dr. Tilmann Hdberle" <Tilmann.Haeberle@sap-ag.de>
Subject: Embedding perl 5.004_01 into a Visual Basic program
Message-Id: <01bca1ce$808906d0$9df4389b@p21907>
I tried to call the perl.dll from 32 bit Visual Basic, following the
instructions in "perlembed" similar to doing it from C.
There are some obstacles in doing that. Some of them I could solve, but I'm
stuck with the last one. Maybe someone having a clearer insight into the
perl win32 source code than me can help me out.
Embedding is for me more favourable than starting perl in a separate
process since I would like to call some perl functions from VB after
loading my script.
Since I have encountered several posts in the usenet asking for that kind
of embedding, we should make it work. I'd like to contribute, but currently
I need some help.
First I will list the visual basic demo program I used, then the obstacles
I could solve, and finally where I am stuck.
The Visual Basic Program
===================
The following Visual Basic 4.0 program is used ("PerlEmbed.BAS"). It is
similar to interp.c from CPAN's ExtUtils-Embed module.
Attribute VB_Name = "PerlEmbed"
Declare Function perl_alloc Lib "perl.dll" () As Long
Declare Sub perl_construct Lib "perl.dll" (ByVal pinterp As Long)
Declare Sub perl_destruct Lib "perl.dll" (ByVal pinterp As Long)
Declare Sub perl_free Lib "perl.dll" (ByVal pinterp As Long)
Declare Sub perl_parse_vb Lib "perl.dll" (ByVal pinterp As Long, ByVal
cmdline As String)
Declare Sub perl_run Lib "perl.dll" (ByVal pinterp As Long)
Sub main()
Dim hPerl As Long
hPerl = perl_alloc
perl_construct hPerl
perl_parse_vb hPerl, "perl.exe -e 0"
'perl_run hPerl
'perl_destruct hPerl
perl_free hPerl
End Sub
---------------------end of the visual basic program
The Solved Problems
===============
1.) _stdcall Calling convention required (Visual Basic requires called DLL
routines to clean up their stack)
Thus I inserted the _stdcall keyword for the following function prototypes
in "proto.h" (below) and the corresponding function definitions in "perl.c"
(not shown), and recompiled Perl.
PerlInterpreter* __stdcall perl_alloc _((void));
I32 __stdcall perl_call_argv _((char* subname, I32 flags, char** argv));
I32 __stdcall perl_call_method _((char* methname, I32 flags));
I32 __stdcall perl_call_pv _((char* subname, I32 flags));
I32 __stdcall perl_call_sv _((SV* sv, I32 flags));
void __stdcall perl_construct _((PerlInterpreter* sv_interp));
void __stdcall perl_destruct _((PerlInterpreter* sv_interp));
SV* __stdcall perl_eval_pv _((char* p, I32 croak_on_error));
I32 __stdcall perl_eval_sv _((SV* sv, I32 flags));
void __stdcall perl_free _((PerlInterpreter* sv_interp));
SV* __stdcall perl_get_sv _((char* name, I32 create));
AV* __stdcall perl_get_av _((char* name, I32 create));
HV* __stdcall perl_get_hv _((char* name, I32 create));
CV* __stdcall perl_get_cv _((char* name, I32 create));
void __stdcall perl_require_pv _((char* pv));
int __stdcall perl_run _((PerlInterpreter* sv_interp));
If you don't do this, VB will complain that the functions are not declared
properly.
The suggested solution is of course a hack, maybe for the final version a
collection of wrapper functions with the correct calling convention should
be defined.
2.) It is difficult, if not impossible, to pass a C-style array of null
terminated strings from visual basic to a dll (as required by perl_parse)
int perl_parse _((PerlInterpreter* sv_interp, void(*xsinit)(void), int
argc, char** argv, char** env));
Therefore I wrote a separate wrapper function (perl_parse_vb) which expects
a single string instead of argv, and does the splitting into single
arguments at the whitespaces encountered. Arguments containing whitespace
can be escaped in DOS/Windows style using double quotes. The code resides
in a file "win32\perlvb.c" which has been added to WIN32_C in
Win32\Makefile. perlvb.obj has been added to DLL_OBJ. perl_parse_vb has
been added to "makedef.pl" (and thus perldll.def).
The code:
#ifdef __cplusplus
extern "C" {
#endif
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#ifdef __cplusplus
}
# define EXTERN_C extern "C"
#else
# define EXTERN_C extern
#endif
__declspec(dllexport)
int __stdcall
perl_parse_vb(PerlInterpreter *pinterp, const char *cmdline)
{
int in_quotes = 0;
char *scopy = _alloca(strlen(cmdline)+1); // work on stack
char *p;
char **argv = _alloca(sizeof(char*)*200); // max 200 args
int argc = 0;
strcpy(scopy,cmdline);
p = scopy;
while (*p)
{
while (isspace(*p))
{
*p = '\0';
p++;
}
// now it is at beginning of non-space or end
// escaping quotes has still to be implemented
if (*p == '"')
{
in_quotes = 1;
p++;
}
if (*p)
argv[argc++] = p++;
if (in_quotes)
{
while (*p && *p != '"')
p++;
if (*p == '"')
{
*p = '\0';
in_quotes = 0;
}
}
else // no quotes
{
while (*p && !isspace(*p))
p++;
}
}
// now argc and argv are defined!
return perl_parse(pinterp,NULL,argc,argv,NULL);
}
#ifdef 0 // example
main()
{
perl_parse_vb(pinterp,"arg1 arg2 arg3");
perl_parse_vb(pinterp,"arg1 \"arg2 with spaces\" arg3");
return 0;
}
#endif
--------------end of module perlvb.c ----------------------------
The Open Problem
==============
Doing all this I can run the following visual basic code sequence
successfully:
Dim hPerl As Long
hPerl = perl_alloc
perl_construct hPerl
perl_free hPerl
But if I call
perl_parse_vb hPerl, "perl.exe -e 0"
after 'perl_construct' I get an access violation.
"Unhandled exception in VB32.EXE (PERL.DLL): 0xC0000005: Access Violation
To find out the location of the crash, I built perl.dll with the debug
option.
The crash occurs at the return statement of the routine "win32_environ" in
module win32.c
DllExport char ***
win32_environ(void)
{
return (pIOSubSystem->pfnenviron()); // <<< crashes here
}
which has been called from the line
origenviron = environ;
in function "perl_parse" in module "perl.c".
environ is a preprocessor macro defined in "win32iop.h":
#define environ (*win32_environ())
It looks to me as if the pointer "pIOSubSystem" gets not initialized when
calling the perl.dll from visual basic.
If I try the similar thing from a C-program (interp.c) it works.
My suspicion is that some functionality in the static library "perl.lib" is
linked statically to the C program. This is of course not available if you
have only access to the DLL, as in Visual Basic.
Questions:
========
1.) What do I have to do to to make sure pIOSubSystem is initialized wenn
calling from VB?
2.) (if 1. can be solved): What can I do with stdin/stdout?
3.) How to implement Dynaloader?
Some comments to 2.)
I don't necessarily need stdin/stdout.
But at least it would be useful if I could redirect them to a file.
Even better if I can open a console (Win32::Console?) and redirect
stdin/stdout to it.
Some comments to 3.)
Probably I have to define a routine
EXTERN_C void
vb_xs_init()
{
char *file = __FILE__;
dXSUB_SYS;
/* DynaLoader is a special case */
newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
}
and add it to the DLL, and put it into the second argument of perl_parse in
the routine perl_parse_vb above.
Will this approach work?
Huh, that was a long post. But I'm looking forward to your help.
Regards,
Tilmann Haeberle
--
Disclaimer: This is the personal opinion of me. I'm not a spokesman of SAP.
Tilmann Haeberle
------------------------------
Date: Tue, 05 Aug 1997 13:37:38 -0400
From: Steve Harvey <egodeath@geocities.com>
Subject: File::Find and maxdepth?
Message-Id: <33E764E2.766B@geocities.com>
I am an "advanced beginner" in Perl, with a Unix background, who is
now trying to implement some Perl scripts on a Win95/NT network.
Specifically, one of the things I'm trying to do is return a list of all
of the files in a given directory which are older than two weeks.
I was pleased to discover the "find2perl" utility, but there's one hitch
- I want to find the files *ONLY* in a given directory, without
descending into any subdirectories. With Unix find, I can just add
-maxdepth 1 to the command line, but find2perl doesn't support the
maxdepth option as far as I can tell. I also thought of using a regexp
and -prune to strip out anything more than X leading slashes, but Perl's
find doesn't return the complete pathname -- only the filename itself.
The only other thing I can think of is re-writing find.pl so it doesn't
descend into other directories, but that seems like hunting ants with a
bazooka; I would hope that there's a simpler and more elegant way to do
something so trivial. Any suggestions?
------------------------------
Date: 08 Aug 1997 23:08:04 +0300
From: Jarkko Hietaniemi <jhi@alpha.hut.fi>
Subject: Re: foo bar
Message-Id: <oeezpqszbdn.fsf@alpha.hut.fi>
bart.mediamind@tornado.be (Bart Lateur) writes:
> What is all this "foo bar" stuff that is sprinkled all over the
> documentation?
>
> I think it's pure nonsense, but not being a native English speaker, I'm
> curious where these words came from.
>
> Bart Lateur
> bart.mediamind@tornado.be
The Hacker's Dictionary: (websearch for "hacker and dictionary")
:foo: /foo/ 1. interj. Term of disgust. 2. Used very generally
as a sample name for absolutely anything, esp. programs and files
(esp. scratch files). 3. First on the standard list of
{metasyntactic variable}s used in syntax examples. See also
{bar}, {baz}, {qux}, {quux}, {corge}, {grault},
{garply}, {waldo}, {fred}, {plugh}, {xyzzy},
{thud}.
The etymology of hackish `foo' is obscure. When used in
connection with `bar' it is generally traced to the WWII-era Army
slang acronym FUBAR (`Fucked Up Beyond All Repair'), later
bowdlerized to {foobar}. (See also {FUBAR}).
However, the use of the word `foo' itself has more complicated
antecedents, including a long history in comic strips and cartoons.
The old "Smokey Stover" comic strips by Bill Holman often
included the word `FOO', in particular on license plates of cars;
allegedly, `FOO' and `BAR' also occurred in Walt Kelly's
"Pogo" strips. In the 1938 cartoon "The Daffy Doc", a very
early version of Daffy Duck holds up a sign saying "SILENCE IS
FOO!"; oddly, this seems to refer to some approving or positive
affirmative use of foo. It has been suggested that this might be
related to the Chinese word `fu' (sometimes transliterated
`foo'), which can mean "happiness" when spoken with the proper
tone (the lion-dog guardians flanking the steps of many Chinese
restaurants are properly called "fu dogs").
Earlier versions of this entry suggested the possibility that
hacker usage actually sprang from "FOO, Lampoons and Parody",
the title of a comic book first issued in September 1958, a joint
project of Charles and Robert Crumb. Though Robert Crumb (then in
his mid-teens) later became one of the most important and
influential artists in underground comics, this venture was hardly
a success; indeed, the brothers later burned most of the existing
copies in disgust. The title FOO was featured in large letters on
the front cover. However, very few copies of this comic actually
circulated, and students of Crumb's `oeuvre' have established
that this title was a reference to the earlier Smokey Stover
comics.
An old-time member reports that in the 1959 "Dictionary of the
TMRC Language", compiled at {TMRC} there was an entry that went
something like this:
FOO: The first syllable of the sacred chant phrase "FOO MANE PADME
HUM." Our first obligation is to keep the foo counters turning.
For more about the legendary foo counters, see {TMRC}. Almost
the entire staff of what became the MIT AI LAB was involved with
TMRC, and probably picked the word up there.
Very probably, hackish `foo' had no single origin and derives
through all these channels from Yiddish `feh' and/or English
`fooey'.
------------------------------
Date: Fri, 8 Aug 1997 16:16:04 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: larry paul schrof <l-schro@students.uiuc.edu>
Subject: Re: Help: perl can't find sub in module Socket
Message-Id: <Pine.GSO.3.96.970808161358.4449C-100000@kelly.teleport.com>
On 8 Aug 1997, larry paul schrof wrote:
> I have checked the O'Reilly Perl5 book and I know inet_atom() is in
> the Socket module.
How about inet_aton? :-)
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 8 Aug 1997 13:10:59 GMT
From: "Joshua Marotti" <jpm@iti-oh.comNOSPAM>
Subject: Re: How to create more than object at once?
Message-Id: <01bca3fc$75236030$36601ec6@bach>
The last reply is correct... here I corrected it to look pretty and
stuff...
--
Josh,
Gavin Dragon...
Remove NOSPAM from address...
Oliver Hellberg <oliver.hellberg@fernuni-hagen.de> wrote in article
<33ea360b.8986057@newshost.rz.hu-berlin.de>...
> #! /usr/bin/perl -w
>
> package Paket; # Paket, that's German for package
>
> sub new {
> my $type = shift;
> my $self = {};
> $self->{inhalt} = shift; #make the reference a reference to the scalar
> bless ($self, $type); #no need to return... the bless does it for
you.
> }
>
> sub drucke { # Well, "drucke", that's print
> my ($self) = @_; #make sure you are getting the instance,
#I don't think the shift gets the instance.
$inhalt = $self->{inhalt}; #the print doesn't recoginze the ->
operator well
> print "$self: $inhalt \n";
> }
>
> package main;
>
> $first = new Paket 5; #now it looks like C++ objects :)
> $second = new Paket 15;
> $first->drucke();
> $second->drucke();
I didn't try to run this, but it *should* work. Hope this helps.
------------------------------
Date: Fri, 08 Aug 1997 05:02:53 -0700
From: "Mark J. Schaal" <mark@tstonramp.com>
Subject: Re: How to create more than object at once?
Message-Id: <33EB0AED.2BD1@tstonramp.com>
Oliver Hellberg wrote:
>
> I've got a problem ... well, actually two problems. The first one: my
> bad English, the second one:
I wish my Korean were half as good as your "bad" English. <sigh>
The problem you are seeing is from your 'new' subroutine, though
you'll need to change you drucke subroutine as well.
sub new {
my $type = shift;
my $self = {}; # $self is a reference to {} hash
$self{inhalt} = shift; # adds an element to %self hash
bless ($self, $type);
return $self;
}
$self is a reference to an anonymous hash. You must explicitly
dereference this variable to get to the hash.
$self->{inhalt} will assign to that hash.
$$self{inhalt} does the same thing.
$self{inhalt} is part of the hash named %self, and completely
unrelated to $self. The first time through it is set to 5.
The second time through it is set to 15. The value of
$self->{inhalt} is never assigned to (or printed).
If you add 'use strict;' to the top of your script it will give
a hint to the problem with something like the following:
Global symbol "self" requires explicit package name at test.pl line 9.
Hope this helps,
mark
--
Mark J. Schaal TST On Ramp Sysadmin mark@tstonramp.com
------------------------------
Date: Fri, 08 Aug 1997 04:02:59 -0700
From: "Mark J. Schaal" <mark@tstonramp.com>
Subject: Re: How to get file names from a directory
Message-Id: <33EAFCE3.3211@tstonramp.com>
In article <5roh91$jvi@ds2.acs.ucalgary.ca>, Euan Forrester
<deforres@acs.ucalgary.ca> says:
>
>I need to write a Perl script to remove old files from a specific
>directory. I can find the time since the file was last accessed just fine,
>but I don't know how to find out what file names exist in the directory,
>so I can check them. Can anyone help me? Thanks in advance!
>
If you don't need to use perl, see the man page on find.
find directory_name -atime +7 -print | xargs rm
However find defaults to traversing subdirectories and it can
be a pain to figure out how to avoid this. Perhaps
cd directory_name
find . -atime +7 -print ! -name . -type d -prune | xargs rm
Yes, people did need to find files before perl was created. :-)
mark
------------------------------
Date: 5 Aug 1997 13:22:18 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: How-to cut the last characters of a varibles
Message-Id: <5s79ea$leb@news-central.tiac.net>
In article <33E656F3.76BE4B9A@hec.ca>,
Stephane Robertson <Stephane.Robertson@hec.ca> wrote:
>How can I cut the last characters of a variable?
>
>For example: I need to use printf "%20s", $variable;
> and if the $variable is more than 20 characters I want it
> to be cut to the 20th characters. Even if the variable is
>more then 20 characters
> I want 20 characters to be printed on the screen.
>
>How do I do that?
You can either use substr to truncate the character, or use a printf
format specifier of %20.20s which will leave the variable unmolested but
only displays the first 20 characters of the string e.g.
$str = 'abcdefghijklmnopqrstuvwxyz';
printf '%20.20s', $str;
prints abcdefghijklmnopqrst
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Fri, 8 Aug 1997 16:13:07 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Volker Gierenz <volker@halifax.rwth-aachen.de>
Subject: Re: Linux Installation perl5.004_01/02
Message-Id: <Pine.GSO.3.96.970808160802.4449B-100000@kelly.teleport.com>
On Fri, 8 Aug 1997, Volker Gierenz wrote:
> Howerver I get the following error-message:
> >perl: warning: Setting locale failed.
> >perl: warning: Please check that your locale settings:
> > LC_ALL = (unset),
> > LC_CTYPE = "ISO-8859-1",
> > LANG = (unset)
> > are supported and installed on your system.
> >perl: warning: Falling back to the standard locale ("C").
Did you check that your locale information is supported and installed on
your system? :-) Somebody in a Linux-specific newsgroup may be able to
help you to ensure that locales are properly installed. Or, if you don't
want locale support (unlikely, since your address ends in .de), you could
compile again after setting d_setlocale to undef in config.sh. Hope this
helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 5 Aug 1997 18:32:59 GMT
From: d1temp@dtek.chalmers.se (Michael Tempsch)
Subject: MacPerl and localtime(time-offset) problem
Message-Id: <5s7rkr$74f$1@nyheter.chalmers.se>
Keywords: MacPerl localtime offset problem
Hello,
nothing I've read suggests that localtime() should be a problem
in Macperl... However, when I try to get an offset date like
localtime(time-1) (doesn't matter if positive or negative nor
size of offset) I get the epoch returned (Jan 1 1904)...
(localtime(time) works though)
Is this something I've just missed in the docs or do I have
a misconfigured/broken installation?
/Michael
--
| Linux: Turn on...Tune in...Fork out... |
| Michael Tempsch, member of Ballistic Wizards, TIP#088, POG#130 |
| d1temp@dtek.chalmers.se | [d1temp@bigfoot.com] | [d1temp@hotmail.com] |
| Cell.Phone:+46 705487554 URL:http://www.dtek.chalmers.se/%7Ed1temp |
------------------------------
Date: 5 Aug 1997 17:48:19 GMT
From: nigelr@convex.com (Nigel Reed)
Subject: Re: Making a variable from a variable?
Message-Id: <5s7p13$gom$1@news.rsn.hp.com>
Dont worry, I've fixed it - It was logical and I was dumb to miss it
first time!
Regards
Nigel
------------------------------
Date: 8 Aug 1997 18:26:17 -0500
From: mikebo@MCS.COM (Michael Borowiec)
Subject: MAX OPEN FILES under SunOS/Solaris?
Message-Id: <5sg9up$9op$1@Mars.mcs.net>
Greetings -
Given the simple program:
#!/usr/local/bin/perl
for $i (0 .. 1024) {
$filename = "crud$i";
open($filename, ">/tmp/$filename") ||
die("File $i open failed: $!");
}
Under SunOS 4.1.4, which has a "ulimit -n" of 256, the program dies:
> ulimit -n
256
> maxfile
File 125 open failed: Bad file number at ./sbin/maxfile line 5.
Under Solaris 2.5[.1], which has a "ulimit -n" of 1024, the program dies:
> ulimit -n
1024
> maxfile
File 253 open failed: at sbin/maxfile line 5.
If you add three to each of the numbers (STDIN, STDOUT, STDERR)
you get suspiciously round numbers: SunOS=128, Solaris=256.
Can anyone tell me why I can't open the OS maximum number of files with
Perl? It fails the exact same way with Perl 4.036 or 5.004_01. Any help
would be appreciated...
Regards,
- Mike
------------------------------
Date: 9 Aug 1997 00:00:59 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: MAX OPEN FILES under SunOS/Solaris?
Message-Id: <5sgbvr$9s9@news-central.tiac.net>
In article <5sg9up$9op$1@Mars.mcs.net>,
Michael Borowiec <mikebo@MCS.COM> wrote:
>Under Solaris 2.5[.1], which has a "ulimit -n" of 1024, the program dies:
>> ulimit -n
>1024
>> maxfile
>File 253 open failed: at sbin/maxfile line 5.
>
>If you add three to each of the numbers (STDIN, STDOUT, STDERR)
>you get suspiciously round numbers: SunOS=128, Solaris=256.
>
>Can anyone tell me why I can't open the OS maximum number of files with
>Perl? It fails the exact same way with Perl 4.036 or 5.004_01. Any help
>would be appreciated...
The operating system imposes these limits per process, using setrlimit
it's possible to lower the limits for a process, and if your process has
superuser permissions it's possible to raise them to some limit which is
specified somewhere deep in a kernel header file or the stdio
implementation you're using. One thing you can do is close the files you
have finished with which allow "slots" in the file handle or file
descriptor tables to be re-used. As your example code used distinct
strings in the filehandles you didn't benefit from perl's automatic
closing of an old file when the same filehandle is re-opened.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Fri, 08 Aug 1997 21:59:29 -0600
From: spohn@millcomm.com (Al)
Subject: MIF file parsing hints?
Message-Id: <spohn-ya023060030808972159290001@news.millcomm.com>
We've got a body of data that currently lives only in framemaker. I've
inherited the enviable task of extracting it, ultimately to a database. In
the interest of not recreating the wheel (not to mention profound personal
laziness) I thought I'd check to see if anyone had been down a similar path
and would be kind enough to share their experience, code snippets, or
suggestions... and perhaps some insight as to where I might find the spec
for the MIF format. Thanks very much in advance - email replies
appreciated.
Al
--
* Al Spohn * spohn@millcomm.com*
http://www.millcomm.com/~spohn/
------------------------------
Date: Fri, 08 Aug 1997 14:24:19 +0200
From: Eike Grote <eike.grote@theo.phy.uni-bayreuth.de>
Subject: Re: Pack / Unpack of IEEE floating point? What about XDR ?
Message-Id: <33EB0FF3.794B@theo.phy.uni-bayreuth.de>
Hi,
Tom Phoenix wrote:
>
> On 7 Aug 1997, Irving Reid wrote:
>
> > We have an application (actually the 'COPE' CORBA IIOP implementation,
> > http://www.lunatech.com/cope/) that needs to pack and unpack floats and
> > doubles in IEEE format.
> >
> > I prowled through all the modules I could find, but there doesn't seem
> > to be any existing IEEE format mangling tools.
> >
> > If nobody else knows of them, I'll go bug the Perl5-porters with a
> > feature request. This seems like a prime candidate for new format
> > designators for the pack() functions..
>
> The existing docs for pack tell me that the IEEE format may vary from one
> machine to another.
What about a module or feature of 'pack' which can deal with floatings
in the XDR format (see also RFC 1014)? It is intended to be platform
independent (developed for use by RPC programs).
I'm currently using this format to store data generated by programs
running on different machines in binary format (to save disk space).
At the moment I'm still using a filter written in C when I want to
work with those files using Perl scripts.
> But there's no reason you can't make a module which
> packs data in whatever format you wish, and you should naturally do so in
> a machine-independant way. (I'm not saying that you can't make this happen
> with pack and unpack. But if you want it right away, making your own
> module would be a good way to go.) Hope this helps!
Is there an easy way to find out (from within Perl) how floating point
numbers are stored by a system - or is it all hidden by the work
done by the C-compiler which compiled perl on a certain machine ?
There should be a better way than doing something like
if ($OSNAME eq 'irix') { conversion_routine_1($float) }
elsif($OSNAME eq 'dec_osf') { conversion_routine_2($float) }
...
Waiting for hints and ideas, Eike
--
======================================================================
Eike Grote, Theoretical Physics IV, University of Bayreuth, Germany
----------------------------------------------------------------------
e-mail -> eike.grote@theo.phy.uni-bayreuth.de
WWW -> http://www.phy.uni-bayreuth.de/theo/tp4/members/grote.html
http://www.phy.uni-bayreuth.de/~btpa25/
======================================================================
------------------------------
Date: 8 Aug 1997 23:49:19 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: perl with a dash of gif?
Message-Id: <5sgb9v$99v@news-central.tiac.net>
In article <33EBA7E0.3AEC@geenite.demon.co.uk>,
Matthew Knight <matt@geenite.demon.co.uk> wrote:
>hi
>
>can anyone direct me to a script, or the whereabouts of a tutorial or
>help to create GIF images through a perl script?
>
>for example, when data is entered through a form, a gif file (say a
>graph or chart) is created.
One place to start is with Boutell's gd library and the perl GD module
avaialble from http://www.boutell.com/ and http://www.perl.com/CPAN/
respectively. It's a fairly low level library but it's relatively easy to
use. If that's not good enough take a look at the modules on CPAN and see
if any fit your purposes.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Fri, 08 Aug 1997 17:09:44 -0700
From: amit kothari <amit@csd.sgi.com>
To: Matthew Knight <matt@geenite.demon.co.uk>
Subject: Re: perl with a dash of gif?
Message-Id: <33EBB548.A81A3907@csd.sgi.com>
Matthew Knight wrote:
>
> hi
>
> can anyone direct me to a script, or the whereabouts of a tutorial or
> help to create GIF images through a perl script?
>
> for example, when data is entered through a form, a gif file (say a
> graph or chart) is created.
>
> please reply to my email address..
> Matt Knight
> matt@geenite.demon.co.uk
Hi Matt,
Why don't u use GIFgraph - Graph Plotting Module for Perl 5. It is very
robust and easy to use.
Source code is available at http://www.tcp.chem.tue.nl/~tgtcmv/perl/
For documentation see
http://www.engelschall.com/e/perldoc/pages/module/GIFgraph.html
Regards
Amit
------------------------------
Date: Fri, 08 Aug 1997 17:19:17 -0700
From: Chad Frost <cfrost@mail.arc.nasa.gov>
To: Matthew Knight <matt@geenite.demon.co.uk>
Subject: Re: perl with a dash of gif?
Message-Id: <33EBB785.2781@mail.arc.nasa.gov>
Matthew Knight wrote:
>
> hi
>
> can anyone direct me to a script, or the whereabouts of a tutorial or
> help to create GIF images through a perl script?
>
> for example, when data is entered through a form, a gif file (say a
> graph or chart) is created.
See the following:
http://www.boutell.com/gd
for info on the 'gd' graphics library, and
http://www.ast.cam.ac.uk/AAO/local/www/kgb/pgperl/
for info on the 'pgplot' graphics library. Perl modules are available
for both. Note: the above URLs are not an exhaustive list; a web search
on 'perl gd gif' or some such will turn up many more!
Best,
chad
--
________________________________________________________________
Chad R. Frost NASA-Ames Research Center
(415) 604-1798
________________________________________________________________
------------------------------
Date: 9 Aug 1997 00:51:43 GMT
From: Zenin <zenin@best.com>
Subject: Re: perl with a dash of gif?
Message-Id: <5sgeuv$17a$2@nntp2.ba.best.com>
amit kothari <amit@csd.sgi.com> wrote:
> Why don't u use GIFgraph - Graph Plotting Module for Perl 5.
Probably because it's buggy as hell, to the point of core dumping
perl 5.003 at points.
> It is very robust and easy to use.
It's not too hard to use (unless you want to get fancy, like
use a different font in some places), but robust it is not. Not
by a long shot.
If you only need bar graphs, I much more highly recommend the
Graph.pm module by Matt Kruse. It's not on CPAN, but you can
get a copy at:
http://mkruse.netexpress.net/perl/
Easier to use (IMO) and produces much better looking graphs with
a greater degree of control if you need it.
--
-Zenin
zenin@best.com
------------------------------
Date: Tue, 05 Aug 1997 12:13:34 -0400
From: "Ron L. Helms" <helmrl@aur.alcatel.com>
To: over@the.net
Subject: Re: Reading from pipes
Message-Id: <33E7512E.2781E494@aur.alcatel.com>
dave wrote:
>
> Pipes are difficult to read without blocking. It's easy to read
> message queues without blocking using IPC_NOWAIT. Look at msgget,
> msgsnd and msgrcv. I think there is also an OO wrapper for the calls
> at CPAN ( IPC::SystemV or something like that).
>
> If you need to read stdout from a program, you could put a wrapper
> around the program that reads a pipe and puts it in the message queue.
>
> Dave
Dave
Thanks for the reply. I have found something different that works for
me.
First thing, don't mix script that needs to read from an execed process
and tk mainloop. The event scheduling gets hosed. I know that is vague.
More concrete, I forked a process that reads the info from an execed
process (and used open2 on it) and set up bidirectional pipes for
sending the read info to the process that writes it to a widget.
Second, if you want a <> to end when nothing is left on the pipe, use
fcntl.
use Fcntl;
$transfer->reader();
my ($retval) = fcntl($transfer, &F_SETFL, &O_NONBLOCK);
I set the reading end of the pipe to non-blocking, and lo & behold, when
there is no output on the pipe the while (<>) exits. That was the
behaviour I was looking for.
If you have any questions, email me.
Ron Helms
------------------------------
Date: Fri, 08 Aug 1997 09:56:33 -0500
From: Eryq <eryq@enteract.com>
To: Graham Barr <gbarr@ti.com>
Subject: Re: Research
Message-Id: <33EB33A1.5F979460@enteract.com>
Graham Barr wrote:
>
> I am trying to do some reasearch on how much my code from CPAN is
> used and where.
>
> If your company uses any of my modules from CPAN in a significant way
> please send me a mail with which modules are used, and maybe
> a note of the extent of thier use.
>
> The module in question are
>
> Mail::Internet Mail::Header Mail::Address Mail::Send Mail::Mailer
> Mail::Cap
NOTE: if your company uses MIME-tools 3.x, you should tell
Graham as well, since some of the principle
MIME:: classes are merely subclasses of the very fine
Mail:: classes...
MIME::Head ISA Mail::Header
MIME::Entity ISA Mail::Internet
...
Hence, you may be using his stuff, even if you think
you ain't. :-)
--
___ _ _ _ _ ___ _ Eryq (eryq@enteract.com)
/ _ \| '_| | | |/ _ ' / Hughes STX, NASA/Goddard Space Flight Cntr.
| __/| | | |_| | |_| | http://www.enteract.com/~eryq
\___||_| \__, |\__, |___/\ Visit STREETWISE, Chicago's newspaper by/
|___/ |______/ of the homeless: http://www.streetwise.org
------------------------------
Date: Tue, 05 Aug 1997 10:33:31 +0200
From: Doug Seay <seay@absyss.fr>
Subject: Re: running perl script
Message-Id: <33E6E55B.51B7ECAD@absyss.fr>
ussen@hotmail.com wrote:
>
> I have installed perl and Omni on w95. Now I can get the Perl window
> to
> open and type my program but don't know how to run it and see if it
> works.
> there is no menu bar to give me the option "run x.pl". How does
> httpd(omni) tie into this?
This doesn't sound very perl related to me. It sounds like your problem
is with "Omni", whatever that might be. I'd guess that asking the same
question in some windows95 group will give you better results.
Good luck
- doug
------------------------------
Date: 5 Aug 1997 16:51:49 GMT
From: v2matt@btv.ibm.com (Matt E Richards)
Subject: shmctl?
Message-Id: <5s7ln5$1b8o$1@mdnews.btv.ibm.com>
I have this perl script, which I believe the output should be
MESSAGE1
MESSAGE1 MESSAGE2
MESSAGE1 MESSAGE2 MESSAGE3
but I get
MESSAGE1
MESSAGE1
MESSAGE1
What am I doing wrong?
#!/usr/bin/perl
$IPC_PRIVATE = 0;
$IPC_RMID = 0;
$size = 2000;
$key = shmget($IPC_PRIVATE,$size,0666);
shmwrite($key,"MESSAGE1",0,$size) or die "$!";
shmread($key,$buff,0,$size) or die "$!";
print "$buff\n";
shmctl($key,$IPC_RMID,0) or die "$!";
$key = shmget($IPC_PRIVATE,$size,0666);
shmwrite($key,"$buff MESSAGE2",0,$size) or die "$!";
shmread($key,$buff,0,$size) or die "$!";
print "$buff\n";
shmctl($key,$IPC_RMID,0) or die "$!";
$key = shmget($IPC_PRIVATE,$size,0666);
shmwrite($key,"$buff MESSAGE3",0,$size) or die "$!";
shmread($key,$buff,0,$size) or die "$!";
print "$buff\n";
shmctl($key,$IPC_RMID,0) or die "$!";
--
* Matt Richards (T/L 446-4764) DCS/CTG
------------------------------
Date: 5 Aug 1997 15:48:16 GMT
From: Bruce Gingery <bruceSpamReject@SpAmReJeCt.gtcs.com>
Subject: TkWeb - continuing development?
Message-Id: <5s7i00$v65@horn.wyoming.com>
Keywords: development,TkWeb, Tk.pm, Tk::Web, browser, embedded tcl, embedded perl, javascript, java, www, world wide web, windows, x-windows, macintosh, solaris, unix
Is anyone ELSE working actively on Tk::Web as an application, and
its directly related objects? There's no GOOD reason that this couldn't
be ``the browser of choice'' because of it's capacities, yet the latest
version I've seen isn't even fully Wilbur compliant, is single-window
oriented (MainWindow or ``.''), and currently has no inherent capacity
to even run embedded perl or safe-tcl, let alone work in a JavaScript
interpretation, or frames/embedded-frames.
It should be EMINENTLY customizable, rivaled perhaps only by emwacs
and form *the* reference browser across all supported platforms (and
that's MOST platforms). (Perl5 seems to be far more widespread than
Java!)
I just don't have time to do everything I'd like to see done in this
myself, and certainly don't have the time to duplicate someone else's
efforts.
Collaborators wanted!
E-Mail: s/SpamReject//g
or followup to comp.infosystems.www.browsers.misc/
comp.lang.perl.tk.
------------------------------
Date: 5 Aug 1997 13:28:37 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Unparse form data?
Message-Id: <5s79q5$ln0@news-central.tiac.net>
In article <33E65804.154B@intranet.org>,
Anneke Floor <anneke@intranet.org> wrote:
>When you parse an HTML form, all the %20's are turned into spaces, all
>the %2F's are turned into slashes, question marks to %3F's, and so on
>and so on...
>
>If I wanted to turn a string back into something like this:
>Is%20this%20a%20 string%3F
>How would I do that?
>
>$new = ($string =~ /(\W)/sprintf("%X", $1)/eg);
($new = $string) =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge;
is probably something like what you need. I stole the regex from the
CGI.pm packege which is included with recent perl distributions, or it's
available to be added to a perl 5.x installation from the comprehensive
perl archive network (CPAN.) CPAN can be reached via
http://www.perl.com/CPAN/ and the CGI module is documented at
http://www.genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.html and may be
worth looking into.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Fri, 08 Aug 1997 07:39:40 -0400
From: Stephen Hill <buck@huron.net>
Subject: Why won't this work!?!
Message-Id: <33EB057B.3D4CFF57@huron.net>
The snipplet of script below sortta works, it does a search but it
ignores the last part of the URL. For some reason I can't get an URL
with an "&" to work right, it ignores everything to the right of the &
in the url.
$url = "http://www.mydomian.com/cgi-bin/search?text=ontario&offset=600";
@lines = `lynx -source $url`;
print "@lines";
This almost works, but the "offset=600" is not passed to the lynx
browser; is there anyway I can pass an URL(with an "&") to the lynx
browser??????
------------------------------
Date: Tue, 05 Aug 1997 14:13:03 -0400
From: "James J. Heck" <jheck@merck.com>
Subject: Re: XS and C Libs:Question
Message-Id: <33E76D2F.794B@merck.com>
Venu,
In my experience so far all C structures I used were typemapped to
T_PTROBJ. So your typemap would be the following:
MY_MESSAGE T_PTROBJ
I made no changes to my Makefile.PL file.
If any of you more experienced XS users, I know you are out there, as
you helped me with this a little while ago, find that this is wrong,
please let me know. :)
Hope this helps.
James
venu128@hotmail.com wrote:
>
> Hello All;
>
> Could someone help me out on how to the the following function
> defined
> in a file(My_client.h)
>
> int My_initClientLibrary(
> char * host,
> MY_MESSAGE * message
> )
>
> in a normal c program I would do the folloeing;
>
> MY_MESSAGE message;
> if(My_initClientLibrary(char*)getenv("MY_SERVERHOST"),&message) ==
> MY_SUCCESS){/*do something useful */}
> else{/*exit with error */}
>
> MY_MESSAGE and MY_SUCCESS are defined in My_client.h;(MY_MESSAGE
> is a
> structure);
>
> I am new to XS and am finding it difficulkt to write the
--------------------
James J. Heck
jheck@acm.org
http://www.bucknell.edu/~jheck
The contents of this message express only the sender's opinion.
This message does not necessarily reflect the policy or views of
my employer, Merck & Co., Inc. All responsibility for the statements
made in this Usenet posting resides solely and completely with the
sender.
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 833
*************************************