[18698] in Perl-Users-Digest
Perl-Users Digest, Issue: 866 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 10 03:05:39 2001
Date: Thu, 10 May 2001 00:05:09 -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: <989478308-v10-i866@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 10 May 2001 Volume: 10 Number: 866
Today's topics:
Re: $a . $a++ or Perl for vulcans? (Martien Verbruggen)
Re: 1 billion seconds bug <bop@mypad.com>
ANNOUNCE: Attribute::Handlers 0.61 (Damian Conway)
ANNOUNCE: Attribute::Types 0.10 (Damian Conway)
Bad File Number? <mikecook@cigarpool.com>
Re: Bad File Number? (Mark Jason Dominus)
cgi.pm problems <crud_alex@yahoo.com>
Re: cgi.pm problems (David Efflandt)
Re: Javascript or Perl ? (David H. Adler)
Re: Javascript or Perl ? <godzilla@stomp.stomp.tokyo>
Re: Javascript or Perl ? (David H. Adler)
Re: Javascript or Perl ? <godzilla@stomp.stomp.tokyo>
Re: Local Time (David H. Adler)
Re: Local Time <godzilla@stomp.stomp.tokyo>
Re: Local Time (Eric Bohlman)
one click and execute on many boxes <ayumi.ozeki@verizon.net>
Re: one click and execute on many boxes (Eric Bohlman)
Pattern matching using variable ... <vsen@interrainc.com>
Re: Pattern matching using variable ... (Jay Tilton)
problem with perlapp (PDK 2.1) <nutcracker@no-spam.org>
Re: problem with perlapp (PDK 2.1) <wyzelli@yahoo.com>
Re: Reading from empty file handle OR from a pipe <ronald.fischer@deadspam.com>
Re: Reading from empty file handle OR from a pipe (Mark Jason Dominus)
Re: unicode support in perl 5.6 -- I'm trying to get it <ilya@math.ohio-state.edu>
Re: weird error on @array syntax (Craig Berry)
Re: weird error on @array syntax (Mark Jason Dominus)
What's wrong with my loop? <vaughan@timboonmusic.com>
Re: What's wrong with my loop? <wyzelli@yahoo.com>
XS and varargs agnes@talarian.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 10 May 2001 03:33:47 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: $a . $a++ or Perl for vulcans?
Message-Id: <slrn9fk30r.22m.mgjv@verbruggen.comdyn.com.au>
On 09 May 2001 12:52:45 -0500,
Ren Maddox <ren@tivoli.com> wrote:
> On 09 May 2001, jbehren@gwdg.de wrote:
>
>> Having the possibility to encounter an equivalence of $a+0 != $a
>> in the context of integers (occupied by common human interpretation)
>> doesn't really make Perl an intuitive language, IMHO. Use of this
>> feature by mistake might be hard to discover without debugger.
>
> This only comes up when you use $a++ (or its ilk), which are very
> non-intuitive. The solution is really the same in Perl as it is in C,
> which is to avoid this constructs in anything but the most straight-
> forward cases.
>
> The common pitfall of this in C is when calling a macro (perhaps
> without even realizing it) that uses its argument more than once. You
> end up incrementing the variable twice without realizing it. The
> quintessential example is:
Plus that in C you invoke undefined behaviour when you modify and
reference a variable between two sequence points. This is well
documented and well understood. Anything might happen.
Some people in this thread act as if the same goes for Perl, however,
this isn't necessarily true. Perl has no definitive standard. Some
people say the documentation is the definitive standard, but if this
is so, it's one that's severely lacking. Some people say the perl code
is the definitive standard. In that case, the demonstrated code is
well defined, because it is defined to do exactly what the current
Perl does.
Perl's behaviour in this area, and the issue of what is 'defined' and
what is 'undefined' is not decently documented. When someone like Dan
Sugalski comes in, and tells us all that it is undefined, that most
likely is true. But... Where is that documented?
Martien
--
Martien Verbruggen |
Interactive Media Division | Unix is user friendly. It's just
Commercial Dynamics Pty. Ltd. | selective about its friends.
NSW, Australia |
------------------------------
Date: Thu, 10 May 2001 02:13:38 GMT
From: "flash" <bop@mypad.com>
Subject: Re: 1 billion seconds bug
Message-Id: <mPmK6.7939$yw.351653@news20.bellglobal.com>
That is weird my birthday is september 9th and i was born in the early
morning some time close to that.
Im going back under my rock now.
"Craig Berry" <cberry@cinenet.net> wrote in message
news:tfjnbgojdqj9b1@corp.supernews.com...
> John Doe (jdoe@main.com) wrote:
> : Anyway I just want to share the kind of traps I fell into having to do
> : with this 1 billion seconds time point.
>
> We're probably going to be talking about this almost as much as good ol'
> y2k a couple of years ago.
>
> Quite soon now (specifically, Sun Sep 9 01:46:40 2001 GMT), the Unix epoch
> time (seconds since Jan 1 1970) will reach one billion. This will
> certainly break code which compares epoch times lexically, and will also
> break code which stores such times as a string representation in
> nine-char-wide fields. Start your code reviews now -- avoid the
> last-second rush. :-)
>
> --
> | Craig Berry - http://www.cinenet.net/~cberry/
> --*-- "God becomes as we are that we may be as he is."
> | - William Blake
------------------------------
Date: 10 May 2001 06:28:56 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: ANNOUNCE: Attribute::Handlers 0.61
Message-Id: <9ddcf8$s01$1@towncrier.cc.monash.edu.au>
Keywords: perl, module, release
==============================================================================
Release of version 0.61 of Attribute::Handlers
==============================================================================
NAME
Attribute::Handlers - Simpler definition of attribute handlers
VERSION
This document describes version 0.50 of Attribute::Handlers, released
November 1, 2000.
DESCRIPTION
This module, when inherited by a package, allows that package's class to
define attribute handler subroutines for specific attributes. Variables
and subroutines subsequently defined in that package, or in packages
derived from that package may be given attributes with the same names as
the attribute handler subroutines, which will then be called at the end
of the compilation phase (i.e. in a `CHECK' block).
EXAMPLE
package UNIVERSAL;
use Attribute::Handlers;
my %name;
sub name { return $name{$_[2]}||*{$_[1]}{NAME} }
sub Name :ATTR { $name{$_[2]} = $_[4] }
sub Purpose :ATTR { print STDERR "Purpose of ", &name, " is $_[4]\n" }
sub Unit :ATTR { print STDERR &name, " measured in $_[4]\n" }
package main;
my $capacity : Name(capacity)
: Purpose(to store max storage capacity for files)
: Unit(Gb);
package Other;
sub foo : Purpose(to foo all data before barring it) { }
AUTHOR
Damian Conway (damian@conway.org)
COPYRIGHT
Copyright (c) 2001, Damian Conway. All Rights Reserved.
This module is free software. It may be used, redistributed
and/or modified under the terms of the Perl Artistic License
(see http://www.perl.com/perl/misc/Artistic.html)
==============================================================================
CHANGES IN VERSION 0.61
- Added RAWDATA specifier
- Cleaned up documentation (thanks Garrett)
- Added warning for all-lowercase handlers (thanks Garrett)
- Added autotie functionality
- Tweaked handling of anon arrays as attribute args
- Critical doc path
==============================================================================
AVAILABILITY
Attribute::Handlers has been uploaded to the CPAN
and is also available from:
http://www.csse.monash.edu.au/~damian/CPAN/Attribute-Handlers.tar.gz
==============================================================================
------------------------------
Date: 10 May 2001 03:47:58 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: ANNOUNCE: Attribute::Types 0.10
Message-Id: <9dd31e$prl$1@towncrier.cc.monash.edu.au>
Keywords: perl, module, release
==============================================================================
Release of version 0.10 of Attribute::Types
==============================================================================
NAME
Attribute::Types - Attributes that confer type on variables
VERSION
This document describes version 0.10 of Attribute::Types
released May 10, 2001
DESCRIPTION
The Attribute::Types module provides 10 universally accessible
attributes that can be used to create variables that accept assignments
of only specific types of data.
EXAMPLES
use Attribute::Types;
my $count : INTEGER; # Can only store an integer
my $date : INTEGER(1..31); # Can only store an int between 1..31
my $value : NUMBER; # Can only store a number
my $score : NUMBER(0.1..9.9); # Can only store a num between 0.1..9.9
my @rain : NUMBER; # Elements can only store numbers
my %vars : SCALAR; # Entries can only store scalar refs
my %handler : CODE; # Entries can only store sub refs
my $arr : ARRAY; # Can only store array ref
my @hashes : HASH; # Elements can only store hash refs
my $glob : GLOB; # Can only store a typeglob ref
my $pattern : REGEX; # Can only store a qr'd regex
my $ref2 : REF; # Can only store a meta-reference
my $obj : Type(My::Class); # Can only store objects of (or
# derived from) the specified class
my $x : Type(/good|bad|ugly/); # Can only store strings matching
# the specified regex
sub odd { no warnings; $_[0]%2 }
my $guarded : Type(&odd); # Can only store values for which
# odd($value) returns true
$date = 23; # okay
$date = 32; # KABOOM!
$rain[1] = 121.7; # okay
$rain[1] = "lots"; # KABOOM!
$x = 'very good'; # okay
$x = 'excellent'; # KABOOM!
package My::Class::Der;
use base 'My::Class';
$obj = My::Class->new(); # okay
$obj = My::Class::Der->new(); # okay
$obj = Other::Class->new(); # KABOOM!
$guarded = 1; # okay
$guarded = 2; # KABOOM!
AUTHOR
Damian Conway (damian@conway.org)
COPYRIGHT
Copyright (c) 2001, Damian Conway. All Rights Reserved.
This module is free software. It may be used, redistributed
and/or modified under the terms of the Perl Artistic License
(see http://www.perl.com/perl/misc/Artistic.html)
==============================================================================
CHANGES IN VERSION 0.10
(No changes have been documented for this version)
==============================================================================
AVAILABILITY
Attribute::Types has been uploaded to the CPAN
and is also available from:
http://www.csse.monash.edu.au/~damian/CPAN/Attribute-Types.tar.gz
==============================================================================
------------------------------
Date: Wed, 9 May 2001 20:32:08 -0700
From: "Michael Cook" <mikecook@cigarpool.com>
Subject: Bad File Number?
Message-Id: <1ZnK6.2804$VX.392183@news.uswest.net>
Hello,
I am getting this error when I try to run a CGI Perl script from the
command line. I am running Perl 5.6.1 on an Ultra 5, Solaris 8. Any ideas? I
would be happy to send the complete file or any other info needed. This runs
fine on other Perl boxes I am testing on. I am running Apache 1.319 with
mod_perl, but even with Apache stopped this happens at the command line.
Thanks!
Michael
Error:
~~~~
can't write-lock board/May: Bad file number at board.pl line 486.
Relevant Code:
~~~~~~~~~~
use Fcntl qw(:DEFAULT :flock);
open (MESSAGES, "board/$db") or die("Unable to open board/$db: $!");
$OFH=select(MESSAGES); $| = 1; select($OFH);
flock(MESSAGES, LOCK_EX) or die "can't write-lock board/$db: $!";
while ($line=<MESSAGES>)
{
process blah blah...
}
close (MESSAGES);
--
== CigarPool ==
http://www.cigarpool.com
------------------------------
Date: Thu, 10 May 2001 06:51:28 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Bad File Number?
Message-Id: <3afa3a6f.3d6b$221@news.op.net>
In article <1ZnK6.2804$VX.392183@news.uswest.net>,
Michael Cook <mikecook@cigarpool.com> wrote:
>Hello,
> I am getting this error when I try to run a CGI Perl script from the
>command line. I am running Perl 5.6.1 on an Ultra 5, Solaris 8. Any ideas?
"file number" actually means "filehandle".
The problem here is that your OS will not allow you to get an
exclusive lock on a file that you have opened only for reading. (It's
supid, but that's the way it goes.) Try
open (MESSAGES, "+< board/$db") or die("Unable to open board/$db: $!");
instead.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Thu, 10 May 2001 09:57:54 +0800
From: "´Z©Ò¤ô@!¡±o^" <crud_alex@yahoo.com>
Subject: cgi.pm problems
Message-Id: <9dcs5u$8m$1@taliesin.netcom.net.uk>
i can't add "pragma=>'no-cache' into the header tag,otherwise it will put up
the header information like normal text,but if i didn't put anything into
the header attributes , it works just fine at all anyone give me a tip i'll
be appreciated,thanks in advance
#!perl
#script: time4.pl
use CGI ':standard';
use POSIX 'strftime';
#print the HTTP header and the HTML document
print header({-pragma=>'no-cache'}),#i suppose not to #put anything right
here
start_html('A Virtual Clock'),
h1('A Virtual Clock');
print_time();
print_form();
print end_html;
#print out the time
sub print_time {
my($format);
if (param){
$format = (param('type') eq '12-hour') ? '%r' : '%T ' if param('time');
$format .= '%d ' if param('day');
$format .= '%B ' if param('month');
$format .= '%A ' if param('day-of-month');
$format .= '^Y ' if param('year');
} else {
$format = '%r %A %B %d %Y';
}
$current_time = strftime($format,localtime);
print "the current time is ",strong($current_time),".",hr;
}
#print the clock settings form
sub print_form {
print start_form,
"show: ",
checkbox(-name=>'time',-checked=>1),
checkbox(-name=>'day',-checked=>1),
checkbox(-name=>'month',-checked=>1),
checkbox(-name=>'day-of-month',-checked=>1),
checkbox(-name=>'year',-checked=>1),
p(),
"Time style: ",
radio_group(-name=>'type',
-values=>['12-hour','24-hour']),
p(),
reset(-name=>'Reset'),
submit(-name=>'Set'),
end_form;
}
------------------------------
Date: Thu, 10 May 2001 02:57:28 +0000 (UTC)
From: see-sig@from.invalid (David Efflandt)
Subject: Re: cgi.pm problems
Message-Id: <slrn9fk0so.ih2.see-sig@typhoon.xnet.com>
On Thu, 10 May 2001 09:57:54 +0800, ´Z©Ò¤ô@!¡±o^ <crud_alex@yahoo.com> wrote:
> i can't add "pragma=>'no-cache' into the header tag,otherwise it will put up
> the header information like normal text,but if i didn't put anything into
> the header attributes , it works just fine at all anyone give me a tip i'll
> be appreciated,thanks in advance
What web server OS and CGI.pm version? Are you going through a proxy?
Your script works for Netscape 4.76 and KDE Konqueror in Linux apache.
The headers I get from the commandline are:
Pragma: no-cache
Content-Type: text/html
or grabbed as CGI with my urlcheck script:
HTTP/1.1 200 OK
Date: Thu, 10 May 2001 02:43:02 GMT
Server: Apache/1.3.14 (Unix) (SuSE/Linux)
Pragma: no-cache
Connection: close
Content-Type: text/html
I thought nothing was supposed to cache CGI anyway. Wnen I remove the
({-pragma=>'no-cache'}), Netscape still does not cache it, but apparently
Konqueror does. If I click in the URL bar of Konqueror without the
no-cache and hit enter, the display does not change, but with the
no-cache it does change.
Neither browser caches the result in any case using the "Set" (submit)
button.
> #!perl
> #script: time4.pl
>
> use CGI ':standard';
> use POSIX 'strftime';
>
> #print the HTTP header and the HTML document
> print header({-pragma=>'no-cache'}),#i suppose not to #put anything right
> here
> start_html('A Virtual Clock'),
> h1('A Virtual Clock');
> print_time();
> print_form();
> print end_html;
>
> #print out the time
> sub print_time {
> my($format);
> if (param){
> $format = (param('type') eq '12-hour') ? '%r' : '%T ' if param('time');
> $format .= '%d ' if param('day');
> $format .= '%B ' if param('month');
> $format .= '%A ' if param('day-of-month');
> $format .= '^Y ' if param('year');
> } else {
> $format = '%r %A %B %d %Y';
> }
> $current_time = strftime($format,localtime);
> print "the current time is ",strong($current_time),".",hr;
> }
>
> #print the clock settings form
> sub print_form {
> print start_form,
> "show: ",
> checkbox(-name=>'time',-checked=>1),
> checkbox(-name=>'day',-checked=>1),
> checkbox(-name=>'month',-checked=>1),
> checkbox(-name=>'day-of-month',-checked=>1),
> checkbox(-name=>'year',-checked=>1),
> p(),
> "Time style: ",
> radio_group(-name=>'type',
> -values=>['12-hour','24-hour']),
> p(),
> reset(-name=>'Reset'),
> submit(-name=>'Set'),
> end_form;
> }
>
>
--
David Efflandt (Reply-To is valid) http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
------------------------------
Date: 10 May 2001 02:22:29 GMT
From: dha@panix2.panix.com (David H. Adler)
Subject: Re: Javascript or Perl ?
Message-Id: <slrn9fjur6.916.dha@panix2.panix.com>
In article <3AF9E6ED.B7277BA7@stomp.stomp.tokyo>, Godzilla! wrote:
> Zlach wrote:
>
>> I'd like to learn Javascript and Perl.
>> And the question is which one to learn first ?
>
> Although my personal opinion is Java sucks, learn
> both Perl and Java languages, together.
Just to make sure everyone's clear on this - Java and Javascript are two
distinct languages.
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
she's a lovetarian especially in the form of puppies
- Jellyfish, Sebrina, Paste and Plato
------------------------------
Date: Wed, 09 May 2001 19:43:50 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Javascript or Perl ?
Message-Id: <3AFA0066.25A0C2C7@stomp.stomp.tokyo>
David H. Adler whined:
> Godzilla! wrote:
> > Zlach wrote:
> >> I'd like to learn Javascript and Perl.
> >> And the question is which one to learn first ?
> > Although my personal opinion is Java sucks, learn
> > both Perl and Java languages, together.
(snippage not noted by Adler)
> Just to make sure everyone's clear on this - Java and Javascript are two
> distinct languages.
My presumption is while you were attending high school, this is
if you are not still in high school which I suspect you are,
each time your driver's ed classroom instructor uses the
expression "car" you jump up and shout,
"Just to make sure everyone's clear on this,
Ford and Chevrolet are two distinct cars."
So were you born anal retentive or is this a personal
quality at which you work and strive to perfect?
Godzilla! Queen of Five-Hundred Horsepower Mako Sharks.
------------------------------
Date: 10 May 2001 03:19:32 GMT
From: dha@panix2.panix.com (David H. Adler)
Subject: Re: Javascript or Perl ?
Message-Id: <slrn9fk265.mjg.dha@panix2.panix.com>
In article <3AFA0066.25A0C2C7@stomp.stomp.tokyo>, Godzilla! wrote:
> David H. Adler whined:
>
>> Godzilla! wrote:
>> > Zlach wrote:
>
>> >> I'd like to learn Javascript and Perl.
>> >> And the question is which one to learn first ?
>
>> > Although my personal opinion is Java sucks, learn
>> > both Perl and Java languages, together.
>
> (snippage not noted by Adler)
Since I wasn't commenting on the rest of the post, no, I did not include
it.
>> Just to make sure everyone's clear on this - Java and Javascript are two
>> distinct languages.
>
>
> My presumption is while you were attending high school, this is
> if you are not still in high school which I suspect you are,
> each time your driver's ed classroom instructor uses the
> expression "car" you jump up and shout,
>
> "Just to make sure everyone's clear on this,
> Ford and Chevrolet are two distinct cars."
If they had completely different methods of operation, yes I might well
have done so. Java and Javascript have very little to do with each
other. The main common feature is the first four letters of their names.
> So were you born anal retentive or is this a personal
> quality at which you work and strive to perfect?
It's a common mistake, so I thought I might make it clearer so that more
useful discussion might occur. If clarity is not something you wish to
foster, I suppose that is your option.
Why you see fit to respond to a small clarification with a personal
attack, I do not know.
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/ The
Revolution Will Not Be Televised
- Gil Scott-Heron
------------------------------
Date: Wed, 09 May 2001 22:15:43 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Javascript or Perl ?
Message-Id: <3AFA23FF.57E1A351@stomp.stomp.tokyo>
David H. Adler piddled:
> Godzilla! asserted her dignity:
> > David H. Adler whined:
> > > Godzilla! wrote:
> > > > Zlach wrote:
(snipped significantly)
> Why you see fit to respond to a small clarification with a personal
> attack, I do not know.
I would not expect a person of your relative intellectual
caliber to understand my words. Others do, however.
Godzilla!
------------------------------
Date: 10 May 2001 02:20:25 GMT
From: dha@panix2.panix.com (David H. Adler)
Subject: Re: Local Time
Message-Id: <slrn9fjuna.916.dha@panix2.panix.com>
In article <SzkK6.1563$I5.481893@news1.rdc1.tn.home.com>, Todd Smith wrote:
> Apparently it doesn't matter what I think- everything I say is wrong or
> stupid or pointless to everybody else. But I see your point about the
> unsecure outside process. (I hope that wasn't the wrong thing to say!)
Actually, the only thing I've seen anyone complaining about that you
said was about that very thing... so I'm not sure why you'd think that
everyone thinks that everything you say is "stupid or pointless".
But, hey, whatever you get the most out of! :-)
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"When the bug expands, I contract. When it contracts, I expand. And
when an opportunity appears, I do not fix the bug -- my keyboard does
it, on its own." - Chip Salzenberg
------------------------------
Date: Wed, 09 May 2001 19:51:32 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Local Time
Message-Id: <3AFA0234.4697CBAA@stomp.stomp.tokyo>
David H. Adler wrote:
> Todd Smith wrote:
> > Apparently it doesn't matter what I think- everything I say is wrong or
> > stupid or pointless to everybody else. But I see your point about the
> > unsecure outside process. (I hope that wasn't the wrong thing to say!)
> Actually, the only thing I've seen anyone complaining about that you
> said was about that very thing... so I'm not sure why you'd think that
> everyone thinks that everything you say is "stupid or pointless".
> But, hey, whatever you get the most out of! :-)
DOG FIGHT! DOG FIGHT! DOG FIGHT!
Women are feline. Men are canine. We only have
one pet, a cat. There is a good reason for this.
Cats are smarter than dogs. Cats bury what dogs
love to eat.
Meow.
Godzilla! Queen of Cattiness.
------------------------------
Date: 10 May 2001 04:51:45 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Local Time
Message-Id: <9dd6p1$k8a$2@bob.news.rcn.net>
Craig Berry <cberry@cinenet.net> wrote:
> By the way, "naus" is the Greek for "ship" (with a clear relation to
> "nautos"), which was borrowed into Latin as "navis", which is in turn the
> root of such English words as "navigate" and "navy". So "nautical" means
> "about sailors", but "naval" means "about ships".
And, of course, "nausea" and its relatives come from the same root,
originally referring to seasickness.
------------------------------
Date: Thu, 10 May 2001 03:09:16 GMT
From: "Naoko Ozeki" <ayumi.ozeki@verizon.net>
Subject: one click and execute on many boxes
Message-Id: <wDnK6.1643$372.991050@typhoon2.ba-dsg.net>
Basically, we've been doing this manually:
1. Login to box one as a user A; run some script; exit
2. Login to box two as a user B; run some script; exit
3. Login to box three as a user C; run some script; exit
etc., etc.
Now I'm wondering how I can have a perl script on a web server (box zero)
that can do the above in one shot - ideally some cgi script is presented to
a browser as a link, and thus a single click of a link will execute all the
things mentioned above, and shows the return code (or some fancy stuff).
This saves tremendous amount of admin work we do often.
any thoughts highly appreciated. thanks.
------------------------------
Date: 10 May 2001 05:12:06 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: one click and execute on many boxes
Message-Id: <9dd7v6$k8a$3@bob.news.rcn.net>
Naoko Ozeki <ayumi.ozeki@verizon.net> wrote:
> Basically, we've been doing this manually:
> 1. Login to box one as a user A; run some script; exit
> 2. Login to box two as a user B; run some script; exit
> 3. Login to box three as a user C; run some script; exit
> etc., etc.
> Now I'm wondering how I can have a perl script on a web server (box zero)
> that can do the above in one shot - ideally some cgi script is presented to
> a browser as a link, and thus a single click of a link will execute all the
> things mentioned above, and shows the return code (or some fancy stuff).
> This saves tremendous amount of admin work we do often.
Look into Net::Telnet.
------------------------------
Date: Wed, 09 May 2001 19:39:53 -0700
From: Vishwanath Sen <vsen@interrainc.com>
Subject: Pattern matching using variable ...
Message-Id: <3AF9FF78.8C6E90AF@interrainc.com>
Hi Friends,
How do I do pattern matching using pattern stored in a variable ?
for example, the code
if ($tmp1 =~ /abc/) {
print "match found \n";
}
will print match found if $tmp1 has pattern abc.
Now I have pattern in $pattern, so what will the code look like ?
something like
$pattern = "abc";
if ($tmp1 =~ /$pattern/) {
print "match found \n";
}
Basically in the pattern matching if condition I want to use pattern
defined in $pattern. So what will that if condition look like ?
Thanks in Advance,
- Vishwanath.
------------------------------
Date: Thu, 10 May 2001 03:00:59 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Pattern matching using variable ...
Message-Id: <3afa0401.183975926@news.erols.com>
On Wed, 09 May 2001 19:39:53 -0700, Vishwanath Sen
<vsen@interrainc.com> wrote:
>Now I have pattern in $pattern, so what will the code look like ?
>something like
>
>$pattern = "abc";
>if ($tmp1 =~ /$pattern/) {
> print "match found \n";
>}
>
>Basically in the pattern matching if condition I want to use pattern
>defined in $pattern. So what will that if condition look like ?
Did you try the code you've written there?
Go ahead. Be adventurous. You might surprise yourself, but you'll
always learn something.
------------------------------
Date: 10 May 2001 05:23:23 GMT
From: "nutcracker" <nutcracker@no-spam.org>
Subject: problem with perlapp (PDK 2.1)
Message-Id: <9dd8kb$416@dispatch.concentric.net>
Hello Everyone,
I have a particulary annoying problem. I am unable to get perlapp to create
a usable, freestanding exe from a rather simple perl script. When I issue my
build command, it just sits there, with perlapp hoggin the
processor...forever.
When running the command:
perlapp -v script.pl -f
I should end up with script.exe, and I do. Sometimes it is 24k in size,
others it is 117k. Neither will run on a system that does not have perl
installed on it, as it complains that perlapp.dll cannot be loaded.
I have tried everything that I can think of. I have even specified it as
a -b[ind]=<list> arguement.
I really need this to work. Does anyone have any ideas?
I have activestate 5.6.1.626 installed, and PDK 2.1. Both licensed.
Thank you very much,
lordcompaq
------------------------------
Date: Thu, 10 May 2001 15:33:52 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: problem with perlapp (PDK 2.1)
Message-Id: <8aqK6.15$Dp.2591@vic.nntp.telstra.net>
"nutcracker" <nutcracker@no-spam.org> wrote in message
news:9dd8kb$416@dispatch.concentric.net...
> Hello Everyone,
>
> I have a particulary annoying problem. I am unable to get perlapp to
create
> a usable, freestanding exe from a rather simple perl script. When I issue
my
> build command, it just sits there, with perlapp hoggin the
> processor...forever.
>
> When running the command:
>
> perlapp -v script.pl -f
>
> I should end up with script.exe, and I do. Sometimes it is 24k in size,
> others it is 117k. Neither will run on a system that does not have perl
> installed on it, as it complains that perlapp.dll cannot be loaded.
>
> I have tried everything that I can think of. I have even specified it as
> a -b[ind]=<list> arguement.
>
> I really need this to work. Does anyone have any ideas?
>
> I have activestate 5.6.1.626 installed, and PDK 2.1. Both licensed.
Perhaps a look at the script in question would be helpful, and What OS are
you on?
Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass it
around');
$d='$_$a$s$b$w';$e='$_$a$s$b';sub d{$h=shift;$h=~s/\$(\w+)/${$1}/g;return$h}
sub
e{return(shift!=1)?'s':''}for(reverse(1..100)){$s=e($_);$f=d($d);$g=d($e);
$c.="$f\n$g\n$t\n";$_--;$s=e($_);$e=d($d);$c.="$e\n\n";}print"$c*hic*";
------------------------------
Date: 10 May 2001 08:22:19 +0200
From: Ronald Fischer <ronald.fischer@deadspam.com>
Subject: Re: Reading from empty file handle OR from a pipe
Message-Id: <7qfk83plo4k.fsf@demchh2msx.icn.siemens.de>
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) writes:
> According to Ronald Fischer <ronald.fischer@deadspam.com>:
> > Depending on some switch (say), my program should sometimes do this:
> >
> > while(<>)
> > {
> > ... process every line from the arguments or stdin
> > }
> >
> > and sometimes do this:
> >
> > open(X,"myfilter|");
> > while(<X>)
> > {
> > ... process every line coming from my filter
> > }
>
> my $fh;
> if ( $flag ) {
> $fh = \ *ARGV;
> } else {
> open( $fh, ...);
> }
> process( $_) while <$fh>;
Thanks a lot!!! I was not aware that ARGV and the empty file handle
are the same!
Ronald
--
Do NOT reply to the address given in the From: header. If you want to
reply by mail, use the following address (after deleting the XXX):
Ronald Otto Valentin Fischer <rovfXXX@thekeyboard.com>
(Tired of getting spam after posting a message? http://www.deadspam.com)
------------------------------
Date: Thu, 10 May 2001 07:01:14 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Reading from empty file handle OR from a pipe
Message-Id: <3afa3cba.3d93$28c@news.op.net>
In article <7qfr8xyofsg.fsf@demchh2msx.icn.siemens.de>,
Ronald Fischer <ronald.fischer@deadspam.com> wrote:
>Depending on some switch (say), my program should sometimes do this:
>
> while(<>)
> {
> ... process every line from the arguments or stdin
> }
>
>and sometimes do this:
>
> open(X,"myfilter|");
> while(<X>)
> {
> ... process every line coming from my filter
> }
How about:
if ($flag) { @ARGV = "myfilter|" }
while (<>) {
... process every line from the arguments or stdin or myfilter
}
That seems easier than anything else anyone mentioned so far.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: 10 May 2001 06:27:02 GMT
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Subject: Re: unicode support in perl 5.6 -- I'm trying to get it to work l
Message-Id: <9ddcbm$60t$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
Eli the Bearded
<elijah@workspot.net>], who wrote in article <eli$0105091657@qz.little-neck.ny.us>:
> > > $chr2 = "Jâ~X| ";
> > that you set this through Usenet, so I have no idea what chars were in
> > your original posting file.
>
> The five octet sequence that is a valid UTF-8 encoding of
> "\N{LATIN CAPITAL LETTER J}\N{SKULL AND CROSSBONES}".
Then assuming one of two wide-spread encodings, $chr2 is (should be)
either of length 5, or of length 2 (Latin-1 or UTF-8).
> > And I have no idea what you are trying to achieve by your $isutf8. I
> > have no idea what reasonalbe thing the utf8() function may do. The
> > only reasonable interpretation I may assume is
> > sub utf8 {1}
>
> It is from Convert::Scalar --
>
> utf8 scalar[, mode]
> Returns true when the given scalar is marked as utf8,
> false otherwise.
This is an absolutely useless piece of info - outside of XSUBs.
Having a flag or not has (should have?) no impact on the result of any
Perl operation.
> I don't have 5.6.1 installed, so I cannot test it there.
What are you discussing then? Until 5.6.1 there may be discussion of
the Unicode support...
Ilya
------------------------------
Date: Thu, 10 May 2001 05:38:47 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: weird error on @array syntax
Message-Id: <tfkab7f687e943@corp.supernews.com>
Godzilla! (godzilla@stomp.stomp.tokyo) wrote:
: > Note that it's not the use of eval that causes the error; rather, it's the
: > use of an otherwise unknown-at-compile-time array variable in double-
: > quotish context. The eval changes the DWIMosity of the situation, but
: > there's no way for the compiler to know that.
:
: Well, this does change my DUHosity. Glad I prefaced with this being
: beyond my expertise. There are fleeting moments, usually when I am
: angry with someone here, I wish I could remember these little known
: bugs with Perl. However, anger increases DIMosity of thinking and
: usually leads to making embarrassing mistakes.
Sometimes I think that the greatest tragedy of the net is that it allows
us to compose and send messages faster than our higher brain functions can
reconsider them. I've considered lobbying for a mandatory ten-minute
waiting period on newsgroup and mailing list postings. :)
: It is rewarding to discover a "You are ready for IBM" moment.
I'm not sure I'd go *that* far...
: I have not thought about this compile / eval glitch for a very
: long time. My cure came to mind, right off though. I thought
: about suggesting, following his eval function,
:
: @a = @a;
: print "@a\n";
That does it, but so would a simple
our @a;
which is the prefered way to tell the compiler about a global in any case.
: to satisfy the author's possible need to incorporate spaces
: between elements by moving the eval created array into a
: double quoted treatment. However, I decided most would laugh
: with such crazy looking syntax. Works though!
And it has such a nice Objectivist feel, too.
: I really enjoy your articles.
Again, thanks for the kind words. I must admit that I have not been the
greatest fan of your postings in the past, but your stuff has improved
markedly in tone and content of late, and I welcome the change -- and I've
always enjoyed your sense of humor, which is a key asset for any
programmer.
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "God becomes as we are that we may be as he is."
| - William Blake
------------------------------
Date: Thu, 10 May 2001 06:55:11 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: weird error on @array syntax
Message-Id: <3afa3b4f.3d7f$17a@news.op.net>
In article <tfje1h1l5962a2@corp.supernews.com>,
Craig Berry <cberry@cinenet.net> wrote:
>: In string, @a now must be written as \@a at ..
>
>I understand this will be downgraded to a warning in some future version.
Current version.
% perl5.6.1 -e 'print "@a"'
% perl5.6.1 -we 'print "@a"'
Possible unintended interpolation of @a in string at -e line 1.
>In brief, the Perl compiler cannot, at compiler time, see any other
>reference to @a anywhere in your program, so it leaps to the conclusion
>that you are trying to write a literal '@' rather than trying to
>interpolate @a.
Wrong. Perl never does this. @ in a string is *always* interpreted
as an array interpolation, since version 5.000.
See
http://perl.plover.com/at-error.html
for complete details.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Thu, 10 May 2001 13:47:44 +1000
From: Vaughan McAlley <vaughan@timboonmusic.com>
Subject: What's wrong with my loop?
Message-Id: <B7204C80.1F0D%vaughan@timboonmusic.com>
Hello,
This code doesn't give me my beloved Internal Server Error, but the loop
doesn't run. I've checked the syntax against the obscure examples about five
times and can't find anything wrong. What's the matter?
Thanks,
Vaughan
@POSTAGE{'0airmail', 'NZairmail', 'NZecon_air', '1airmail', '1econ_air',
'4airmail', '4econ_air', '4seamail', '5airmail', '5econ_air', '5seamail'} =
('', '', '', '', '', '', '', '', '', '', '' );
foreach my $temp (@POSTAGE) {
# $temp = <CHARGES>; # read in the postage from charges file
print "This loop is running<BR>\n";
}
------------------------------
Date: Thu, 10 May 2001 13:33:06 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: What's wrong with my loop?
Message-Id: <WooK6.8$Dp.1956@vic.nntp.telstra.net>
"Vaughan McAlley" <vaughan@timboonmusic.com> wrote in message
news:B7204C80.1F0D%vaughan@timboonmusic.com...
> Hello,
>
> This code doesn't give me my beloved Internal Server Error, but the loop
> doesn't run. I've checked the syntax against the obscure examples about
five
> times and can't find anything wrong. What's the matter?
>
> Thanks,
>
> Vaughan
>
>
> @POSTAGE{'0airmail', 'NZairmail', 'NZecon_air', '1airmail', '1econ_air',
> '4airmail', '4econ_air', '4seamail', '5airmail', '5econ_air', '5seamail'}
=
> ('', '', '', '', '', '', '', '', '', '', '' );
>
> foreach my $temp (@POSTAGE) {
@POSTAGE does not exist... %POSTAGE does
> # $temp = <CHARGES>; # read in the postage from charges file
> print "This loop is running<BR>\n";
> }
>
HTH
Wyzelli
--
#Modified from the original by Jim Menard
for(reverse(1..100)){$s=($_!=1)? 's':'';print"$_ bottle$s of beer on the
wall,\n";
print"$_ bottle$s of beer,\nTake one down, pass it around,\n";
$_--;$s=($_==1)?'':'s';print"$_ bottle$s of beer on the
wall\n\n";}print'*burp*';
------------------------------
Date: 10 May 2001 01:20:34 GMT
From: agnes@talarian.com
Subject: XS and varargs
Message-Id: <9dcqd2$cba$1@news.netmar.com>
So I am trying to write a perl wrapper around a set of C functions using XS.
I ran into a problem with a "print-like" function that takes a format argument
followed by a vararg list. From the perlxs manual, using an ellipsis should
work. But the only example given assume that the programmer actually knows
what will be in the list.
I started my XS prototype with something like:
void
pseudoprint(formatStr, ...)
T_STR format_str
And I am stuck there. As is, my function silently fails to take into account
any argument provided after formatStr. But I have no idea what else to put in
my .xs file, since I the number and type of arguments could be anything.
I am not a very experienced Perl programmer, and the answer might be
completely obvious, but I spent one day scouring all the usual sources of
information without finding a single hint on how to make this work.
Any help/pointer to resources would be more than welcome.
Thanks,
Agnes Charrel-Berthillier
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 866
**************************************