[10225] in Perl-Users-Digest
Perl-Users Digest, Issue: 3818 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Sep 24 22:07:28 1998
Date: Thu, 24 Sep 98 19:00:19 -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 Thu, 24 Sep 1998 Volume: 8 Number: 3818
Today's topics:
AutoQuote - SearchQuote - WebSite Scripts .. (rga)
Does the $string contain "my_text"? vbakke@atlas.otago.ac.nz
Re: Does the $string contain "my_text"? <ajohnson@gpu.srv.ualberta.ca>
Re: Does the $string contain "my_text"? <95ncp@eng.cam.ac.uk>
Re: Does the $string contain "my_text"? <ajohnson@gpu.srv.ualberta.ca>
Re: getting open(FH, "| tee $filenameVar"); to work (wo <ngrossman@searchathome.com>
Re: getting open(FH, "| tee $filenameVar"); to work (wo <uri@camel.fastserv.com>
Re: grep syntax question (Matthew Bafford)
Re: HELP (bug?) : backtick and system return different <george.kuetemeyer@mail.tju.edu>
help with pattern matching (remove)
Re: How to tinker with @_ in threaded Perl? (Ilya Zakharevich)
Re: How to tinker with @_ in threaded Perl? <sugalskd@netserve.ous.edu>
Re: Perl & Java - differences and uses <jdane@hawaii.edu>
Re: Perl & Java - differences and uses (David Formosa)
Re: Perl & Java - differences and uses (David Formosa)
Re: Perl & Java - differences and uses arw@pythonpros.com
Re: Perl & Java - differences and uses <retnuh@corona.pixar.com>
Re: Perl GMTIME?? (Andre L.)
Perl under Win95 and Binary files <nhon@*spam*hons.compulink.co.uk>
setting path in win95 <brianjulz@earthlink.net>
Tk::fileevent() bug??? honchi_ng@my-dejanews.com
Re: Trouble with ActiveState Perl on WinNT Workstation (Byte Schlepper)
trouble with end of line and Win32::ODBC <don@emedia.net.nz>
Re: Undefined subroutine &main::read_and_parse_form_dat (Alastair)
Re: URGENT-PLEASE READ!!! (Andre L.)
Using 'use' pgiesin@my-dejanews.com
Using GD and graph.pm under WIN NT4 and Activestate Per <new_user@email.msn.com>
When will comp.lang.perl.moderated be newgroup'd? hermit@bayview.com
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 25 Sep 1998 01:47:40 GMT
From: rga@io.com (rga)
Subject: AutoQuote - SearchQuote - WebSite Scripts ..
Message-Id: <360af634.5051774@news.io.com>
A few new CGI scripts written in Perl for the
Personal WebSite .. by RGA !
http://www.io.com/~rga/scripts/
Free, Web-Ware for Personal Sites
* AutoQuote v2.0
Random image and quote slide show, with variations.
* SearchQuote v2.0
A very nice little search script for the Quote File used in
AutoQuote, ince features: incremental return, numbering, HR,
exact / string match, more.
* A very well done 6,400 line quote file also available ..
The SearchQuote can be used to search your own ascii
flatfile.. Make your own data file and SearchQuote can do your:
- tape collection, etc.
- image collection, etc.
- even web site catalogue
------------------------------
Date: Thu, 24 Sep 1998 23:03:15 GMT
From: vbakke@atlas.otago.ac.nz
Subject: Does the $string contain "my_text"?
Message-Id: <6uej3j$au2$1@nnrp1.dejanews.com>
Heres an example in quasi-perl:
if( $String contains "tea") {
print "Tea-time!\n";
}
If $String contains the letters 't','e','a' (in this order), "Tea-time!\n"
should be printed. How do I check if a string contains a given substring?
TIA,
Vegard
--
Vegard Bakke - http://atlas.otago.ac.nz:800/~vbakke/
traceroute 127.0.0.1
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Thu, 24 Sep 1998 18:35:26 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Does the $string contain "my_text"?
Message-Id: <360AD73E.66A7E53D@gpu.srv.ualberta.ca>
vbakke@atlas.otago.ac.nz wrote:
!
! Heres an example in quasi-perl:
!
! if( $String contains "tea") {
! print "Tea-time!\n";
! }
!
! If $String contains the letters 't','e','a' (in this order),
! "Tea-time!\n" should be printed. How do I check if a string contains
! a given substring?
if you are looking for given substrings see:
'perldoc -f index' to find out about the index() function
for pattern matching see:
'perldoc perlre' to find out about regular expressions
hope it helps
regards
andrew
------------------------------
Date: Fri, 25 Sep 1998 00:54:17 +0100
From: Nigel Parker <95ncp@eng.cam.ac.uk>
Subject: Re: Does the $string contain "my_text"?
Message-Id: <Pine.HPP.3.96L.980925005228.19701A-100000@club.eng.cam.ac.uk>
On Thu, 24 Sep 1998, Andrew Johnson wrote:
: ! if( $String contains "tea") {
: ! print "Tea-time!\n";
: ! }
$sub_string ="tea";
if ($string =~ /$sub_string/) { ...
I believe this works. Give it a try!
Nigel
--
Girton College, Cambridge, England, CB3 0JG. Tel: 0411 384803
http://welcome.to/nigels nigel.parker@iee.org
------------------------------
Date: Thu, 24 Sep 1998 20:09:13 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
To: nigel.parker@iee.org
Subject: Re: Does the $string contain "my_text"?
Message-Id: <360AED39.2D5F890A@gpu.srv.ualberta.ca>
[posted and mailed]
Nigel Parker wrote:
!
! On Thu, 24 Sep 1998, Andrew Johnson wrote:
!
! : ! if( $String contains "tea") {
! : ! print "Tea-time!\n";
! : ! }
!
! $sub_string ="tea";
! if ($string =~ /$sub_string/) { ...
!
! I believe this works. Give it a try!
please, if are going to delete everything I wrote
in my followup, at least remove my attribution and
retain the original posters --- better yet, respond to
the original post in the first place.
regards
andrew
------------------------------
Date: Fri, 25 Sep 1998 18:55:43 -0400
From: Nick Grossman <ngrossman@searchathome.com>
Subject: Re: getting open(FH, "| tee $filenameVar"); to work (won't convert var name)
Message-Id: <360C1F6F.A98E577@searchathome.com>
Uri Guttman wrote:
>
> >>>>> "NG" == Nick Grossman <ngrossman@searchathome.com> writes:
>
> if this is real code then you have a spelling problem
>
> NG> $filemaneVar=$input{'MyVar'}; open (FH1, "|tee $filenameVar")
> ^ ^
> NG> or die("Can't open file $filenameVar");
>
> otherwise it should work fine with "".
Oops... nope, that's not the real code. The real code doesn't have a
typo. :)
It works fine if I do a normal open(), the problem arises when I try to
go to tee with the pipe.
--
Nicolai Grossman Webmaster
SearchAtHome.com +212-481-6501 http://www.searchathome.com/
------------------------------
Date: 24 Sep 1998 19:57:20 -0400
From: Uri Guttman <uri@camel.fastserv.com>
To: Nick Grossman <ngrossman@searchathome.com>
Subject: Re: getting open(FH, "| tee $filenameVar"); to work (won't convert var name)
Message-Id: <sarlnn9vzbz.fsf@camel.fastserv.com>
>>>>> "NG" == Nick Grossman <ngrossman@searchathome.com> writes:
NG> Uri Guttman wrote:
>> >>>>> "NG" == Nick Grossman <ngrossman@searchathome.com> writes:
>>
>> if this is real code then you have a spelling problem
>>
NG> $filemaneVar=$input{'MyVar'}; open (FH1, "|tee $filenameVar")
>> ^ ^
NG> or die("Can't open file $filenameVar");
>> otherwise it should work fine with "".
NG> Oops... nope, that's not the real code. The real code doesn't have
NG> a typo. :)
NG> It works fine if I do a normal open(), the problem arises when I
NG> try to go to tee with the pipe.
well i ran this one liner and it works:
perl -e '$f="bar";open F,"|tee $f"; print F "asdf\n"'
not nice code but asdf went to the file and stdout
maybe you should post more broken code. what you have here works.
hth,
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Thu, 24 Sep 1998 20:22:44 -0400
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: grep syntax question
Message-Id: <MPG.1073f7fa5bdb10119896b6@news.south-carolina.net>
In article <6ud8cb$nrg$1@schbbs.mot.com> on Thu, 24 Sep 1998
11:53:11 +0100, Stephen Totten (stephent@comm.mot.com) pounded in
the following text:
=> I know how do to a regular grep on a string, but how do I do a '-i' test?
=>
=> grep {?i/.pdf$/} $file
=>
=> doesn't work...
=>
=> Thanks
=> - Steve
=>
I think you've got the wrong idea about grep...
>From perlfunc:
grep BLOCK LIST
grep EXPR,LIST
This is similar in spirit to, but not the same as, grep(1)
and its relatives. In particular, it is not limited to using
regular expressions.
Evaluates the BLOCK or EXPR for each element of LIST (locally
setting $_ to each element) and returns the list value consisting
of those elements for which the expression evaluated to TRUE. In
a scalar context, returns the number of times the expression was
TRUE.
@foo = grep(!/^#/, @bar); # weed out comments
or equivalently,
@foo = grep {!/^#/} @bar; # weed out comments
[...]
See also map for an array composed of the results of the
BLOCK or EXPR.
EOT
For more information on how to find a pattern within a string,
look in perlre.
Or, in perlfunc under 'index'.
Hope This Helps!
--Matthew
------------------------------
Date: Thu, 24 Sep 1998 18:57:20 -0400
From: George Kuetemeyer <george.kuetemeyer@mail.tju.edu>
Subject: Re: HELP (bug?) : backtick and system return different value !!
Message-Id: <360ACE4F.8288EDD9@mail.tju.edu>
Nicolas Pomarede wrote:
> Then, I run a.pl :
>
> res bb done ret 1024
> ret2 1024
>
> So here, both invocations of system and `` give the same result.
>
> But if I use a crontab or the at command to run a.pl at a fixed date,
> I get :
>
> res bb done ret -1
> ret2 1024
>
> This means that whatever I return in my exit in bb.sh, I always get -1
> as exit code in a.pl !!
>
> So, am I missing an env variable, is there a problem with the red hat
> perl version, or is this a bug in perl ??
>
> Please, send any possible help, because I'm really becoming crazy ;
> I have many scripts in perl which need the result $? of the backtick
> operator, and I don't see any solution for now.
>
Hmmm... I've also posted a problem re: spurious $? values. In our case, we
are piping a command through a 'while' loop, as opposed to using the
backtick or system call. Everything worked fine until we upgraded our system
(HP-UX) to two processors. Now, very occasionally, we get invalid return
codes - 0xFFFFFF. I did get one reply from a list member who pointed out
that we were getting the $? value before closing the pipe. On the other
hand, we didn't have a problem until after the processor upgrade & the
person who wrote the code said that the code he copied (imitation being the
sincerest form of flattery) specifically stated that $? was to be read
*before* the close. Our current Perl version is: version 5.005_02 built for
PA-RISC1.1, but the problem showed up with the previous release as well. I
might add that the pipe code is part of a child process that's being called
by a server process. The overall application is an administrative server
that allows us to create/delete/modify mail/calendaring accounts via the
web.
I've looked through the camel book, online documentation, and (the really
great) Perl Cookbook to find out what I can about $?, but am still in a bit
of a quandry. Should $? always be accessed after the pipe is closed?. Are
there reasons why you might not want to do that? And why do I get
intermittent bad values?
------------------------------
Date: Thu, 24 Sep 1998 17:03:34 +0000
From: jasonW <"westi"@(remove)leland.stanford.edu>
Subject: help with pattern matching
Message-Id: <6uemft$s19$1@nntp.Stanford.EDU>
I am sure the answer to this is probably obvious. I don't have alot of
experience with Perl, but I have tried everything and I cannot figure it
out.I am trying to use perl to extract the I.P addresses out of a web
log file. The problem is that while I can pattern match and use grep to
only select the lines that have an i.p address in them, I don't know how
to get rid of the rest of the information. I want to end up with an
array that only has I.p addresses in it. If anyone can give me some
advice, I would really appreciate it.
Thanks Jason
------------------------------
Date: 24 Sep 1998 18:41:23 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: How to tinker with @_ in threaded Perl?
Message-Id: <6ue3oj$86b$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Dan Sugalski
<sugalskd@netserve.ous.edu>],
who wrote in article <6ue0mp$gq2$1@news.NERO.NET>:
> :> : sub wrapper { unshift @_, qq{$cref}; goto &_handler }
> :>
> :> : sub _handler {
> :> : my $cref = shift;
> :> : ...
> :> : }
>
> :> Seriously, I don't think there's a whole lot you can do. @_ being lexical
> :> breaks these tricks pretty badly. Tell folks "threads are experimental.
> :> Don't be surpised that it breaks"
>
> : I do not follow. What has the implementation of @_ to do with the fact
> : that
> : goto &_handler
> : does not work as expected? It looks like a bug in pp_goto, nothing more.
>
> No, it's not. Would that it was that simple.
No it is.
> The lexical @_ inside of wrapper() isn't available to _handler() any more
> than a my variable in wrapper would be. Lexical scope for @_ begins at the
> sub's opening {, IIRC. _handler's completely outside the scope of wrapper,
> so there's no way it'd have access to wrapper's lexicals.
>
> The situations' identical to this:
>
> #! perl -w
> my $foo = "1";
> sub bar { my $foo = "2"; goto &baz;}
> sub baz {print "$foo\n"}
> bar();
> with $foo taking the place of @_.
Maybe it is with the current broken implementation, but it should not
be. pp_goto should copy @_ if this is needed, period.
Ilya
------------------------------
Date: 25 Sep 1998 01:10:31 GMT
From: Dan Sugalski <sugalskd@netserve.ous.edu>
Subject: Re: How to tinker with @_ in threaded Perl?
Message-Id: <6ueqi7$aqn$1@news.NERO.NET>
In comp.lang.perl.misc Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
: [A complimentary Cc of this posting was sent to Dan Sugalski
: <sugalskd@netserve.ous.edu>],
: who wrote in article <6ue0mp$gq2$1@news.NERO.NET>:
:> :> : sub wrapper { unshift @_, qq{$cref}; goto &_handler }
:> :>
:> :> : sub _handler {
:> :> : my $cref = shift;
:> :> : ...
:> :> : }
:>
:> :> Seriously, I don't think there's a whole lot you can do. @_ being lexical
:> :> breaks these tricks pretty badly. Tell folks "threads are experimental.
:> :> Don't be surpised that it breaks"
:>
:> : I do not follow. What has the implementation of @_ to do with the fact
:> : that
:> : goto &_handler
:> : does not work as expected? It looks like a bug in pp_goto, nothing more.
:>
:> No, it's not. Would that it was that simple.
: No it is.
You're right, of course--thinko on my part. pp_goto looks to be getting
the wrong @_ array in some cases. Not sure why yet. Basically if you call
a sub with parameters, then call a sub with no parens, then goto &sub, the
goto picks up the @_ array up two levels rather than one. (I posted a more
coherent explanation along with a patch to t/op/goto.t to catch the error
to the p5p list earlier today)
Dan
------------------------------
Date: 24 Sep 1998 13:33:26 -1000
From: Joseph Allen Dane <jdane@hawaii.edu>
Subject: Re: Perl & Java - differences and uses
Message-Id: <29iuidjdbt.fsf@honlab.nmfs.hawaii.edu>
Zenin <zenin@bawdycaste.org> writes:
>
> But it is not a closure, that's part of the problem. You can not
> for instance, do:
>
> int foo = 10;
> closure c = new closure();
> printer p10 = c.closureMaker(foo);
> foo = 20;
> p10.print();
>
> And have it print 20. The context and scope of foo is not
> maintained.
>
Your point is taken. In order to make closures work, objects to be
closed over need to have indefinite extent. They can't be allocated
on a stack. So I was mistaken above that Java could close over
primitive types, which can only be allocated on the stack. But Java
objects can be closed over in the way you describe above.
public class closure2 {
class modInt {
public int val;
public modInt(int i) { val = i; }
}
public closure2() {}
printer makeClosure(final modInt i) {
printer p = new printer() {
public void print() {
System.out.println(i.val);
}
};
return p;
}
void show() {
modInt i = new modInt(10);
printer p = makeClosure(i);
p.print();
i.val = 20;
p.print();
}
public static void main(String args[]) {
closure2 c = new closure2();
c.show();
}
}
This prints
10
20
Is this not a closure?
--
joe
------------------------------
Date: 25 Sep 1998 10:32:53 +1000
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: Perl & Java - differences and uses
Message-Id: <6ueobl$bbm$1@godzilla.zeta.org.au>
In <6udojf$d5t$1@nnrp1.dejanews.com> droby@copyright.com writes:
>Really, this thread should have ended three weeks ago when it started.
I've learned alot about java, perl and python from this thread. So I
think its been worthwhile.
------------------------------
Date: 25 Sep 1998 10:34:55 +1000
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: Perl & Java - differences and uses
Message-Id: <6ueoff$bgo$1@godzilla.zeta.org.au>
In <360A6C23.D83A947@ensam.inra.fr> Xavier Cousin <cousin@ensam.inra.fr> writes:
>Behavioral questions : Is this kind of exchange often in this group ?
It occours accross most every programing newsgroup.
>WWW questions : Isn't this slowing the net ?
Not as much as the meany terrabites for porn.
------------------------------
Date: Fri, 25 Sep 1998 01:12:30 GMT
From: arw@pythonpros.com
Subject: Re: Perl & Java - differences and uses
Message-Id: <6ueqlu$irk$1@nnrp1.dejanews.com>
In article <906653836.885276@thrush.omix.com>,
Zenin <zenin@bawdycaste.org> wrote:
> arw@pythonpros.com wrote:
> : Okay, I read that to mean you either don't understand
> : the question and don't care to bother trying, or you
> : can't think of an example and are blustering.
>
> You read it wrong. Do we really need to teach *basic* functional
> programming here? I really hope we don't have to act out "Mr Rogers
> Teaches Lisp" or "Barney's Scheme Hour"...
I'll teach you some manners, chump! Step outside...
oops... oh yeah this is cyber space, I forgot (gotta
take off this virtual reality helmet...)
> {
> my $counter = 0;
> sub set ($) { $counter = shift }
> sub up () { ++$counter }
> sub down () { --$counter }
> }
class counter:
value = 0
def set(self, x): self.value = x
def up(self): self.value=self.value+1
def down(self): self.value=self.value-1
Whassobadaboutthat? Gimmeabreakferchrissake!
Okay, I can see why you might like the other style,
but I still don't know anything interesting about
what I can do with one style that I can't do with
the other, if we can start acting like grown ups,
if you don't mind.
-- Aaron Watters
===
We'll be back home by Christm...
-- last words of some general, I think, I forget which.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 24 Sep 1998 17:32:31 -0700
From: Hunter Kelly <retnuh@corona.pixar.com>
To: Zenin <zenin@bawdycaste.org>
Subject: Re: Perl & Java - differences and uses
Message-Id: <yvtn27p58ww.fsf@corona.pixar.com>
Zenin <zenin@bcawdycaste.org> writes:
<snip>
> And print out 40 and 80. This of course, will not compile. More
> over, it wouldn't be the best example of a closure since we are
> using two different pieces of code (o1 and o2 use two complete
> blocks of code). Indeed, as Java does not support real closures
> an example in Java can't really be done (at least not well, and
> definedly not that will compile).
>
> Here is a better example in Perl:
>
> sub times_something {
> my $x = shift;
> return sub { $x * shift };
> }
>
> my $o1 = times_something (10);
> my $o2 = times_something (20);
>
> print $o1->(4.0), "\n";
> print $o2->(4.0), "\n";
>
> This prints 40 and 80 respectively. Funky hey?
>
> The value passed to times_something() is bound at *run time* in
> the particular anonymous function pointer. Indeed, the ability to
> bind values in the context of the run time environment is key to
> what a lambda function is.
>
> Java can only bind values to a context at compile/load time, which
> is why it can not support closures (lambda functions).
This is blatantly false. Joseph Allen Dane <jdane@hawaii.edu> showed
that this was possible, yet you flamed him because _you_ don't know
how to compile a java program. Here is his code, modified so that it
will fit in one file, so even _you_ can compile it, and also changed
to look like the perl example you just presented.
32 @corona:/tmp> cat closure.java
public class closure {
interface printer {
void printTimes(int i);
void set(int n);
}
public closure() {}
public printer times_something(int num) {
final int pnum = num;
return new printer() {
int foo = pnum;
public void printTimes(int i) {
System.out.println(foo*i);
}
public void set(int n) {
foo = n;
}
};
}
public static void main(String args[]) {
closure cl = new closure();
int a=0,b=0,c=0,times=0;
try {
a = Integer.parseInt(args[0]);
b = Integer.parseInt(args[1]);
c = Integer.parseInt(args[2]);
times = Integer.parseInt(args[3]);
}
catch (Exception e) {}
printer p10 = cl.times_something(a);
printer p20 = cl.times_something(b);
p10.printTimes(times);
p20.printTimes(times);
p10.set(c);
p10.printTimes(times);
}
}
33 @corona:/tmp> javac closure.java
34 @corona:/tmp> java closure 10 20 15 4
40
80
60
35 @corona:/tmp>
It binds the values all at run time. Looks like your perl
example to me. Well, alot more code, granted, but it still
does the same thing.
> : Java typed solution is definitely more verbose than the other languages.
>
> True, but verbosity is not the issue. Mear ability is. Java simply
> can't do closures, and neither can its byte code which is why a
> Scheme Java byte code compiler is impossible.
>
> Inner classes are a major kluge at best to try and make up for
> *some* of the functionality, but not all or even most of it.
What part is it lacking? Give us another example in perl showing what
Java can't do. I'm not being antagonistic or saying that there isn't
anything, just that Java can do what you've described so far.
> To do closures you need to have at least one context stack in the
> runtime. The system does not provide this, and neither does the
> JVM. Therefor, to do closures you would need to build anothern
> runtime system/VM *on top* of the JVM ala the Python written in
> Java. A Python in Java however is much easier then a Perl in
> Java, simply because Python does not properly support closures
> anyway so this isn't a concern there. Lisp, Scheme, or Perl
> runtimes in Java would be harder, but possible. Pure Java byte
> code backends for them however, are likely impossible.
>
> : If there is some design which needs lambda style functions instead of inner
> : classes I would be interested.
>
> Any functional programming book should be able to give you dozens
> of examples. If that fails, I'm sure a couple clicks off of
> www.scheme.org should fill this order and then some. :-)
>
> --
> -Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
> BSD: A psychoactive drug, popular in the 80s, probably developed at UC
> Berkeley or thereabouts. Similar in many ways to the prescription-only
> medication called "System V", but infinitely more useful. (Or, at least,
> more fun.) The full chemical name is "Berkeley Standard Distribution".
Hunter
------------------------------
Date: Thu, 24 Sep 1998 19:14:29 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Perl GMTIME??
Message-Id: <alecler-2409981914290001@dialup-683.hip.cam.org>
In article <360A98EE.718511C9@hknet.com>, thief <marlboro9@hknet.com> wrote:
> I'm use matt's guestbook,How Can I put a script into the gbook.pl to get
>
> the GMTime??
With the function gmtime(), of course. :-)
Andre
------------------------------
Date: Fri, 25 Sep 1998 02:28:50 +0100
From: "nshon" <nhon@*spam*hons.compulink.co.uk>
Subject: Perl under Win95 and Binary files
Message-Id: <6uerjs$sua$1@plug.news.pipex.net>
The script below works under Linux and not under Win95. I'm trying to read
in a JPG image and duplicate it. The file size of out.jpg(OUTFILE) is larger
than the infile so I guess it must be carriage returns or something. Any
ideas on solving this? Thanks in advance.
---------------------
#!/usr/bin/perl
$fname=<STDIN>;
open(IMG,$fname);
open(OUT,">out.jpg");
binmode(IMG);
my $image;
my $size = -s IMG;
my $bytes=read(IMG,$image,$size);
print OUT "$image" if $bytes==$size;
----------------------
Regards,
Nash.
------------------------------
Date: Thu, 24 Sep 1998 18:00:11 -0700
From: Brian Day <brianjulz@earthlink.net>
Subject: setting path in win95
Message-Id: <360AEB1B.E48A9F37@earthlink.net>
I am very familiar with setting a path in the Unix environment, but
can't figure out how to
do the same on a Win95 system. I see it referred to in a number of the
FAQ's but I don't
see where it explains "how" to do it.
Any help would be greatly appreciated.
Thank You,
Brian Day
------------------------------
Date: Fri, 25 Sep 1998 00:31:30 GMT
From: honchi_ng@my-dejanews.com
Subject: Tk::fileevent() bug???
Message-Id: <6ueo93$gci$1@nnrp1.dejanews.com>
Hi
I'm wondering if this is a bug in method fileevent of Tk.pm. BTW, I'm using
Perl/Tk 402.004.
The line 188 of lib/Tk.pm is
sub fileevent {
...
croak "Unknown mode '$mode'" unless $mode =~ /^(readable|writeable)$/;
^^^^^^^^^
Should it be "writable" instead?
Below is the error message complained when I ran "pgs".
> Ghostview/pgs foo.ps
Tk::Error: Unknown mode 'writable' at lib/auto/Tk/Ghostscript/Postscript.al
line 15
Carp::croak at lib/Carp.pm line 139
Tk::fileevent at lib/Tk.pm line 188
...
Regards
Hon-Chi
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Thu, 24 Sep 1998 21:32:33 -0400
From: cdenker@wardsci.com (Byte Schlepper)
Subject: Re: Trouble with ActiveState Perl on WinNT Workstation 4.0SP3
Message-Id: <MPG.1074bcbf731683f898968e@news.frontiernet.net>
>
> Check your system variable PATH and rearrange it to put
> C:\WINNT\SYSTEM32 in front.
I don't think scanning \perl\bin would slow things down that much, with
only a few files in it (but with M$ software you never know). Maybe disk
space is a little too low and perl sends it over the edge??? I've got two
machines with Outlook with no problems noticed.
---------------------
Just a Byte Schlepper
------------------------------
Date: Fri, 25 Sep 1998 13:26:50 +1200
From: "Don Robertson" <don@emedia.net.nz>
Subject: trouble with end of line and Win32::ODBC
Message-Id: <360af231.0@news.actrix.gen.nz>
Greetings,
i'm running perl on a win 95 machine, and I have a load of text files that
have been output from a Unix system.
My script reads each file, grabs various bits of data and then pops it into
a Access data base via win32::ODBC using insert into ....
when the insert into fails, the sql statment is wirtten out to another file.
My problem is that the some files work fine, others do not. Opening a file
and saving a file fixes it.
At the end of the "value" in the insert statements feilds that cause the
problem are a large number of what appear to be spaces.
The "value" comes from a line of text that has been "chomped".
I have added a line that removes all spaces (to test), line feeds, returns,
tabs, and form feeds (using $_ =~s/[ \t\r\n\f]+/ /g; $-=~s/\s/ /g; ect.),
but the long line of 'spaces' are still showing.
My only thought is that there is some sort of unix control character at the
end of the lines that are causing the problems. I'd copy them into the post
but they probably would translate well.
Anybody have any thoughs? Help most appreciated.
Don
don@emedia.net.nz
------------------------------
Date: Thu, 24 Sep 1998 23:19:30 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Undefined subroutine &main::read_and_parse_form_data called at web_store.cgi lin
Message-Id: <slrn70lojf.4m.alastair@calliope.demon.co.uk>
APH <silk_stockings@mailexcite.com> wrote:
>Undefined subroutine &main::read_and_parse_form_data called at
>web_store.cgi lin
>
>where would i look to fix this and how?
A wild guess might be to look at the code - but what do I know?
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Thu, 24 Sep 1998 19:26:12 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: URGENT-PLEASE READ!!!
Message-Id: <alecler-2409981926120001@dialup-683.hip.cam.org>
Please don't post job offers here.
Regards,
Andre
==============
In article <6udjvb$jeo@bgtnsc02.worldnet.att.net>, "Datanomics"
<datanomics@worldnet.att.net> wrote:
> Hello,
> I have a job opening available ASAP
[...]
------------------------------
Date: Thu, 24 Sep 1998 23:27:46 GMT
From: pgiesin@my-dejanews.com
Subject: Using 'use'
Message-Id: <6uekhi$cok$1@nnrp1.dejanews.com>
Does anybody know of a way to dynamically use 'use'?
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: Fri, 25 Sep 1998 01:16:29 +0100
From: <new_user@email.msn.com>
Subject: Using GD and graph.pm under WIN NT4 and Activestate Perl 5.02
Message-Id: <#uCgxnB69GA.186@upnetnews02.moswest.msn.net>
Has anybody done this successfully? I am having some problems and would like
some help.
------------------------------
Date: 24 Sep 1998 17:27:51 -0700
From: hermit@bayview.com
Subject: When will comp.lang.perl.moderated be newgroup'd?
Message-Id: <waayar9kpdk.fsf@ese.UCSC.EDU>
I thought that the new group had been approved, but it isn't appearing
on my server... Does it exist yet? If so perhaps the newgroup
messages aren't propagating very well. If not, when will it be
created so that I can use it?
--Bill.
--
William R Ward Bay View Consulting http://www.bayview.com/~hermit/
hermit@bayview.com 1803 Mission St. #339 voicemail +1 408/479-4072
hermit@cats.ucsc.edu Santa Cruz CA 95060 USA pager +1 408/458-8862
PGP Key 0x2BD331E5; Public key at http://www.bayview.com/~hermit/pubkey.txt
-----------------------------------------------------------------------------
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." - Ben Franklin, ~1784
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3818
**************************************